diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8cfb40a0f..06882911b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - go-version: ["1.18", "1.19", "1.20", "1.21", "1.22", "1.23"] + go-version: ["1.21", "1.22", "1.23"] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -17,20 +17,28 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + - name: Test + run: make test + + lint: + name: Linting + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 - name: Install project tools and dependencies - if: ${{ matrix.go-version == '1.23' }} run: make project-tools - name: Lint - if: ${{ matrix.go-version == '1.23' }} run: | make lint scripts/check-sync-tidy.sh - name: Lint scripts - if: ${{ matrix.go-version == '1.23' }} run: | make lint-scripts - - name: Test - run: make test - - name: Test scripts - if: ${{ matrix.go-version >= '1.22' }} - run: make test-scripts diff --git a/.gitignore b/.gitignore index c24ab16ba..cd0231d2e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ bin/ ## IDE *.idea/ *.vscode/ + +go.work.sum diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f2c998c8..8a052c7f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,115 @@ -## Release (2025-XX-XX) - +## Release (2025-02-21) +> [!WARNING] +> +> **The lowest supported go version is now 1.21. In the future, only the two most recent versions will be supported.** + + +- `core`: [0.16.0](core/CHANGELOG.md#v0160-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `archiving`: [0.2.0](services/archiving/CHANGELOG.md#v020-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `authorization`: [0.6.0](services/authorization/CHANGELOG.md#v060-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `certificates`: [0.2.0](services/certificates/CHANGELOG.md#v020-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `dns`: [0.13.0](services/dns/CHANGELOG.md#v0130-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `iaas`: [0.20.0](services/iaas/CHANGELOG.md#v0200-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `lbapplication`: [0.3.0](services/lbapplication/CHANGELOG.md#v030-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `loadbalancer`: [0.18.0](services/loadbalancer/CHANGELOG.md#v0180-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `logme`: [0.21.0](services/logme/CHANGELOG.md#v0210-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `mariadb`: [0.21.0](services/mariadb/CHANGELOG.md#v0210-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `mongodbflex`: [0.18.0](services/mongodbflex/CHANGELOG.md#v0180-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `objectstorage`: [1.1.0](services/objectstorage/CHANGELOG.md#v110-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `observability`: [0.14.0](services/observability/CHANGELOG.md#v0140-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `opensearch`: [0.20.0](services/opensearch/CHANGELOG.md#v0200-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `postgresflex`: [0.18.0](services/postgresflex/CHANGELOG.md#v0180-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `rabbitmq`: [0.21.0](services/rabbitmq/CHANGELOG.md#v0210-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `redis`: [0.21.0](services/redis/CHANGELOG.md#v0210-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `resourcemanager`: [0.13.0](services/resourcemanager/CHANGELOG.md#v0130-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `runcommand`: [0.3.0](services/runcommand/CHANGELOG.md#v030-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `secretsmanager`: [0.11.0](services/secretsmanager/CHANGELOG.md#v0110-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `serverbackup`: [0.6.0](services/serverbackup/CHANGELOG.md#v060-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `serverupdate`: [0.5.0](services/serverupdate/CHANGELOG.md#v050-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `serviceaccount`: [0.6.0](services/serviceaccount/CHANGELOG.md#v060-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `serviceenablement`: [0.5.0](services/serviceenablement/CHANGELOG.md#v050-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `ske`: [0.22.0](services/ske/CHANGELOG.md#v0220-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `sqlserverflex`: [0.10.0](services/sqlserverflex/CHANGELOG.md#v0100-2025-02-21) + - **New**: Minimal go version is now Go 1.21 +- `stackitmarketplace`: [0.2.0](services/stackitmarketplace/CHANGELOG.md#v020-2025-02-21) + - **New**: Minimal go version is now Go 1.21 + + +## Release (2025-02-11) + +- `lbapplication`: [v0.2.0](services/lbapplication/CHANGELOG.md#v020-2025-01-30) + - **Bugfix**: Set type from interface to int64 of `HealthyThreshold`, `UnhealthyThreshold`, `MaxLoadBalancers`, `Port`, `MaxConnections`, `Code` and `TargetPort` +- `resourcemanager`: [v0.12.0](services/resourcemanager/CHANGELOG.md#v0120-2025-01-31) + - **Breaking Change**: Remove the methods `BffGetContainersOfAFolder` and `BffGetContainersOfAnOrganization` +- `serverupdate`: [v0.4.0](services/serverupdate/CHANGELOG.md#v040-2025-02-05) + - **Breaking Change**: Remove field `BackupProperties` from `CreateUpdatePayload` model + - **Fix**: Remove field `Id` from `CreateUpdateSchedulePayload` model +- `objectstorage`: [v1.0.0](services/objectstorage/CHANGELOG.md#v100-2025-02-05) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + + +## Release (2025-01-24) + +- `ske`: [v0.21.1](services/ske/CHANGELOG.md#v0211-2025-01-23) + - Use current SKE API +- `ske`: [v0.21.0](services/ske/CHANGELOG.md#v0210-2025-01-21) + - **Removal:** The following methods were removed after deprecation (2024-04-16) and [`serviceenablement` SDK](https://github.com/stackitcloud/stackit-sdk-go/tree/main/services/serviceenablement) must be used instead. + - `DisableService` + - `EnableService` + - `GetServiceStatus` +- `sqlserverflex`: [v0.9.0](services/sqlserverflex/CHANGELOG.md#v090-2025-01-20) + - **Breaking change**: Delete endpoint made private. +- `postgresflex`: [0.17.0](services/postgresflex/CHANGELOG.md#v0170-2025-01-20) + - **Breaking change**: Delete endpoint made private. +- `mongodbflex`: [v0.17.0](services/mongodbflex/CHANGELOG.md#v0170-2025-01-20) + - **Breaking change**: Delete endpoint made private. +- `logme`: [v0.20.2](services/logme/CHANGELOG.md#v0202-2025-01-20) + - **Bugfix:** Remove mistakenly implemented `syslog-use-udp`. Does not exist. +- `authorization`: [v0.5.1](services/authorization/CHANGELOG.md#v051-2025-01-17) + - **Bugfix:** Revert back to global URL configuration - `core`: [v0.15.1](core/CHANGELOG.md#v0151-2025-01-08) - **Bugfix:** `ConfigureRegion` does not return an error if a region is set by an environment variable. - `authorization`: [v0.5.0](services/authorization/CHANGELOG.md#v050-2025-01-09) - **Feature:** Add support for regions in `APIClient` - +- `stackitmarketplace`: [v0.1.0](services/stackitmarketplace/CHANGELOG.md#v010-2025-01-10) + - **New**: STACKIT Marketplace module can be used to manage the STACKIT Marketplace. +- `lbapplication` [v0.1.0](services/lbapplication/CHANGELOG.md#v010-2025-01-13) + - **New**: STACKIT Load Balancer Application module can be used to manage the STACKIT Load Balancer Application +- `certificates`: [v0.1.0](services/certificates/CHANGELOG.md#v010-2025-01-13) + - **New**: STACKIT Certificates module can be used to manage the STACKIT Load Balancer Certificates +- `serverbackup`: [v0.5.0](services/serverbackup/CHANGELOG.md#v050-2025-01-14) + - **Feature:** Add new method: `GetServiceResource` +- `serverupdate`: [v0.3.0](services/serverupdate/CHANGELOG.md#v030-2025-01-14) + - **Feature:** Add new method: `GetServiceResource` + ## Release (2025-01-07) -- `postgresflex`: [0.16.1](services/postgresflex/CHANGELOG.md#v0161-2025-xx-yy) +- `postgresflex`: [0.16.1](services/postgresflex/CHANGELOG.md#v0161-2024-12-19) - **Bugfix:** Correctly handle nullable attributes in model types - `iaas`: [v0.19.0](services/iaas/CHANGELOG.md#v0190-2024-12-20) - **Feature:** Add method to list quotas: `ListQuotas` diff --git a/LICENSE.md b/LICENSE.md index bc892668d..7e2f06484 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,180 +2,180 @@ Version 2.0, January 2004 http://www.apache.org/licenses/ - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" @@ -186,16 +186,16 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/NOTICE.txt b/NOTICE.txt index c0b5639b5..1e3b201d7 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/README.md b/README.md index e65b7b709..8769d55f2 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The usage of the SDK is shown in some [examples](https://github.com/stackitcloud ## Getting started -Requires `Go 1.18` or higher. +Requires `Go 1.21` or higher. To download the `core` module: @@ -99,90 +99,126 @@ More examples on other services, configuration and authentication possibilities ## Authentication -To authenticate to the SDK, you will need a [service account](https://docs.stackit.cloud/stackit/en/service-accounts-134415819.html). Create it in the STACKIT Portal an assign it the necessary permissions, e.g. `project.owner`. There are multiple ways to authenticate: +To authenticate with the SDK, you need a [service account](https://docs.stackit.cloud/stackit/en/service-accounts-134415819.html) with appropriate permissions (e.g., `project.owner`). You can create a service account through the STACKIT Portal. -- Key flow (recommended) -- Token flow +### Authentication Methods -When setting up authentication, the SDK will always try to use the key flow first and search for credentials in several locations, following a specific order: +The SDK supports two authentication methods: -1. Explicit configuration, e.g. by using the option `config.WithServiceAccountKeyPath("path/to/sa_key.json")` -2. Environment variable, e.g. by setting `STACKIT_SERVICE_ACCOUNT_KEY_PATH` -3. Credentials file +1. **Key Flow** (Recommended) - The SDK will check the credentials file located in the path defined by the `STACKIT_CREDENTIALS_PATH` env var, if specified, - or in `$HOME/.stackit/credentials.json` as a fallback. - The credentials file should be a json and each credential should be set using the name of the respective environment variable, as stated below in each flow. Example: + - Uses RSA key-pair based authentication + - Provides better security through short-lived tokens + - Supports both STACKIT-generated and custom key pairs - ```json - { - "STACKIT_SERVICE_ACCOUNT_TOKEN": "foo_token", - "STACKIT_SERVICE_ACCOUNT_KEY_PATH": "path/to/sa_key.json" - } - ``` - -Check the [authentication example](examples/authentication/authentication.go) for more details. +2. **Token Flow** + - Uses long-lived service account tokens + - Simpler but less secure -### Key flow +### Configuration Priority - The following instructions assume that you have created a service account and assigned it the necessary permissions, e.g. `project.owner`. +The SDK searches for credentials in the following order: -To use the key flow, you need to have a service account key, which must have an RSA key-pair attached to it. +1. Explicit configuration in code +2. Environment variables +3. Credentials file (`$HOME/.stackit/credentials.json`) -When creating the service account key, a new pair can be created automatically, which will be included in the service account key. This will make it much easier to configure the key flow authentication in the CLI, by just providing the service account key. +For each authentication method, the key flow is attempted first, followed by the token flow. -**Optionally**, you can provide your own private key when creating the service account key, which will then require you to also provide it explicitly to the CLI, additionaly to the service account key. Check the STACKIT Knowledge Base for an [example of how to create your own key-pair](https://docs.stackit.cloud/stackit/en/usage-of-the-service-account-keys-in-stackit-175112464.html#UsageoftheserviceaccountkeysinSTACKIT-CreatinganRSAkey-pair). +### Using the Key Flow -To configure the key flow, follow this steps: +1. Create a service account key in the STACKIT Portal: -1. Create a service account key: + - Navigate to `Service Accounts` → Select account → `Service Account Keys` → Create key + - You can either let STACKIT generate the key pair or provide your own RSA key pair (see [Creating an RSA key-pair](https://docs.stackit.cloud/stackit/en/usage-of-the-service-account-keys-in-stackit-175112464.html#UsageoftheserviceaccountkeysinSTACKIT-CreatinganRSAkey-pair) for more details) + - **Note**: it's also possible to create the service account key in other ways (see [Tutorials for Service Accounts](https://docs.stackit.cloud/stackit/en/tutorials-for-service-accounts-134415861.html) for more details) -- Use the STACKIT Portal: go to the `Service Accounts` tab, choose a `Service Account` and go to `Service Account Keys` to create a key. For more details, see [Create a service account key](https://docs.stackit.cloud/stackit/en/create-a-service-account-key-175112456.html) - -2. Save the content of the service account key by copying it and saving it in a JSON file. - - The expected format of the service account key is a **json** with the following structure: +2. Save the service account key JSON: ```json { "id": "uuid", "publicKey": "public key", - "createdAt": "2023-08-24T14:15:22Z", - "validUntil": "2023-08-24T14:15:22Z", - "keyType": "USER_MANAGED", - "keyOrigin": "USER_PROVIDED", - "keyAlgorithm": "RSA_2048", - "active": true, "credentials": { "kid": "string", "iss": "my-sa@sa.stackit.cloud", "sub": "uuid", "aud": "string", - (optional) "privateKey": "private key when generated by the SA service" + "privateKey": "private key (if STACKIT-generated)" } + // ... other fields ... } ``` -3. Configure the service account key for authentication in the SDK by following one of the alternatives below: - - using the configuration options: `config.WithServiceAccountKey` or `config.WithServiceAccountKeyPath`, `config.WithPrivateKey` or `config.WithPrivateKeyPath` - - setting the environment variable: `STACKIT_SERVICE_ACCOUNT_KEY_PATH` - - setting `STACKIT_SERVICE_ACCOUNT_KEY_PATH` in the credentials file (see above) +3. Configure authentication using any of these methods: -> **Optionally, only if you have provided your own RSA key-pair when creating the service account key**, you also need to configure your private key (takes precedence over the one included in the service account key, if present). **The private key must be PEM encoded** and can be provided using one of the options below: -> -> - using the configuration options: `config.WithPrivateKey` or `config.WithPrivateKeyPath` -> - setting the environment variable: `STACKIT_PRIVATE_KEY_PATH` -> - setting `STACKIT_PRIVATE_KEY_PATH` in the credentials file (see above) + **A. Code Configuration** -4. The SDK will search for the keys and, if valid, will use them to get access and refresh tokens which will be used to authenticate all the requests. + ```go + // Using service account key file + config.WithServiceAccountKeyPath("path/to/sa_key.json") + // Or using key content directly + config.WithServiceAccountKey(keyJSON) + + // Optional: For custom key pairs + config.WithPrivateKeyPath("path/to/private.pem") + // Or using private key content directly + config.WithPrivateKey(privateKeyJSON) + ``` -### Token flow + **B. Environment Variables** -Using this flow is less secure since the token is long-lived. You can provide the token in several ways: + ```bash + # Using service account key + STACKIT_SERVICE_ACCOUNT_KEY_PATH=/path/to/sa_key.json + # or + STACKIT_SERVICE_ACCOUNT_KEY= + + # Optional: For custom key pairs + STACKIT_PRIVATE_KEY_PATH=/path/to/private.pem + # or + STACKIT_PRIVATE_KEY= + ``` + + **C. Credentials File** (`$HOME/.stackit/credentials.json`) + + ```json + { + "STACKIT_SERVICE_ACCOUNT_KEY_PATH": "/path/to/sa_key.json", + "STACKIT_PRIVATE_KEY_PATH": "/path/to/private.pem" + } + ``` + +### Using the Token Flow + +1. Create an access token in the STACKIT Portal: + + - Navigate to `Service Accounts` → Select account → `Access Tokens` → Create token + - **Note**: it's also possible to create the service account access tokens in other ways (see [Tutorials for Service Accounts](https://docs.stackit.cloud/stackit/en/tutorials-for-service-accounts-134415861.html) for more details) + +2. Configure authentication using any of these methods: + + **A. Code Configuration** + + ```go + config.WithToken("your-token") + ``` + + **B. Environment Variables** + + ```bash + STACKIT_SERVICE_ACCOUNT_TOKEN=your-token + ``` + + **C. Credentials File** (`$HOME/.stackit/credentials.json`) + + ```json + { + "STACKIT_SERVICE_ACCOUNT_TOKEN": "your-token" + } + ``` -1. Using the configuration option `config.WithToken` -2. Setting the environment variable `STACKIT_SERVICE_ACCOUNT_TOKEN` -3. Setting it in the credentials file (see above) +For detailed implementation examples, see the [authentication example](examples/authentication/authentication.go). ## Reporting issues diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 129d2cafe..11f9c967f 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.16.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.15.1 (2025-01-08) - **Bugfix:** `ConfigureRegion` does not return an error if a region is set by an enviroment variable. diff --git a/core/LICENSE.md b/core/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/core/LICENSE.md +++ b/core/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/core/NOTICE.txt b/core/NOTICE.txt index 05c71746a..e82d5ec36 100644 --- a/core/NOTICE.txt +++ b/core/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Core SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/core/go.mod b/core/go.mod index 55aaabd77..1dcda31d5 100644 --- a/core/go.mod +++ b/core/go.mod @@ -1,6 +1,6 @@ module github.com/stackitcloud/stackit-sdk-go/core -go 1.18 +go 1.21 require ( github.com/golang-jwt/jwt/v5 v5.2.1 diff --git a/examples/authentication/go.mod b/examples/authentication/go.mod index c89e8258e..680faee25 100644 --- a/examples/authentication/go.mod +++ b/examples/authentication/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/authentication -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 ) diff --git a/examples/authentication/go.sum b/examples/authentication/go.sum index 6cbca3a14..ed12dae46 100644 --- a/examples/authentication/go.sum +++ b/examples/authentication/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 h1:nzOZQ2X6joM2iStePoACZeYvXFBQIBjkYE9sLanOGvE= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1/go.mod h1:mv8U7kuclXo+0VpDHtBCkve/3i9h1yT+RAId/MUi+C8= diff --git a/examples/authorization/go.mod b/examples/authorization/go.mod index 73956578f..81b989b6e 100644 --- a/examples/authorization/go.mod +++ b/examples/authorization/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/examples/authorization -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - github.com/stackitcloud/stackit-sdk-go/services/authorization v0.4.1 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + github.com/stackitcloud/stackit-sdk-go/services/authorization v0.5.1 ) require ( diff --git a/examples/authorization/go.sum b/examples/authorization/go.sum index cea78785a..1fb9b93e7 100644 --- a/examples/authorization/go.sum +++ b/examples/authorization/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/authorization v0.4.1 h1:sK7FZHN1tF8D/7rbWLhu4DX0qrAP5Psn2NusnwbCsEM= -github.com/stackitcloud/stackit-sdk-go/services/authorization v0.4.1/go.mod h1:8spVqlPqZrvQQ63Qodbydk3qsZx7lr963ECft+sqFhY= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/authorization v0.5.1 h1:MAB7z8Hr6nCNdPCiLy5uNOJB+1R/eYFseFNEQUYK7qc= +github.com/stackitcloud/stackit-sdk-go/services/authorization v0.5.1/go.mod h1:8xSVF4KRo4GbkGBmmiOYP/CzIIivppvGIafUpdctnZc= diff --git a/examples/backgroundrefresh/go.mod b/examples/backgroundrefresh/go.mod index 9dd778045..802d903d5 100644 --- a/examples/backgroundrefresh/go.mod +++ b/examples/backgroundrefresh/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/backgroundrefresh -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 ) diff --git a/examples/backgroundrefresh/go.sum b/examples/backgroundrefresh/go.sum index 6cbca3a14..ed12dae46 100644 --- a/examples/backgroundrefresh/go.sum +++ b/examples/backgroundrefresh/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 h1:nzOZQ2X6joM2iStePoACZeYvXFBQIBjkYE9sLanOGvE= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1/go.mod h1:mv8U7kuclXo+0VpDHtBCkve/3i9h1yT+RAId/MUi+C8= diff --git a/examples/configuration/go.mod b/examples/configuration/go.mod index b5513ced0..8e85a089f 100644 --- a/examples/configuration/go.mod +++ b/examples/configuration/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/configuration -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.12.1 ) diff --git a/examples/configuration/go.sum b/examples/configuration/go.sum index 6cbb1ad3e..08a09e6e3 100644 --- a/examples/configuration/go.sum +++ b/examples/configuration/go.sum @@ -1,10 +1,11 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 h1:nzOZQ2X6joM2iStePoACZeYvXFBQIBjkYE9sLanOGvE= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1/go.mod h1:mv8U7kuclXo+0VpDHtBCkve/3i9h1yT+RAId/MUi+C8= github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.12.1 h1:u2jNFPPLM2TlpM1qUu1UuG9XKx/EYPjwg2nJqAK1HUY= diff --git a/examples/dns/go.mod b/examples/dns/go.mod index a96d875f0..d0d8a322d 100644 --- a/examples/dns/go.mod +++ b/examples/dns/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/dns -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 ) diff --git a/examples/dns/go.sum b/examples/dns/go.sum index 6cbca3a14..ed12dae46 100644 --- a/examples/dns/go.sum +++ b/examples/dns/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 h1:nzOZQ2X6joM2iStePoACZeYvXFBQIBjkYE9sLanOGvE= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1/go.mod h1:mv8U7kuclXo+0VpDHtBCkve/3i9h1yT+RAId/MUi+C8= diff --git a/examples/errorhandling/go.mod b/examples/errorhandling/go.mod index 0966f4a37..8c6c51cb9 100644 --- a/examples/errorhandling/go.mod +++ b/examples/errorhandling/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/errorhandling -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 ) diff --git a/examples/errorhandling/go.sum b/examples/errorhandling/go.sum index 6cbca3a14..ed12dae46 100644 --- a/examples/errorhandling/go.sum +++ b/examples/errorhandling/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 h1:nzOZQ2X6joM2iStePoACZeYvXFBQIBjkYE9sLanOGvE= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1/go.mod h1:mv8U7kuclXo+0VpDHtBCkve/3i9h1yT+RAId/MUi+C8= diff --git a/examples/iaas/go.mod b/examples/iaas/go.mod index 86dbe7057..66427031c 100644 --- a/examples/iaas/go.mod +++ b/examples/iaas/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/iaas -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/iaas v0.19.0 ) diff --git a/examples/iaas/go.sum b/examples/iaas/go.sum index 768ea9a48..c874ea78b 100644 --- a/examples/iaas/go.sum +++ b/examples/iaas/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/iaas v0.19.0 h1:o9OAGh4mdYY5LZYZiJio0KYUhqPSpBY4vT08piGx0pI= github.com/stackitcloud/stackit-sdk-go/services/iaas v0.19.0/go.mod h1:YfuN+eXuqr846xeRyW2Vf1JM2jU0ikeQa76dDI66RsM= diff --git a/examples/iaasalpha/go.mod b/examples/iaasalpha/go.mod index ebb633ffe..7d23ffec4 100644 --- a/examples/iaasalpha/go.mod +++ b/examples/iaasalpha/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/iaasalpha -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.11-alpha ) diff --git a/examples/iaasalpha/go.sum b/examples/iaasalpha/go.sum index 84f7a3f8b..3646d1ef3 100644 --- a/examples/iaasalpha/go.sum +++ b/examples/iaasalpha/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.11-alpha h1:uYslPwq0euGkuH6kHIhoXUaB9w+yrrDKLd80eo/5GZU= github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.11-alpha/go.mod h1:nW/6vvumUHA7o1/JOOqsrEOBNrRHombEKB1U4jmg2wU= diff --git a/examples/loadbalancer/go.mod b/examples/loadbalancer/go.mod index 2edb52dee..eaf598c4c 100644 --- a/examples/loadbalancer/go.mod +++ b/examples/loadbalancer/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/loadbalancer -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v0.17.0 ) diff --git a/examples/loadbalancer/go.sum b/examples/loadbalancer/go.sum index c6e0aac86..8544254a5 100644 --- a/examples/loadbalancer/go.sum +++ b/examples/loadbalancer/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v0.17.0 h1:06CGP64CEk3Zg6i9kZCMRdmCzLLiyMWQqGK1teBr9Oc= github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v0.17.0/go.mod h1:JL94zc8K0ebWs+DBGXR28vNCF0EFV54ZLUtrlXOvWgA= diff --git a/examples/logme/go.mod b/examples/logme/go.mod index aaf44273d..834c54ad6 100644 --- a/examples/logme/go.mod +++ b/examples/logme/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/examples/logme -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - github.com/stackitcloud/stackit-sdk-go/services/logme v0.20.1 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + github.com/stackitcloud/stackit-sdk-go/services/logme v0.20.2 ) require ( diff --git a/examples/logme/go.sum b/examples/logme/go.sum index 162a98734..1b36da0f0 100644 --- a/examples/logme/go.sum +++ b/examples/logme/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/logme v0.20.1 h1:ogo7Ce4wA9ln/Z0VwvckH0FT5/i7d9/34bG85aayHn8= -github.com/stackitcloud/stackit-sdk-go/services/logme v0.20.1/go.mod h1:+NlUMcid2dEFSmqtbXJrcT57iP0oTdnIXHOQku0E04A= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/logme v0.20.2 h1:K921/2U8dJh1SAOClhPqmZtid+/kP+BPrGZjXWOABkQ= +github.com/stackitcloud/stackit-sdk-go/services/logme v0.20.2/go.mod h1:mwKowXJhwB9/PQdvdmOyyqOzLF0AmkzpcwrQbDYxllo= diff --git a/examples/mariadb/go.mod b/examples/mariadb/go.mod index cd37b36d9..a3153d8da 100644 --- a/examples/mariadb/go.mod +++ b/examples/mariadb/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/mariadb -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.20.1 ) diff --git a/examples/mariadb/go.sum b/examples/mariadb/go.sum index 02589f446..ee9dde110 100644 --- a/examples/mariadb/go.sum +++ b/examples/mariadb/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.20.1 h1:J+GLgfDIDnNpq/z6ev1whfLbOwUn5XgSKh3aE2auHIs= github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.20.1/go.mod h1:nuZK6OXyZ4zlGsC1gZDj9+ajJzzFi9vVgSSRQlEJAqA= diff --git a/examples/middleware/go.mod b/examples/middleware/go.mod index adb1c9d5f..b1fe633e1 100644 --- a/examples/middleware/go.mod +++ b/examples/middleware/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/middleware -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/argus v0.11.0 ) diff --git a/examples/middleware/go.sum b/examples/middleware/go.sum index 3bc528fad..a864081b3 100644 --- a/examples/middleware/go.sum +++ b/examples/middleware/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/argus v0.11.0 h1:JVEx/ouHB6PlwGzQa3ywyDym1HTWo3WgrxAyXprCnuM= github.com/stackitcloud/stackit-sdk-go/services/argus v0.11.0/go.mod h1:nVllQfYODhX1q3bgwVTLO7wHOp+8NMLiKbn3u/Dg5nU= diff --git a/examples/mongodbflex/go.mod b/examples/mongodbflex/go.mod index 188b9126d..4f1d8299a 100644 --- a/examples/mongodbflex/go.mod +++ b/examples/mongodbflex/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/examples/mongodbflex -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.16.1 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.17.0 ) require ( diff --git a/examples/mongodbflex/go.sum b/examples/mongodbflex/go.sum index b232c92ef..b86f65834 100644 --- a/examples/mongodbflex/go.sum +++ b/examples/mongodbflex/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.16.1 h1:BCzShNI9TX6vZ8Q5vLzdG32gOdgcAwMWjEpy2AGHdnI= -github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.16.1/go.mod h1:CvGSm9Goma2O1xkA0LEJbHfZpGlhy0AXJnMPpMmRdMM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.17.0 h1:SXNkKaAsGOkr9C6bv2i7q3kucxL3kril+z2wnshlXK0= +github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.17.0/go.mod h1:5hMtm08NrL+QcgKl94zUDrY7VEzKRcvCJOEOvENBxqc= diff --git a/examples/objectstorage/go.mod b/examples/objectstorage/go.mod index 66b73ff42..d5133ab7c 100644 --- a/examples/objectstorage/go.mod +++ b/examples/objectstorage/go.mod @@ -1,13 +1,11 @@ module github.com/stackitcloud/stackit-sdk-go/examples/objectstorage -go 1.18 +go 1.21 -require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - github.com/stackitcloud/stackit-sdk-go/services/objectstorage v0.11.1 -) +require github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.0.0 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 // indirect ) diff --git a/examples/objectstorage/go.sum b/examples/objectstorage/go.sum index 79fdcef8f..a0912d8a2 100644 --- a/examples/objectstorage/go.sum +++ b/examples/objectstorage/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/objectstorage v0.11.1 h1:Df3fTAHaVgyiiyp9LyTTQI8jXSVeGo49eW5ya4AATCY= -github.com/stackitcloud/stackit-sdk-go/services/objectstorage v0.11.1/go.mod h1:V2LEHKyTaaiEBi9L3v62mNQ7xyJSred4OK+himLJOZQ= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.0.0 h1:/0n2zcH1nMw2noroGhz0fgu2YqtNo9v3AsVhXMRtmtw= +github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.0.0/go.mod h1:0XumGX33DT6ItyD8yMlogSPWvpIuoqN7RZBrpUBPX+k= diff --git a/examples/objectstorage/objectstorage.go b/examples/objectstorage/objectstorage.go index 446b417f2..5bf2c3f85 100644 --- a/examples/objectstorage/objectstorage.go +++ b/examples/objectstorage/objectstorage.go @@ -5,25 +5,23 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/services/objectstorage" ) func main() { // Specify the project ID projectId := "PROJECT_ID" + region := "eu01" // Create a new API client, that uses default authentication and configuration - objectStorageClient, err := objectstorage.NewAPIClient( - config.WithRegion("eu01"), - ) + objectStorageClient, err := objectstorage.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "Creating API client: %v\n", err) os.Exit(1) } // Get the object storage buckets for your project - getBucketsResp, err := objectStorageClient.ListBuckets(context.Background(), projectId).Execute() + getBucketsResp, err := objectStorageClient.ListBuckets(context.Background(), projectId, region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `GetBuckets`: %v\n", err) } else { @@ -31,7 +29,7 @@ func main() { } // Create an object storage bucket - createBucketResp, err := objectStorageClient.CreateBucket(context.Background(), projectId, "example-bucket").Execute() + createBucketResp, err := objectStorageClient.CreateBucket(context.Background(), projectId, region, "example-bucket").Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CreateBucket`: %v\n", err) } else { diff --git a/examples/observability/go.mod b/examples/observability/go.mod index 74ec33a78..1e31a9e52 100644 --- a/examples/observability/go.mod +++ b/examples/observability/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/argus -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/observability v0.2.1 ) diff --git a/examples/observability/go.sum b/examples/observability/go.sum index a5fa7e5d8..8c80a25ec 100644 --- a/examples/observability/go.sum +++ b/examples/observability/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/observability v0.2.1 h1:sIz4wJIz6/9Eh6nSoi2sQ+Ef53iOrFsqLKIp2oRkmgo= github.com/stackitcloud/stackit-sdk-go/services/observability v0.2.1/go.mod h1:okcRTrNDTI3d7MQcYJMliK0qoXeLq0b1wvZuEqgJIWE= diff --git a/examples/opensearch/go.mod b/examples/opensearch/go.mod index 96b4d2be1..b87801a2a 100644 --- a/examples/opensearch/go.mod +++ b/examples/opensearch/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/opensearch -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.19.1 ) diff --git a/examples/opensearch/go.sum b/examples/opensearch/go.sum index 40fe30490..d71f1f473 100644 --- a/examples/opensearch/go.sum +++ b/examples/opensearch/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.19.1 h1:hwRkCCUSWMhKTc7fLakL89V6+9xkxsFQlRthVmrvi1U= github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.19.1/go.mod h1:U45gFwIAAdXWL/Wlp9rY3iPVWFHLGILz1C3Qc62o8KM= diff --git a/examples/postgresflex/go.mod b/examples/postgresflex/go.mod index ffa068878..b0b225a61 100644 --- a/examples/postgresflex/go.mod +++ b/examples/postgresflex/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/examples/postgresflex -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.16.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.17.0 ) require ( diff --git a/examples/postgresflex/go.sum b/examples/postgresflex/go.sum index f6252af6c..89bbeec17 100644 --- a/examples/postgresflex/go.sum +++ b/examples/postgresflex/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.16.0 h1:aRVPIaTtM2zyep3k22lu6ARG0j0P1N/7fjH7TS6ucio= -github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.16.0/go.mod h1:JnhCZzXprN/em1Uxpvl1ITMf6Hl/8N/4y5zNsRqEGlA= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.17.0 h1:2mxf7vAaQuEM28D78uSIdUyqHKqNLM+pZnYC0LqbDpc= +github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.17.0/go.mod h1:gPOT3o+b0mx2Z4r/ZXhSqt5MRHbZplGoUafxeClSSng= diff --git a/examples/rabbitmq/go.mod b/examples/rabbitmq/go.mod index ba57e46fd..626f138fb 100644 --- a/examples/rabbitmq/go.mod +++ b/examples/rabbitmq/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/rabbitmq -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.20.1 ) diff --git a/examples/rabbitmq/go.sum b/examples/rabbitmq/go.sum index 26b4067d3..7ef3b88cd 100644 --- a/examples/rabbitmq/go.sum +++ b/examples/rabbitmq/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.20.1 h1:6XfGxsPFqci/geSDd1gCtiaRJun85X5JepXn4edobXQ= github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.20.1/go.mod h1:42oYZOqin+rIUrUqgtCIE4wzCWWY30H4UFhzvo1Wg2w= diff --git a/examples/redis/go.mod b/examples/redis/go.mod index cfdeb97c4..076c85b02 100644 --- a/examples/redis/go.mod +++ b/examples/redis/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/redis -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/redis v0.20.1 ) diff --git a/examples/redis/go.sum b/examples/redis/go.sum index 039c524ff..03504ead8 100644 --- a/examples/redis/go.sum +++ b/examples/redis/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/redis v0.20.1 h1:/EVm0bD9a3KCk9aj/v2ivJIURlGsTr4O2OwMQ4ey3e4= github.com/stackitcloud/stackit-sdk-go/services/redis v0.20.1/go.mod h1:YJdkyuY7aK/clfE3lQDz7O369JLPcg0FO4yfCIPNUNE= diff --git a/examples/resourcemanager/go.mod b/examples/resourcemanager/go.mod index 22bc56c70..e2581b4b8 100644 --- a/examples/resourcemanager/go.mod +++ b/examples/resourcemanager/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/examples/resourcemanager -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.11.1 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.12.0 ) require ( diff --git a/examples/resourcemanager/go.sum b/examples/resourcemanager/go.sum index e8723085b..f1838532e 100644 --- a/examples/resourcemanager/go.sum +++ b/examples/resourcemanager/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.11.1 h1:bICGCqRsGEzqidVCgQIH3hxB+SX1vJapZgrSP5nhvBo= -github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.11.1/go.mod h1:9Om4A5FI/wXZE/8zu5wF8eRBb70VddyPfnj/nlYXHX0= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.12.0 h1:uYWg/wovldLquCsHsdJUWyUF3Z1Yz4rR64WPfcfudmg= +github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.12.0/go.mod h1:hLc1YDjcwnkkQntTMQ5pk1ZQyX6cuBZoaEe4lr8sppI= diff --git a/examples/runtime/go.mod b/examples/runtime/go.mod index 18a28926e..95fb1648c 100644 --- a/examples/runtime/go.mod +++ b/examples/runtime/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/examples/runtime -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.16.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.17.0 ) require ( diff --git a/examples/runtime/go.sum b/examples/runtime/go.sum index f6252af6c..89bbeec17 100644 --- a/examples/runtime/go.sum +++ b/examples/runtime/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.16.0 h1:aRVPIaTtM2zyep3k22lu6ARG0j0P1N/7fjH7TS6ucio= -github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.16.0/go.mod h1:JnhCZzXprN/em1Uxpvl1ITMf6Hl/8N/4y5zNsRqEGlA= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.17.0 h1:2mxf7vAaQuEM28D78uSIdUyqHKqNLM+pZnYC0LqbDpc= +github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.17.0/go.mod h1:gPOT3o+b0mx2Z4r/ZXhSqt5MRHbZplGoUafxeClSSng= diff --git a/examples/secretsmanager/go.mod b/examples/secretsmanager/go.mod index 745432892..d361593fe 100644 --- a/examples/secretsmanager/go.mod +++ b/examples/secretsmanager/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/secretsmanager -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.10.1 ) diff --git a/examples/secretsmanager/go.sum b/examples/secretsmanager/go.sum index 7b19698b9..a2ad1331b 100644 --- a/examples/secretsmanager/go.sum +++ b/examples/secretsmanager/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.10.1 h1:qShB0OuNR8EOffY36/DfJs/Yk12syy38xkE88Z15f4k= github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.10.1/go.mod h1:268uoY2gKCa5xcDL169TGVjLUNTcZ2En77YdfYOcR1w= diff --git a/examples/serviceaccount/go.mod b/examples/serviceaccount/go.mod index 0ec3dbf08..969548dbf 100644 --- a/examples/serviceaccount/go.mod +++ b/examples/serviceaccount/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/serviceaccount -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.5.0 ) diff --git a/examples/serviceaccount/go.sum b/examples/serviceaccount/go.sum index e033650fa..bc4c70377 100644 --- a/examples/serviceaccount/go.sum +++ b/examples/serviceaccount/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.5.0 h1:yf9BxAZEG2hdaekWxaNt2BOX/4qmGkl0d268ggR+tCU= github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.5.0/go.mod h1:Wpqj80yGruCNYGr2yxqhRaLLj4gPSkhJqZyWRXUh/QU= diff --git a/examples/serviceenablement/go.mod b/examples/serviceenablement/go.mod index fd71e2832..4c2d6f3b1 100644 --- a/examples/serviceenablement/go.mod +++ b/examples/serviceenablement/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/serviceenablement -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v0.4.0 ) diff --git a/examples/serviceenablement/go.sum b/examples/serviceenablement/go.sum index 0e8385670..4c338c87b 100644 --- a/examples/serviceenablement/go.sum +++ b/examples/serviceenablement/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v0.4.0 h1:K5fVTcJxjOVwJBa3kiWRsYNAq+I3jAYdU1U+f6no5lE= github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v0.4.0/go.mod h1:zyg0hpiNdZLRbelkJb2KDf9OHQKLqqcTpePQ1qHL5dE= diff --git a/examples/ske/go.mod b/examples/ske/go.mod index e82b17a71..3dd9f46ca 100644 --- a/examples/ske/go.mod +++ b/examples/ske/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/examples/ske -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - github.com/stackitcloud/stackit-sdk-go/services/ske v0.20.1 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.1 ) require ( diff --git a/examples/ske/go.sum b/examples/ske/go.sum index d1b75ed7c..95f057c04 100644 --- a/examples/ske/go.sum +++ b/examples/ske/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/ske v0.20.1 h1:Gw68D2U+cAh20sRX2GvhLCSvRVvbKF52Ew7FQ/AoCXc= -github.com/stackitcloud/stackit-sdk-go/services/ske v0.20.1/go.mod h1:A4+9KslxCA31JvxnT+O/GC67eAOdw+iqhBzewZZaCD0= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.1 h1:oO+wCobC4OfH+vpfJQEnCUQuKVILRj5mQojBbzWgzDA= +github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.1/go.mod h1:iZyh3DMi2fUZxAIseykjKfDo2wf2FIDwpF43I22b8uk= diff --git a/examples/sqlserverflex/go.mod b/examples/sqlserverflex/go.mod index 4922b8987..0d58da9b2 100644 --- a/examples/sqlserverflex/go.mod +++ b/examples/sqlserverflex/go.mod @@ -1,11 +1,11 @@ module github.com/stackitcloud/stackit-sdk-go/examples/sqlserverflex -go 1.18 +go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.8.1 + github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.9.0 ) diff --git a/examples/sqlserverflex/go.sum b/examples/sqlserverflex/go.sum index 9e077d4f2..7ab6b94ff 100644 --- a/examples/sqlserverflex/go.sum +++ b/examples/sqlserverflex/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= -github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.8.1 h1:26MyaOGc3Sn4yuR3zoOOOFfb4MTbDV9PJwzU8yulWNc= -github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.8.1/go.mod h1:ui+yRLddE9mknzjZa45boyaU1ZomQuZy3p7wuwOufCY= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.9.0 h1:OYWT7B63isBPyVuPxd3yobvky7/nhcXQxaBgPki5nR4= +github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.9.0/go.mod h1:vrl+OVJkjjupkvfkqY2T3HAB6x2x0S6zDhdFB5BWEnU= diff --git a/examples/waiter/go.mod b/examples/waiter/go.mod index 3457e8ba2..52cabf7fb 100644 --- a/examples/waiter/go.mod +++ b/examples/waiter/go.mod @@ -1,9 +1,9 @@ module github.com/stackitcloud/stackit-sdk-go/examples/waiter -go 1.18 +go 1.21 require ( - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 ) diff --git a/examples/waiter/go.sum b/examples/waiter/go.sum index 6cbca3a14..ed12dae46 100644 --- a/examples/waiter/go.sum +++ b/examples/waiter/go.sum @@ -1,9 +1,10 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1 h1:nzOZQ2X6joM2iStePoACZeYvXFBQIBjkYE9sLanOGvE= github.com/stackitcloud/stackit-sdk-go/services/dns v0.12.1/go.mod h1:mv8U7kuclXo+0VpDHtBCkve/3i9h1yT+RAId/MUi+C8= diff --git a/go.work b/go.work index 18fe2932b..ede5f74cc 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.18 +go 1.21 use ( ./core @@ -32,9 +32,11 @@ use ( ./scripts ./services/archiving ./services/authorization + ./services/certificates ./services/dns ./services/iaas ./services/iaasalpha + ./services/lbapplication ./services/loadbalancer ./services/logme ./services/mariadb @@ -54,4 +56,5 @@ use ( ./services/serviceenablement ./services/ske ./services/sqlserverflex + ./services/stackitmarketplace ) diff --git a/golang-ci.yaml b/golang-ci.yaml index 3d8a4c1fe..8b621382f 100644 --- a/golang-ci.yaml +++ b/golang-ci.yaml @@ -93,4 +93,4 @@ linters: - unparam # false positives issues: exclude-use-default: false -go: 1.18 +go: 1.21 diff --git a/scripts/go.mod b/scripts/go.mod index eb9da10bd..bca946b20 100644 --- a/scripts/go.mod +++ b/scripts/go.mod @@ -1,36 +1,35 @@ module github.com/stackitcloud/stackit-sdk-go/scripts -go 1.18 +go 1.21 require ( github.com/go-git/go-git/v5 v5.12.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 - golang.org/x/term v0.28.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + golang.org/x/mod v0.20.0 + golang.org/x/term v0.29.0 ) require ( - dario.cat/mergo v1.0.0 // indirect - github.com/ProtonMail/go-crypto v1.0.0 // indirect + dario.cat/mergo v1.0.1 // indirect + github.com/ProtonMail/go-crypto v1.1.5 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect + github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.5.0 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/go-git/go-billy/v5 v5.6.2 // indirect + github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect + github.com/pjbgf/sha1cd v0.3.2 // indirect github.com/skeema/knownhosts v1.2.2 // indirect ) require ( - github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/mod v0.20.0 - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.29.0 // indirect - golang.org/x/tools v0.13.0 // indirect + golang.org/x/crypto v0.33.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/scripts/go.sum b/scripts/go.sum index 81f2fe025..87217c2ab 100644 --- a/scripts/go.sum +++ b/scripts/go.sum @@ -1,18 +1,16 @@ -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= -github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/ProtonMail/go-crypto v1.1.5 h1:eoAQfK2dwL+tFSFpr7TbOaPNUbPiJj4fLYwwGE1FQO4= +github.com/ProtonMail/go-crypto v1.1.5/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= +github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= 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= @@ -22,13 +20,13 @@ github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FM github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM= +github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= +github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= @@ -39,89 +37,50 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= -github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4= +github.com/pjbgf/sha1cd v0.3.2/go.mod h1:zQWigSxVmsHEZow5qaLtPYxpcKMMQpa09ixqBxuCS6A= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/services/archiving/CHANGELOG.md b/services/archiving/CHANGELOG.md index 6a511cbe6..b2f671770 100644 --- a/services/archiving/CHANGELOG.md +++ b/services/archiving/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.1.0 (2024-07-04) - Manage your STACKIT Archiving instance with: `CreateInstance`, `DeleteInstance`, `GetInstance`, `ListInstances` and `PartialUpdateInstance`. diff --git a/services/archiving/LICENSE.md b/services/archiving/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/archiving/LICENSE.md +++ b/services/archiving/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/archiving/NOTICE.txt b/services/archiving/NOTICE.txt index e3aa6b7e6..1de747dc3 100644 --- a/services/archiving/NOTICE.txt +++ b/services/archiving/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Archiving SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/archiving/go.mod b/services/archiving/go.mod index 51944fd29..4d6b523c6 100644 --- a/services/archiving/go.mod +++ b/services/archiving/go.mod @@ -1,8 +1,8 @@ module github.com/stackitcloud/stackit-sdk-go/services/archiving -go 1.18 +go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/services/archiving/go.sum b/services/archiving/go.sum index 318b353d7..b7342b5ac 100644 --- a/services/archiving/go.sum +++ b/services/archiving/go.sum @@ -1,7 +1,8 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/authorization/CHANGELOG.md b/services/authorization/CHANGELOG.md index 31b4182ae..f45295834 100644 --- a/services/authorization/CHANGELOG.md +++ b/services/authorization/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.6.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.5.1 (2025-01-17) + +- **Bugfix:** Revert back to global URL configuration + ## v0.5.0 (2025-01-09) - Add support for regions in `APIClient` diff --git a/services/authorization/LICENSE.md b/services/authorization/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/authorization/LICENSE.md +++ b/services/authorization/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/authorization/NOTICE.txt b/services/authorization/NOTICE.txt index a5f3117fa..3507dd840 100644 --- a/services/authorization/NOTICE.txt +++ b/services/authorization/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Authorization SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/authorization/configuration.go b/services/authorization/configuration.go index 6dbacd3e4..0b01a4f8d 100644 --- a/services/authorization/configuration.go +++ b/services/authorization/configuration.go @@ -22,16 +22,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://authorization.api.{region}stackit.cloud", + URL: "https://authorization.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - "eu02.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/authorization/go.mod b/services/authorization/go.mod index cd97f53c5..1c5a3944f 100644 --- a/services/authorization/go.mod +++ b/services/authorization/go.mod @@ -1,8 +1,8 @@ module github.com/stackitcloud/stackit-sdk-go/services/authorization -go 1.18 +go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/services/authorization/go.sum b/services/authorization/go.sum index 318b353d7..b7342b5ac 100644 --- a/services/authorization/go.sum +++ b/services/authorization/go.sum @@ -1,7 +1,8 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/certificates/.openapi-generator/VERSION b/services/certificates/.openapi-generator/VERSION new file mode 100644 index 000000000..cd802a1ec --- /dev/null +++ b/services/certificates/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/services/certificates/CHANGELOG.md b/services/certificates/CHANGELOG.md new file mode 100644 index 000000000..263070171 --- /dev/null +++ b/services/certificates/CHANGELOG.md @@ -0,0 +1,6 @@ +## v0.2.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.1.0 (2025-01-13) + +- **New**: STACKIT Certificates module can be used to manage the STACKIT Load Balancer Certificates \ No newline at end of file diff --git a/services/certificates/LICENSE.md b/services/certificates/LICENSE.md new file mode 100644 index 000000000..7e2f06484 --- /dev/null +++ b/services/certificates/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2025 Schwarz IT KG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/certificates/NOTICE.txt b/services/certificates/NOTICE.txt new file mode 100644 index 000000000..1e3b201d7 --- /dev/null +++ b/services/certificates/NOTICE.txt @@ -0,0 +1,2 @@ +STACKIT SDK for Go +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/certificates/api_default.go b/services/certificates/api_default.go new file mode 100644 index 000000000..3e58e0a1e --- /dev/null +++ b/services/certificates/api_default.go @@ -0,0 +1,614 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiCreateCertificateRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createCertificatePayload *CreateCertificatePayload +} + +func (r ApiCreateCertificateRequest) CreateCertificatePayload(createCertificatePayload CreateCertificatePayload) ApiCreateCertificateRequest { + r.createCertificatePayload = &createCertificatePayload + return r +} + +func (r ApiCreateCertificateRequest) Execute() (*CreateCertificateResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateCertificateResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCertificate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/certificates" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createCertificatePayload == nil { + return localVarReturnValue, fmt.Errorf("createCertificatePayload 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.createCertificatePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateCertificate: Store a TLS certificate in a project. + +CreateCertificate will store a TLS certificate in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiCreateCertificateRequest +*/ +func (a *APIClient) CreateCertificate(ctx context.Context, projectId string) ApiCreateCertificateRequest { + return ApiCreateCertificateRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) CreateCertificateExecute(ctx context.Context, projectId string) (*CreateCertificateResponse, error) { + r := ApiCreateCertificateRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiDeleteCertificateRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + id string +} + +func (r ApiDeleteCertificateRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCertificate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/certificates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteCertificate: Delete a stored TLS certificate in a project. + +DeleteCertificate will delete the stored TLS certificate. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return ApiDeleteCertificateRequest +*/ +func (a *APIClient) DeleteCertificate(ctx context.Context, projectId string, id string) ApiDeleteCertificateRequest { + return ApiDeleteCertificateRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +func (a *APIClient) DeleteCertificateExecute(ctx context.Context, projectId string, id string) (map[string]interface{}, error) { + r := ApiDeleteCertificateRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + id: id, + } + return r.Execute() +} + +type ApiGetCertificateRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + id string +} + +func (r ApiGetCertificateRequest) Execute() (*GetCertificateResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCertificateResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCertificate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/certificates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetCertificate: Retrieve the public parts of a stored TLS certificate. + +GetCertificate will return the public parts of a stored TLS certificate. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return ApiGetCertificateRequest +*/ +func (a *APIClient) GetCertificate(ctx context.Context, projectId string, id string) ApiGetCertificateRequest { + return ApiGetCertificateRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +func (a *APIClient) GetCertificateExecute(ctx context.Context, projectId string, id string) (*GetCertificateResponse, error) { + r := ApiGetCertificateRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + id: id, + } + return r.Execute() +} + +type ApiListCertificatesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + pageSize *string + pageId *string +} + +// page_size specifies how many certificates should be returned on this page. Must be a positive number <= 1000 + +func (r ApiListCertificatesRequest) PageSize(pageSize string) ApiListCertificatesRequest { + r.pageSize = &pageSize + return r +} + +// page_id is a page identifier returned by the previous response and is used to request the next page + +func (r ApiListCertificatesRequest) PageId(pageId string) ApiListCertificatesRequest { + r.pageId = &pageId + return r +} + +func (r ApiListCertificatesRequest) Execute() (*ListCertificatesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCertificatesResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCertificates") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/certificates" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "") + } + if r.pageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageId", r.pageId, "") + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListCertificates: Retrieve the list of TLS certificate stored in a project. + +ListCertificates will return the list of TLS certificates in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListCertificatesRequest +*/ +func (a *APIClient) ListCertificates(ctx context.Context, projectId string) ApiListCertificatesRequest { + return ApiListCertificatesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) ListCertificatesExecute(ctx context.Context, projectId string) (*ListCertificatesResponse, error) { + r := ApiListCertificatesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} diff --git a/services/certificates/api_default_test.go b/services/certificates/api_default_test.go new file mode 100644 index 000000000..82fce34c7 --- /dev/null +++ b/services/certificates/api_default_test.go @@ -0,0 +1,241 @@ +/* +Load Balancer Certificates API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package certificates + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +func Test_certificates_DefaultApiService(t *testing.T) { + + t.Run("Test DefaultApiService CreateCertificate", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/certificates" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := CreateCertificateResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for certificates_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + createCertificatePayload := CreateCertificatePayload{} + + resp, reqErr := apiClient.CreateCertificate(context.Background(), projectId).CreateCertificatePayload(createCertificatePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteCertificate", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/certificates/{id}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + idValue := "id" + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for certificates_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + id := "id" + + resp, reqErr := apiClient.DeleteCertificate(context.Background(), projectId, id).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetCertificate", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/certificates/{id}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + idValue := "id" + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetCertificateResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for certificates_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + id := "id" + + resp, reqErr := apiClient.GetCertificate(context.Background(), projectId, id).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListCertificates", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/certificates" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListCertificatesResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for certificates_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.ListCertificates(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + +} diff --git a/services/certificates/client.go b/services/certificates/client.go new file mode 100644 index 000000000..04b4b3f3b --- /dev/null +++ b/services/certificates/client.go @@ -0,0 +1,631 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the Load Balancer Certificates API API v1beta.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + defaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. +// Optionally receives configuration options +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + c.defaultApi = (*DefaultApiService)(&c.common) + + return c, nil +} + +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 { + dump, err := httputil.DumpRequestOut(request, true) + 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 + } + + 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() *config.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, fmt.Errorf("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, fmt.Errorf("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 fmt.Errorf("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 fmt.Errorf("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 +} + +// 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) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s", 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) +} diff --git a/services/certificates/configuration.go b/services/certificates/configuration.go new file mode 100644 index 000000000..609422d22 --- /dev/null +++ b/services/certificates/configuration.go @@ -0,0 +1,41 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://certificates.api.{region}stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/certificates/go.mod b/services/certificates/go.mod new file mode 100644 index 000000000..004b14388 --- /dev/null +++ b/services/certificates/go.mod @@ -0,0 +1,10 @@ +module github.com/stackitcloud/stackit-sdk-go/services/certificates + +go 1.21 + +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + +require ( + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/google/uuid v1.6.0 // indirect +) diff --git a/services/certificates/go.sum b/services/certificates/go.sum new file mode 100644 index 000000000..b7342b5ac --- /dev/null +++ b/services/certificates/go.sum @@ -0,0 +1,8 @@ +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/certificates/model_create_certificate_payload.go b/services/certificates/model_create_certificate_payload.go new file mode 100644 index 000000000..d101a8ca7 --- /dev/null +++ b/services/certificates/model_create_certificate_payload.go @@ -0,0 +1,228 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "encoding/json" +) + +// checks if the CreateCertificatePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCertificatePayload{} + +// CreateCertificatePayload Uploads a PEM encoded X509 public/private key pair +type CreateCertificatePayload struct { + // TLS certificate name + Name *string `json:"name,omitempty"` + // The PEM encoded private key part + PrivateKey *string `json:"privateKey,omitempty"` + // Project identifier + ProjectId *string `json:"projectId,omitempty"` + // The PEM encoded public key part + PublicKey *string `json:"publicKey,omitempty"` +} + +// NewCreateCertificatePayload instantiates a new CreateCertificatePayload object +// This constructor will assign default values to properties that have it defined, +// 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 NewCreateCertificatePayload() *CreateCertificatePayload { + this := CreateCertificatePayload{} + return &this +} + +// NewCreateCertificatePayloadWithDefaults instantiates a new CreateCertificatePayload object +// This 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 NewCreateCertificatePayloadWithDefaults() *CreateCertificatePayload { + this := CreateCertificatePayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateCertificatePayload) 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 *CreateCertificatePayload) 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 *CreateCertificatePayload) 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 *CreateCertificatePayload) SetName(v *string) { + o.Name = v +} + +// GetPrivateKey returns the PrivateKey field value if set, zero value otherwise. +func (o *CreateCertificatePayload) GetPrivateKey() *string { + if o == nil || IsNil(o.PrivateKey) { + var ret *string + return ret + } + return o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCertificatePayload) GetPrivateKeyOk() (*string, bool) { + if o == nil || IsNil(o.PrivateKey) { + return nil, false + } + return o.PrivateKey, true +} + +// HasPrivateKey returns a boolean if a field has been set. +func (o *CreateCertificatePayload) HasPrivateKey() bool { + if o != nil && !IsNil(o.PrivateKey) { + return true + } + + return false +} + +// SetPrivateKey gets a reference to the given string and assigns it to the PrivateKey field. +func (o *CreateCertificatePayload) SetPrivateKey(v *string) { + o.PrivateKey = v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *CreateCertificatePayload) 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 *CreateCertificatePayload) 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 *CreateCertificatePayload) 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 *CreateCertificatePayload) SetProjectId(v *string) { + o.ProjectId = v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *CreateCertificatePayload) GetPublicKey() *string { + if o == nil || IsNil(o.PublicKey) { + var ret *string + return ret + } + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCertificatePayload) GetPublicKeyOk() (*string, bool) { + if o == nil || IsNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *CreateCertificatePayload) HasPublicKey() bool { + if o != nil && !IsNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *CreateCertificatePayload) SetPublicKey(v *string) { + o.PublicKey = v +} + +func (o CreateCertificatePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PrivateKey) { + toSerialize["privateKey"] = o.PrivateKey + } + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + if !IsNil(o.PublicKey) { + toSerialize["publicKey"] = o.PublicKey + } + return toSerialize, nil +} + +type NullableCreateCertificatePayload struct { + value *CreateCertificatePayload + isSet bool +} + +func (v NullableCreateCertificatePayload) Get() *CreateCertificatePayload { + return v.value +} + +func (v *NullableCreateCertificatePayload) Set(val *CreateCertificatePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCertificatePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCertificatePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCertificatePayload(val *CreateCertificatePayload) *NullableCreateCertificatePayload { + return &NullableCreateCertificatePayload{value: val, isSet: true} +} + +func (v NullableCreateCertificatePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCertificatePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/certificates/model_create_certificate_response.go b/services/certificates/model_create_certificate_response.go new file mode 100644 index 000000000..27a48deb5 --- /dev/null +++ b/services/certificates/model_create_certificate_response.go @@ -0,0 +1,117 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "encoding/json" +) + +// checks if the CreateCertificateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCertificateResponse{} + +// CreateCertificateResponse CreateCertificateResponse returns unique resource id +type CreateCertificateResponse struct { + // The certificates resource id + Id *string `json:"id,omitempty"` +} + +// NewCreateCertificateResponse instantiates a new CreateCertificateResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewCreateCertificateResponse() *CreateCertificateResponse { + this := CreateCertificateResponse{} + return &this +} + +// NewCreateCertificateResponseWithDefaults instantiates a new CreateCertificateResponse object +// This 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 NewCreateCertificateResponseWithDefaults() *CreateCertificateResponse { + this := CreateCertificateResponse{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateCertificateResponse) 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 *CreateCertificateResponse) 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 *CreateCertificateResponse) 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 *CreateCertificateResponse) SetId(v *string) { + o.Id = v +} + +func (o CreateCertificateResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableCreateCertificateResponse struct { + value *CreateCertificateResponse + isSet bool +} + +func (v NullableCreateCertificateResponse) Get() *CreateCertificateResponse { + return v.value +} + +func (v *NullableCreateCertificateResponse) Set(val *CreateCertificateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCertificateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCertificateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCertificateResponse(val *CreateCertificateResponse) *NullableCreateCertificateResponse { + return &NullableCreateCertificateResponse{value: val, isSet: true} +} + +func (v NullableCreateCertificateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCertificateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/certificates/model_get_certificate_response.go b/services/certificates/model_get_certificate_response.go new file mode 100644 index 000000000..1e4d49edd --- /dev/null +++ b/services/certificates/model_get_certificate_response.go @@ -0,0 +1,191 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "encoding/json" +) + +// checks if the GetCertificateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCertificateResponse{} + +// GetCertificateResponse GetCertificateResponse returns name, id and public key +type GetCertificateResponse struct { + // The certificates resource id + Id *string `json:"id,omitempty"` + // TLS certificate name + Name *string `json:"name,omitempty"` + // The PEM encoded public key part + PublicKey *string `json:"publicKey,omitempty"` +} + +// NewGetCertificateResponse instantiates a new GetCertificateResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewGetCertificateResponse() *GetCertificateResponse { + this := GetCertificateResponse{} + return &this +} + +// NewGetCertificateResponseWithDefaults instantiates a new GetCertificateResponse object +// This 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 NewGetCertificateResponseWithDefaults() *GetCertificateResponse { + this := GetCertificateResponse{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GetCertificateResponse) 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 *GetCertificateResponse) 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 *GetCertificateResponse) 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 *GetCertificateResponse) SetId(v *string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetCertificateResponse) 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 *GetCertificateResponse) 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 *GetCertificateResponse) 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 *GetCertificateResponse) SetName(v *string) { + o.Name = v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *GetCertificateResponse) GetPublicKey() *string { + if o == nil || IsNil(o.PublicKey) { + var ret *string + return ret + } + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetCertificateResponse) GetPublicKeyOk() (*string, bool) { + if o == nil || IsNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *GetCertificateResponse) HasPublicKey() bool { + if o != nil && !IsNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *GetCertificateResponse) SetPublicKey(v *string) { + o.PublicKey = v +} + +func (o GetCertificateResponse) 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.PublicKey) { + toSerialize["publicKey"] = o.PublicKey + } + return toSerialize, nil +} + +type NullableGetCertificateResponse struct { + value *GetCertificateResponse + isSet bool +} + +func (v NullableGetCertificateResponse) Get() *GetCertificateResponse { + return v.value +} + +func (v *NullableGetCertificateResponse) Set(val *GetCertificateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCertificateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCertificateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCertificateResponse(val *GetCertificateResponse) *NullableGetCertificateResponse { + return &NullableGetCertificateResponse{value: val, isSet: true} +} + +func (v NullableGetCertificateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCertificateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/certificates/model_google_protobuf_any.go b/services/certificates/model_google_protobuf_any.go new file mode 100644 index 000000000..c318761d4 --- /dev/null +++ b/services/certificates/model_google_protobuf_any.go @@ -0,0 +1,125 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "encoding/json" +) + +// checks if the GoogleProtobufAny type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleProtobufAny{} + +// GoogleProtobufAny Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +type GoogleProtobufAny struct { + // The type of the serialized message. + Type *string `json:"@type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GoogleProtobufAny GoogleProtobufAny + +// NewGoogleProtobufAny instantiates a new GoogleProtobufAny object +// This constructor will assign default values to properties that have it defined, +// 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 NewGoogleProtobufAny() *GoogleProtobufAny { + this := GoogleProtobufAny{} + return &this +} + +// NewGoogleProtobufAnyWithDefaults instantiates a new GoogleProtobufAny object +// This 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 NewGoogleProtobufAnyWithDefaults() *GoogleProtobufAny { + this := GoogleProtobufAny{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GoogleProtobufAny) 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 *GoogleProtobufAny) 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 *GoogleProtobufAny) 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 *GoogleProtobufAny) SetType(v *string) { + o.Type = v +} + +func (o GoogleProtobufAny) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["@type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +type NullableGoogleProtobufAny struct { + value *GoogleProtobufAny + isSet bool +} + +func (v NullableGoogleProtobufAny) Get() *GoogleProtobufAny { + return v.value +} + +func (v *NullableGoogleProtobufAny) Set(val *GoogleProtobufAny) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleProtobufAny) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleProtobufAny) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleProtobufAny(val *GoogleProtobufAny) *NullableGoogleProtobufAny { + return &NullableGoogleProtobufAny{value: val, isSet: true} +} + +func (v NullableGoogleProtobufAny) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleProtobufAny) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/certificates/model_list_certificates_response.go b/services/certificates/model_list_certificates_response.go new file mode 100644 index 000000000..f1aa19702 --- /dev/null +++ b/services/certificates/model_list_certificates_response.go @@ -0,0 +1,153 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "encoding/json" +) + +// checks if the ListCertificatesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCertificatesResponse{} + +// ListCertificatesResponse ListCertificateResponse returns a list of certificate responses +type ListCertificatesResponse struct { + Items *[]GetCertificateResponse `json:"items,omitempty"` + // Continue token from the ListCertificatesResponse with Limit option + NextPageId *string `json:"nextPageId,omitempty"` +} + +// NewListCertificatesResponse instantiates a new ListCertificatesResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewListCertificatesResponse() *ListCertificatesResponse { + this := ListCertificatesResponse{} + return &this +} + +// NewListCertificatesResponseWithDefaults instantiates a new ListCertificatesResponse object +// This 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 NewListCertificatesResponseWithDefaults() *ListCertificatesResponse { + this := ListCertificatesResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListCertificatesResponse) GetItems() *[]GetCertificateResponse { + if o == nil || IsNil(o.Items) { + var ret *[]GetCertificateResponse + 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 *ListCertificatesResponse) GetItemsOk() (*[]GetCertificateResponse, 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 *ListCertificatesResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []GetCertificateResponse and assigns it to the Items field. +func (o *ListCertificatesResponse) SetItems(v *[]GetCertificateResponse) { + o.Items = v +} + +// GetNextPageId returns the NextPageId field value if set, zero value otherwise. +func (o *ListCertificatesResponse) GetNextPageId() *string { + if o == nil || IsNil(o.NextPageId) { + var ret *string + return ret + } + return o.NextPageId +} + +// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCertificatesResponse) GetNextPageIdOk() (*string, bool) { + if o == nil || IsNil(o.NextPageId) { + return nil, false + } + return o.NextPageId, true +} + +// HasNextPageId returns a boolean if a field has been set. +func (o *ListCertificatesResponse) HasNextPageId() bool { + if o != nil && !IsNil(o.NextPageId) { + return true + } + + return false +} + +// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field. +func (o *ListCertificatesResponse) SetNextPageId(v *string) { + o.NextPageId = v +} + +func (o ListCertificatesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !IsNil(o.NextPageId) { + toSerialize["nextPageId"] = o.NextPageId + } + return toSerialize, nil +} + +type NullableListCertificatesResponse struct { + value *ListCertificatesResponse + isSet bool +} + +func (v NullableListCertificatesResponse) Get() *ListCertificatesResponse { + return v.value +} + +func (v *NullableListCertificatesResponse) Set(val *ListCertificatesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCertificatesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCertificatesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCertificatesResponse(val *ListCertificatesResponse) *NullableListCertificatesResponse { + return &NullableListCertificatesResponse{value: val, isSet: true} +} + +func (v NullableListCertificatesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCertificatesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/certificates/model_status.go b/services/certificates/model_status.go new file mode 100644 index 000000000..445d32abf --- /dev/null +++ b/services/certificates/model_status.go @@ -0,0 +1,192 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +import ( + "encoding/json" +) + +// checks if the Status type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Status{} + +// Status The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). +type Status struct { + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + // Can be cast to int32 without loss of precision. + Code *int64 `json:"code,omitempty"` + // A list of messages that carry the error details. There is a common set of message types for APIs to use. + Details *[]GoogleProtobufAny `json:"details,omitempty"` + // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + Message *string `json:"message,omitempty"` +} + +// NewStatus instantiates a new Status object +// This constructor will assign default values to properties that have it defined, +// 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 NewStatus() *Status { + this := Status{} + return &this +} + +// NewStatusWithDefaults instantiates a new Status object +// This 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 NewStatusWithDefaults() *Status { + this := Status{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *Status) GetCode() *int64 { + if o == nil || IsNil(o.Code) { + var ret *int64 + 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 *Status) GetCodeOk() (*int64, 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 *Status) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int64 and assigns it to the Code field. +func (o *Status) SetCode(v *int64) { + o.Code = v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Status) GetDetails() *[]GoogleProtobufAny { + if o == nil || IsNil(o.Details) { + var ret *[]GoogleProtobufAny + 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 *Status) GetDetailsOk() (*[]GoogleProtobufAny, 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 *Status) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given []GoogleProtobufAny and assigns it to the Details field. +func (o *Status) SetDetails(v *[]GoogleProtobufAny) { + o.Details = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *Status) 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 *Status) 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 *Status) 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 *Status) SetMessage(v *string) { + o.Message = v +} + +func (o Status) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableStatus struct { + value *Status + isSet bool +} + +func (v NullableStatus) Get() *Status { + return v.value +} + +func (v *NullableStatus) Set(val *Status) { + v.value = val + v.isSet = true +} + +func (v NullableStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatus(val *Status) *NullableStatus { + return &NullableStatus{value: val, isSet: true} +} + +func (v NullableStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/certificates/utils.go b/services/certificates/utils.go new file mode 100644 index 000000000..fd09fc7ab --- /dev/null +++ b/services/certificates/utils.go @@ -0,0 +1,347 @@ +/* +Load Balancer Certificates API + +This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package certificates + +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/services/dns/CHANGELOG.md b/services/dns/CHANGELOG.md index 9b4efe484..70fc7c3c0 100644 --- a/services/dns/CHANGELOG.md +++ b/services/dns/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.13.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.12.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/dns/LICENSE.md b/services/dns/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/dns/LICENSE.md +++ b/services/dns/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/dns/NOTICE.txt b/services/dns/NOTICE.txt index 002ea338e..71cd41a5b 100644 --- a/services/dns/NOTICE.txt +++ b/services/dns/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT DNS SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/dns/api_default.go b/services/dns/api_default.go index acd264bba..81f4513b1 100644 --- a/services/dns/api_default.go +++ b/services/dns/api_default.go @@ -459,6 +459,17 @@ func (r ApiCreateMoveCodeRequest) Execute() (*MoveCodeResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Message + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 502 { var v Message err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) diff --git a/services/dns/go.mod b/services/dns/go.mod index 8a216618c..38e06fb84 100644 --- a/services/dns/go.mod +++ b/services/dns/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/dns -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/dns/go.sum b/services/dns/go.sum index b7c164325..b7342b5ac 100644 --- a/services/dns/go.sum +++ b/services/dns/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/dns/model_create_zone_payload.go b/services/dns/model_create_zone_payload.go index 610cc5a46..47fa47511 100644 --- a/services/dns/model_create_zone_payload.go +++ b/services/dns/model_create_zone_payload.go @@ -31,7 +31,8 @@ type CreateZonePayload struct { // REQUIRED DnsName *string `json:"dnsName"` // expire time - ExpireTime *int64 `json:"expireTime,omitempty"` + ExpireTime *int64 `json:"expireTime,omitempty"` + Extensions *CreateZonePayloadExtensions `json:"extensions,omitempty"` // if the zone is a reverse zone or not IsReverseZone *bool `json:"isReverseZone,omitempty"` // user given name @@ -270,6 +271,38 @@ func (o *CreateZonePayload) SetExpireTime(v *int64) { o.ExpireTime = v } +// GetExtensions returns the Extensions field value if set, zero value otherwise. +func (o *CreateZonePayload) GetExtensions() *CreateZonePayloadExtensions { + if o == nil || IsNil(o.Extensions) { + var ret *CreateZonePayloadExtensions + return ret + } + return o.Extensions +} + +// GetExtensionsOk returns a tuple with the Extensions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateZonePayload) GetExtensionsOk() (*CreateZonePayloadExtensions, bool) { + if o == nil || IsNil(o.Extensions) { + return nil, false + } + return o.Extensions, true +} + +// HasExtensions returns a boolean if a field has been set. +func (o *CreateZonePayload) HasExtensions() bool { + if o != nil && !IsNil(o.Extensions) { + return true + } + + return false +} + +// SetExtensions gets a reference to the given CreateZonePayloadExtensions and assigns it to the Extensions field. +func (o *CreateZonePayload) SetExtensions(v *CreateZonePayloadExtensions) { + o.Extensions = v +} + // GetIsReverseZone returns the IsReverseZone field value if set, zero value otherwise. func (o *CreateZonePayload) GetIsReverseZone() *bool { if o == nil || IsNil(o.IsReverseZone) { @@ -504,6 +537,9 @@ func (o CreateZonePayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.ExpireTime) { toSerialize["expireTime"] = o.ExpireTime } + if !IsNil(o.Extensions) { + toSerialize["extensions"] = o.Extensions + } if !IsNil(o.IsReverseZone) { toSerialize["isReverseZone"] = o.IsReverseZone } diff --git a/services/dns/model_create_zone_payload_extensions.go b/services/dns/model_create_zone_payload_extensions.go new file mode 100644 index 000000000..683934cef --- /dev/null +++ b/services/dns/model_create_zone_payload_extensions.go @@ -0,0 +1,116 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package dns + +import ( + "encoding/json" +) + +// checks if the CreateZonePayloadExtensions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateZonePayloadExtensions{} + +// CreateZonePayloadExtensions optional extensions +type CreateZonePayloadExtensions struct { + ObservabilityExtension *ZoneObservabilityExtension `json:"observabilityExtension,omitempty"` +} + +// NewCreateZonePayloadExtensions instantiates a new CreateZonePayloadExtensions object +// This constructor will assign default values to properties that have it defined, +// 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 NewCreateZonePayloadExtensions() *CreateZonePayloadExtensions { + this := CreateZonePayloadExtensions{} + return &this +} + +// NewCreateZonePayloadExtensionsWithDefaults instantiates a new CreateZonePayloadExtensions object +// This 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 NewCreateZonePayloadExtensionsWithDefaults() *CreateZonePayloadExtensions { + this := CreateZonePayloadExtensions{} + return &this +} + +// GetObservabilityExtension returns the ObservabilityExtension field value if set, zero value otherwise. +func (o *CreateZonePayloadExtensions) GetObservabilityExtension() *ZoneObservabilityExtension { + if o == nil || IsNil(o.ObservabilityExtension) { + var ret *ZoneObservabilityExtension + return ret + } + return o.ObservabilityExtension +} + +// GetObservabilityExtensionOk returns a tuple with the ObservabilityExtension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateZonePayloadExtensions) GetObservabilityExtensionOk() (*ZoneObservabilityExtension, bool) { + if o == nil || IsNil(o.ObservabilityExtension) { + return nil, false + } + return o.ObservabilityExtension, true +} + +// HasObservabilityExtension returns a boolean if a field has been set. +func (o *CreateZonePayloadExtensions) HasObservabilityExtension() bool { + if o != nil && !IsNil(o.ObservabilityExtension) { + return true + } + + return false +} + +// SetObservabilityExtension gets a reference to the given ZoneObservabilityExtension and assigns it to the ObservabilityExtension field. +func (o *CreateZonePayloadExtensions) SetObservabilityExtension(v *ZoneObservabilityExtension) { + o.ObservabilityExtension = v +} + +func (o CreateZonePayloadExtensions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ObservabilityExtension) { + toSerialize["observabilityExtension"] = o.ObservabilityExtension + } + return toSerialize, nil +} + +type NullableCreateZonePayloadExtensions struct { + value *CreateZonePayloadExtensions + isSet bool +} + +func (v NullableCreateZonePayloadExtensions) Get() *CreateZonePayloadExtensions { + return v.value +} + +func (v *NullableCreateZonePayloadExtensions) Set(val *CreateZonePayloadExtensions) { + v.value = val + v.isSet = true +} + +func (v NullableCreateZonePayloadExtensions) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateZonePayloadExtensions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateZonePayloadExtensions(val *CreateZonePayloadExtensions) *NullableCreateZonePayloadExtensions { + return &NullableCreateZonePayloadExtensions{value: val, isSet: true} +} + +func (v NullableCreateZonePayloadExtensions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateZonePayloadExtensions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/model_domain_extensions.go b/services/dns/model_domain_extensions.go new file mode 100644 index 000000000..80481c8a5 --- /dev/null +++ b/services/dns/model_domain_extensions.go @@ -0,0 +1,116 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package dns + +import ( + "encoding/json" +) + +// checks if the DomainExtensions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DomainExtensions{} + +// DomainExtensions struct for DomainExtensions +type DomainExtensions struct { + ObservabilityExtension *DomainObservabilityExtension `json:"observabilityExtension,omitempty"` +} + +// NewDomainExtensions instantiates a new DomainExtensions object +// This constructor will assign default values to properties that have it defined, +// 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 NewDomainExtensions() *DomainExtensions { + this := DomainExtensions{} + return &this +} + +// NewDomainExtensionsWithDefaults instantiates a new DomainExtensions object +// This 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 NewDomainExtensionsWithDefaults() *DomainExtensions { + this := DomainExtensions{} + return &this +} + +// GetObservabilityExtension returns the ObservabilityExtension field value if set, zero value otherwise. +func (o *DomainExtensions) GetObservabilityExtension() *DomainObservabilityExtension { + if o == nil || IsNil(o.ObservabilityExtension) { + var ret *DomainObservabilityExtension + return ret + } + return o.ObservabilityExtension +} + +// GetObservabilityExtensionOk returns a tuple with the ObservabilityExtension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DomainExtensions) GetObservabilityExtensionOk() (*DomainObservabilityExtension, bool) { + if o == nil || IsNil(o.ObservabilityExtension) { + return nil, false + } + return o.ObservabilityExtension, true +} + +// HasObservabilityExtension returns a boolean if a field has been set. +func (o *DomainExtensions) HasObservabilityExtension() bool { + if o != nil && !IsNil(o.ObservabilityExtension) { + return true + } + + return false +} + +// SetObservabilityExtension gets a reference to the given DomainObservabilityExtension and assigns it to the ObservabilityExtension field. +func (o *DomainExtensions) SetObservabilityExtension(v *DomainObservabilityExtension) { + o.ObservabilityExtension = v +} + +func (o DomainExtensions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ObservabilityExtension) { + toSerialize["observabilityExtension"] = o.ObservabilityExtension + } + return toSerialize, nil +} + +type NullableDomainExtensions struct { + value *DomainExtensions + isSet bool +} + +func (v NullableDomainExtensions) Get() *DomainExtensions { + return v.value +} + +func (v *NullableDomainExtensions) Set(val *DomainExtensions) { + v.value = val + v.isSet = true +} + +func (v NullableDomainExtensions) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainExtensions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainExtensions(val *DomainExtensions) *NullableDomainExtensions { + return &NullableDomainExtensions{value: val, isSet: true} +} + +func (v NullableDomainExtensions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainExtensions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/model_domain_observability_extension.go b/services/dns/model_domain_observability_extension.go new file mode 100644 index 000000000..cf507aa02 --- /dev/null +++ b/services/dns/model_domain_observability_extension.go @@ -0,0 +1,146 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package dns + +import ( + "encoding/json" +) + +// checks if the DomainObservabilityExtension type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DomainObservabilityExtension{} + +// DomainObservabilityExtension struct for DomainObservabilityExtension +type DomainObservabilityExtension struct { + // REQUIRED + ObservabilityInstanceId *string `json:"observabilityInstanceId"` + State *string `json:"state,omitempty"` +} + +type _DomainObservabilityExtension DomainObservabilityExtension + +// NewDomainObservabilityExtension instantiates a new DomainObservabilityExtension object +// This constructor will assign default values to properties that have it defined, +// 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 NewDomainObservabilityExtension(observabilityInstanceId *string) *DomainObservabilityExtension { + this := DomainObservabilityExtension{} + this.ObservabilityInstanceId = observabilityInstanceId + return &this +} + +// NewDomainObservabilityExtensionWithDefaults instantiates a new DomainObservabilityExtension object +// This 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 NewDomainObservabilityExtensionWithDefaults() *DomainObservabilityExtension { + this := DomainObservabilityExtension{} + return &this +} + +// GetObservabilityInstanceId returns the ObservabilityInstanceId field value +func (o *DomainObservabilityExtension) GetObservabilityInstanceId() *string { + if o == nil || IsNil(o.ObservabilityInstanceId) { + var ret *string + return ret + } + + return o.ObservabilityInstanceId +} + +// GetObservabilityInstanceIdOk returns a tuple with the ObservabilityInstanceId field value +// and a boolean to check if the value has been set. +func (o *DomainObservabilityExtension) GetObservabilityInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObservabilityInstanceId, true +} + +// SetObservabilityInstanceId sets field value +func (o *DomainObservabilityExtension) SetObservabilityInstanceId(v *string) { + o.ObservabilityInstanceId = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *DomainObservabilityExtension) 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 *DomainObservabilityExtension) 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 *DomainObservabilityExtension) 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 *DomainObservabilityExtension) SetState(v *string) { + o.State = v +} + +func (o DomainObservabilityExtension) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["observabilityInstanceId"] = o.ObservabilityInstanceId + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + return toSerialize, nil +} + +type NullableDomainObservabilityExtension struct { + value *DomainObservabilityExtension + isSet bool +} + +func (v NullableDomainObservabilityExtension) Get() *DomainObservabilityExtension { + return v.value +} + +func (v *NullableDomainObservabilityExtension) Set(val *DomainObservabilityExtension) { + v.value = val + v.isSet = true +} + +func (v NullableDomainObservabilityExtension) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainObservabilityExtension) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainObservabilityExtension(val *DomainObservabilityExtension) *NullableDomainObservabilityExtension { + return &NullableDomainObservabilityExtension{value: val, isSet: true} +} + +func (v NullableDomainObservabilityExtension) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainObservabilityExtension) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/model_partial_update_zone_payload.go b/services/dns/model_partial_update_zone_payload.go index fee7a6b73..17cf476a8 100644 --- a/services/dns/model_partial_update_zone_payload.go +++ b/services/dns/model_partial_update_zone_payload.go @@ -28,7 +28,8 @@ type PartialUpdateZonePayload struct { // description of the zone Description *string `json:"description,omitempty"` // expire time - ExpireTime *int64 `json:"expireTime,omitempty"` + ExpireTime *int64 `json:"expireTime,omitempty"` + Extensions *CreateZonePayloadExtensions `json:"extensions,omitempty"` // user given name Name *string `json:"name,omitempty"` // negative caching @@ -226,6 +227,38 @@ func (o *PartialUpdateZonePayload) SetExpireTime(v *int64) { o.ExpireTime = v } +// GetExtensions returns the Extensions field value if set, zero value otherwise. +func (o *PartialUpdateZonePayload) GetExtensions() *CreateZonePayloadExtensions { + if o == nil || IsNil(o.Extensions) { + var ret *CreateZonePayloadExtensions + return ret + } + return o.Extensions +} + +// GetExtensionsOk returns a tuple with the Extensions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateZonePayload) GetExtensionsOk() (*CreateZonePayloadExtensions, bool) { + if o == nil || IsNil(o.Extensions) { + return nil, false + } + return o.Extensions, true +} + +// HasExtensions returns a boolean if a field has been set. +func (o *PartialUpdateZonePayload) HasExtensions() bool { + if o != nil && !IsNil(o.Extensions) { + return true + } + + return false +} + +// SetExtensions gets a reference to the given CreateZonePayloadExtensions and assigns it to the Extensions field. +func (o *PartialUpdateZonePayload) SetExtensions(v *CreateZonePayloadExtensions) { + o.Extensions = v +} + // GetName returns the Name field value if set, zero value otherwise. func (o *PartialUpdateZonePayload) GetName() *string { if o == nil || IsNil(o.Name) { @@ -403,6 +436,9 @@ func (o PartialUpdateZonePayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.ExpireTime) { toSerialize["expireTime"] = o.ExpireTime } + if !IsNil(o.Extensions) { + toSerialize["extensions"] = o.Extensions + } if !IsNil(o.Name) { toSerialize["name"] = o.Name } diff --git a/services/dns/model_zone.go b/services/dns/model_zone.go index 693c19f62..a65cf5e08 100644 --- a/services/dns/model_zone.go +++ b/services/dns/model_zone.go @@ -43,7 +43,8 @@ type Zone struct { Error *string `json:"error,omitempty"` // expire time // REQUIRED - ExpireTime *int64 `json:"expireTime"` + ExpireTime *int64 `json:"expireTime"` + Extensions *DomainExtensions `json:"extensions,omitempty"` // zone id // REQUIRED Id *string `json:"id"` @@ -398,6 +399,38 @@ func (o *Zone) SetExpireTime(v *int64) { o.ExpireTime = v } +// GetExtensions returns the Extensions field value if set, zero value otherwise. +func (o *Zone) GetExtensions() *DomainExtensions { + if o == nil || IsNil(o.Extensions) { + var ret *DomainExtensions + return ret + } + return o.Extensions +} + +// GetExtensionsOk returns a tuple with the Extensions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Zone) GetExtensionsOk() (*DomainExtensions, bool) { + if o == nil || IsNil(o.Extensions) { + return nil, false + } + return o.Extensions, true +} + +// HasExtensions returns a boolean if a field has been set. +func (o *Zone) HasExtensions() bool { + if o != nil && !IsNil(o.Extensions) { + return true + } + + return false +} + +// SetExtensions gets a reference to the given DomainExtensions and assigns it to the Extensions field. +func (o *Zone) SetExtensions(v *DomainExtensions) { + o.Extensions = v +} + // GetId returns the Id field value func (o *Zone) GetId() *string { if o == nil || IsNil(o.Id) { @@ -834,6 +867,9 @@ func (o Zone) ToMap() (map[string]interface{}, error) { toSerialize["error"] = o.Error } toSerialize["expireTime"] = o.ExpireTime + if !IsNil(o.Extensions) { + toSerialize["extensions"] = o.Extensions + } toSerialize["id"] = o.Id if !IsNil(o.IsReverseZone) { toSerialize["isReverseZone"] = o.IsReverseZone diff --git a/services/dns/model_zone_extensions.go b/services/dns/model_zone_extensions.go new file mode 100644 index 000000000..3b3a39c55 --- /dev/null +++ b/services/dns/model_zone_extensions.go @@ -0,0 +1,116 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package dns + +import ( + "encoding/json" +) + +// checks if the ZoneExtensions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ZoneExtensions{} + +// ZoneExtensions struct for ZoneExtensions +type ZoneExtensions struct { + ObservabilityExtension *ZoneObservabilityExtension `json:"observabilityExtension,omitempty"` +} + +// NewZoneExtensions instantiates a new ZoneExtensions object +// This constructor will assign default values to properties that have it defined, +// 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 NewZoneExtensions() *ZoneExtensions { + this := ZoneExtensions{} + return &this +} + +// NewZoneExtensionsWithDefaults instantiates a new ZoneExtensions object +// This 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 NewZoneExtensionsWithDefaults() *ZoneExtensions { + this := ZoneExtensions{} + return &this +} + +// GetObservabilityExtension returns the ObservabilityExtension field value if set, zero value otherwise. +func (o *ZoneExtensions) GetObservabilityExtension() *ZoneObservabilityExtension { + if o == nil || IsNil(o.ObservabilityExtension) { + var ret *ZoneObservabilityExtension + return ret + } + return o.ObservabilityExtension +} + +// GetObservabilityExtensionOk returns a tuple with the ObservabilityExtension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ZoneExtensions) GetObservabilityExtensionOk() (*ZoneObservabilityExtension, bool) { + if o == nil || IsNil(o.ObservabilityExtension) { + return nil, false + } + return o.ObservabilityExtension, true +} + +// HasObservabilityExtension returns a boolean if a field has been set. +func (o *ZoneExtensions) HasObservabilityExtension() bool { + if o != nil && !IsNil(o.ObservabilityExtension) { + return true + } + + return false +} + +// SetObservabilityExtension gets a reference to the given ZoneObservabilityExtension and assigns it to the ObservabilityExtension field. +func (o *ZoneExtensions) SetObservabilityExtension(v *ZoneObservabilityExtension) { + o.ObservabilityExtension = v +} + +func (o ZoneExtensions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ObservabilityExtension) { + toSerialize["observabilityExtension"] = o.ObservabilityExtension + } + return toSerialize, nil +} + +type NullableZoneExtensions struct { + value *ZoneExtensions + isSet bool +} + +func (v NullableZoneExtensions) Get() *ZoneExtensions { + return v.value +} + +func (v *NullableZoneExtensions) Set(val *ZoneExtensions) { + v.value = val + v.isSet = true +} + +func (v NullableZoneExtensions) IsSet() bool { + return v.isSet +} + +func (v *NullableZoneExtensions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableZoneExtensions(val *ZoneExtensions) *NullableZoneExtensions { + return &NullableZoneExtensions{value: val, isSet: true} +} + +func (v NullableZoneExtensions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableZoneExtensions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/model_zone_observability_extension.go b/services/dns/model_zone_observability_extension.go new file mode 100644 index 000000000..201d3d0bf --- /dev/null +++ b/services/dns/model_zone_observability_extension.go @@ -0,0 +1,146 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package dns + +import ( + "encoding/json" +) + +// checks if the ZoneObservabilityExtension type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ZoneObservabilityExtension{} + +// ZoneObservabilityExtension struct for ZoneObservabilityExtension +type ZoneObservabilityExtension struct { + // REQUIRED + ObservabilityInstanceId *string `json:"observabilityInstanceId"` + State *string `json:"state,omitempty"` +} + +type _ZoneObservabilityExtension ZoneObservabilityExtension + +// NewZoneObservabilityExtension instantiates a new ZoneObservabilityExtension object +// This constructor will assign default values to properties that have it defined, +// 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 NewZoneObservabilityExtension(observabilityInstanceId *string) *ZoneObservabilityExtension { + this := ZoneObservabilityExtension{} + this.ObservabilityInstanceId = observabilityInstanceId + return &this +} + +// NewZoneObservabilityExtensionWithDefaults instantiates a new ZoneObservabilityExtension object +// This 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 NewZoneObservabilityExtensionWithDefaults() *ZoneObservabilityExtension { + this := ZoneObservabilityExtension{} + return &this +} + +// GetObservabilityInstanceId returns the ObservabilityInstanceId field value +func (o *ZoneObservabilityExtension) GetObservabilityInstanceId() *string { + if o == nil || IsNil(o.ObservabilityInstanceId) { + var ret *string + return ret + } + + return o.ObservabilityInstanceId +} + +// GetObservabilityInstanceIdOk returns a tuple with the ObservabilityInstanceId field value +// and a boolean to check if the value has been set. +func (o *ZoneObservabilityExtension) GetObservabilityInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObservabilityInstanceId, true +} + +// SetObservabilityInstanceId sets field value +func (o *ZoneObservabilityExtension) SetObservabilityInstanceId(v *string) { + o.ObservabilityInstanceId = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *ZoneObservabilityExtension) 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 *ZoneObservabilityExtension) 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 *ZoneObservabilityExtension) 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 *ZoneObservabilityExtension) SetState(v *string) { + o.State = v +} + +func (o ZoneObservabilityExtension) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["observabilityInstanceId"] = o.ObservabilityInstanceId + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + return toSerialize, nil +} + +type NullableZoneObservabilityExtension struct { + value *ZoneObservabilityExtension + isSet bool +} + +func (v NullableZoneObservabilityExtension) Get() *ZoneObservabilityExtension { + return v.value +} + +func (v *NullableZoneObservabilityExtension) Set(val *ZoneObservabilityExtension) { + v.value = val + v.isSet = true +} + +func (v NullableZoneObservabilityExtension) IsSet() bool { + return v.isSet +} + +func (v *NullableZoneObservabilityExtension) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableZoneObservabilityExtension(val *ZoneObservabilityExtension) *NullableZoneObservabilityExtension { + return &NullableZoneObservabilityExtension{value: val, isSet: true} +} + +func (v NullableZoneObservabilityExtension) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableZoneObservabilityExtension) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/CHANGELOG.md b/services/iaas/CHANGELOG.md index 075e2f701..f2c6a0bef 100644 --- a/services/iaas/CHANGELOG.md +++ b/services/iaas/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.20.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.19.0 (2024-12-20) - **Feature:** Add method to list quotas: `ListQuotas` diff --git a/services/iaas/LICENSE.md b/services/iaas/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/iaas/LICENSE.md +++ b/services/iaas/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/iaas/NOTICE.txt b/services/iaas/NOTICE.txt index 806cd156a..ac4ed2cc9 100644 --- a/services/iaas/NOTICE.txt +++ b/services/iaas/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT IaaS SDK for Go -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG diff --git a/services/iaas/go.mod b/services/iaas/go.mod index 9802d7912..e0878c3c0 100644 --- a/services/iaas/go.mod +++ b/services/iaas/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/iaas -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/iaas/go.sum b/services/iaas/go.sum index b7c164325..b7342b5ac 100644 --- a/services/iaas/go.sum +++ b/services/iaas/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/iaasalpha/go.mod b/services/iaasalpha/go.mod index 6421c33fd..5cdf754be 100644 --- a/services/iaasalpha/go.mod +++ b/services/iaasalpha/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/iaasalpha -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/iaasalpha/go.sum b/services/iaasalpha/go.sum index b7c164325..b7342b5ac 100644 --- a/services/iaasalpha/go.sum +++ b/services/iaasalpha/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/lbapplication/.openapi-generator/VERSION b/services/lbapplication/.openapi-generator/VERSION new file mode 100644 index 000000000..cd802a1ec --- /dev/null +++ b/services/lbapplication/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/services/lbapplication/CHANGELOG.md b/services/lbapplication/CHANGELOG.md new file mode 100644 index 000000000..099fa3b4b --- /dev/null +++ b/services/lbapplication/CHANGELOG.md @@ -0,0 +1,10 @@ +## v0.3.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.2.0 (2025-01-30) + +- **Bugfix**: Set type from interface to int64 of `HealthyThreshold`, `UnhealthyThreshold`, `MaxLoadBalancers`, `Port`, `MaxConnections`, `Code` and `TargetPort` + +## v0.1.0 (2025-01-13) + +- **New**: STACKIT Load Balancer Application module can be used to manage the STACKIT Load Balancer Application diff --git a/services/lbapplication/LICENSE.md b/services/lbapplication/LICENSE.md new file mode 100644 index 000000000..7e2f06484 --- /dev/null +++ b/services/lbapplication/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2025 Schwarz IT KG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/lbapplication/NOTICE.txt b/services/lbapplication/NOTICE.txt new file mode 100644 index 000000000..91288b389 --- /dev/null +++ b/services/lbapplication/NOTICE.txt @@ -0,0 +1,2 @@ +STACKIT Load Balancer Application SDK for Go +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/lbapplication/api_default.go b/services/lbapplication/api_default.go new file mode 100644 index 000000000..14ec28807 --- /dev/null +++ b/services/lbapplication/api_default.go @@ -0,0 +1,2385 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiCreateCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + xRequestID *string + createCredentialsPayload *CreateCredentialsPayload +} + +func (r ApiCreateCredentialsRequest) XRequestID(xRequestID string) ApiCreateCredentialsRequest { + r.xRequestID = &xRequestID + return r +} + +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.xRequestID == nil { + return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") + } + if r.createCredentialsPayload == nil { + return localVarReturnValue, fmt.Errorf("createCredentialsPayload 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 + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") + // body params + localVarPostBody = r.createCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateCredentials: Create credentials for observability of the application load balancer + +Creates and stores credentials for use with Application Load Balancer Observability. + + For example, when using ARGUS, credentials must first be created via the ARGUS API + and then stored with this endpoint to be used by the Application Load Balancer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiCreateCredentialsRequest +*/ +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string) (*CreateCredentialsResponse, error) { + r := ApiCreateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiCreateLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + xRequestID *string + createLoadBalancerPayload *CreateLoadBalancerPayload +} + +func (r ApiCreateLoadBalancerRequest) XRequestID(xRequestID string) ApiCreateLoadBalancerRequest { + r.xRequestID = &xRequestID + return r +} + +func (r ApiCreateLoadBalancerRequest) CreateLoadBalancerPayload(createLoadBalancerPayload CreateLoadBalancerPayload) ApiCreateLoadBalancerRequest { + r.createLoadBalancerPayload = &createLoadBalancerPayload + return r +} + +func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LoadBalancer + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.xRequestID == nil { + return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") + } + if r.createLoadBalancerPayload == nil { + return localVarReturnValue, fmt.Errorf("createLoadBalancerPayload 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 + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") + // body params + localVarPostBody = r.createLoadBalancerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateLoadBalancer: Create an application load balancer in a project + +Creates an Application Load Balancer. + + The default load balancing algorithm is Maglev, and selecting a different algorithm is currently not supported. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiCreateLoadBalancerRequest +*/ +func (a *APIClient) CreateLoadBalancer(ctx context.Context, projectId string) ApiCreateLoadBalancerRequest { + return ApiCreateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) CreateLoadBalancerExecute(ctx context.Context, projectId string) (*LoadBalancer, error) { + r := ApiCreateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + credentialsRef string +} + +func (r ApiDeleteCredentialsRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(r.credentialsRef, "credentialsRef")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteCredentials: Delete a single credential in a project. + +Deletes the stored Observability credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param credentialsRef + @return ApiDeleteCredentialsRequest +*/ +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, credentialsRef string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } +} + +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, credentialsRef string) (map[string]interface{}, error) { + r := ApiDeleteCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } + return r.Execute() +} + +type ApiDeleteLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string +} + +func (r ApiDeleteLoadBalancerRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteLoadBalancer: Delete a given load balancer in a project. + +Deletes the specified Application Load Balancer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @return ApiDeleteLoadBalancerRequest +*/ +func (a *APIClient) DeleteLoadBalancer(ctx context.Context, projectId string, name string) ApiDeleteLoadBalancerRequest { + return ApiDeleteLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } +} + +func (a *APIClient) DeleteLoadBalancerExecute(ctx context.Context, projectId string, name string) (map[string]interface{}, error) { + r := ApiDeleteLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } + return r.Execute() +} + +type ApiDisableServiceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiDisableServiceRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableService") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DisableService: Disables the functionality of load balancers for the project specified. + +Deprecated: DEPRECATED! Disabling the Application Load Balancer functionality is now automatic. + + This endpoint is kept for compatibility. + Disables the Application Load Balancer functionality for the specified project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiDisableServiceRequest +*/ +func (a *APIClient) DisableService(ctx context.Context, projectId string) ApiDisableServiceRequest { + return ApiDisableServiceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +/* +Deprecated: DEPRECATED! Disabling the Application Load Balancer functionality is now automatic. + + This endpoint is kept for compatibility. + Disables the Application Load Balancer functionality for the specified project. +*/ +func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { + r := ApiDisableServiceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiEnableServiceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + xRequestID *string +} + +func (r ApiEnableServiceRequest) XRequestID(xRequestID string) ApiEnableServiceRequest { + r.xRequestID = &xRequestID + return r +} + +func (r ApiEnableServiceRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EnableService") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.xRequestID == nil { + return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") + } + + // 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 + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +EnableService: Enables the functionality of application load balancers for the project specified. + +Deprecated: DEPRECATED! Checking the status is now obsolete. The endpoint is kept for compatibility. + + Enables the Application Load Balancer service for the specified project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiEnableServiceRequest +*/ +func (a *APIClient) EnableService(ctx context.Context, projectId string) ApiEnableServiceRequest { + return ApiEnableServiceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +/* +Deprecated: DEPRECATED! Checking the status is now obsolete. The endpoint is kept for compatibility. + + Enables the Application Load Balancer service for the specified project. +*/ +func (a *APIClient) EnableServiceExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { + r := ApiEnableServiceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiGetCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + credentialsRef string +} + +func (r ApiGetCredentialsRequest) Execute() (*GetCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(r.credentialsRef, "credentialsRef")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetCredentials: Get a single credential reference in a project. + +Gets the stored Observability credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param credentialsRef + @return ApiGetCredentialsRequest +*/ +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, credentialsRef string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } +} + +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, credentialsRef string) (*GetCredentialsResponse, error) { + r := ApiGetCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } + return r.Execute() +} + +type ApiGetLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string +} + +func (r ApiGetLoadBalancerRequest) Execute() (*LoadBalancer, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LoadBalancer + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetLoadBalancer: Get a single application load balancer in a project. + +Retrieves details of a specific Application Load Balancer in a project. + + Includes creation and update information, current status, and any error descriptions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @return ApiGetLoadBalancerRequest +*/ +func (a *APIClient) GetLoadBalancer(ctx context.Context, projectId string, name string) ApiGetLoadBalancerRequest { + return ApiGetLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } +} + +func (a *APIClient) GetLoadBalancerExecute(ctx context.Context, projectId string, name string) (*LoadBalancer, error) { + r := ApiGetLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } + return r.Execute() +} + +type ApiGetQuotaRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiGetQuotaRequest) Execute() (*GetQuotaResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetQuotaResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetQuota") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/quota" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetQuota: Get the quota of application load balancers and target pools in a project. + +Retrieves the configured Application Load Balancer quota for the project. + + The default quota is 3. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiGetQuotaRequest +*/ +func (a *APIClient) GetQuota(ctx context.Context, projectId string) ApiGetQuotaRequest { + return ApiGetQuotaRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) GetQuotaExecute(ctx context.Context, projectId string) (*GetQuotaResponse, error) { + r := ApiGetQuotaRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiGetServiceStatusRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiGetServiceStatusRequest) Execute() (*GetServiceStatusResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetServiceStatusResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceStatus") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetServiceStatus: Return the status of application load balancer functionality for the project specified. + +Deprecated: DEPRECATED! Checking the status is now obsolete. The endpoint is kept for compatibility. + + Status will return the Application Load Balancer functionality status for the specified project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiGetServiceStatusRequest +*/ +func (a *APIClient) GetServiceStatus(ctx context.Context, projectId string) ApiGetServiceStatusRequest { + return ApiGetServiceStatusRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +/* +Deprecated: DEPRECATED! Checking the status is now obsolete. The endpoint is kept for compatibility. + + Status will return the Application Load Balancer functionality status for the specified project. +*/ +func (a *APIClient) GetServiceStatusExecute(ctx context.Context, projectId string) (*GetServiceStatusResponse, error) { + r := ApiGetServiceStatusRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiListCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListCredentials: List all credentials in a project. + +Lists the stored Observability credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListCredentialsRequest +*/ +func (a *APIClient) ListCredentials(ctx context.Context, projectId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string) (*ListCredentialsResponse, error) { + r := ApiListCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiListLoadBalancersRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + pageSize *string + pageId *string +} + +// page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000 + +func (r ApiListLoadBalancersRequest) PageSize(pageSize string) ApiListLoadBalancersRequest { + r.pageSize = &pageSize + return r +} + +// page_id is a page identifier returned by the previous response and is used to request the next page + +func (r ApiListLoadBalancersRequest) PageId(pageId string) ApiListLoadBalancersRequest { + r.pageId = &pageId + return r +} + +func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListLoadBalancersResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListLoadBalancers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "") + } + if r.pageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageId", r.pageId, "") + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListLoadBalancers: List load balancers in a project. + +Lists all Application Load Balancers in a project. + + Includes details from creation or updates, along with their status and any error descriptions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListLoadBalancersRequest +*/ +func (a *APIClient) ListLoadBalancers(ctx context.Context, projectId string) ApiListLoadBalancersRequest { + return ApiListLoadBalancersRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) ListLoadBalancersExecute(ctx context.Context, projectId string) (*ListLoadBalancersResponse, error) { + r := ApiListLoadBalancersRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiListPlansRequest struct { + ctx context.Context + apiService *DefaultApiService +} + +func (r ApiListPlansRequest) Execute() (*ListPlansResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListPlansResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPlans") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/plans" + + 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListPlans: List available service plans. + +Lists the configured service plans for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPlansRequest +*/ +func (a *APIClient) ListPlans(ctx context.Context) ApiListPlansRequest { + return ApiListPlansRequest{ + apiService: a.defaultApi, + ctx: ctx, + } +} + +func (a *APIClient) ListPlansExecute(ctx context.Context) (*ListPlansResponse, error) { + r := ApiListPlansRequest{ + apiService: a.defaultApi, + ctx: ctx, + } + return r.Execute() +} + +type ApiUpdateCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + credentialsRef string + updateCredentialsPayload *UpdateCredentialsPayload +} + +func (r ApiUpdateCredentialsRequest) UpdateCredentialsPayload(updateCredentialsPayload UpdateCredentialsPayload) ApiUpdateCredentialsRequest { + r.updateCredentialsPayload = &updateCredentialsPayload + return r +} + +func (r ApiUpdateCredentialsRequest) Execute() (*UpdateCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(r.credentialsRef, "credentialsRef")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateCredentialsPayload == nil { + return localVarReturnValue, fmt.Errorf("updateCredentialsPayload 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.updateCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +UpdateCredentials: Update credentials for observability in a project. + +Updates the stored Observability credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param credentialsRef + @return ApiUpdateCredentialsRequest +*/ +func (a *APIClient) UpdateCredentials(ctx context.Context, projectId string, credentialsRef string) ApiUpdateCredentialsRequest { + return ApiUpdateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } +} + +func (a *APIClient) UpdateCredentialsExecute(ctx context.Context, projectId string, credentialsRef string) (*UpdateCredentialsResponse, error) { + r := ApiUpdateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } + return r.Execute() +} + +type ApiUpdateLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string + updateLoadBalancerPayload *UpdateLoadBalancerPayload +} + +func (r ApiUpdateLoadBalancerRequest) UpdateLoadBalancerPayload(updateLoadBalancerPayload UpdateLoadBalancerPayload) ApiUpdateLoadBalancerRequest { + r.updateLoadBalancerPayload = &updateLoadBalancerPayload + return r +} + +func (r ApiUpdateLoadBalancerRequest) Execute() (*LoadBalancer, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LoadBalancer + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateLoadBalancerPayload == nil { + return localVarReturnValue, fmt.Errorf("updateLoadBalancerPayload 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.updateLoadBalancerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +UpdateLoadBalancer: Update a load balancer in a project. + +Updates an existing Application Load Balancer by modifying its listeners and target pools. + + Ensure the resource version is current to maintain concurrency safety. + The default load balancing algorithm is Maglev, and selecting a different algorithm is currently not supported. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @return ApiUpdateLoadBalancerRequest +*/ +func (a *APIClient) UpdateLoadBalancer(ctx context.Context, projectId string, name string) ApiUpdateLoadBalancerRequest { + return ApiUpdateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } +} + +func (a *APIClient) UpdateLoadBalancerExecute(ctx context.Context, projectId string, name string) (*LoadBalancer, error) { + r := ApiUpdateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } + return r.Execute() +} + +type ApiUpdateTargetPoolRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string + targetPoolName string + updateTargetPoolPayload *UpdateTargetPoolPayload +} + +func (r ApiUpdateTargetPoolRequest) UpdateTargetPoolPayload(updateTargetPoolPayload UpdateTargetPoolPayload) ApiUpdateTargetPoolRequest { + r.updateTargetPoolPayload = &updateTargetPoolPayload + return r +} + +func (r ApiUpdateTargetPoolRequest) Execute() (*TargetPool, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TargetPool + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateTargetPool") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"targetPoolName"+"}", url.PathEscape(ParameterValueToString(r.targetPoolName, "targetPoolName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateTargetPoolPayload == nil { + return localVarReturnValue, fmt.Errorf("updateTargetPoolPayload 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.updateTargetPoolPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +UpdateTargetPool: Update a single target pool of a load balancer in a project. + +Replaces the content of a specific target pool in the Application Load Balancer (useful for adding or removing target servers). + + Only updates the specified target pool, leaving others unchanged. + Cannot be used to create or rename target pools. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @param targetPoolName + @return ApiUpdateTargetPoolRequest +*/ +func (a *APIClient) UpdateTargetPool(ctx context.Context, projectId string, name string, targetPoolName string) ApiUpdateTargetPoolRequest { + return ApiUpdateTargetPoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + targetPoolName: targetPoolName, + } +} + +func (a *APIClient) UpdateTargetPoolExecute(ctx context.Context, projectId string, name string, targetPoolName string) (*TargetPool, error) { + r := ApiUpdateTargetPoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + targetPoolName: targetPoolName, + } + return r.Execute() +} diff --git a/services/lbapplication/api_default_test.go b/services/lbapplication/api_default_test.go new file mode 100644 index 000000000..679f444ac --- /dev/null +++ b/services/lbapplication/api_default_test.go @@ -0,0 +1,886 @@ +/* +Application Load Balancer API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package lbapplication + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +func Test_lbapplication_DefaultApiService(t *testing.T) { + + t.Run("Test DefaultApiService CreateCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := CreateCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + var xRequestID string + createCredentialsPayload := CreateCredentialsPayload{} + + resp, reqErr := apiClient.CreateCredentials(context.Background(), projectId).XRequestID(xRequestID).CreateCredentialsPayload(createCredentialsPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService CreateLoadBalancer", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := LoadBalancer{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + var xRequestID string + createLoadBalancerPayload := CreateLoadBalancerPayload{} + + resp, reqErr := apiClient.CreateLoadBalancer(context.Background(), projectId).XRequestID(xRequestID).CreateLoadBalancerPayload(createLoadBalancerPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + credentialsRefValue := "credentialsRef" + path = strings.Replace(path, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(credentialsRefValue, "credentialsRef")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + credentialsRef := "credentialsRef" + + resp, reqErr := apiClient.DeleteCredentials(context.Background(), projectId, credentialsRef).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteLoadBalancer", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers/{name}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + + resp, reqErr := apiClient.DeleteLoadBalancer(context.Background(), projectId, name).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DisableService", func(t *testing.T) { + path := "/v1beta/projects/{projectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.DisableService(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService EnableService", func(t *testing.T) { + path := "/v1beta/projects/{projectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + var xRequestID string + + resp, reqErr := apiClient.EnableService(context.Background(), projectId).XRequestID(xRequestID).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + credentialsRefValue := "credentialsRef" + path = strings.Replace(path, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(credentialsRefValue, "credentialsRef")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + credentialsRef := "credentialsRef" + + resp, reqErr := apiClient.GetCredentials(context.Background(), projectId, credentialsRef).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetLoadBalancer", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers/{name}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := LoadBalancer{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + + resp, reqErr := apiClient.GetLoadBalancer(context.Background(), projectId, name).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetQuota", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/quota" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetQuotaResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.GetQuota(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetServiceStatus", func(t *testing.T) { + path := "/v1beta/projects/{projectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetServiceStatusResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.GetServiceStatus(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.ListCredentials(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListLoadBalancers", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListLoadBalancersResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.ListLoadBalancers(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListPlans", func(t *testing.T) { + path := "/v1beta/plans" + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListPlansResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + resp, reqErr := apiClient.ListPlans(context.Background()).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + credentialsRefValue := "credentialsRef" + path = strings.Replace(path, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(credentialsRefValue, "credentialsRef")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := UpdateCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + credentialsRef := "credentialsRef" + updateCredentialsPayload := UpdateCredentialsPayload{} + + resp, reqErr := apiClient.UpdateCredentials(context.Background(), projectId, credentialsRef).UpdateCredentialsPayload(updateCredentialsPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateLoadBalancer", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers/{name}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := LoadBalancer{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + updateLoadBalancerPayload := UpdateLoadBalancerPayload{} + + resp, reqErr := apiClient.UpdateLoadBalancer(context.Background(), projectId, name).UpdateLoadBalancerPayload(updateLoadBalancerPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateTargetPool", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + targetPoolNameValue := "targetPoolName" + path = strings.Replace(path, "{"+"targetPoolName"+"}", url.PathEscape(ParameterValueToString(targetPoolNameValue, "targetPoolName")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := TargetPool{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + targetPoolName := "targetPoolName" + updateTargetPoolPayload := UpdateTargetPoolPayload{} + + resp, reqErr := apiClient.UpdateTargetPool(context.Background(), projectId, name, targetPoolName).UpdateTargetPoolPayload(updateTargetPoolPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + +} diff --git a/services/lbapplication/client.go b/services/lbapplication/client.go new file mode 100644 index 000000000..79406adb6 --- /dev/null +++ b/services/lbapplication/client.go @@ -0,0 +1,631 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the Application Load Balancer API API v1beta.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + defaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. +// Optionally receives configuration options +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + c.defaultApi = (*DefaultApiService)(&c.common) + + return c, nil +} + +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 { + dump, err := httputil.DumpRequestOut(request, true) + 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 + } + + 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() *config.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, fmt.Errorf("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, fmt.Errorf("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 fmt.Errorf("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 fmt.Errorf("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 +} + +// 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) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s", 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) +} diff --git a/services/lbapplication/configuration.go b/services/lbapplication/configuration.go new file mode 100644 index 000000000..23ba6d090 --- /dev/null +++ b/services/lbapplication/configuration.go @@ -0,0 +1,41 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://lb-application.api.{region}stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/lbapplication/go.mod b/services/lbapplication/go.mod new file mode 100644 index 000000000..6abc35f5d --- /dev/null +++ b/services/lbapplication/go.mod @@ -0,0 +1,10 @@ +module github.com/stackitcloud/stackit-sdk-go/services/lbapplication + +go 1.21 + +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + +require ( + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/google/uuid v1.6.0 // indirect +) diff --git a/services/lbapplication/go.sum b/services/lbapplication/go.sum new file mode 100644 index 000000000..b7342b5ac --- /dev/null +++ b/services/lbapplication/go.sum @@ -0,0 +1,8 @@ +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/lbapplication/model_active_health_check.go b/services/lbapplication/model_active_health_check.go new file mode 100644 index 000000000..1d0966761 --- /dev/null +++ b/services/lbapplication/model_active_health_check.go @@ -0,0 +1,301 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ActiveHealthCheck type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActiveHealthCheck{} + +// ActiveHealthCheck struct for ActiveHealthCheck +type ActiveHealthCheck struct { + // Healthy threshold of the health checking + HealthyThreshold *int64 `json:"healthyThreshold,omitempty"` + HttpHealthChecks *HttpHealthChecks `json:"httpHealthChecks,omitempty"` + // Interval duration of health checking in seconds + Interval *string `json:"interval,omitempty"` + // Interval duration threshold of the health checking in seconds + IntervalJitter *string `json:"intervalJitter,omitempty"` + // Active health checking timeout duration in seconds + Timeout *string `json:"timeout,omitempty"` + // Unhealthy threshold of the health checking + UnhealthyThreshold *int64 `json:"unhealthyThreshold,omitempty"` +} + +// NewActiveHealthCheck instantiates a new ActiveHealthCheck object +// This constructor will assign default values to properties that have it defined, +// 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 NewActiveHealthCheck() *ActiveHealthCheck { + this := ActiveHealthCheck{} + return &this +} + +// NewActiveHealthCheckWithDefaults instantiates a new ActiveHealthCheck object +// This 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 NewActiveHealthCheckWithDefaults() *ActiveHealthCheck { + this := ActiveHealthCheck{} + return &this +} + +// GetHealthyThreshold returns the HealthyThreshold field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetHealthyThreshold() *int64 { + if o == nil || IsNil(o.HealthyThreshold) { + var ret *int64 + return ret + } + return o.HealthyThreshold +} + +// GetHealthyThresholdOk returns a tuple with the HealthyThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetHealthyThresholdOk() (*int64, bool) { + if o == nil || IsNil(o.HealthyThreshold) { + return nil, false + } + return o.HealthyThreshold, true +} + +// HasHealthyThreshold returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasHealthyThreshold() bool { + if o != nil && !IsNil(o.HealthyThreshold) { + return true + } + + return false +} + +// SetHealthyThreshold gets a reference to the given int64 and assigns it to the HealthyThreshold field. +func (o *ActiveHealthCheck) SetHealthyThreshold(v *int64) { + o.HealthyThreshold = v +} + +// GetHttpHealthChecks returns the HttpHealthChecks field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetHttpHealthChecks() *HttpHealthChecks { + if o == nil || IsNil(o.HttpHealthChecks) { + var ret *HttpHealthChecks + return ret + } + return o.HttpHealthChecks +} + +// GetHttpHealthChecksOk returns a tuple with the HttpHealthChecks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetHttpHealthChecksOk() (*HttpHealthChecks, bool) { + if o == nil || IsNil(o.HttpHealthChecks) { + return nil, false + } + return o.HttpHealthChecks, true +} + +// HasHttpHealthChecks returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasHttpHealthChecks() bool { + if o != nil && !IsNil(o.HttpHealthChecks) { + return true + } + + return false +} + +// SetHttpHealthChecks gets a reference to the given HttpHealthChecks and assigns it to the HttpHealthChecks field. +func (o *ActiveHealthCheck) SetHttpHealthChecks(v *HttpHealthChecks) { + o.HttpHealthChecks = v +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetInterval() *string { + if o == nil || IsNil(o.Interval) { + var ret *string + return ret + } + return o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetIntervalOk() (*string, bool) { + if o == nil || IsNil(o.Interval) { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasInterval() bool { + if o != nil && !IsNil(o.Interval) { + return true + } + + return false +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *ActiveHealthCheck) SetInterval(v *string) { + o.Interval = v +} + +// GetIntervalJitter returns the IntervalJitter field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetIntervalJitter() *string { + if o == nil || IsNil(o.IntervalJitter) { + var ret *string + return ret + } + return o.IntervalJitter +} + +// GetIntervalJitterOk returns a tuple with the IntervalJitter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetIntervalJitterOk() (*string, bool) { + if o == nil || IsNil(o.IntervalJitter) { + return nil, false + } + return o.IntervalJitter, true +} + +// HasIntervalJitter returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasIntervalJitter() bool { + if o != nil && !IsNil(o.IntervalJitter) { + return true + } + + return false +} + +// SetIntervalJitter gets a reference to the given string and assigns it to the IntervalJitter field. +func (o *ActiveHealthCheck) SetIntervalJitter(v *string) { + o.IntervalJitter = v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetTimeout() *string { + if o == nil || IsNil(o.Timeout) { + var ret *string + return ret + } + return o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given string and assigns it to the Timeout field. +func (o *ActiveHealthCheck) SetTimeout(v *string) { + o.Timeout = v +} + +// GetUnhealthyThreshold returns the UnhealthyThreshold field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetUnhealthyThreshold() *int64 { + if o == nil || IsNil(o.UnhealthyThreshold) { + var ret *int64 + return ret + } + return o.UnhealthyThreshold +} + +// GetUnhealthyThresholdOk returns a tuple with the UnhealthyThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetUnhealthyThresholdOk() (*int64, bool) { + if o == nil || IsNil(o.UnhealthyThreshold) { + return nil, false + } + return o.UnhealthyThreshold, true +} + +// HasUnhealthyThreshold returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasUnhealthyThreshold() bool { + if o != nil && !IsNil(o.UnhealthyThreshold) { + return true + } + + return false +} + +// SetUnhealthyThreshold gets a reference to the given int64 and assigns it to the UnhealthyThreshold field. +func (o *ActiveHealthCheck) SetUnhealthyThreshold(v *int64) { + o.UnhealthyThreshold = v +} + +func (o ActiveHealthCheck) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HealthyThreshold) { + toSerialize["healthyThreshold"] = o.HealthyThreshold + } + if !IsNil(o.HttpHealthChecks) { + toSerialize["httpHealthChecks"] = o.HttpHealthChecks + } + if !IsNil(o.Interval) { + toSerialize["interval"] = o.Interval + } + if !IsNil(o.IntervalJitter) { + toSerialize["intervalJitter"] = o.IntervalJitter + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.UnhealthyThreshold) { + toSerialize["unhealthyThreshold"] = o.UnhealthyThreshold + } + return toSerialize, nil +} + +type NullableActiveHealthCheck struct { + value *ActiveHealthCheck + isSet bool +} + +func (v NullableActiveHealthCheck) Get() *ActiveHealthCheck { + return v.value +} + +func (v *NullableActiveHealthCheck) Set(val *ActiveHealthCheck) { + v.value = val + v.isSet = true +} + +func (v NullableActiveHealthCheck) IsSet() bool { + return v.isSet +} + +func (v *NullableActiveHealthCheck) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActiveHealthCheck(val *ActiveHealthCheck) *NullableActiveHealthCheck { + return &NullableActiveHealthCheck{value: val, isSet: true} +} + +func (v NullableActiveHealthCheck) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActiveHealthCheck) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_certificate_config.go b/services/lbapplication/model_certificate_config.go new file mode 100644 index 000000000..347987148 --- /dev/null +++ b/services/lbapplication/model_certificate_config.go @@ -0,0 +1,117 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CertificateConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateConfig{} + +// CertificateConfig struct for CertificateConfig +type CertificateConfig struct { + // Certificate IDs for TLS termination + CertificateIds *[]string `json:"certificateIds,omitempty"` +} + +// NewCertificateConfig instantiates a new CertificateConfig object +// This constructor will assign default values to properties that have it defined, +// 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 NewCertificateConfig() *CertificateConfig { + this := CertificateConfig{} + return &this +} + +// NewCertificateConfigWithDefaults instantiates a new CertificateConfig object +// This 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 NewCertificateConfigWithDefaults() *CertificateConfig { + this := CertificateConfig{} + return &this +} + +// GetCertificateIds returns the CertificateIds field value if set, zero value otherwise. +func (o *CertificateConfig) GetCertificateIds() *[]string { + if o == nil || IsNil(o.CertificateIds) { + var ret *[]string + return ret + } + return o.CertificateIds +} + +// GetCertificateIdsOk returns a tuple with the CertificateIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CertificateConfig) GetCertificateIdsOk() (*[]string, bool) { + if o == nil || IsNil(o.CertificateIds) { + return nil, false + } + return o.CertificateIds, true +} + +// HasCertificateIds returns a boolean if a field has been set. +func (o *CertificateConfig) HasCertificateIds() bool { + if o != nil && !IsNil(o.CertificateIds) { + return true + } + + return false +} + +// SetCertificateIds gets a reference to the given []string and assigns it to the CertificateIds field. +func (o *CertificateConfig) SetCertificateIds(v *[]string) { + o.CertificateIds = v +} + +func (o CertificateConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CertificateIds) { + toSerialize["certificateIds"] = o.CertificateIds + } + return toSerialize, nil +} + +type NullableCertificateConfig struct { + value *CertificateConfig + isSet bool +} + +func (v NullableCertificateConfig) Get() *CertificateConfig { + return v.value +} + +func (v *NullableCertificateConfig) Set(val *CertificateConfig) { + v.value = val + v.isSet = true +} + +func (v NullableCertificateConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableCertificateConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCertificateConfig(val *CertificateConfig) *NullableCertificateConfig { + return &NullableCertificateConfig{value: val, isSet: true} +} + +func (v NullableCertificateConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCertificateConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_cookie_persistence.go b/services/lbapplication/model_cookie_persistence.go new file mode 100644 index 000000000..46fd43257 --- /dev/null +++ b/services/lbapplication/model_cookie_persistence.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CookiePersistence type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CookiePersistence{} + +// CookiePersistence struct for CookiePersistence +type CookiePersistence struct { + // Cookie is the name of the cookie to use. + Name *string `json:"name,omitempty"` + // TTL specifies the time-to-live for the cookie. The default value is 0s, and it acts as a session cookie, expiring when the client session ends. + Ttl *string `json:"ttl,omitempty"` +} + +// NewCookiePersistence instantiates a new CookiePersistence object +// This constructor will assign default values to properties that have it defined, +// 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 NewCookiePersistence() *CookiePersistence { + this := CookiePersistence{} + return &this +} + +// NewCookiePersistenceWithDefaults instantiates a new CookiePersistence object +// This 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 NewCookiePersistenceWithDefaults() *CookiePersistence { + this := CookiePersistence{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CookiePersistence) 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 *CookiePersistence) 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 *CookiePersistence) 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 *CookiePersistence) SetName(v *string) { + o.Name = v +} + +// GetTtl returns the Ttl field value if set, zero value otherwise. +func (o *CookiePersistence) GetTtl() *string { + if o == nil || IsNil(o.Ttl) { + var ret *string + return ret + } + return o.Ttl +} + +// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CookiePersistence) GetTtlOk() (*string, bool) { + if o == nil || IsNil(o.Ttl) { + return nil, false + } + return o.Ttl, true +} + +// HasTtl returns a boolean if a field has been set. +func (o *CookiePersistence) HasTtl() bool { + if o != nil && !IsNil(o.Ttl) { + return true + } + + return false +} + +// SetTtl gets a reference to the given string and assigns it to the Ttl field. +func (o *CookiePersistence) SetTtl(v *string) { + o.Ttl = v +} + +func (o CookiePersistence) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ttl) { + toSerialize["ttl"] = o.Ttl + } + return toSerialize, nil +} + +type NullableCookiePersistence struct { + value *CookiePersistence + isSet bool +} + +func (v NullableCookiePersistence) Get() *CookiePersistence { + return v.value +} + +func (v *NullableCookiePersistence) Set(val *CookiePersistence) { + v.value = val + v.isSet = true +} + +func (v NullableCookiePersistence) IsSet() bool { + return v.isSet +} + +func (v *NullableCookiePersistence) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCookiePersistence(val *CookiePersistence) *NullableCookiePersistence { + return &NullableCookiePersistence{value: val, isSet: true} +} + +func (v NullableCookiePersistence) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCookiePersistence) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_create_credentials_payload.go b/services/lbapplication/model_create_credentials_payload.go new file mode 100644 index 000000000..e1662d4d6 --- /dev/null +++ b/services/lbapplication/model_create_credentials_payload.go @@ -0,0 +1,191 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // A valid password used for an existing ARGUS instance, which is used during basic auth. + Password *string `json:"password,omitempty"` + // A valid username used for an existing ARGUS instance, which is used during basic auth. + Username *string `json:"username,omitempty"` +} + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// 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 NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This 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 NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *CreateCredentialsPayload) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) 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 *CreateCredentialsPayload) 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 *CreateCredentialsPayload) 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 *CreateCredentialsPayload) SetPassword(v *string) { + o.Password = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetUsername() *string { + if o == nil || IsNil(o.Username) { + var ret *string + return ret + } + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CreateCredentialsPayload) SetUsername(v *string) { + o.Username = v +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_create_credentials_response.go b/services/lbapplication/model_create_credentials_response.go new file mode 100644 index 000000000..e92fd0010 --- /dev/null +++ b/services/lbapplication/model_create_credentials_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsResponse{} + +// CreateCredentialsResponse struct for CreateCredentialsResponse +type CreateCredentialsResponse struct { + Credential *CredentialsResponse `json:"credential,omitempty"` +} + +// NewCreateCredentialsResponse instantiates a new CreateCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewCreateCredentialsResponse() *CreateCredentialsResponse { + this := CreateCredentialsResponse{} + return &this +} + +// NewCreateCredentialsResponseWithDefaults instantiates a new CreateCredentialsResponse object +// This 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 NewCreateCredentialsResponseWithDefaults() *CreateCredentialsResponse { + this := CreateCredentialsResponse{} + return &this +} + +// GetCredential returns the Credential field value if set, zero value otherwise. +func (o *CreateCredentialsResponse) GetCredential() *CredentialsResponse { + if o == nil || IsNil(o.Credential) { + var ret *CredentialsResponse + return ret + } + return o.Credential +} + +// GetCredentialOk returns a tuple with the Credential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsResponse) GetCredentialOk() (*CredentialsResponse, bool) { + if o == nil || IsNil(o.Credential) { + return nil, false + } + return o.Credential, true +} + +// HasCredential returns a boolean if a field has been set. +func (o *CreateCredentialsResponse) HasCredential() bool { + if o != nil && !IsNil(o.Credential) { + return true + } + + return false +} + +// SetCredential gets a reference to the given CredentialsResponse and assigns it to the Credential field. +func (o *CreateCredentialsResponse) SetCredential(v *CredentialsResponse) { + o.Credential = v +} + +func (o CreateCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credential) { + toSerialize["credential"] = o.Credential + } + return toSerialize, nil +} + +type NullableCreateCredentialsResponse struct { + value *CreateCredentialsResponse + isSet bool +} + +func (v NullableCreateCredentialsResponse) Get() *CreateCredentialsResponse { + return v.value +} + +func (v *NullableCreateCredentialsResponse) Set(val *CreateCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsResponse(val *CreateCredentialsResponse) *NullableCreateCredentialsResponse { + return &NullableCreateCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCreateCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_create_load_balancer_payload.go b/services/lbapplication/model_create_load_balancer_payload.go new file mode 100644 index 000000000..e207f09c3 --- /dev/null +++ b/services/lbapplication/model_create_load_balancer_payload.go @@ -0,0 +1,485 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CreateLoadBalancerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateLoadBalancerPayload{} + +// CreateLoadBalancerPayload struct for CreateLoadBalancerPayload +type CreateLoadBalancerPayload struct { + // Reports all errors a application load balancer has. + Errors *[]LoadBalancerError `json:"errors,omitempty"` + // External application load balancer IP address where this application load balancer is exposed. Not changeable after creation. + ExternalAddress *string `json:"externalAddress,omitempty"` + // There is a maximum listener count of 20. + Listeners *[]Listener `json:"listeners,omitempty"` + // Application Load Balancer name. Not changeable after creation. + Name *string `json:"name,omitempty"` + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. + Networks *[]Network `json:"networks,omitempty"` + Options *LoadBalancerOptions `json:"options,omitempty"` + // Service Plan configures the size of the Application Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. + PlanId *string `json:"planId,omitempty"` + // Transient private application load balancer IP address that can change any time. + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *string `json:"status,omitempty"` + // List of all target pools which will be used in the application load balancer. Limited to 20. + TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Application Load Balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this application load balancer resource that changes during updates of the load balancers. On updates this field specified the application load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a application load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of application load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` +} + +// NewCreateLoadBalancerPayload instantiates a new CreateLoadBalancerPayload object +// This constructor will assign default values to properties that have it defined, +// 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 NewCreateLoadBalancerPayload() *CreateLoadBalancerPayload { + this := CreateLoadBalancerPayload{} + return &this +} + +// NewCreateLoadBalancerPayloadWithDefaults instantiates a new CreateLoadBalancerPayload object +// This 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 NewCreateLoadBalancerPayloadWithDefaults() *CreateLoadBalancerPayload { + this := CreateLoadBalancerPayload{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetErrors() *[]LoadBalancerError { + if o == nil || IsNil(o.Errors) { + var ret *[]LoadBalancerError + 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 *CreateLoadBalancerPayload) GetErrorsOk() (*[]LoadBalancerError, 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 *CreateLoadBalancerPayload) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []LoadBalancerError and assigns it to the Errors field. +func (o *CreateLoadBalancerPayload) SetErrors(v *[]LoadBalancerError) { + o.Errors = v +} + +// GetExternalAddress returns the ExternalAddress field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetExternalAddress() *string { + if o == nil || IsNil(o.ExternalAddress) { + var ret *string + return ret + } + return o.ExternalAddress +} + +// GetExternalAddressOk returns a tuple with the ExternalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetExternalAddressOk() (*string, bool) { + if o == nil || IsNil(o.ExternalAddress) { + return nil, false + } + return o.ExternalAddress, true +} + +// HasExternalAddress returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasExternalAddress() bool { + if o != nil && !IsNil(o.ExternalAddress) { + return true + } + + return false +} + +// SetExternalAddress gets a reference to the given string and assigns it to the ExternalAddress field. +func (o *CreateLoadBalancerPayload) SetExternalAddress(v *string) { + o.ExternalAddress = v +} + +// GetListeners returns the Listeners field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetListeners() *[]Listener { + if o == nil || IsNil(o.Listeners) { + var ret *[]Listener + return ret + } + return o.Listeners +} + +// GetListenersOk returns a tuple with the Listeners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetListenersOk() (*[]Listener, bool) { + if o == nil || IsNil(o.Listeners) { + return nil, false + } + return o.Listeners, true +} + +// HasListeners returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasListeners() bool { + if o != nil && !IsNil(o.Listeners) { + return true + } + + return false +} + +// SetListeners gets a reference to the given []Listener and assigns it to the Listeners field. +func (o *CreateLoadBalancerPayload) SetListeners(v *[]Listener) { + o.Listeners = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) SetName(v *string) { + o.Name = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetNetworks() *[]Network { + if o == nil || IsNil(o.Networks) { + var ret *[]Network + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetNetworksOk() (*[]Network, bool) { + if o == nil || IsNil(o.Networks) { + return nil, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given []Network and assigns it to the Networks field. +func (o *CreateLoadBalancerPayload) SetNetworks(v *[]Network) { + o.Networks = v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetOptions() *LoadBalancerOptions { + if o == nil || IsNil(o.Options) { + var ret *LoadBalancerOptions + 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 *CreateLoadBalancerPayload) GetOptionsOk() (*LoadBalancerOptions, 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 *CreateLoadBalancerPayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given LoadBalancerOptions and assigns it to the Options field. +func (o *CreateLoadBalancerPayload) SetOptions(v *LoadBalancerOptions) { + o.Options = v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) SetPlanId(v *string) { + o.PlanId = v +} + +// GetPrivateAddress returns the PrivateAddress field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetPrivateAddress() *string { + if o == nil || IsNil(o.PrivateAddress) { + var ret *string + return ret + } + return o.PrivateAddress +} + +// GetPrivateAddressOk returns a tuple with the PrivateAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetPrivateAddressOk() (*string, bool) { + if o == nil || IsNil(o.PrivateAddress) { + return nil, false + } + return o.PrivateAddress, true +} + +// HasPrivateAddress returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasPrivateAddress() bool { + if o != nil && !IsNil(o.PrivateAddress) { + return true + } + + return false +} + +// SetPrivateAddress gets a reference to the given string and assigns it to the PrivateAddress field. +func (o *CreateLoadBalancerPayload) SetPrivateAddress(v *string) { + o.PrivateAddress = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) SetStatus(v *string) { + o.Status = v +} + +// GetTargetPools returns the TargetPools field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetTargetPools() *[]TargetPool { + if o == nil || IsNil(o.TargetPools) { + var ret *[]TargetPool + return ret + } + return o.TargetPools +} + +// GetTargetPoolsOk returns a tuple with the TargetPools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetTargetPoolsOk() (*[]TargetPool, bool) { + if o == nil || IsNil(o.TargetPools) { + return nil, false + } + return o.TargetPools, true +} + +// HasTargetPools returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasTargetPools() bool { + if o != nil && !IsNil(o.TargetPools) { + return true + } + + return false +} + +// SetTargetPools gets a reference to the given []TargetPool and assigns it to the TargetPools field. +func (o *CreateLoadBalancerPayload) SetTargetPools(v *[]TargetPool) { + o.TargetPools = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) 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 *CreateLoadBalancerPayload) SetVersion(v *string) { + o.Version = v +} + +func (o CreateLoadBalancerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.ExternalAddress) { + toSerialize["externalAddress"] = o.ExternalAddress + } + if !IsNil(o.Listeners) { + toSerialize["listeners"] = o.Listeners + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + if !IsNil(o.PrivateAddress) { + toSerialize["privateAddress"] = o.PrivateAddress + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TargetPools) { + toSerialize["targetPools"] = o.TargetPools + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableCreateLoadBalancerPayload struct { + value *CreateLoadBalancerPayload + isSet bool +} + +func (v NullableCreateLoadBalancerPayload) Get() *CreateLoadBalancerPayload { + return v.value +} + +func (v *NullableCreateLoadBalancerPayload) Set(val *CreateLoadBalancerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateLoadBalancerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateLoadBalancerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateLoadBalancerPayload(val *CreateLoadBalancerPayload) *NullableCreateLoadBalancerPayload { + return &NullableCreateLoadBalancerPayload{value: val, isSet: true} +} + +func (v NullableCreateLoadBalancerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateLoadBalancerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_credentials_response.go b/services/lbapplication/model_credentials_response.go new file mode 100644 index 000000000..180b5344f --- /dev/null +++ b/services/lbapplication/model_credentials_response.go @@ -0,0 +1,191 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsResponse{} + +// CredentialsResponse struct for CredentialsResponse +type CredentialsResponse struct { + // The credentials reference can be used for observability of the Application Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // The username used for the ARGUS instance + Username *string `json:"username,omitempty"` +} + +// NewCredentialsResponse instantiates a new CredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewCredentialsResponse() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// NewCredentialsResponseWithDefaults instantiates a new CredentialsResponse object +// This 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 NewCredentialsResponseWithDefaults() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// GetCredentialsRef returns the CredentialsRef field value if set, zero value otherwise. +func (o *CredentialsResponse) GetCredentialsRef() *string { + if o == nil || IsNil(o.CredentialsRef) { + var ret *string + return ret + } + return o.CredentialsRef +} + +// GetCredentialsRefOk returns a tuple with the CredentialsRef field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetCredentialsRefOk() (*string, bool) { + if o == nil || IsNil(o.CredentialsRef) { + return nil, false + } + return o.CredentialsRef, true +} + +// HasCredentialsRef returns a boolean if a field has been set. +func (o *CredentialsResponse) HasCredentialsRef() bool { + if o != nil && !IsNil(o.CredentialsRef) { + return true + } + + return false +} + +// SetCredentialsRef gets a reference to the given string and assigns it to the CredentialsRef field. +func (o *CredentialsResponse) SetCredentialsRef(v *string) { + o.CredentialsRef = v +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *CredentialsResponse) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *CredentialsResponse) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *CredentialsResponse) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CredentialsResponse) GetUsername() *string { + if o == nil || IsNil(o.Username) { + var ret *string + return ret + } + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *CredentialsResponse) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CredentialsResponse) SetUsername(v *string) { + o.Username = v +} + +func (o CredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CredentialsRef) { + toSerialize["credentialsRef"] = o.CredentialsRef + } + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableCredentialsResponse struct { + value *CredentialsResponse + isSet bool +} + +func (v NullableCredentialsResponse) Get() *CredentialsResponse { + return v.value +} + +func (v *NullableCredentialsResponse) Set(val *CredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsResponse(val *CredentialsResponse) *NullableCredentialsResponse { + return &NullableCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_get_credentials_response.go b/services/lbapplication/model_get_credentials_response.go new file mode 100644 index 000000000..521163d39 --- /dev/null +++ b/services/lbapplication/model_get_credentials_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the GetCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCredentialsResponse{} + +// GetCredentialsResponse struct for GetCredentialsResponse +type GetCredentialsResponse struct { + Credential *CredentialsResponse `json:"credential,omitempty"` +} + +// NewGetCredentialsResponse instantiates a new GetCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewGetCredentialsResponse() *GetCredentialsResponse { + this := GetCredentialsResponse{} + return &this +} + +// NewGetCredentialsResponseWithDefaults instantiates a new GetCredentialsResponse object +// This 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 NewGetCredentialsResponseWithDefaults() *GetCredentialsResponse { + this := GetCredentialsResponse{} + return &this +} + +// GetCredential returns the Credential field value if set, zero value otherwise. +func (o *GetCredentialsResponse) GetCredential() *CredentialsResponse { + if o == nil || IsNil(o.Credential) { + var ret *CredentialsResponse + return ret + } + return o.Credential +} + +// GetCredentialOk returns a tuple with the Credential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetCredentialsResponse) GetCredentialOk() (*CredentialsResponse, bool) { + if o == nil || IsNil(o.Credential) { + return nil, false + } + return o.Credential, true +} + +// HasCredential returns a boolean if a field has been set. +func (o *GetCredentialsResponse) HasCredential() bool { + if o != nil && !IsNil(o.Credential) { + return true + } + + return false +} + +// SetCredential gets a reference to the given CredentialsResponse and assigns it to the Credential field. +func (o *GetCredentialsResponse) SetCredential(v *CredentialsResponse) { + o.Credential = v +} + +func (o GetCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credential) { + toSerialize["credential"] = o.Credential + } + return toSerialize, nil +} + +type NullableGetCredentialsResponse struct { + value *GetCredentialsResponse + isSet bool +} + +func (v NullableGetCredentialsResponse) Get() *GetCredentialsResponse { + return v.value +} + +func (v *NullableGetCredentialsResponse) Set(val *GetCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCredentialsResponse(val *GetCredentialsResponse) *NullableGetCredentialsResponse { + return &NullableGetCredentialsResponse{value: val, isSet: true} +} + +func (v NullableGetCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_get_quota_response.go b/services/lbapplication/model_get_quota_response.go new file mode 100644 index 000000000..6b270b597 --- /dev/null +++ b/services/lbapplication/model_get_quota_response.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the GetQuotaResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetQuotaResponse{} + +// GetQuotaResponse struct for GetQuotaResponse +type GetQuotaResponse struct { + // The maximum number of load balancing servers in this project. Unlimited if set to -1. + MaxLoadBalancers *int64 `json:"maxLoadBalancers,omitempty"` + // Project identifier + ProjectId *string `json:"projectId,omitempty"` +} + +// NewGetQuotaResponse instantiates a new GetQuotaResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewGetQuotaResponse() *GetQuotaResponse { + this := GetQuotaResponse{} + return &this +} + +// NewGetQuotaResponseWithDefaults instantiates a new GetQuotaResponse object +// This 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 NewGetQuotaResponseWithDefaults() *GetQuotaResponse { + this := GetQuotaResponse{} + return &this +} + +// GetMaxLoadBalancers returns the MaxLoadBalancers field value if set, zero value otherwise. +func (o *GetQuotaResponse) GetMaxLoadBalancers() *int64 { + if o == nil || IsNil(o.MaxLoadBalancers) { + var ret *int64 + return ret + } + return o.MaxLoadBalancers +} + +// GetMaxLoadBalancersOk returns a tuple with the MaxLoadBalancers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetQuotaResponse) GetMaxLoadBalancersOk() (*int64, bool) { + if o == nil || IsNil(o.MaxLoadBalancers) { + return nil, false + } + return o.MaxLoadBalancers, true +} + +// HasMaxLoadBalancers returns a boolean if a field has been set. +func (o *GetQuotaResponse) HasMaxLoadBalancers() bool { + if o != nil && !IsNil(o.MaxLoadBalancers) { + return true + } + + return false +} + +// SetMaxLoadBalancers gets a reference to the given int64 and assigns it to the MaxLoadBalancers field. +func (o *GetQuotaResponse) SetMaxLoadBalancers(v *int64) { + o.MaxLoadBalancers = v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GetQuotaResponse) 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 *GetQuotaResponse) 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 *GetQuotaResponse) 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 *GetQuotaResponse) SetProjectId(v *string) { + o.ProjectId = v +} + +func (o GetQuotaResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MaxLoadBalancers) { + toSerialize["maxLoadBalancers"] = o.MaxLoadBalancers + } + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + return toSerialize, nil +} + +type NullableGetQuotaResponse struct { + value *GetQuotaResponse + isSet bool +} + +func (v NullableGetQuotaResponse) Get() *GetQuotaResponse { + return v.value +} + +func (v *NullableGetQuotaResponse) Set(val *GetQuotaResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetQuotaResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetQuotaResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetQuotaResponse(val *GetQuotaResponse) *NullableGetQuotaResponse { + return &NullableGetQuotaResponse{value: val, isSet: true} +} + +func (v NullableGetQuotaResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetQuotaResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_get_service_status_response.go b/services/lbapplication/model_get_service_status_response.go new file mode 100644 index 000000000..06948290a --- /dev/null +++ b/services/lbapplication/model_get_service_status_response.go @@ -0,0 +1,117 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the GetServiceStatusResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetServiceStatusResponse{} + +// GetServiceStatusResponse Response with customer project status. +type GetServiceStatusResponse struct { + // status of the project + Status *string `json:"status,omitempty"` +} + +// NewGetServiceStatusResponse instantiates a new GetServiceStatusResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewGetServiceStatusResponse() *GetServiceStatusResponse { + this := GetServiceStatusResponse{} + return &this +} + +// NewGetServiceStatusResponseWithDefaults instantiates a new GetServiceStatusResponse object +// This 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 NewGetServiceStatusResponseWithDefaults() *GetServiceStatusResponse { + this := GetServiceStatusResponse{} + return &this +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GetServiceStatusResponse) 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 *GetServiceStatusResponse) 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 *GetServiceStatusResponse) 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 *GetServiceStatusResponse) SetStatus(v *string) { + o.Status = v +} + +func (o GetServiceStatusResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableGetServiceStatusResponse struct { + value *GetServiceStatusResponse + isSet bool +} + +func (v NullableGetServiceStatusResponse) Get() *GetServiceStatusResponse { + return v.value +} + +func (v *NullableGetServiceStatusResponse) Set(val *GetServiceStatusResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetServiceStatusResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServiceStatusResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServiceStatusResponse(val *GetServiceStatusResponse) *NullableGetServiceStatusResponse { + return &NullableGetServiceStatusResponse{value: val, isSet: true} +} + +func (v NullableGetServiceStatusResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServiceStatusResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_google_protobuf_any.go b/services/lbapplication/model_google_protobuf_any.go new file mode 100644 index 000000000..4875ade32 --- /dev/null +++ b/services/lbapplication/model_google_protobuf_any.go @@ -0,0 +1,125 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the GoogleProtobufAny type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleProtobufAny{} + +// GoogleProtobufAny Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +type GoogleProtobufAny struct { + // The type of the serialized message. + Type *string `json:"@type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GoogleProtobufAny GoogleProtobufAny + +// NewGoogleProtobufAny instantiates a new GoogleProtobufAny object +// This constructor will assign default values to properties that have it defined, +// 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 NewGoogleProtobufAny() *GoogleProtobufAny { + this := GoogleProtobufAny{} + return &this +} + +// NewGoogleProtobufAnyWithDefaults instantiates a new GoogleProtobufAny object +// This 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 NewGoogleProtobufAnyWithDefaults() *GoogleProtobufAny { + this := GoogleProtobufAny{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GoogleProtobufAny) 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 *GoogleProtobufAny) 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 *GoogleProtobufAny) 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 *GoogleProtobufAny) SetType(v *string) { + o.Type = v +} + +func (o GoogleProtobufAny) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["@type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +type NullableGoogleProtobufAny struct { + value *GoogleProtobufAny + isSet bool +} + +func (v NullableGoogleProtobufAny) Get() *GoogleProtobufAny { + return v.value +} + +func (v *NullableGoogleProtobufAny) Set(val *GoogleProtobufAny) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleProtobufAny) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleProtobufAny) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleProtobufAny(val *GoogleProtobufAny) *NullableGoogleProtobufAny { + return &NullableGoogleProtobufAny{value: val, isSet: true} +} + +func (v NullableGoogleProtobufAny) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleProtobufAny) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_header.go b/services/lbapplication/model_header.go new file mode 100644 index 000000000..bae66c09a --- /dev/null +++ b/services/lbapplication/model_header.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Header type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Header{} + +// Header struct for Header +type Header struct { + // Exact match for the header value. + ExactMatch *string `json:"exactMatch,omitempty"` + // Header name. + Name *string `json:"name,omitempty"` +} + +// NewHeader instantiates a new Header object +// This constructor will assign default values to properties that have it defined, +// 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 NewHeader() *Header { + this := Header{} + return &this +} + +// NewHeaderWithDefaults instantiates a new Header object +// This 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 NewHeaderWithDefaults() *Header { + this := Header{} + return &this +} + +// GetExactMatch returns the ExactMatch field value if set, zero value otherwise. +func (o *Header) GetExactMatch() *string { + if o == nil || IsNil(o.ExactMatch) { + var ret *string + return ret + } + return o.ExactMatch +} + +// GetExactMatchOk returns a tuple with the ExactMatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Header) GetExactMatchOk() (*string, bool) { + if o == nil || IsNil(o.ExactMatch) { + return nil, false + } + return o.ExactMatch, true +} + +// HasExactMatch returns a boolean if a field has been set. +func (o *Header) HasExactMatch() bool { + if o != nil && !IsNil(o.ExactMatch) { + return true + } + + return false +} + +// SetExactMatch gets a reference to the given string and assigns it to the ExactMatch field. +func (o *Header) SetExactMatch(v *string) { + o.ExactMatch = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Header) 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 *Header) 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 *Header) 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 *Header) SetName(v *string) { + o.Name = v +} + +func (o Header) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ExactMatch) { + toSerialize["exactMatch"] = o.ExactMatch + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableHeader struct { + value *Header + isSet bool +} + +func (v NullableHeader) Get() *Header { + return v.value +} + +func (v *NullableHeader) Set(val *Header) { + v.value = val + v.isSet = true +} + +func (v NullableHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHeader(val *Header) *NullableHeader { + return &NullableHeader{value: val, isSet: true} +} + +func (v NullableHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_http_config.go b/services/lbapplication/model_http_config.go new file mode 100644 index 000000000..73e481b65 --- /dev/null +++ b/services/lbapplication/model_http_config.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the HTTPConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HTTPConfig{} + +// HTTPConfig struct for HTTPConfig +type HTTPConfig struct { + Matcher *[]Matcher `json:"matcher,omitempty"` +} + +// NewHTTPConfig instantiates a new HTTPConfig object +// This constructor will assign default values to properties that have it defined, +// 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 NewHTTPConfig() *HTTPConfig { + this := HTTPConfig{} + return &this +} + +// NewHTTPConfigWithDefaults instantiates a new HTTPConfig object +// This 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 NewHTTPConfigWithDefaults() *HTTPConfig { + this := HTTPConfig{} + return &this +} + +// GetMatcher returns the Matcher field value if set, zero value otherwise. +func (o *HTTPConfig) GetMatcher() *[]Matcher { + if o == nil || IsNil(o.Matcher) { + var ret *[]Matcher + return ret + } + return o.Matcher +} + +// GetMatcherOk returns a tuple with the Matcher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HTTPConfig) GetMatcherOk() (*[]Matcher, bool) { + if o == nil || IsNil(o.Matcher) { + return nil, false + } + return o.Matcher, true +} + +// HasMatcher returns a boolean if a field has been set. +func (o *HTTPConfig) HasMatcher() bool { + if o != nil && !IsNil(o.Matcher) { + return true + } + + return false +} + +// SetMatcher gets a reference to the given []Matcher and assigns it to the Matcher field. +func (o *HTTPConfig) SetMatcher(v *[]Matcher) { + o.Matcher = v +} + +func (o HTTPConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Matcher) { + toSerialize["matcher"] = o.Matcher + } + return toSerialize, nil +} + +type NullableHTTPConfig struct { + value *HTTPConfig + isSet bool +} + +func (v NullableHTTPConfig) Get() *HTTPConfig { + return v.value +} + +func (v *NullableHTTPConfig) Set(val *HTTPConfig) { + v.value = val + v.isSet = true +} + +func (v NullableHTTPConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableHTTPConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHTTPConfig(val *HTTPConfig) *NullableHTTPConfig { + return &NullableHTTPConfig{value: val, isSet: true} +} + +func (v NullableHTTPConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHTTPConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_http_health_checks.go b/services/lbapplication/model_http_health_checks.go new file mode 100644 index 000000000..be8b0a257 --- /dev/null +++ b/services/lbapplication/model_http_health_checks.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the HttpHealthChecks type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpHealthChecks{} + +// HttpHealthChecks struct for HttpHealthChecks +type HttpHealthChecks struct { + // List of HTTP status codes that indicate a healthy response + OkStatuses *[]string `json:"okStatuses,omitempty"` + // Path to send the health check request to + Path *string `json:"path,omitempty"` +} + +// NewHttpHealthChecks instantiates a new HttpHealthChecks object +// This constructor will assign default values to properties that have it defined, +// 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 NewHttpHealthChecks() *HttpHealthChecks { + this := HttpHealthChecks{} + return &this +} + +// NewHttpHealthChecksWithDefaults instantiates a new HttpHealthChecks object +// This 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 NewHttpHealthChecksWithDefaults() *HttpHealthChecks { + this := HttpHealthChecks{} + return &this +} + +// GetOkStatuses returns the OkStatuses field value if set, zero value otherwise. +func (o *HttpHealthChecks) GetOkStatuses() *[]string { + if o == nil || IsNil(o.OkStatuses) { + var ret *[]string + return ret + } + return o.OkStatuses +} + +// GetOkStatusesOk returns a tuple with the OkStatuses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpHealthChecks) GetOkStatusesOk() (*[]string, bool) { + if o == nil || IsNil(o.OkStatuses) { + return nil, false + } + return o.OkStatuses, true +} + +// HasOkStatuses returns a boolean if a field has been set. +func (o *HttpHealthChecks) HasOkStatuses() bool { + if o != nil && !IsNil(o.OkStatuses) { + return true + } + + return false +} + +// SetOkStatuses gets a reference to the given []string and assigns it to the OkStatuses field. +func (o *HttpHealthChecks) SetOkStatuses(v *[]string) { + o.OkStatuses = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *HttpHealthChecks) GetPath() *string { + if o == nil || IsNil(o.Path) { + var ret *string + return ret + } + return o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpHealthChecks) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *HttpHealthChecks) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *HttpHealthChecks) SetPath(v *string) { + o.Path = v +} + +func (o HttpHealthChecks) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.OkStatuses) { + toSerialize["okStatuses"] = o.OkStatuses + } + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + return toSerialize, nil +} + +type NullableHttpHealthChecks struct { + value *HttpHealthChecks + isSet bool +} + +func (v NullableHttpHealthChecks) Get() *HttpHealthChecks { + return v.value +} + +func (v *NullableHttpHealthChecks) Set(val *HttpHealthChecks) { + v.value = val + v.isSet = true +} + +func (v NullableHttpHealthChecks) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpHealthChecks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpHealthChecks(val *HttpHealthChecks) *NullableHttpHealthChecks { + return &NullableHttpHealthChecks{value: val, isSet: true} +} + +func (v NullableHttpHealthChecks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpHealthChecks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_list_credentials_response.go b/services/lbapplication/model_list_credentials_response.go new file mode 100644 index 000000000..fec42f0a7 --- /dev/null +++ b/services/lbapplication/model_list_credentials_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ListCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCredentialsResponse{} + +// ListCredentialsResponse struct for ListCredentialsResponse +type ListCredentialsResponse struct { + Credentials *[]CredentialsResponse `json:"credentials,omitempty"` +} + +// NewListCredentialsResponse instantiates a new ListCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewListCredentialsResponse() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// NewListCredentialsResponseWithDefaults instantiates a new ListCredentialsResponse object +// This 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 NewListCredentialsResponseWithDefaults() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *ListCredentialsResponse) GetCredentials() *[]CredentialsResponse { + if o == nil || IsNil(o.Credentials) { + var ret *[]CredentialsResponse + return ret + } + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCredentialsResponse) GetCredentialsOk() (*[]CredentialsResponse, bool) { + if o == nil || IsNil(o.Credentials) { + return nil, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *ListCredentialsResponse) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given []CredentialsResponse and assigns it to the Credentials field. +func (o *ListCredentialsResponse) SetCredentials(v *[]CredentialsResponse) { + o.Credentials = v +} + +func (o ListCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + return toSerialize, nil +} + +type NullableListCredentialsResponse struct { + value *ListCredentialsResponse + isSet bool +} + +func (v NullableListCredentialsResponse) Get() *ListCredentialsResponse { + return v.value +} + +func (v *NullableListCredentialsResponse) Set(val *ListCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCredentialsResponse(val *ListCredentialsResponse) *NullableListCredentialsResponse { + return &NullableListCredentialsResponse{value: val, isSet: true} +} + +func (v NullableListCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_list_load_balancers_response.go b/services/lbapplication/model_list_load_balancers_response.go new file mode 100644 index 000000000..d599bf13b --- /dev/null +++ b/services/lbapplication/model_list_load_balancers_response.go @@ -0,0 +1,153 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ListLoadBalancersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListLoadBalancersResponse{} + +// ListLoadBalancersResponse struct for ListLoadBalancersResponse +type ListLoadBalancersResponse struct { + LoadBalancers *[]LoadBalancer `json:"loadBalancers,omitempty"` + // Continue token from the ListLoadBalancerResponse with Limit option + NextPageId *string `json:"nextPageId,omitempty"` +} + +// NewListLoadBalancersResponse instantiates a new ListLoadBalancersResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewListLoadBalancersResponse() *ListLoadBalancersResponse { + this := ListLoadBalancersResponse{} + return &this +} + +// NewListLoadBalancersResponseWithDefaults instantiates a new ListLoadBalancersResponse object +// This 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 NewListLoadBalancersResponseWithDefaults() *ListLoadBalancersResponse { + this := ListLoadBalancersResponse{} + return &this +} + +// GetLoadBalancers returns the LoadBalancers field value if set, zero value otherwise. +func (o *ListLoadBalancersResponse) GetLoadBalancers() *[]LoadBalancer { + if o == nil || IsNil(o.LoadBalancers) { + var ret *[]LoadBalancer + return ret + } + return o.LoadBalancers +} + +// GetLoadBalancersOk returns a tuple with the LoadBalancers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListLoadBalancersResponse) GetLoadBalancersOk() (*[]LoadBalancer, bool) { + if o == nil || IsNil(o.LoadBalancers) { + return nil, false + } + return o.LoadBalancers, true +} + +// HasLoadBalancers returns a boolean if a field has been set. +func (o *ListLoadBalancersResponse) HasLoadBalancers() bool { + if o != nil && !IsNil(o.LoadBalancers) { + return true + } + + return false +} + +// SetLoadBalancers gets a reference to the given []LoadBalancer and assigns it to the LoadBalancers field. +func (o *ListLoadBalancersResponse) SetLoadBalancers(v *[]LoadBalancer) { + o.LoadBalancers = v +} + +// GetNextPageId returns the NextPageId field value if set, zero value otherwise. +func (o *ListLoadBalancersResponse) GetNextPageId() *string { + if o == nil || IsNil(o.NextPageId) { + var ret *string + return ret + } + return o.NextPageId +} + +// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListLoadBalancersResponse) GetNextPageIdOk() (*string, bool) { + if o == nil || IsNil(o.NextPageId) { + return nil, false + } + return o.NextPageId, true +} + +// HasNextPageId returns a boolean if a field has been set. +func (o *ListLoadBalancersResponse) HasNextPageId() bool { + if o != nil && !IsNil(o.NextPageId) { + return true + } + + return false +} + +// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field. +func (o *ListLoadBalancersResponse) SetNextPageId(v *string) { + o.NextPageId = v +} + +func (o ListLoadBalancersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.LoadBalancers) { + toSerialize["loadBalancers"] = o.LoadBalancers + } + if !IsNil(o.NextPageId) { + toSerialize["nextPageId"] = o.NextPageId + } + return toSerialize, nil +} + +type NullableListLoadBalancersResponse struct { + value *ListLoadBalancersResponse + isSet bool +} + +func (v NullableListLoadBalancersResponse) Get() *ListLoadBalancersResponse { + return v.value +} + +func (v *NullableListLoadBalancersResponse) Set(val *ListLoadBalancersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListLoadBalancersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListLoadBalancersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListLoadBalancersResponse(val *ListLoadBalancersResponse) *NullableListLoadBalancersResponse { + return &NullableListLoadBalancersResponse{value: val, isSet: true} +} + +func (v NullableListLoadBalancersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListLoadBalancersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_list_plans_response.go b/services/lbapplication/model_list_plans_response.go new file mode 100644 index 000000000..612dfee7b --- /dev/null +++ b/services/lbapplication/model_list_plans_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ListPlansResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListPlansResponse{} + +// ListPlansResponse struct for ListPlansResponse +type ListPlansResponse struct { + ValidPlans *[]PlanDetails `json:"validPlans,omitempty"` +} + +// NewListPlansResponse instantiates a new ListPlansResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewListPlansResponse() *ListPlansResponse { + this := ListPlansResponse{} + return &this +} + +// NewListPlansResponseWithDefaults instantiates a new ListPlansResponse object +// This 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 NewListPlansResponseWithDefaults() *ListPlansResponse { + this := ListPlansResponse{} + return &this +} + +// GetValidPlans returns the ValidPlans field value if set, zero value otherwise. +func (o *ListPlansResponse) GetValidPlans() *[]PlanDetails { + if o == nil || IsNil(o.ValidPlans) { + var ret *[]PlanDetails + return ret + } + return o.ValidPlans +} + +// GetValidPlansOk returns a tuple with the ValidPlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListPlansResponse) GetValidPlansOk() (*[]PlanDetails, bool) { + if o == nil || IsNil(o.ValidPlans) { + return nil, false + } + return o.ValidPlans, true +} + +// HasValidPlans returns a boolean if a field has been set. +func (o *ListPlansResponse) HasValidPlans() bool { + if o != nil && !IsNil(o.ValidPlans) { + return true + } + + return false +} + +// SetValidPlans gets a reference to the given []PlanDetails and assigns it to the ValidPlans field. +func (o *ListPlansResponse) SetValidPlans(v *[]PlanDetails) { + o.ValidPlans = v +} + +func (o ListPlansResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ValidPlans) { + toSerialize["validPlans"] = o.ValidPlans + } + return toSerialize, nil +} + +type NullableListPlansResponse struct { + value *ListPlansResponse + isSet bool +} + +func (v NullableListPlansResponse) Get() *ListPlansResponse { + return v.value +} + +func (v *NullableListPlansResponse) Set(val *ListPlansResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListPlansResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListPlansResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListPlansResponse(val *ListPlansResponse) *NullableListPlansResponse { + return &NullableListPlansResponse{value: val, isSet: true} +} + +func (v NullableListPlansResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListPlansResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_listener.go b/services/lbapplication/model_listener.go new file mode 100644 index 000000000..46d6d790b --- /dev/null +++ b/services/lbapplication/model_listener.go @@ -0,0 +1,336 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Listener type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Listener{} + +// Listener struct for Listener +type Listener struct { + DisplayName *string `json:"displayName,omitempty"` + Http *map[string]interface{} `json:"http,omitempty"` + Https *ProtocolOptionsHTTPS `json:"https,omitempty"` + // Will be used to reference a listener and will replace display name in the future. Currently uses - as the name if no display name is given. + Name *string `json:"name,omitempty"` + // Port number where we listen for traffic + Port *int64 `json:"port,omitempty"` + // Protocol is the highest network protocol we understand to load balance. Currently PROTOCOL_HTTP and PROTOCOL_HTTPS are supported. + Protocol *string `json:"protocol,omitempty"` + // Rules define the routing parameters for the HTTP and HTTPS listeners. + Rules *[]Rule `json:"rules,omitempty"` +} + +// NewListener instantiates a new Listener object +// This constructor will assign default values to properties that have it defined, +// 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 NewListener() *Listener { + this := Listener{} + return &this +} + +// NewListenerWithDefaults instantiates a new Listener object +// This 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 NewListenerWithDefaults() *Listener { + this := Listener{} + return &this +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *Listener) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *Listener) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *Listener) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetHttp returns the Http field value if set, zero value otherwise. +func (o *Listener) GetHttp() *map[string]interface{} { + if o == nil || IsNil(o.Http) { + var ret *map[string]interface{} + return ret + } + return o.Http +} + +// GetHttpOk returns a tuple with the Http field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetHttpOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Http) { + return &map[string]interface{}{}, false + } + return o.Http, true +} + +// HasHttp returns a boolean if a field has been set. +func (o *Listener) HasHttp() bool { + if o != nil && !IsNil(o.Http) { + return true + } + + return false +} + +// SetHttp gets a reference to the given map[string]interface{} and assigns it to the Http field. +func (o *Listener) SetHttp(v *map[string]interface{}) { + o.Http = v +} + +// GetHttps returns the Https field value if set, zero value otherwise. +func (o *Listener) GetHttps() *ProtocolOptionsHTTPS { + if o == nil || IsNil(o.Https) { + var ret *ProtocolOptionsHTTPS + return ret + } + return o.Https +} + +// GetHttpsOk returns a tuple with the Https field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetHttpsOk() (*ProtocolOptionsHTTPS, bool) { + if o == nil || IsNil(o.Https) { + return nil, false + } + return o.Https, true +} + +// HasHttps returns a boolean if a field has been set. +func (o *Listener) HasHttps() bool { + if o != nil && !IsNil(o.Https) { + return true + } + + return false +} + +// SetHttps gets a reference to the given ProtocolOptionsHTTPS and assigns it to the Https field. +func (o *Listener) SetHttps(v *ProtocolOptionsHTTPS) { + o.Https = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Listener) 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 *Listener) 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 *Listener) 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 *Listener) SetName(v *string) { + o.Name = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *Listener) GetPort() *int64 { + if o == nil || IsNil(o.Port) { + var ret *int64 + 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 *Listener) GetPortOk() (*int64, 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 *Listener) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int64 and assigns it to the Port field. +func (o *Listener) SetPort(v *int64) { + o.Port = v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *Listener) GetProtocol() *string { + if o == nil || IsNil(o.Protocol) { + var ret *string + return ret + } + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetProtocolOk() (*string, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *Listener) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given string and assigns it to the Protocol field. +func (o *Listener) SetProtocol(v *string) { + o.Protocol = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *Listener) GetRules() *[]Rule { + if o == nil || IsNil(o.Rules) { + var ret *[]Rule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetRulesOk() (*[]Rule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *Listener) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []Rule and assigns it to the Rules field. +func (o *Listener) SetRules(v *[]Rule) { + o.Rules = v +} + +func (o Listener) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Http) { + toSerialize["http"] = o.Http + } + if !IsNil(o.Https) { + toSerialize["https"] = o.Https + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + return toSerialize, nil +} + +type NullableListener struct { + value *Listener + isSet bool +} + +func (v NullableListener) Get() *Listener { + return v.value +} + +func (v *NullableListener) Set(val *Listener) { + v.value = val + v.isSet = true +} + +func (v NullableListener) IsSet() bool { + return v.isSet +} + +func (v *NullableListener) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListener(val *Listener) *NullableListener { + return &NullableListener{value: val, isSet: true} +} + +func (v NullableListener) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListener) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_load_balancer.go b/services/lbapplication/model_load_balancer.go new file mode 100644 index 000000000..476d8bd26 --- /dev/null +++ b/services/lbapplication/model_load_balancer.go @@ -0,0 +1,485 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadBalancer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadBalancer{} + +// LoadBalancer struct for LoadBalancer +type LoadBalancer struct { + // Reports all errors a application load balancer has. + Errors *[]LoadBalancerError `json:"errors,omitempty"` + // External application load balancer IP address where this application load balancer is exposed. Not changeable after creation. + ExternalAddress *string `json:"externalAddress,omitempty"` + // There is a maximum listener count of 20. + Listeners *[]Listener `json:"listeners,omitempty"` + // Application Load Balancer name. Not changeable after creation. + Name *string `json:"name,omitempty"` + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. + Networks *[]Network `json:"networks,omitempty"` + Options *LoadBalancerOptions `json:"options,omitempty"` + // Service Plan configures the size of the Application Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. + PlanId *string `json:"planId,omitempty"` + // Transient private application load balancer IP address that can change any time. + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *string `json:"status,omitempty"` + // List of all target pools which will be used in the application load balancer. Limited to 20. + TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Application Load Balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this application load balancer resource that changes during updates of the load balancers. On updates this field specified the application load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a application load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of application load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` +} + +// NewLoadBalancer instantiates a new LoadBalancer object +// This constructor will assign default values to properties that have it defined, +// 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 NewLoadBalancer() *LoadBalancer { + this := LoadBalancer{} + return &this +} + +// NewLoadBalancerWithDefaults instantiates a new LoadBalancer object +// This 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 NewLoadBalancerWithDefaults() *LoadBalancer { + this := LoadBalancer{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *LoadBalancer) GetErrors() *[]LoadBalancerError { + if o == nil || IsNil(o.Errors) { + var ret *[]LoadBalancerError + 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 *LoadBalancer) GetErrorsOk() (*[]LoadBalancerError, 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 *LoadBalancer) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []LoadBalancerError and assigns it to the Errors field. +func (o *LoadBalancer) SetErrors(v *[]LoadBalancerError) { + o.Errors = v +} + +// GetExternalAddress returns the ExternalAddress field value if set, zero value otherwise. +func (o *LoadBalancer) GetExternalAddress() *string { + if o == nil || IsNil(o.ExternalAddress) { + var ret *string + return ret + } + return o.ExternalAddress +} + +// GetExternalAddressOk returns a tuple with the ExternalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetExternalAddressOk() (*string, bool) { + if o == nil || IsNil(o.ExternalAddress) { + return nil, false + } + return o.ExternalAddress, true +} + +// HasExternalAddress returns a boolean if a field has been set. +func (o *LoadBalancer) HasExternalAddress() bool { + if o != nil && !IsNil(o.ExternalAddress) { + return true + } + + return false +} + +// SetExternalAddress gets a reference to the given string and assigns it to the ExternalAddress field. +func (o *LoadBalancer) SetExternalAddress(v *string) { + o.ExternalAddress = v +} + +// GetListeners returns the Listeners field value if set, zero value otherwise. +func (o *LoadBalancer) GetListeners() *[]Listener { + if o == nil || IsNil(o.Listeners) { + var ret *[]Listener + return ret + } + return o.Listeners +} + +// GetListenersOk returns a tuple with the Listeners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetListenersOk() (*[]Listener, bool) { + if o == nil || IsNil(o.Listeners) { + return nil, false + } + return o.Listeners, true +} + +// HasListeners returns a boolean if a field has been set. +func (o *LoadBalancer) HasListeners() bool { + if o != nil && !IsNil(o.Listeners) { + return true + } + + return false +} + +// SetListeners gets a reference to the given []Listener and assigns it to the Listeners field. +func (o *LoadBalancer) SetListeners(v *[]Listener) { + o.Listeners = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LoadBalancer) 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 *LoadBalancer) 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 *LoadBalancer) 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 *LoadBalancer) SetName(v *string) { + o.Name = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *LoadBalancer) GetNetworks() *[]Network { + if o == nil || IsNil(o.Networks) { + var ret *[]Network + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetNetworksOk() (*[]Network, bool) { + if o == nil || IsNil(o.Networks) { + return nil, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *LoadBalancer) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given []Network and assigns it to the Networks field. +func (o *LoadBalancer) SetNetworks(v *[]Network) { + o.Networks = v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *LoadBalancer) GetOptions() *LoadBalancerOptions { + if o == nil || IsNil(o.Options) { + var ret *LoadBalancerOptions + 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 *LoadBalancer) GetOptionsOk() (*LoadBalancerOptions, 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 *LoadBalancer) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given LoadBalancerOptions and assigns it to the Options field. +func (o *LoadBalancer) SetOptions(v *LoadBalancerOptions) { + o.Options = v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *LoadBalancer) 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 *LoadBalancer) 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 *LoadBalancer) 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 *LoadBalancer) SetPlanId(v *string) { + o.PlanId = v +} + +// GetPrivateAddress returns the PrivateAddress field value if set, zero value otherwise. +func (o *LoadBalancer) GetPrivateAddress() *string { + if o == nil || IsNil(o.PrivateAddress) { + var ret *string + return ret + } + return o.PrivateAddress +} + +// GetPrivateAddressOk returns a tuple with the PrivateAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetPrivateAddressOk() (*string, bool) { + if o == nil || IsNil(o.PrivateAddress) { + return nil, false + } + return o.PrivateAddress, true +} + +// HasPrivateAddress returns a boolean if a field has been set. +func (o *LoadBalancer) HasPrivateAddress() bool { + if o != nil && !IsNil(o.PrivateAddress) { + return true + } + + return false +} + +// SetPrivateAddress gets a reference to the given string and assigns it to the PrivateAddress field. +func (o *LoadBalancer) SetPrivateAddress(v *string) { + o.PrivateAddress = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *LoadBalancer) 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 *LoadBalancer) 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 *LoadBalancer) 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 *LoadBalancer) SetStatus(v *string) { + o.Status = v +} + +// GetTargetPools returns the TargetPools field value if set, zero value otherwise. +func (o *LoadBalancer) GetTargetPools() *[]TargetPool { + if o == nil || IsNil(o.TargetPools) { + var ret *[]TargetPool + return ret + } + return o.TargetPools +} + +// GetTargetPoolsOk returns a tuple with the TargetPools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetTargetPoolsOk() (*[]TargetPool, bool) { + if o == nil || IsNil(o.TargetPools) { + return nil, false + } + return o.TargetPools, true +} + +// HasTargetPools returns a boolean if a field has been set. +func (o *LoadBalancer) HasTargetPools() bool { + if o != nil && !IsNil(o.TargetPools) { + return true + } + + return false +} + +// SetTargetPools gets a reference to the given []TargetPool and assigns it to the TargetPools field. +func (o *LoadBalancer) SetTargetPools(v *[]TargetPool) { + o.TargetPools = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *LoadBalancer) 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 *LoadBalancer) 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 *LoadBalancer) 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 *LoadBalancer) SetVersion(v *string) { + o.Version = v +} + +func (o LoadBalancer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.ExternalAddress) { + toSerialize["externalAddress"] = o.ExternalAddress + } + if !IsNil(o.Listeners) { + toSerialize["listeners"] = o.Listeners + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + if !IsNil(o.PrivateAddress) { + toSerialize["privateAddress"] = o.PrivateAddress + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TargetPools) { + toSerialize["targetPools"] = o.TargetPools + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableLoadBalancer struct { + value *LoadBalancer + isSet bool +} + +func (v NullableLoadBalancer) Get() *LoadBalancer { + return v.value +} + +func (v *NullableLoadBalancer) Set(val *LoadBalancer) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancer) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancer(val *LoadBalancer) *NullableLoadBalancer { + return &NullableLoadBalancer{value: val, isSet: true} +} + +func (v NullableLoadBalancer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_load_balancer_error.go b/services/lbapplication/model_load_balancer_error.go new file mode 100644 index 000000000..ffbfdabb2 --- /dev/null +++ b/services/lbapplication/model_load_balancer_error.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadBalancerError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadBalancerError{} + +// LoadBalancerError struct for LoadBalancerError +type LoadBalancerError struct { + // The error description contains additional helpful user information to fix the error state of the application load balancer. For example the IP 45.135.247.139 does not exist in the project, then the description will report: Floating IP \"45.135.247.139\" could not be found. + Description *string `json:"description,omitempty"` + // The error type specifies which part of the application load balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the application load balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error. + Type *string `json:"type,omitempty"` +} + +// NewLoadBalancerError instantiates a new LoadBalancerError object +// This constructor will assign default values to properties that have it defined, +// 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 NewLoadBalancerError() *LoadBalancerError { + this := LoadBalancerError{} + return &this +} + +// NewLoadBalancerErrorWithDefaults instantiates a new LoadBalancerError object +// This 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 NewLoadBalancerErrorWithDefaults() *LoadBalancerError { + this := LoadBalancerError{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LoadBalancerError) 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 *LoadBalancerError) 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 *LoadBalancerError) 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 *LoadBalancerError) SetDescription(v *string) { + o.Description = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LoadBalancerError) 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 *LoadBalancerError) 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 *LoadBalancerError) 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 *LoadBalancerError) SetType(v *string) { + o.Type = v +} + +func (o LoadBalancerError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableLoadBalancerError struct { + value *LoadBalancerError + isSet bool +} + +func (v NullableLoadBalancerError) Get() *LoadBalancerError { + return v.value +} + +func (v *NullableLoadBalancerError) Set(val *LoadBalancerError) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerError) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerError(val *LoadBalancerError) *NullableLoadBalancerError { + return &NullableLoadBalancerError{value: val, isSet: true} +} + +func (v NullableLoadBalancerError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_load_balancer_options.go b/services/lbapplication/model_load_balancer_options.go new file mode 100644 index 000000000..58f200228 --- /dev/null +++ b/services/lbapplication/model_load_balancer_options.go @@ -0,0 +1,225 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadBalancerOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadBalancerOptions{} + +// LoadBalancerOptions Defines any optional functionality you want to have enabled on your application load balancer. +type LoadBalancerOptions struct { + AccessControl *LoadbalancerOptionAccessControl `json:"accessControl,omitempty"` + EphemeralAddress *bool `json:"ephemeralAddress,omitempty"` + Observability *LoadbalancerOptionObservability `json:"observability,omitempty"` + // Application Load Balancer is accessible only via a private network ip address. Not changeable after creation. + PrivateNetworkOnly *bool `json:"privateNetworkOnly,omitempty"` +} + +// NewLoadBalancerOptions instantiates a new LoadBalancerOptions object +// This constructor will assign default values to properties that have it defined, +// 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 NewLoadBalancerOptions() *LoadBalancerOptions { + this := LoadBalancerOptions{} + return &this +} + +// NewLoadBalancerOptionsWithDefaults instantiates a new LoadBalancerOptions object +// This 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 NewLoadBalancerOptionsWithDefaults() *LoadBalancerOptions { + this := LoadBalancerOptions{} + return &this +} + +// GetAccessControl returns the AccessControl field value if set, zero value otherwise. +func (o *LoadBalancerOptions) GetAccessControl() *LoadbalancerOptionAccessControl { + if o == nil || IsNil(o.AccessControl) { + var ret *LoadbalancerOptionAccessControl + return ret + } + return o.AccessControl +} + +// GetAccessControlOk returns a tuple with the AccessControl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerOptions) GetAccessControlOk() (*LoadbalancerOptionAccessControl, bool) { + if o == nil || IsNil(o.AccessControl) { + return nil, false + } + return o.AccessControl, true +} + +// HasAccessControl returns a boolean if a field has been set. +func (o *LoadBalancerOptions) HasAccessControl() bool { + if o != nil && !IsNil(o.AccessControl) { + return true + } + + return false +} + +// SetAccessControl gets a reference to the given LoadbalancerOptionAccessControl and assigns it to the AccessControl field. +func (o *LoadBalancerOptions) SetAccessControl(v *LoadbalancerOptionAccessControl) { + o.AccessControl = v +} + +// GetEphemeralAddress returns the EphemeralAddress field value if set, zero value otherwise. +func (o *LoadBalancerOptions) GetEphemeralAddress() *bool { + if o == nil || IsNil(o.EphemeralAddress) { + var ret *bool + return ret + } + return o.EphemeralAddress +} + +// GetEphemeralAddressOk returns a tuple with the EphemeralAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerOptions) GetEphemeralAddressOk() (*bool, bool) { + if o == nil || IsNil(o.EphemeralAddress) { + return nil, false + } + return o.EphemeralAddress, true +} + +// HasEphemeralAddress returns a boolean if a field has been set. +func (o *LoadBalancerOptions) HasEphemeralAddress() bool { + if o != nil && !IsNil(o.EphemeralAddress) { + return true + } + + return false +} + +// SetEphemeralAddress gets a reference to the given bool and assigns it to the EphemeralAddress field. +func (o *LoadBalancerOptions) SetEphemeralAddress(v *bool) { + o.EphemeralAddress = v +} + +// GetObservability returns the Observability field value if set, zero value otherwise. +func (o *LoadBalancerOptions) GetObservability() *LoadbalancerOptionObservability { + if o == nil || IsNil(o.Observability) { + var ret *LoadbalancerOptionObservability + return ret + } + return o.Observability +} + +// GetObservabilityOk returns a tuple with the Observability field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerOptions) GetObservabilityOk() (*LoadbalancerOptionObservability, bool) { + if o == nil || IsNil(o.Observability) { + return nil, false + } + return o.Observability, true +} + +// HasObservability returns a boolean if a field has been set. +func (o *LoadBalancerOptions) HasObservability() bool { + if o != nil && !IsNil(o.Observability) { + return true + } + + return false +} + +// SetObservability gets a reference to the given LoadbalancerOptionObservability and assigns it to the Observability field. +func (o *LoadBalancerOptions) SetObservability(v *LoadbalancerOptionObservability) { + o.Observability = v +} + +// GetPrivateNetworkOnly returns the PrivateNetworkOnly field value if set, zero value otherwise. +func (o *LoadBalancerOptions) GetPrivateNetworkOnly() *bool { + if o == nil || IsNil(o.PrivateNetworkOnly) { + var ret *bool + return ret + } + return o.PrivateNetworkOnly +} + +// GetPrivateNetworkOnlyOk returns a tuple with the PrivateNetworkOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerOptions) GetPrivateNetworkOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.PrivateNetworkOnly) { + return nil, false + } + return o.PrivateNetworkOnly, true +} + +// HasPrivateNetworkOnly returns a boolean if a field has been set. +func (o *LoadBalancerOptions) HasPrivateNetworkOnly() bool { + if o != nil && !IsNil(o.PrivateNetworkOnly) { + return true + } + + return false +} + +// SetPrivateNetworkOnly gets a reference to the given bool and assigns it to the PrivateNetworkOnly field. +func (o *LoadBalancerOptions) SetPrivateNetworkOnly(v *bool) { + o.PrivateNetworkOnly = v +} + +func (o LoadBalancerOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessControl) { + toSerialize["accessControl"] = o.AccessControl + } + if !IsNil(o.EphemeralAddress) { + toSerialize["ephemeralAddress"] = o.EphemeralAddress + } + if !IsNil(o.Observability) { + toSerialize["observability"] = o.Observability + } + if !IsNil(o.PrivateNetworkOnly) { + toSerialize["privateNetworkOnly"] = o.PrivateNetworkOnly + } + return toSerialize, nil +} + +type NullableLoadBalancerOptions struct { + value *LoadBalancerOptions + isSet bool +} + +func (v NullableLoadBalancerOptions) Get() *LoadBalancerOptions { + return v.value +} + +func (v *NullableLoadBalancerOptions) Set(val *LoadBalancerOptions) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerOptions(val *LoadBalancerOptions) *NullableLoadBalancerOptions { + return &NullableLoadBalancerOptions{value: val, isSet: true} +} + +func (v NullableLoadBalancerOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_loadbalancer_option_access_control.go b/services/lbapplication/model_loadbalancer_option_access_control.go new file mode 100644 index 000000000..837d64342 --- /dev/null +++ b/services/lbapplication/model_loadbalancer_option_access_control.go @@ -0,0 +1,117 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadbalancerOptionAccessControl type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadbalancerOptionAccessControl{} + +// LoadbalancerOptionAccessControl Use this option to limit the IP ranges that can use the application load balancer. +type LoadbalancerOptionAccessControl struct { + // Application Load Balancer is accessible only from an IP address in this range + AllowedSourceRanges *[]string `json:"allowedSourceRanges,omitempty"` +} + +// NewLoadbalancerOptionAccessControl instantiates a new LoadbalancerOptionAccessControl object +// This constructor will assign default values to properties that have it defined, +// 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 NewLoadbalancerOptionAccessControl() *LoadbalancerOptionAccessControl { + this := LoadbalancerOptionAccessControl{} + return &this +} + +// NewLoadbalancerOptionAccessControlWithDefaults instantiates a new LoadbalancerOptionAccessControl object +// This 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 NewLoadbalancerOptionAccessControlWithDefaults() *LoadbalancerOptionAccessControl { + this := LoadbalancerOptionAccessControl{} + return &this +} + +// GetAllowedSourceRanges returns the AllowedSourceRanges field value if set, zero value otherwise. +func (o *LoadbalancerOptionAccessControl) GetAllowedSourceRanges() *[]string { + if o == nil || IsNil(o.AllowedSourceRanges) { + var ret *[]string + return ret + } + return o.AllowedSourceRanges +} + +// GetAllowedSourceRangesOk returns a tuple with the AllowedSourceRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionAccessControl) GetAllowedSourceRangesOk() (*[]string, bool) { + if o == nil || IsNil(o.AllowedSourceRanges) { + return nil, false + } + return o.AllowedSourceRanges, true +} + +// HasAllowedSourceRanges returns a boolean if a field has been set. +func (o *LoadbalancerOptionAccessControl) HasAllowedSourceRanges() bool { + if o != nil && !IsNil(o.AllowedSourceRanges) { + return true + } + + return false +} + +// SetAllowedSourceRanges gets a reference to the given []string and assigns it to the AllowedSourceRanges field. +func (o *LoadbalancerOptionAccessControl) SetAllowedSourceRanges(v *[]string) { + o.AllowedSourceRanges = v +} + +func (o LoadbalancerOptionAccessControl) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedSourceRanges) { + toSerialize["allowedSourceRanges"] = o.AllowedSourceRanges + } + return toSerialize, nil +} + +type NullableLoadbalancerOptionAccessControl struct { + value *LoadbalancerOptionAccessControl + isSet bool +} + +func (v NullableLoadbalancerOptionAccessControl) Get() *LoadbalancerOptionAccessControl { + return v.value +} + +func (v *NullableLoadbalancerOptionAccessControl) Set(val *LoadbalancerOptionAccessControl) { + v.value = val + v.isSet = true +} + +func (v NullableLoadbalancerOptionAccessControl) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadbalancerOptionAccessControl) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadbalancerOptionAccessControl(val *LoadbalancerOptionAccessControl) *NullableLoadbalancerOptionAccessControl { + return &NullableLoadbalancerOptionAccessControl{value: val, isSet: true} +} + +func (v NullableLoadbalancerOptionAccessControl) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadbalancerOptionAccessControl) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_loadbalancer_option_logs.go b/services/lbapplication/model_loadbalancer_option_logs.go new file mode 100644 index 000000000..341116e32 --- /dev/null +++ b/services/lbapplication/model_loadbalancer_option_logs.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadbalancerOptionLogs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadbalancerOptionLogs{} + +// LoadbalancerOptionLogs struct for LoadbalancerOptionLogs +type LoadbalancerOptionLogs struct { + // Credentials reference for logging. This reference is created via the observability create endpoint and the credential needs to contain the basic auth username and password for the logging solution the push URL points to. Then this enables monitoring via remote write for the Application Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // The ARGUS/Loki remote write Push URL you want the logs to be shipped to. + PushUrl *string `json:"pushUrl,omitempty"` +} + +// NewLoadbalancerOptionLogs instantiates a new LoadbalancerOptionLogs object +// This constructor will assign default values to properties that have it defined, +// 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 NewLoadbalancerOptionLogs() *LoadbalancerOptionLogs { + this := LoadbalancerOptionLogs{} + return &this +} + +// NewLoadbalancerOptionLogsWithDefaults instantiates a new LoadbalancerOptionLogs object +// This 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 NewLoadbalancerOptionLogsWithDefaults() *LoadbalancerOptionLogs { + this := LoadbalancerOptionLogs{} + return &this +} + +// GetCredentialsRef returns the CredentialsRef field value if set, zero value otherwise. +func (o *LoadbalancerOptionLogs) GetCredentialsRef() *string { + if o == nil || IsNil(o.CredentialsRef) { + var ret *string + return ret + } + return o.CredentialsRef +} + +// GetCredentialsRefOk returns a tuple with the CredentialsRef field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionLogs) GetCredentialsRefOk() (*string, bool) { + if o == nil || IsNil(o.CredentialsRef) { + return nil, false + } + return o.CredentialsRef, true +} + +// HasCredentialsRef returns a boolean if a field has been set. +func (o *LoadbalancerOptionLogs) HasCredentialsRef() bool { + if o != nil && !IsNil(o.CredentialsRef) { + return true + } + + return false +} + +// SetCredentialsRef gets a reference to the given string and assigns it to the CredentialsRef field. +func (o *LoadbalancerOptionLogs) SetCredentialsRef(v *string) { + o.CredentialsRef = v +} + +// GetPushUrl returns the PushUrl field value if set, zero value otherwise. +func (o *LoadbalancerOptionLogs) GetPushUrl() *string { + if o == nil || IsNil(o.PushUrl) { + var ret *string + return ret + } + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionLogs) GetPushUrlOk() (*string, bool) { + if o == nil || IsNil(o.PushUrl) { + return nil, false + } + return o.PushUrl, true +} + +// HasPushUrl returns a boolean if a field has been set. +func (o *LoadbalancerOptionLogs) HasPushUrl() bool { + if o != nil && !IsNil(o.PushUrl) { + return true + } + + return false +} + +// SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. +func (o *LoadbalancerOptionLogs) SetPushUrl(v *string) { + o.PushUrl = v +} + +func (o LoadbalancerOptionLogs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CredentialsRef) { + toSerialize["credentialsRef"] = o.CredentialsRef + } + if !IsNil(o.PushUrl) { + toSerialize["pushUrl"] = o.PushUrl + } + return toSerialize, nil +} + +type NullableLoadbalancerOptionLogs struct { + value *LoadbalancerOptionLogs + isSet bool +} + +func (v NullableLoadbalancerOptionLogs) Get() *LoadbalancerOptionLogs { + return v.value +} + +func (v *NullableLoadbalancerOptionLogs) Set(val *LoadbalancerOptionLogs) { + v.value = val + v.isSet = true +} + +func (v NullableLoadbalancerOptionLogs) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadbalancerOptionLogs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadbalancerOptionLogs(val *LoadbalancerOptionLogs) *NullableLoadbalancerOptionLogs { + return &NullableLoadbalancerOptionLogs{value: val, isSet: true} +} + +func (v NullableLoadbalancerOptionLogs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadbalancerOptionLogs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_loadbalancer_option_metrics.go b/services/lbapplication/model_loadbalancer_option_metrics.go new file mode 100644 index 000000000..a79db913b --- /dev/null +++ b/services/lbapplication/model_loadbalancer_option_metrics.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadbalancerOptionMetrics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadbalancerOptionMetrics{} + +// LoadbalancerOptionMetrics struct for LoadbalancerOptionMetrics +type LoadbalancerOptionMetrics struct { + // Credentials reference for metrics. This reference is created via the observability create endpoint and the credential needs to contain the basic auth username and password for the metrics solution the push URL points to. Then this enables monitoring via remote write for the Application Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // The ARGUS/Prometheus remote write Push URL you want the metrics to be shipped to. + PushUrl *string `json:"pushUrl,omitempty"` +} + +// NewLoadbalancerOptionMetrics instantiates a new LoadbalancerOptionMetrics object +// This constructor will assign default values to properties that have it defined, +// 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 NewLoadbalancerOptionMetrics() *LoadbalancerOptionMetrics { + this := LoadbalancerOptionMetrics{} + return &this +} + +// NewLoadbalancerOptionMetricsWithDefaults instantiates a new LoadbalancerOptionMetrics object +// This 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 NewLoadbalancerOptionMetricsWithDefaults() *LoadbalancerOptionMetrics { + this := LoadbalancerOptionMetrics{} + return &this +} + +// GetCredentialsRef returns the CredentialsRef field value if set, zero value otherwise. +func (o *LoadbalancerOptionMetrics) GetCredentialsRef() *string { + if o == nil || IsNil(o.CredentialsRef) { + var ret *string + return ret + } + return o.CredentialsRef +} + +// GetCredentialsRefOk returns a tuple with the CredentialsRef field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionMetrics) GetCredentialsRefOk() (*string, bool) { + if o == nil || IsNil(o.CredentialsRef) { + return nil, false + } + return o.CredentialsRef, true +} + +// HasCredentialsRef returns a boolean if a field has been set. +func (o *LoadbalancerOptionMetrics) HasCredentialsRef() bool { + if o != nil && !IsNil(o.CredentialsRef) { + return true + } + + return false +} + +// SetCredentialsRef gets a reference to the given string and assigns it to the CredentialsRef field. +func (o *LoadbalancerOptionMetrics) SetCredentialsRef(v *string) { + o.CredentialsRef = v +} + +// GetPushUrl returns the PushUrl field value if set, zero value otherwise. +func (o *LoadbalancerOptionMetrics) GetPushUrl() *string { + if o == nil || IsNil(o.PushUrl) { + var ret *string + return ret + } + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionMetrics) GetPushUrlOk() (*string, bool) { + if o == nil || IsNil(o.PushUrl) { + return nil, false + } + return o.PushUrl, true +} + +// HasPushUrl returns a boolean if a field has been set. +func (o *LoadbalancerOptionMetrics) HasPushUrl() bool { + if o != nil && !IsNil(o.PushUrl) { + return true + } + + return false +} + +// SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. +func (o *LoadbalancerOptionMetrics) SetPushUrl(v *string) { + o.PushUrl = v +} + +func (o LoadbalancerOptionMetrics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CredentialsRef) { + toSerialize["credentialsRef"] = o.CredentialsRef + } + if !IsNil(o.PushUrl) { + toSerialize["pushUrl"] = o.PushUrl + } + return toSerialize, nil +} + +type NullableLoadbalancerOptionMetrics struct { + value *LoadbalancerOptionMetrics + isSet bool +} + +func (v NullableLoadbalancerOptionMetrics) Get() *LoadbalancerOptionMetrics { + return v.value +} + +func (v *NullableLoadbalancerOptionMetrics) Set(val *LoadbalancerOptionMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableLoadbalancerOptionMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadbalancerOptionMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadbalancerOptionMetrics(val *LoadbalancerOptionMetrics) *NullableLoadbalancerOptionMetrics { + return &NullableLoadbalancerOptionMetrics{value: val, isSet: true} +} + +func (v NullableLoadbalancerOptionMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadbalancerOptionMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_loadbalancer_option_observability.go b/services/lbapplication/model_loadbalancer_option_observability.go new file mode 100644 index 000000000..9fed6ed40 --- /dev/null +++ b/services/lbapplication/model_loadbalancer_option_observability.go @@ -0,0 +1,152 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadbalancerOptionObservability type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadbalancerOptionObservability{} + +// LoadbalancerOptionObservability We offer Application Load Balancer metrics observability via ARGUS or external solutions. Not changeable after creation. +type LoadbalancerOptionObservability struct { + Logs *LoadbalancerOptionLogs `json:"logs,omitempty"` + Metrics *LoadbalancerOptionMetrics `json:"metrics,omitempty"` +} + +// NewLoadbalancerOptionObservability instantiates a new LoadbalancerOptionObservability object +// This constructor will assign default values to properties that have it defined, +// 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 NewLoadbalancerOptionObservability() *LoadbalancerOptionObservability { + this := LoadbalancerOptionObservability{} + return &this +} + +// NewLoadbalancerOptionObservabilityWithDefaults instantiates a new LoadbalancerOptionObservability object +// This 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 NewLoadbalancerOptionObservabilityWithDefaults() *LoadbalancerOptionObservability { + this := LoadbalancerOptionObservability{} + return &this +} + +// GetLogs returns the Logs field value if set, zero value otherwise. +func (o *LoadbalancerOptionObservability) GetLogs() *LoadbalancerOptionLogs { + if o == nil || IsNil(o.Logs) { + var ret *LoadbalancerOptionLogs + return ret + } + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionObservability) GetLogsOk() (*LoadbalancerOptionLogs, bool) { + if o == nil || IsNil(o.Logs) { + return nil, false + } + return o.Logs, true +} + +// HasLogs returns a boolean if a field has been set. +func (o *LoadbalancerOptionObservability) HasLogs() bool { + if o != nil && !IsNil(o.Logs) { + return true + } + + return false +} + +// SetLogs gets a reference to the given LoadbalancerOptionLogs and assigns it to the Logs field. +func (o *LoadbalancerOptionObservability) SetLogs(v *LoadbalancerOptionLogs) { + o.Logs = v +} + +// GetMetrics returns the Metrics field value if set, zero value otherwise. +func (o *LoadbalancerOptionObservability) GetMetrics() *LoadbalancerOptionMetrics { + if o == nil || IsNil(o.Metrics) { + var ret *LoadbalancerOptionMetrics + return ret + } + return o.Metrics +} + +// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionObservability) GetMetricsOk() (*LoadbalancerOptionMetrics, bool) { + if o == nil || IsNil(o.Metrics) { + return nil, false + } + return o.Metrics, true +} + +// HasMetrics returns a boolean if a field has been set. +func (o *LoadbalancerOptionObservability) HasMetrics() bool { + if o != nil && !IsNil(o.Metrics) { + return true + } + + return false +} + +// SetMetrics gets a reference to the given LoadbalancerOptionMetrics and assigns it to the Metrics field. +func (o *LoadbalancerOptionObservability) SetMetrics(v *LoadbalancerOptionMetrics) { + o.Metrics = v +} + +func (o LoadbalancerOptionObservability) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Logs) { + toSerialize["logs"] = o.Logs + } + if !IsNil(o.Metrics) { + toSerialize["metrics"] = o.Metrics + } + return toSerialize, nil +} + +type NullableLoadbalancerOptionObservability struct { + value *LoadbalancerOptionObservability + isSet bool +} + +func (v NullableLoadbalancerOptionObservability) Get() *LoadbalancerOptionObservability { + return v.value +} + +func (v *NullableLoadbalancerOptionObservability) Set(val *LoadbalancerOptionObservability) { + v.value = val + v.isSet = true +} + +func (v NullableLoadbalancerOptionObservability) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadbalancerOptionObservability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadbalancerOptionObservability(val *LoadbalancerOptionObservability) *NullableLoadbalancerOptionObservability { + return &NullableLoadbalancerOptionObservability{value: val, isSet: true} +} + +func (v NullableLoadbalancerOptionObservability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadbalancerOptionObservability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_matcher.go b/services/lbapplication/model_matcher.go new file mode 100644 index 000000000..183945b06 --- /dev/null +++ b/services/lbapplication/model_matcher.go @@ -0,0 +1,301 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Matcher type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Matcher{} + +// Matcher struct for Matcher +type Matcher struct { + CookiePersistence *CookiePersistence `json:"cookiePersistence,omitempty"` + // Headers for the matcher + Headers *[]Header `json:"headers,omitempty"` + // Path prefix for the matcher + PathPrefix *string `json:"pathPrefix,omitempty"` + // Query Parameters for the matcher + QueryParameters *[]QueryParameters `json:"queryParameters,omitempty"` + // Reference target pool by target pool name. + TargetPool *string `json:"targetPool,omitempty"` + // If enabled, when client sends an HTTP request with and Upgrade header, indicating the desire to establish a Websocket connection, if backend server supports WebSocket, it responds with HTTP 101 status code, switching protocols from HTTP to WebSocket. Hence the client and the server can exchange data in real-time using one long-lived TCP connection. + WebSocket *bool `json:"webSocket,omitempty"` +} + +// NewMatcher instantiates a new Matcher object +// This constructor will assign default values to properties that have it defined, +// 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 NewMatcher() *Matcher { + this := Matcher{} + return &this +} + +// NewMatcherWithDefaults instantiates a new Matcher object +// This 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 NewMatcherWithDefaults() *Matcher { + this := Matcher{} + return &this +} + +// GetCookiePersistence returns the CookiePersistence field value if set, zero value otherwise. +func (o *Matcher) GetCookiePersistence() *CookiePersistence { + if o == nil || IsNil(o.CookiePersistence) { + var ret *CookiePersistence + return ret + } + return o.CookiePersistence +} + +// GetCookiePersistenceOk returns a tuple with the CookiePersistence field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetCookiePersistenceOk() (*CookiePersistence, bool) { + if o == nil || IsNil(o.CookiePersistence) { + return nil, false + } + return o.CookiePersistence, true +} + +// HasCookiePersistence returns a boolean if a field has been set. +func (o *Matcher) HasCookiePersistence() bool { + if o != nil && !IsNil(o.CookiePersistence) { + return true + } + + return false +} + +// SetCookiePersistence gets a reference to the given CookiePersistence and assigns it to the CookiePersistence field. +func (o *Matcher) SetCookiePersistence(v *CookiePersistence) { + o.CookiePersistence = v +} + +// GetHeaders returns the Headers field value if set, zero value otherwise. +func (o *Matcher) GetHeaders() *[]Header { + if o == nil || IsNil(o.Headers) { + var ret *[]Header + return ret + } + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetHeadersOk() (*[]Header, bool) { + if o == nil || IsNil(o.Headers) { + return nil, false + } + return o.Headers, true +} + +// HasHeaders returns a boolean if a field has been set. +func (o *Matcher) HasHeaders() bool { + if o != nil && !IsNil(o.Headers) { + return true + } + + return false +} + +// SetHeaders gets a reference to the given []Header and assigns it to the Headers field. +func (o *Matcher) SetHeaders(v *[]Header) { + o.Headers = v +} + +// GetPathPrefix returns the PathPrefix field value if set, zero value otherwise. +func (o *Matcher) GetPathPrefix() *string { + if o == nil || IsNil(o.PathPrefix) { + var ret *string + return ret + } + return o.PathPrefix +} + +// GetPathPrefixOk returns a tuple with the PathPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetPathPrefixOk() (*string, bool) { + if o == nil || IsNil(o.PathPrefix) { + return nil, false + } + return o.PathPrefix, true +} + +// HasPathPrefix returns a boolean if a field has been set. +func (o *Matcher) HasPathPrefix() bool { + if o != nil && !IsNil(o.PathPrefix) { + return true + } + + return false +} + +// SetPathPrefix gets a reference to the given string and assigns it to the PathPrefix field. +func (o *Matcher) SetPathPrefix(v *string) { + o.PathPrefix = v +} + +// GetQueryParameters returns the QueryParameters field value if set, zero value otherwise. +func (o *Matcher) GetQueryParameters() *[]QueryParameters { + if o == nil || IsNil(o.QueryParameters) { + var ret *[]QueryParameters + return ret + } + return o.QueryParameters +} + +// GetQueryParametersOk returns a tuple with the QueryParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetQueryParametersOk() (*[]QueryParameters, bool) { + if o == nil || IsNil(o.QueryParameters) { + return nil, false + } + return o.QueryParameters, true +} + +// HasQueryParameters returns a boolean if a field has been set. +func (o *Matcher) HasQueryParameters() bool { + if o != nil && !IsNil(o.QueryParameters) { + return true + } + + return false +} + +// SetQueryParameters gets a reference to the given []QueryParameters and assigns it to the QueryParameters field. +func (o *Matcher) SetQueryParameters(v *[]QueryParameters) { + o.QueryParameters = v +} + +// GetTargetPool returns the TargetPool field value if set, zero value otherwise. +func (o *Matcher) GetTargetPool() *string { + if o == nil || IsNil(o.TargetPool) { + var ret *string + return ret + } + return o.TargetPool +} + +// GetTargetPoolOk returns a tuple with the TargetPool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetTargetPoolOk() (*string, bool) { + if o == nil || IsNil(o.TargetPool) { + return nil, false + } + return o.TargetPool, true +} + +// HasTargetPool returns a boolean if a field has been set. +func (o *Matcher) HasTargetPool() bool { + if o != nil && !IsNil(o.TargetPool) { + return true + } + + return false +} + +// SetTargetPool gets a reference to the given string and assigns it to the TargetPool field. +func (o *Matcher) SetTargetPool(v *string) { + o.TargetPool = v +} + +// GetWebSocket returns the WebSocket field value if set, zero value otherwise. +func (o *Matcher) GetWebSocket() *bool { + if o == nil || IsNil(o.WebSocket) { + var ret *bool + return ret + } + return o.WebSocket +} + +// GetWebSocketOk returns a tuple with the WebSocket field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetWebSocketOk() (*bool, bool) { + if o == nil || IsNil(o.WebSocket) { + return nil, false + } + return o.WebSocket, true +} + +// HasWebSocket returns a boolean if a field has been set. +func (o *Matcher) HasWebSocket() bool { + if o != nil && !IsNil(o.WebSocket) { + return true + } + + return false +} + +// SetWebSocket gets a reference to the given bool and assigns it to the WebSocket field. +func (o *Matcher) SetWebSocket(v *bool) { + o.WebSocket = v +} + +func (o Matcher) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CookiePersistence) { + toSerialize["cookiePersistence"] = o.CookiePersistence + } + if !IsNil(o.Headers) { + toSerialize["headers"] = o.Headers + } + if !IsNil(o.PathPrefix) { + toSerialize["pathPrefix"] = o.PathPrefix + } + if !IsNil(o.QueryParameters) { + toSerialize["queryParameters"] = o.QueryParameters + } + if !IsNil(o.TargetPool) { + toSerialize["targetPool"] = o.TargetPool + } + if !IsNil(o.WebSocket) { + toSerialize["webSocket"] = o.WebSocket + } + return toSerialize, nil +} + +type NullableMatcher struct { + value *Matcher + isSet bool +} + +func (v NullableMatcher) Get() *Matcher { + return v.value +} + +func (v *NullableMatcher) Set(val *Matcher) { + v.value = val + v.isSet = true +} + +func (v NullableMatcher) IsSet() bool { + return v.isSet +} + +func (v *NullableMatcher) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMatcher(val *Matcher) *NullableMatcher { + return &NullableMatcher{value: val, isSet: true} +} + +func (v NullableMatcher) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMatcher) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_network.go b/services/lbapplication/model_network.go new file mode 100644 index 000000000..075d1df8e --- /dev/null +++ b/services/lbapplication/model_network.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Network type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Network{} + +// Network struct for Network +type Network struct { + // Openstack network ID + NetworkId *string `json:"networkId,omitempty"` + // The role defines how the Application Load Balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. + Role *string `json:"role,omitempty"` +} + +// NewNetwork instantiates a new Network object +// This constructor will assign default values to properties that have it defined, +// 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 NewNetwork() *Network { + this := Network{} + return &this +} + +// NewNetworkWithDefaults instantiates a new Network object +// This 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 NewNetworkWithDefaults() *Network { + this := Network{} + return &this +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *Network) GetNetworkId() *string { + if o == nil || IsNil(o.NetworkId) { + var ret *string + return ret + } + return o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *Network) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *Network) SetNetworkId(v *string) { + o.NetworkId = v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *Network) 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 *Network) 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 *Network) 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 *Network) SetRole(v *string) { + o.Role = v +} + +func (o Network) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + return toSerialize, nil +} + +type NullableNetwork struct { + value *Network + isSet bool +} + +func (v NullableNetwork) Get() *Network { + return v.value +} + +func (v *NullableNetwork) Set(val *Network) { + v.value = val + v.isSet = true +} + +func (v NullableNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetwork(val *Network) *NullableNetwork { + return &NullableNetwork{value: val, isSet: true} +} + +func (v NullableNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_plan_details.go b/services/lbapplication/model_plan_details.go new file mode 100644 index 000000000..996535924 --- /dev/null +++ b/services/lbapplication/model_plan_details.go @@ -0,0 +1,265 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the PlanDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanDetails{} + +// PlanDetails struct for PlanDetails +type PlanDetails struct { + // Description + Description *string `json:"description,omitempty"` + // Flavor Name + FlavorName *string `json:"flavorName,omitempty"` + // Maximum number of concurrent connections per application load balancer VM instance. + MaxConnections *int64 `json:"maxConnections,omitempty"` + // Service Plan Name + Name *string `json:"name,omitempty"` + // Service Plan Identifier + PlanId *string `json:"planId,omitempty"` +} + +// NewPlanDetails instantiates a new PlanDetails object +// This constructor will assign default values to properties that have it defined, +// 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 NewPlanDetails() *PlanDetails { + this := PlanDetails{} + return &this +} + +// NewPlanDetailsWithDefaults instantiates a new PlanDetails object +// This 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 NewPlanDetailsWithDefaults() *PlanDetails { + this := PlanDetails{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PlanDetails) 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 *PlanDetails) 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 *PlanDetails) 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 *PlanDetails) SetDescription(v *string) { + o.Description = v +} + +// GetFlavorName returns the FlavorName field value if set, zero value otherwise. +func (o *PlanDetails) GetFlavorName() *string { + if o == nil || IsNil(o.FlavorName) { + var ret *string + return ret + } + return o.FlavorName +} + +// GetFlavorNameOk returns a tuple with the FlavorName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanDetails) GetFlavorNameOk() (*string, bool) { + if o == nil || IsNil(o.FlavorName) { + return nil, false + } + return o.FlavorName, true +} + +// HasFlavorName returns a boolean if a field has been set. +func (o *PlanDetails) HasFlavorName() bool { + if o != nil && !IsNil(o.FlavorName) { + return true + } + + return false +} + +// SetFlavorName gets a reference to the given string and assigns it to the FlavorName field. +func (o *PlanDetails) SetFlavorName(v *string) { + o.FlavorName = v +} + +// GetMaxConnections returns the MaxConnections field value if set, zero value otherwise. +func (o *PlanDetails) GetMaxConnections() *int64 { + if o == nil || IsNil(o.MaxConnections) { + var ret *int64 + return ret + } + return o.MaxConnections +} + +// GetMaxConnectionsOk returns a tuple with the MaxConnections field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanDetails) GetMaxConnectionsOk() (*int64, bool) { + if o == nil || IsNil(o.MaxConnections) { + return nil, false + } + return o.MaxConnections, true +} + +// HasMaxConnections returns a boolean if a field has been set. +func (o *PlanDetails) HasMaxConnections() bool { + if o != nil && !IsNil(o.MaxConnections) { + return true + } + + return false +} + +// SetMaxConnections gets a reference to the given int64 and assigns it to the MaxConnections field. +func (o *PlanDetails) SetMaxConnections(v *int64) { + o.MaxConnections = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PlanDetails) 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 *PlanDetails) 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 *PlanDetails) 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 *PlanDetails) SetName(v *string) { + o.Name = v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *PlanDetails) 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 *PlanDetails) 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 *PlanDetails) 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 *PlanDetails) SetPlanId(v *string) { + o.PlanId = v +} + +func (o PlanDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.FlavorName) { + toSerialize["flavorName"] = o.FlavorName + } + if !IsNil(o.MaxConnections) { + toSerialize["maxConnections"] = o.MaxConnections + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + return toSerialize, nil +} + +type NullablePlanDetails struct { + value *PlanDetails + isSet bool +} + +func (v NullablePlanDetails) Get() *PlanDetails { + return v.value +} + +func (v *NullablePlanDetails) Set(val *PlanDetails) { + v.value = val + v.isSet = true +} + +func (v NullablePlanDetails) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanDetails(val *PlanDetails) *NullablePlanDetails { + return &NullablePlanDetails{value: val, isSet: true} +} + +func (v NullablePlanDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_protocol_options_https.go b/services/lbapplication/model_protocol_options_https.go new file mode 100644 index 000000000..dc841d519 --- /dev/null +++ b/services/lbapplication/model_protocol_options_https.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ProtocolOptionsHTTPS type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProtocolOptionsHTTPS{} + +// ProtocolOptionsHTTPS struct for ProtocolOptionsHTTPS +type ProtocolOptionsHTTPS struct { + CertificateConfig *CertificateConfig `json:"certificateConfig,omitempty"` +} + +// NewProtocolOptionsHTTPS instantiates a new ProtocolOptionsHTTPS object +// This constructor will assign default values to properties that have it defined, +// 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 NewProtocolOptionsHTTPS() *ProtocolOptionsHTTPS { + this := ProtocolOptionsHTTPS{} + return &this +} + +// NewProtocolOptionsHTTPSWithDefaults instantiates a new ProtocolOptionsHTTPS object +// This 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 NewProtocolOptionsHTTPSWithDefaults() *ProtocolOptionsHTTPS { + this := ProtocolOptionsHTTPS{} + return &this +} + +// GetCertificateConfig returns the CertificateConfig field value if set, zero value otherwise. +func (o *ProtocolOptionsHTTPS) GetCertificateConfig() *CertificateConfig { + if o == nil || IsNil(o.CertificateConfig) { + var ret *CertificateConfig + return ret + } + return o.CertificateConfig +} + +// GetCertificateConfigOk returns a tuple with the CertificateConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolOptionsHTTPS) GetCertificateConfigOk() (*CertificateConfig, bool) { + if o == nil || IsNil(o.CertificateConfig) { + return nil, false + } + return o.CertificateConfig, true +} + +// HasCertificateConfig returns a boolean if a field has been set. +func (o *ProtocolOptionsHTTPS) HasCertificateConfig() bool { + if o != nil && !IsNil(o.CertificateConfig) { + return true + } + + return false +} + +// SetCertificateConfig gets a reference to the given CertificateConfig and assigns it to the CertificateConfig field. +func (o *ProtocolOptionsHTTPS) SetCertificateConfig(v *CertificateConfig) { + o.CertificateConfig = v +} + +func (o ProtocolOptionsHTTPS) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CertificateConfig) { + toSerialize["certificateConfig"] = o.CertificateConfig + } + return toSerialize, nil +} + +type NullableProtocolOptionsHTTPS struct { + value *ProtocolOptionsHTTPS + isSet bool +} + +func (v NullableProtocolOptionsHTTPS) Get() *ProtocolOptionsHTTPS { + return v.value +} + +func (v *NullableProtocolOptionsHTTPS) Set(val *ProtocolOptionsHTTPS) { + v.value = val + v.isSet = true +} + +func (v NullableProtocolOptionsHTTPS) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocolOptionsHTTPS) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocolOptionsHTTPS(val *ProtocolOptionsHTTPS) *NullableProtocolOptionsHTTPS { + return &NullableProtocolOptionsHTTPS{value: val, isSet: true} +} + +func (v NullableProtocolOptionsHTTPS) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocolOptionsHTTPS) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_query_parameters.go b/services/lbapplication/model_query_parameters.go new file mode 100644 index 000000000..69db2ed5d --- /dev/null +++ b/services/lbapplication/model_query_parameters.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the QueryParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QueryParameters{} + +// QueryParameters struct for QueryParameters +type QueryParameters struct { + // Exact match for the parameter value + ExactMatch *string `json:"exactMatch,omitempty"` + // Parameter name + Name *string `json:"name,omitempty"` +} + +// NewQueryParameters instantiates a new QueryParameters object +// This constructor will assign default values to properties that have it defined, +// 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 NewQueryParameters() *QueryParameters { + this := QueryParameters{} + return &this +} + +// NewQueryParametersWithDefaults instantiates a new QueryParameters object +// This 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 NewQueryParametersWithDefaults() *QueryParameters { + this := QueryParameters{} + return &this +} + +// GetExactMatch returns the ExactMatch field value if set, zero value otherwise. +func (o *QueryParameters) GetExactMatch() *string { + if o == nil || IsNil(o.ExactMatch) { + var ret *string + return ret + } + return o.ExactMatch +} + +// GetExactMatchOk returns a tuple with the ExactMatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryParameters) GetExactMatchOk() (*string, bool) { + if o == nil || IsNil(o.ExactMatch) { + return nil, false + } + return o.ExactMatch, true +} + +// HasExactMatch returns a boolean if a field has been set. +func (o *QueryParameters) HasExactMatch() bool { + if o != nil && !IsNil(o.ExactMatch) { + return true + } + + return false +} + +// SetExactMatch gets a reference to the given string and assigns it to the ExactMatch field. +func (o *QueryParameters) SetExactMatch(v *string) { + o.ExactMatch = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *QueryParameters) 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 *QueryParameters) 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 *QueryParameters) 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 *QueryParameters) SetName(v *string) { + o.Name = v +} + +func (o QueryParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ExactMatch) { + toSerialize["exactMatch"] = o.ExactMatch + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableQueryParameters struct { + value *QueryParameters + isSet bool +} + +func (v NullableQueryParameters) Get() *QueryParameters { + return v.value +} + +func (v *NullableQueryParameters) Set(val *QueryParameters) { + v.value = val + v.isSet = true +} + +func (v NullableQueryParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableQueryParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQueryParameters(val *QueryParameters) *NullableQueryParameters { + return &NullableQueryParameters{value: val, isSet: true} +} + +func (v NullableQueryParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQueryParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_rule.go b/services/lbapplication/model_rule.go new file mode 100644 index 000000000..b0237c17e --- /dev/null +++ b/services/lbapplication/model_rule.go @@ -0,0 +1,153 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Rule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Rule{} + +// Rule struct for Rule +type Rule struct { + // Host for the rule + Host *string `json:"host,omitempty"` + Http *HTTPConfig `json:"http,omitempty"` +} + +// NewRule instantiates a new Rule object +// This constructor will assign default values to properties that have it defined, +// 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 NewRule() *Rule { + this := Rule{} + return &this +} + +// NewRuleWithDefaults instantiates a new Rule object +// This 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 NewRuleWithDefaults() *Rule { + this := Rule{} + return &this +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *Rule) GetHost() *string { + if o == nil || IsNil(o.Host) { + var ret *string + return ret + } + return o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rule) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *Rule) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *Rule) SetHost(v *string) { + o.Host = v +} + +// GetHttp returns the Http field value if set, zero value otherwise. +func (o *Rule) GetHttp() *HTTPConfig { + if o == nil || IsNil(o.Http) { + var ret *HTTPConfig + return ret + } + return o.Http +} + +// GetHttpOk returns a tuple with the Http field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rule) GetHttpOk() (*HTTPConfig, bool) { + if o == nil || IsNil(o.Http) { + return nil, false + } + return o.Http, true +} + +// HasHttp returns a boolean if a field has been set. +func (o *Rule) HasHttp() bool { + if o != nil && !IsNil(o.Http) { + return true + } + + return false +} + +// SetHttp gets a reference to the given HTTPConfig and assigns it to the Http field. +func (o *Rule) SetHttp(v *HTTPConfig) { + o.Http = v +} + +func (o Rule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Http) { + toSerialize["http"] = o.Http + } + return toSerialize, nil +} + +type NullableRule struct { + value *Rule + isSet bool +} + +func (v NullableRule) Get() *Rule { + return v.value +} + +func (v *NullableRule) Set(val *Rule) { + v.value = val + v.isSet = true +} + +func (v NullableRule) IsSet() bool { + return v.isSet +} + +func (v *NullableRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRule(val *Rule) *NullableRule { + return &NullableRule{value: val, isSet: true} +} + +func (v NullableRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_status.go b/services/lbapplication/model_status.go new file mode 100644 index 000000000..ea546534f --- /dev/null +++ b/services/lbapplication/model_status.go @@ -0,0 +1,192 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Status type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Status{} + +// Status The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). +type Status struct { + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + // Can be cast to int32 without loss of precision. + Code *int64 `json:"code,omitempty"` + // A list of messages that carry the error details. There is a common set of message types for APIs to use. + Details *[]GoogleProtobufAny `json:"details,omitempty"` + // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + Message *string `json:"message,omitempty"` +} + +// NewStatus instantiates a new Status object +// This constructor will assign default values to properties that have it defined, +// 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 NewStatus() *Status { + this := Status{} + return &this +} + +// NewStatusWithDefaults instantiates a new Status object +// This 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 NewStatusWithDefaults() *Status { + this := Status{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *Status) GetCode() *int64 { + if o == nil || IsNil(o.Code) { + var ret *int64 + 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 *Status) GetCodeOk() (*int64, 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 *Status) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int64 and assigns it to the Code field. +func (o *Status) SetCode(v *int64) { + o.Code = v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Status) GetDetails() *[]GoogleProtobufAny { + if o == nil || IsNil(o.Details) { + var ret *[]GoogleProtobufAny + 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 *Status) GetDetailsOk() (*[]GoogleProtobufAny, 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 *Status) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given []GoogleProtobufAny and assigns it to the Details field. +func (o *Status) SetDetails(v *[]GoogleProtobufAny) { + o.Details = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *Status) 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 *Status) 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 *Status) 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 *Status) SetMessage(v *string) { + o.Message = v +} + +func (o Status) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableStatus struct { + value *Status + isSet bool +} + +func (v NullableStatus) Get() *Status { + return v.value +} + +func (v *NullableStatus) Set(val *Status) { + v.value = val + v.isSet = true +} + +func (v NullableStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatus(val *Status) *NullableStatus { + return &NullableStatus{value: val, isSet: true} +} + +func (v NullableStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_target.go b/services/lbapplication/model_target.go new file mode 100644 index 000000000..5b331e368 --- /dev/null +++ b/services/lbapplication/model_target.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Target type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Target{} + +// Target struct for Target +type Target struct { + // Target name + DisplayName *string `json:"displayName,omitempty"` + // Target IP. Must by unique within a target pool. + Ip *string `json:"ip,omitempty"` +} + +// NewTarget instantiates a new Target object +// This constructor will assign default values to properties that have it defined, +// 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 NewTarget() *Target { + this := Target{} + return &this +} + +// NewTargetWithDefaults instantiates a new Target object +// This 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 NewTargetWithDefaults() *Target { + this := Target{} + return &this +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *Target) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Target) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *Target) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *Target) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *Target) 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 *Target) 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 *Target) 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 *Target) SetIp(v *string) { + o.Ip = v +} + +func (o Target) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + return toSerialize, nil +} + +type NullableTarget struct { + value *Target + isSet bool +} + +func (v NullableTarget) Get() *Target { + return v.value +} + +func (v *NullableTarget) Set(val *Target) { + v.value = val + v.isSet = true +} + +func (v NullableTarget) IsSet() bool { + return v.isSet +} + +func (v *NullableTarget) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTarget(val *Target) *NullableTarget { + return &NullableTarget{value: val, isSet: true} +} + +func (v NullableTarget) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTarget) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_target_pool.go b/services/lbapplication/model_target_pool.go new file mode 100644 index 000000000..26ec61d20 --- /dev/null +++ b/services/lbapplication/model_target_pool.go @@ -0,0 +1,227 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the TargetPool type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TargetPool{} + +// TargetPool struct for TargetPool +type TargetPool struct { + ActiveHealthCheck *ActiveHealthCheck `json:"activeHealthCheck,omitempty"` + // Target pool name + Name *string `json:"name,omitempty"` + // The number identifying the port where each target listens for traffic. + TargetPort *int64 `json:"targetPort,omitempty"` + // List of all targets which will be used in the pool. Limited to 250. + Targets *[]Target `json:"targets,omitempty"` +} + +// NewTargetPool instantiates a new TargetPool object +// This constructor will assign default values to properties that have it defined, +// 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 NewTargetPool() *TargetPool { + this := TargetPool{} + return &this +} + +// NewTargetPoolWithDefaults instantiates a new TargetPool object +// This 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 NewTargetPoolWithDefaults() *TargetPool { + this := TargetPool{} + return &this +} + +// GetActiveHealthCheck returns the ActiveHealthCheck field value if set, zero value otherwise. +func (o *TargetPool) GetActiveHealthCheck() *ActiveHealthCheck { + if o == nil || IsNil(o.ActiveHealthCheck) { + var ret *ActiveHealthCheck + return ret + } + return o.ActiveHealthCheck +} + +// GetActiveHealthCheckOk returns a tuple with the ActiveHealthCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TargetPool) GetActiveHealthCheckOk() (*ActiveHealthCheck, bool) { + if o == nil || IsNil(o.ActiveHealthCheck) { + return nil, false + } + return o.ActiveHealthCheck, true +} + +// HasActiveHealthCheck returns a boolean if a field has been set. +func (o *TargetPool) HasActiveHealthCheck() bool { + if o != nil && !IsNil(o.ActiveHealthCheck) { + return true + } + + return false +} + +// SetActiveHealthCheck gets a reference to the given ActiveHealthCheck and assigns it to the ActiveHealthCheck field. +func (o *TargetPool) SetActiveHealthCheck(v *ActiveHealthCheck) { + o.ActiveHealthCheck = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TargetPool) 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 *TargetPool) 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 *TargetPool) 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 *TargetPool) SetName(v *string) { + o.Name = v +} + +// GetTargetPort returns the TargetPort field value if set, zero value otherwise. +func (o *TargetPool) GetTargetPort() *int64 { + if o == nil || IsNil(o.TargetPort) { + var ret *int64 + return ret + } + return o.TargetPort +} + +// GetTargetPortOk returns a tuple with the TargetPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TargetPool) GetTargetPortOk() (*int64, bool) { + if o == nil || IsNil(o.TargetPort) { + return nil, false + } + return o.TargetPort, true +} + +// HasTargetPort returns a boolean if a field has been set. +func (o *TargetPool) HasTargetPort() bool { + if o != nil && !IsNil(o.TargetPort) { + return true + } + + return false +} + +// SetTargetPort gets a reference to the given int64 and assigns it to the TargetPort field. +func (o *TargetPool) SetTargetPort(v *int64) { + o.TargetPort = v +} + +// GetTargets returns the Targets field value if set, zero value otherwise. +func (o *TargetPool) GetTargets() *[]Target { + if o == nil || IsNil(o.Targets) { + var ret *[]Target + return ret + } + return o.Targets +} + +// GetTargetsOk returns a tuple with the Targets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TargetPool) GetTargetsOk() (*[]Target, bool) { + if o == nil || IsNil(o.Targets) { + return nil, false + } + return o.Targets, true +} + +// HasTargets returns a boolean if a field has been set. +func (o *TargetPool) HasTargets() bool { + if o != nil && !IsNil(o.Targets) { + return true + } + + return false +} + +// SetTargets gets a reference to the given []Target and assigns it to the Targets field. +func (o *TargetPool) SetTargets(v *[]Target) { + o.Targets = v +} + +func (o TargetPool) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ActiveHealthCheck) { + toSerialize["activeHealthCheck"] = o.ActiveHealthCheck + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.TargetPort) { + toSerialize["targetPort"] = o.TargetPort + } + if !IsNil(o.Targets) { + toSerialize["targets"] = o.Targets + } + return toSerialize, nil +} + +type NullableTargetPool struct { + value *TargetPool + isSet bool +} + +func (v NullableTargetPool) Get() *TargetPool { + return v.value +} + +func (v *NullableTargetPool) Set(val *TargetPool) { + v.value = val + v.isSet = true +} + +func (v NullableTargetPool) IsSet() bool { + return v.isSet +} + +func (v *NullableTargetPool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTargetPool(val *TargetPool) *NullableTargetPool { + return &NullableTargetPool{value: val, isSet: true} +} + +func (v NullableTargetPool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTargetPool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_update_credentials_payload.go b/services/lbapplication/model_update_credentials_payload.go new file mode 100644 index 000000000..1b209fb71 --- /dev/null +++ b/services/lbapplication/model_update_credentials_payload.go @@ -0,0 +1,191 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the UpdateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateCredentialsPayload{} + +// UpdateCredentialsPayload struct for UpdateCredentialsPayload +type UpdateCredentialsPayload struct { + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // A valid password used for an existing ARGUS instance, which is used during basic auth. + Password *string `json:"password,omitempty"` + // A valid username used for an existing ARGUS instance, which is used during basic auth. + Username *string `json:"username,omitempty"` +} + +// NewUpdateCredentialsPayload instantiates a new UpdateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// 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 NewUpdateCredentialsPayload() *UpdateCredentialsPayload { + this := UpdateCredentialsPayload{} + return &this +} + +// NewUpdateCredentialsPayloadWithDefaults instantiates a new UpdateCredentialsPayload object +// This 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 NewUpdateCredentialsPayloadWithDefaults() *UpdateCredentialsPayload { + this := UpdateCredentialsPayload{} + return &this +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *UpdateCredentialsPayload) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCredentialsPayload) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *UpdateCredentialsPayload) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *UpdateCredentialsPayload) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *UpdateCredentialsPayload) 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 *UpdateCredentialsPayload) 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 *UpdateCredentialsPayload) 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 *UpdateCredentialsPayload) SetPassword(v *string) { + o.Password = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *UpdateCredentialsPayload) GetUsername() *string { + if o == nil || IsNil(o.Username) { + var ret *string + return ret + } + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCredentialsPayload) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *UpdateCredentialsPayload) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *UpdateCredentialsPayload) SetUsername(v *string) { + o.Username = v +} + +func (o UpdateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableUpdateCredentialsPayload struct { + value *UpdateCredentialsPayload + isSet bool +} + +func (v NullableUpdateCredentialsPayload) Get() *UpdateCredentialsPayload { + return v.value +} + +func (v *NullableUpdateCredentialsPayload) Set(val *UpdateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateCredentialsPayload(val *UpdateCredentialsPayload) *NullableUpdateCredentialsPayload { + return &NullableUpdateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableUpdateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_update_credentials_response.go b/services/lbapplication/model_update_credentials_response.go new file mode 100644 index 000000000..835802ab3 --- /dev/null +++ b/services/lbapplication/model_update_credentials_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the UpdateCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateCredentialsResponse{} + +// UpdateCredentialsResponse struct for UpdateCredentialsResponse +type UpdateCredentialsResponse struct { + Credential *CredentialsResponse `json:"credential,omitempty"` +} + +// NewUpdateCredentialsResponse instantiates a new UpdateCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewUpdateCredentialsResponse() *UpdateCredentialsResponse { + this := UpdateCredentialsResponse{} + return &this +} + +// NewUpdateCredentialsResponseWithDefaults instantiates a new UpdateCredentialsResponse object +// This 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 NewUpdateCredentialsResponseWithDefaults() *UpdateCredentialsResponse { + this := UpdateCredentialsResponse{} + return &this +} + +// GetCredential returns the Credential field value if set, zero value otherwise. +func (o *UpdateCredentialsResponse) GetCredential() *CredentialsResponse { + if o == nil || IsNil(o.Credential) { + var ret *CredentialsResponse + return ret + } + return o.Credential +} + +// GetCredentialOk returns a tuple with the Credential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCredentialsResponse) GetCredentialOk() (*CredentialsResponse, bool) { + if o == nil || IsNil(o.Credential) { + return nil, false + } + return o.Credential, true +} + +// HasCredential returns a boolean if a field has been set. +func (o *UpdateCredentialsResponse) HasCredential() bool { + if o != nil && !IsNil(o.Credential) { + return true + } + + return false +} + +// SetCredential gets a reference to the given CredentialsResponse and assigns it to the Credential field. +func (o *UpdateCredentialsResponse) SetCredential(v *CredentialsResponse) { + o.Credential = v +} + +func (o UpdateCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credential) { + toSerialize["credential"] = o.Credential + } + return toSerialize, nil +} + +type NullableUpdateCredentialsResponse struct { + value *UpdateCredentialsResponse + isSet bool +} + +func (v NullableUpdateCredentialsResponse) Get() *UpdateCredentialsResponse { + return v.value +} + +func (v *NullableUpdateCredentialsResponse) Set(val *UpdateCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateCredentialsResponse(val *UpdateCredentialsResponse) *NullableUpdateCredentialsResponse { + return &NullableUpdateCredentialsResponse{value: val, isSet: true} +} + +func (v NullableUpdateCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_update_load_balancer_payload.go b/services/lbapplication/model_update_load_balancer_payload.go new file mode 100644 index 000000000..1b709ce59 --- /dev/null +++ b/services/lbapplication/model_update_load_balancer_payload.go @@ -0,0 +1,485 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the UpdateLoadBalancerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateLoadBalancerPayload{} + +// UpdateLoadBalancerPayload struct for UpdateLoadBalancerPayload +type UpdateLoadBalancerPayload struct { + // Reports all errors a application load balancer has. + Errors *[]LoadBalancerError `json:"errors,omitempty"` + // External application load balancer IP address where this application load balancer is exposed. Not changeable after creation. + ExternalAddress *string `json:"externalAddress,omitempty"` + // There is a maximum listener count of 20. + Listeners *[]Listener `json:"listeners,omitempty"` + // Application Load Balancer name. Not changeable after creation. + Name *string `json:"name,omitempty"` + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. + Networks *[]Network `json:"networks,omitempty"` + Options *LoadBalancerOptions `json:"options,omitempty"` + // Service Plan configures the size of the Application Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. + PlanId *string `json:"planId,omitempty"` + // Transient private application load balancer IP address that can change any time. + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *string `json:"status,omitempty"` + // List of all target pools which will be used in the application load balancer. Limited to 20. + TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Application Load Balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this application load balancer resource that changes during updates of the load balancers. On updates this field specified the application load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a application load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of application load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` +} + +// NewUpdateLoadBalancerPayload instantiates a new UpdateLoadBalancerPayload object +// This constructor will assign default values to properties that have it defined, +// 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 NewUpdateLoadBalancerPayload() *UpdateLoadBalancerPayload { + this := UpdateLoadBalancerPayload{} + return &this +} + +// NewUpdateLoadBalancerPayloadWithDefaults instantiates a new UpdateLoadBalancerPayload object +// This 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 NewUpdateLoadBalancerPayloadWithDefaults() *UpdateLoadBalancerPayload { + this := UpdateLoadBalancerPayload{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetErrors() *[]LoadBalancerError { + if o == nil || IsNil(o.Errors) { + var ret *[]LoadBalancerError + 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 *UpdateLoadBalancerPayload) GetErrorsOk() (*[]LoadBalancerError, 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 *UpdateLoadBalancerPayload) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []LoadBalancerError and assigns it to the Errors field. +func (o *UpdateLoadBalancerPayload) SetErrors(v *[]LoadBalancerError) { + o.Errors = v +} + +// GetExternalAddress returns the ExternalAddress field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetExternalAddress() *string { + if o == nil || IsNil(o.ExternalAddress) { + var ret *string + return ret + } + return o.ExternalAddress +} + +// GetExternalAddressOk returns a tuple with the ExternalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetExternalAddressOk() (*string, bool) { + if o == nil || IsNil(o.ExternalAddress) { + return nil, false + } + return o.ExternalAddress, true +} + +// HasExternalAddress returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasExternalAddress() bool { + if o != nil && !IsNil(o.ExternalAddress) { + return true + } + + return false +} + +// SetExternalAddress gets a reference to the given string and assigns it to the ExternalAddress field. +func (o *UpdateLoadBalancerPayload) SetExternalAddress(v *string) { + o.ExternalAddress = v +} + +// GetListeners returns the Listeners field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetListeners() *[]Listener { + if o == nil || IsNil(o.Listeners) { + var ret *[]Listener + return ret + } + return o.Listeners +} + +// GetListenersOk returns a tuple with the Listeners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetListenersOk() (*[]Listener, bool) { + if o == nil || IsNil(o.Listeners) { + return nil, false + } + return o.Listeners, true +} + +// HasListeners returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasListeners() bool { + if o != nil && !IsNil(o.Listeners) { + return true + } + + return false +} + +// SetListeners gets a reference to the given []Listener and assigns it to the Listeners field. +func (o *UpdateLoadBalancerPayload) SetListeners(v *[]Listener) { + o.Listeners = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) SetName(v *string) { + o.Name = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetNetworks() *[]Network { + if o == nil || IsNil(o.Networks) { + var ret *[]Network + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetNetworksOk() (*[]Network, bool) { + if o == nil || IsNil(o.Networks) { + return nil, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given []Network and assigns it to the Networks field. +func (o *UpdateLoadBalancerPayload) SetNetworks(v *[]Network) { + o.Networks = v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetOptions() *LoadBalancerOptions { + if o == nil || IsNil(o.Options) { + var ret *LoadBalancerOptions + 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 *UpdateLoadBalancerPayload) GetOptionsOk() (*LoadBalancerOptions, 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 *UpdateLoadBalancerPayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given LoadBalancerOptions and assigns it to the Options field. +func (o *UpdateLoadBalancerPayload) SetOptions(v *LoadBalancerOptions) { + o.Options = v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) SetPlanId(v *string) { + o.PlanId = v +} + +// GetPrivateAddress returns the PrivateAddress field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetPrivateAddress() *string { + if o == nil || IsNil(o.PrivateAddress) { + var ret *string + return ret + } + return o.PrivateAddress +} + +// GetPrivateAddressOk returns a tuple with the PrivateAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetPrivateAddressOk() (*string, bool) { + if o == nil || IsNil(o.PrivateAddress) { + return nil, false + } + return o.PrivateAddress, true +} + +// HasPrivateAddress returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasPrivateAddress() bool { + if o != nil && !IsNil(o.PrivateAddress) { + return true + } + + return false +} + +// SetPrivateAddress gets a reference to the given string and assigns it to the PrivateAddress field. +func (o *UpdateLoadBalancerPayload) SetPrivateAddress(v *string) { + o.PrivateAddress = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) SetStatus(v *string) { + o.Status = v +} + +// GetTargetPools returns the TargetPools field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetTargetPools() *[]TargetPool { + if o == nil || IsNil(o.TargetPools) { + var ret *[]TargetPool + return ret + } + return o.TargetPools +} + +// GetTargetPoolsOk returns a tuple with the TargetPools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetTargetPoolsOk() (*[]TargetPool, bool) { + if o == nil || IsNil(o.TargetPools) { + return nil, false + } + return o.TargetPools, true +} + +// HasTargetPools returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasTargetPools() bool { + if o != nil && !IsNil(o.TargetPools) { + return true + } + + return false +} + +// SetTargetPools gets a reference to the given []TargetPool and assigns it to the TargetPools field. +func (o *UpdateLoadBalancerPayload) SetTargetPools(v *[]TargetPool) { + o.TargetPools = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) 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 *UpdateLoadBalancerPayload) SetVersion(v *string) { + o.Version = v +} + +func (o UpdateLoadBalancerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.ExternalAddress) { + toSerialize["externalAddress"] = o.ExternalAddress + } + if !IsNil(o.Listeners) { + toSerialize["listeners"] = o.Listeners + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + if !IsNil(o.PrivateAddress) { + toSerialize["privateAddress"] = o.PrivateAddress + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TargetPools) { + toSerialize["targetPools"] = o.TargetPools + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableUpdateLoadBalancerPayload struct { + value *UpdateLoadBalancerPayload + isSet bool +} + +func (v NullableUpdateLoadBalancerPayload) Get() *UpdateLoadBalancerPayload { + return v.value +} + +func (v *NullableUpdateLoadBalancerPayload) Set(val *UpdateLoadBalancerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateLoadBalancerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateLoadBalancerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateLoadBalancerPayload(val *UpdateLoadBalancerPayload) *NullableUpdateLoadBalancerPayload { + return &NullableUpdateLoadBalancerPayload{value: val, isSet: true} +} + +func (v NullableUpdateLoadBalancerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateLoadBalancerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_update_target_pool_payload.go b/services/lbapplication/model_update_target_pool_payload.go new file mode 100644 index 000000000..fe281f741 --- /dev/null +++ b/services/lbapplication/model_update_target_pool_payload.go @@ -0,0 +1,227 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the UpdateTargetPoolPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateTargetPoolPayload{} + +// UpdateTargetPoolPayload struct for UpdateTargetPoolPayload +type UpdateTargetPoolPayload struct { + ActiveHealthCheck *ActiveHealthCheck `json:"activeHealthCheck,omitempty"` + // Target pool name + Name *string `json:"name,omitempty"` + // The number identifying the port where each target listens for traffic. + TargetPort *int64 `json:"targetPort,omitempty"` + // List of all targets which will be used in the pool. Limited to 250. + Targets *[]Target `json:"targets,omitempty"` +} + +// NewUpdateTargetPoolPayload instantiates a new UpdateTargetPoolPayload object +// This constructor will assign default values to properties that have it defined, +// 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 NewUpdateTargetPoolPayload() *UpdateTargetPoolPayload { + this := UpdateTargetPoolPayload{} + return &this +} + +// NewUpdateTargetPoolPayloadWithDefaults instantiates a new UpdateTargetPoolPayload object +// This 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 NewUpdateTargetPoolPayloadWithDefaults() *UpdateTargetPoolPayload { + this := UpdateTargetPoolPayload{} + return &this +} + +// GetActiveHealthCheck returns the ActiveHealthCheck field value if set, zero value otherwise. +func (o *UpdateTargetPoolPayload) GetActiveHealthCheck() *ActiveHealthCheck { + if o == nil || IsNil(o.ActiveHealthCheck) { + var ret *ActiveHealthCheck + return ret + } + return o.ActiveHealthCheck +} + +// GetActiveHealthCheckOk returns a tuple with the ActiveHealthCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTargetPoolPayload) GetActiveHealthCheckOk() (*ActiveHealthCheck, bool) { + if o == nil || IsNil(o.ActiveHealthCheck) { + return nil, false + } + return o.ActiveHealthCheck, true +} + +// HasActiveHealthCheck returns a boolean if a field has been set. +func (o *UpdateTargetPoolPayload) HasActiveHealthCheck() bool { + if o != nil && !IsNil(o.ActiveHealthCheck) { + return true + } + + return false +} + +// SetActiveHealthCheck gets a reference to the given ActiveHealthCheck and assigns it to the ActiveHealthCheck field. +func (o *UpdateTargetPoolPayload) SetActiveHealthCheck(v *ActiveHealthCheck) { + o.ActiveHealthCheck = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateTargetPoolPayload) 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 *UpdateTargetPoolPayload) 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 *UpdateTargetPoolPayload) 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 *UpdateTargetPoolPayload) SetName(v *string) { + o.Name = v +} + +// GetTargetPort returns the TargetPort field value if set, zero value otherwise. +func (o *UpdateTargetPoolPayload) GetTargetPort() *int64 { + if o == nil || IsNil(o.TargetPort) { + var ret *int64 + return ret + } + return o.TargetPort +} + +// GetTargetPortOk returns a tuple with the TargetPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTargetPoolPayload) GetTargetPortOk() (*int64, bool) { + if o == nil || IsNil(o.TargetPort) { + return nil, false + } + return o.TargetPort, true +} + +// HasTargetPort returns a boolean if a field has been set. +func (o *UpdateTargetPoolPayload) HasTargetPort() bool { + if o != nil && !IsNil(o.TargetPort) { + return true + } + + return false +} + +// SetTargetPort gets a reference to the given int64 and assigns it to the TargetPort field. +func (o *UpdateTargetPoolPayload) SetTargetPort(v *int64) { + o.TargetPort = v +} + +// GetTargets returns the Targets field value if set, zero value otherwise. +func (o *UpdateTargetPoolPayload) GetTargets() *[]Target { + if o == nil || IsNil(o.Targets) { + var ret *[]Target + return ret + } + return o.Targets +} + +// GetTargetsOk returns a tuple with the Targets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTargetPoolPayload) GetTargetsOk() (*[]Target, bool) { + if o == nil || IsNil(o.Targets) { + return nil, false + } + return o.Targets, true +} + +// HasTargets returns a boolean if a field has been set. +func (o *UpdateTargetPoolPayload) HasTargets() bool { + if o != nil && !IsNil(o.Targets) { + return true + } + + return false +} + +// SetTargets gets a reference to the given []Target and assigns it to the Targets field. +func (o *UpdateTargetPoolPayload) SetTargets(v *[]Target) { + o.Targets = v +} + +func (o UpdateTargetPoolPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ActiveHealthCheck) { + toSerialize["activeHealthCheck"] = o.ActiveHealthCheck + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.TargetPort) { + toSerialize["targetPort"] = o.TargetPort + } + if !IsNil(o.Targets) { + toSerialize["targets"] = o.Targets + } + return toSerialize, nil +} + +type NullableUpdateTargetPoolPayload struct { + value *UpdateTargetPoolPayload + isSet bool +} + +func (v NullableUpdateTargetPoolPayload) Get() *UpdateTargetPoolPayload { + return v.value +} + +func (v *NullableUpdateTargetPoolPayload) Set(val *UpdateTargetPoolPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateTargetPoolPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateTargetPoolPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateTargetPoolPayload(val *UpdateTargetPoolPayload) *NullableUpdateTargetPoolPayload { + return &NullableUpdateTargetPoolPayload{value: val, isSet: true} +} + +func (v NullableUpdateTargetPoolPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateTargetPoolPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/utils.go b/services/lbapplication/utils.go new file mode 100644 index 000000000..5dd8a85d7 --- /dev/null +++ b/services/lbapplication/utils.go @@ -0,0 +1,347 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +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/services/loadbalancer/CHANGELOG.md b/services/loadbalancer/CHANGELOG.md index 2ecce9547..7ccd85033 100644 --- a/services/loadbalancer/CHANGELOG.md +++ b/services/loadbalancer/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.18.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.17.0 (2024-10-14) - **Feature:** Add support for nullable models diff --git a/services/loadbalancer/LICENSE.md b/services/loadbalancer/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/loadbalancer/LICENSE.md +++ b/services/loadbalancer/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/loadbalancer/NOTICE.txt b/services/loadbalancer/NOTICE.txt index e2888e3a0..2119d5ddf 100644 --- a/services/loadbalancer/NOTICE.txt +++ b/services/loadbalancer/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Load Balancer SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/loadbalancer/go.mod b/services/loadbalancer/go.mod index f33746d33..26d5d6509 100644 --- a/services/loadbalancer/go.mod +++ b/services/loadbalancer/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/loadbalancer -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/loadbalancer/go.sum b/services/loadbalancer/go.sum index b7c164325..b7342b5ac 100644 --- a/services/loadbalancer/go.sum +++ b/services/loadbalancer/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/logme/CHANGELOG.md b/services/logme/CHANGELOG.md index bae717353..c59bba3fc 100644 --- a/services/logme/CHANGELOG.md +++ b/services/logme/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.21.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.20.2 (2025-01-20) + +- **Bugfix:** Remove mistakenly implemented `syslog-use-udp`. Does not exist. + ## v0.20.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/logme/LICENSE.md b/services/logme/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/logme/LICENSE.md +++ b/services/logme/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/logme/NOTICE.txt b/services/logme/NOTICE.txt index a2181bdb1..c3d372b51 100644 --- a/services/logme/NOTICE.txt +++ b/services/logme/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Logme SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/logme/api_default.go b/services/logme/api_default.go index 79d740b7e..20a087b46 100644 --- a/services/logme/api_default.go +++ b/services/logme/api_default.go @@ -1740,7 +1740,7 @@ ListOfferings: get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions @return ApiListOfferingsRequest */ func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { diff --git a/services/logme/go.mod b/services/logme/go.mod index 60f34305d..a5a8ce4b3 100644 --- a/services/logme/go.mod +++ b/services/logme/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/logme -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/logme/go.sum b/services/logme/go.sum index b7c164325..b7342b5ac 100644 --- a/services/logme/go.sum +++ b/services/logme/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/logme/model_instance_parameters.go b/services/logme/model_instance_parameters.go index faa3f8fb0..ca89650b9 100644 --- a/services/logme/model_instance_parameters.go +++ b/services/logme/model_instance_parameters.go @@ -48,9 +48,8 @@ type InstanceParameters struct { OpensearchTlsCiphers *[]string `json:"opensearch-tls-ciphers,omitempty"` OpensearchTlsProtocols *[]string `json:"opensearch-tls-protocols,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - Syslog *[]string `json:"syslog,omitempty"` - SyslogUseUdp *string `json:"syslog-use-udp,omitempty"` + SgwAcl *string `json:"sgw_acl,omitempty"` + Syslog *[]string `json:"syslog,omitempty"` } // NewInstanceParameters instantiates a new InstanceParameters object @@ -846,38 +845,6 @@ func (o *InstanceParameters) SetSyslog(v *[]string) { o.Syslog = v } -// GetSyslogUseUdp returns the SyslogUseUdp field value if set, zero value otherwise. -func (o *InstanceParameters) GetSyslogUseUdp() *string { - if o == nil || IsNil(o.SyslogUseUdp) { - var ret *string - return ret - } - return o.SyslogUseUdp -} - -// GetSyslogUseUdpOk returns a tuple with the SyslogUseUdp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceParameters) GetSyslogUseUdpOk() (*string, bool) { - if o == nil || IsNil(o.SyslogUseUdp) { - return nil, false - } - return o.SyslogUseUdp, true -} - -// HasSyslogUseUdp returns a boolean if a field has been set. -func (o *InstanceParameters) HasSyslogUseUdp() bool { - if o != nil && !IsNil(o.SyslogUseUdp) { - return true - } - - return false -} - -// SetSyslogUseUdp gets a reference to the given string and assigns it to the SyslogUseUdp field. -func (o *InstanceParameters) SetSyslogUseUdp(v *string) { - o.SyslogUseUdp = v -} - func (o InstanceParameters) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.EnableMonitoring) { @@ -949,9 +916,6 @@ func (o InstanceParameters) ToMap() (map[string]interface{}, error) { if !IsNil(o.Syslog) { toSerialize["syslog"] = o.Syslog } - if !IsNil(o.SyslogUseUdp) { - toSerialize["syslog-use-udp"] = o.SyslogUseUdp - } return toSerialize, nil } diff --git a/services/mariadb/CHANGELOG.md b/services/mariadb/CHANGELOG.md index a0619f93d..6945dddbe 100644 --- a/services/mariadb/CHANGELOG.md +++ b/services/mariadb/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.21.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.20.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/mariadb/LICENSE.md b/services/mariadb/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/mariadb/LICENSE.md +++ b/services/mariadb/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/mariadb/NOTICE.txt b/services/mariadb/NOTICE.txt index 6286a75ec..1f3a2178a 100644 --- a/services/mariadb/NOTICE.txt +++ b/services/mariadb/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT MariaDB SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/mariadb/api_default.go b/services/mariadb/api_default.go index 18612671c..0593b9c68 100644 --- a/services/mariadb/api_default.go +++ b/services/mariadb/api_default.go @@ -1740,7 +1740,7 @@ ListOfferings: get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions @return ApiListOfferingsRequest */ func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { diff --git a/services/mariadb/go.mod b/services/mariadb/go.mod index 974dffc84..e35c96a36 100644 --- a/services/mariadb/go.mod +++ b/services/mariadb/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/mariadb -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/mariadb/go.sum b/services/mariadb/go.sum index b7c164325..b7342b5ac 100644 --- a/services/mariadb/go.sum +++ b/services/mariadb/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/mongodbflex/CHANGELOG.md b/services/mongodbflex/CHANGELOG.md index 74d290023..4856cfb91 100644 --- a/services/mongodbflex/CHANGELOG.md +++ b/services/mongodbflex/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.18.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.17.0 (2025-01-20) + +- **Breaking change**: Delete endpoint made private. + ## v0.16.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/mongodbflex/LICENSE.md b/services/mongodbflex/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/mongodbflex/LICENSE.md +++ b/services/mongodbflex/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/mongodbflex/NOTICE.txt b/services/mongodbflex/NOTICE.txt index 8dfdbdd29..12ee688d9 100644 --- a/services/mongodbflex/NOTICE.txt +++ b/services/mongodbflex/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT MongoDB Flex SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/mongodbflex/api_default.go b/services/mongodbflex/api_default.go index 955bcd3c2..92a3934f8 100644 --- a/services/mongodbflex/api_default.go +++ b/services/mongodbflex/api_default.go @@ -803,133 +803,6 @@ func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, ins return r.Execute() } -type ApiDisableServiceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiDisableServiceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableService") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return newErr - } - - return nil -} - -/* -DisableService: Delete project - -removes all instances inside project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId project id - @return ApiDisableServiceRequest -*/ -func (a *APIClient) DisableService(ctx context.Context, projectId string) ApiDisableServiceRequest { - return ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string) error { - r := ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - type ApiGetBackupRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/mongodbflex/api_default_test.go b/services/mongodbflex/api_default_test.go index 86e33b101..f84630f35 100644 --- a/services/mongodbflex/api_default_test.go +++ b/services/mongodbflex/api_default_test.go @@ -289,52 +289,6 @@ func Test_mongodbflex_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService DisableService", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for mongodbflex_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - reqErr := apiClient.DisableService(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - t.Run("Test DefaultApiService GetBackup", func(t *testing.T) { path := "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}" projectIdValue := "projectId" diff --git a/services/mongodbflex/go.mod b/services/mongodbflex/go.mod index e0970098d..bccef14a8 100644 --- a/services/mongodbflex/go.mod +++ b/services/mongodbflex/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/mongodbflex -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/mongodbflex/go.sum b/services/mongodbflex/go.sum index b7c164325..b7342b5ac 100644 --- a/services/mongodbflex/go.sum +++ b/services/mongodbflex/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/objectstorage/CHANGELOG.md b/services/objectstorage/CHANGELOG.md index 9db97c7a3..ffbc59e51 100644 --- a/services/objectstorage/CHANGELOG.md +++ b/services/objectstorage/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.1.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v1.0.0 (2025-02-05) +- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + ## v0.11.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/objectstorage/LICENSE.md b/services/objectstorage/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/objectstorage/LICENSE.md +++ b/services/objectstorage/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/objectstorage/NOTICE.txt b/services/objectstorage/NOTICE.txt index 1a7d58635..4d13cce96 100644 --- a/services/objectstorage/NOTICE.txt +++ b/services/objectstorage/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Object Storage SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/objectstorage/api_default.go b/services/objectstorage/api_default.go index 54c6174da..84418bd5b 100644 --- a/services/objectstorage/api_default.go +++ b/services/objectstorage/api_default.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -30,6 +30,7 @@ type ApiCreateAccessKeyRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string createAccessKeyPayload *CreateAccessKeyPayload credentialsGroup *string } @@ -57,8 +58,9 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/access-key" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/access-key" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -121,6 +123,17 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -187,21 +200,24 @@ Create an access key for the given project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @return ApiCreateAccessKeyRequest */ -func (a *APIClient) CreateAccessKey(ctx context.Context, projectId string) ApiCreateAccessKeyRequest { +func (a *APIClient) CreateAccessKey(ctx context.Context, projectId string, region string) ApiCreateAccessKeyRequest { return ApiCreateAccessKeyRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) CreateAccessKeyExecute(ctx context.Context, projectId string) (*CreateAccessKeyResponse, error) { +func (a *APIClient) CreateAccessKeyExecute(ctx context.Context, projectId string, region string) (*CreateAccessKeyResponse, error) { r := ApiCreateAccessKeyRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -210,6 +226,7 @@ type ApiCreateBucketRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string bucketName string } @@ -226,8 +243,9 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/bucket/{bucketName}" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"bucketName"+"}", url.PathEscape(ParameterValueToString(r.bucketName, "bucketName")), -1) localVarHeaderParams := make(map[string]string) @@ -289,6 +307,17 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -351,28 +380,30 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { /* CreateBucket: Create Bucket -Create a bucket for the given project. Bucket with the same name -cannot already exists in the object storage +Create a bucket for the given project. Bucket with the same name cannot already exists in the object storage @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @param bucketName The name has to be dns-conform. @return ApiCreateBucketRequest */ -func (a *APIClient) CreateBucket(ctx context.Context, projectId string, bucketName string) ApiCreateBucketRequest { +func (a *APIClient) CreateBucket(ctx context.Context, projectId string, region string, bucketName string) ApiCreateBucketRequest { return ApiCreateBucketRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, bucketName: bucketName, } } -func (a *APIClient) CreateBucketExecute(ctx context.Context, projectId string, bucketName string) (*CreateBucketResponse, error) { +func (a *APIClient) CreateBucketExecute(ctx context.Context, projectId string, region string, bucketName string) (*CreateBucketResponse, error) { r := ApiCreateBucketRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, bucketName: bucketName, } return r.Execute() @@ -382,6 +413,7 @@ type ApiCreateCredentialsGroupRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string createCredentialsGroupPayload *CreateCredentialsGroupPayload } @@ -403,8 +435,9 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/credentials-group" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/credentials-group" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -464,6 +497,17 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -539,21 +583,24 @@ CreateCredentialsGroup: Create Credentials Group @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @return ApiCreateCredentialsGroupRequest */ -func (a *APIClient) CreateCredentialsGroup(ctx context.Context, projectId string) ApiCreateCredentialsGroupRequest { +func (a *APIClient) CreateCredentialsGroup(ctx context.Context, projectId string, region string) ApiCreateCredentialsGroupRequest { return ApiCreateCredentialsGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) CreateCredentialsGroupExecute(ctx context.Context, projectId string) (*CreateCredentialsGroupResponse, error) { +func (a *APIClient) CreateCredentialsGroupExecute(ctx context.Context, projectId string, region string) (*CreateCredentialsGroupResponse, error) { r := ApiCreateCredentialsGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -562,6 +609,7 @@ type ApiDeleteAccessKeyRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string keyId string credentialsGroup *string } @@ -584,8 +632,9 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/access-key/{keyId}" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/access-key/{keyId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"keyId"+"}", url.PathEscape(ParameterValueToString(r.keyId, "keyId")), -1) localVarHeaderParams := make(map[string]string) @@ -655,6 +704,17 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -721,23 +781,26 @@ Delete an access key from the given project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @param keyId Object storage access key @return ApiDeleteAccessKeyRequest */ -func (a *APIClient) DeleteAccessKey(ctx context.Context, projectId string, keyId string) ApiDeleteAccessKeyRequest { +func (a *APIClient) DeleteAccessKey(ctx context.Context, projectId string, region string, keyId string) ApiDeleteAccessKeyRequest { return ApiDeleteAccessKeyRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, keyId: keyId, } } -func (a *APIClient) DeleteAccessKeyExecute(ctx context.Context, projectId string, keyId string) (*DeleteAccessKeyResponse, error) { +func (a *APIClient) DeleteAccessKeyExecute(ctx context.Context, projectId string, region string, keyId string) (*DeleteAccessKeyResponse, error) { r := ApiDeleteAccessKeyRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, keyId: keyId, } return r.Execute() @@ -747,6 +810,7 @@ type ApiDeleteBucketRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string bucketName string } @@ -763,8 +827,9 @@ func (r ApiDeleteBucketRequest) Execute() (*DeleteBucketResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/bucket/{bucketName}" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"bucketName"+"}", url.PathEscape(ParameterValueToString(r.bucketName, "bucketName")), -1) localVarHeaderParams := make(map[string]string) @@ -826,6 +891,17 @@ func (r ApiDeleteBucketRequest) Execute() (*DeleteBucketResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -881,23 +957,26 @@ Delete a bucket from the given project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @param bucketName The name has to be dns-conform. @return ApiDeleteBucketRequest */ -func (a *APIClient) DeleteBucket(ctx context.Context, projectId string, bucketName string) ApiDeleteBucketRequest { +func (a *APIClient) DeleteBucket(ctx context.Context, projectId string, region string, bucketName string) ApiDeleteBucketRequest { return ApiDeleteBucketRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, bucketName: bucketName, } } -func (a *APIClient) DeleteBucketExecute(ctx context.Context, projectId string, bucketName string) (*DeleteBucketResponse, error) { +func (a *APIClient) DeleteBucketExecute(ctx context.Context, projectId string, region string, bucketName string) (*DeleteBucketResponse, error) { r := ApiDeleteBucketRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, bucketName: bucketName, } return r.Execute() @@ -907,6 +986,7 @@ type ApiDeleteCredentialsGroupRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string groupId string } @@ -923,8 +1003,9 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/credentials-group/{groupId}" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/credentials-group/{groupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(ParameterValueToString(r.groupId, "groupId")), -1) localVarHeaderParams := make(map[string]string) @@ -980,6 +1061,17 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1031,28 +1123,30 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp /* DeleteCredentialsGroup: Delete Credentials Group -Delete a credentials group inside a project if the project -exists and no valid access keys are left in the group. +Delete a credentials group inside a project if the project exists and no valid access keys are left in the group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @param groupId Id of the credentials group @return ApiDeleteCredentialsGroupRequest */ -func (a *APIClient) DeleteCredentialsGroup(ctx context.Context, projectId string, groupId string) ApiDeleteCredentialsGroupRequest { +func (a *APIClient) DeleteCredentialsGroup(ctx context.Context, projectId string, region string, groupId string) ApiDeleteCredentialsGroupRequest { return ApiDeleteCredentialsGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, groupId: groupId, } } -func (a *APIClient) DeleteCredentialsGroupExecute(ctx context.Context, projectId string, groupId string) (*DeleteCredentialsGroupResponse, error) { +func (a *APIClient) DeleteCredentialsGroupExecute(ctx context.Context, projectId string, region string, groupId string) (*DeleteCredentialsGroupResponse, error) { r := ApiDeleteCredentialsGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, groupId: groupId, } return r.Execute() @@ -1062,6 +1156,7 @@ type ApiDisableServiceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string } func (r ApiDisableServiceRequest) Execute() (*ProjectStatus, error) { @@ -1077,8 +1172,9 @@ func (r ApiDisableServiceRequest) Execute() (*ProjectStatus, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1144,6 +1240,17 @@ func (r ApiDisableServiceRequest) Execute() (*ProjectStatus, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1210,21 +1317,24 @@ Delete the given project @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @return ApiDisableServiceRequest */ -func (a *APIClient) DisableService(ctx context.Context, projectId string) ApiDisableServiceRequest { +func (a *APIClient) DisableService(ctx context.Context, projectId string, region string) ApiDisableServiceRequest { return ApiDisableServiceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string) (*ProjectStatus, error) { +func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string, region string) (*ProjectStatus, error) { r := ApiDisableServiceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -1233,6 +1343,7 @@ type ApiEnableServiceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string } func (r ApiEnableServiceRequest) Execute() (*ProjectStatus, error) { @@ -1248,8 +1359,9 @@ func (r ApiEnableServiceRequest) Execute() (*ProjectStatus, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1304,6 +1416,17 @@ func (r ApiEnableServiceRequest) Execute() (*ProjectStatus, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1371,21 +1494,24 @@ already exists, but will not create a duplicate @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @return ApiEnableServiceRequest */ -func (a *APIClient) EnableService(ctx context.Context, projectId string) ApiEnableServiceRequest { +func (a *APIClient) EnableService(ctx context.Context, projectId string, region string) ApiEnableServiceRequest { return ApiEnableServiceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) EnableServiceExecute(ctx context.Context, projectId string) (*ProjectStatus, error) { +func (a *APIClient) EnableServiceExecute(ctx context.Context, projectId string, region string) (*ProjectStatus, error) { r := ApiEnableServiceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -1394,6 +1520,7 @@ type ApiGetBucketRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string bucketName string } @@ -1410,8 +1537,9 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/bucket/{bucketName}" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"bucketName"+"}", url.PathEscape(ParameterValueToString(r.bucketName, "bucketName")), -1) localVarHeaderParams := make(map[string]string) @@ -1473,6 +1601,17 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1539,23 +1678,26 @@ Get information for the given bucket in the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @param bucketName The name has to be dns-conform. @return ApiGetBucketRequest */ -func (a *APIClient) GetBucket(ctx context.Context, projectId string, bucketName string) ApiGetBucketRequest { +func (a *APIClient) GetBucket(ctx context.Context, projectId string, region string, bucketName string) ApiGetBucketRequest { return ApiGetBucketRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, bucketName: bucketName, } } -func (a *APIClient) GetBucketExecute(ctx context.Context, projectId string, bucketName string) (*GetBucketResponse, error) { +func (a *APIClient) GetBucketExecute(ctx context.Context, projectId string, region string, bucketName string) (*GetBucketResponse, error) { r := ApiGetBucketRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, bucketName: bucketName, } return r.Execute() @@ -1565,6 +1707,7 @@ type ApiGetServiceStatusRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string } func (r ApiGetServiceStatusRequest) Execute() (*ProjectStatus, error) { @@ -1580,8 +1723,9 @@ func (r ApiGetServiceStatusRequest) Execute() (*ProjectStatus, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1636,6 +1780,17 @@ func (r ApiGetServiceStatusRequest) Execute() (*ProjectStatus, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1702,21 +1857,24 @@ Get project details. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @return ApiGetServiceStatusRequest */ -func (a *APIClient) GetServiceStatus(ctx context.Context, projectId string) ApiGetServiceStatusRequest { +func (a *APIClient) GetServiceStatus(ctx context.Context, projectId string, region string) ApiGetServiceStatusRequest { return ApiGetServiceStatusRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) GetServiceStatusExecute(ctx context.Context, projectId string) (*ProjectStatus, error) { +func (a *APIClient) GetServiceStatusExecute(ctx context.Context, projectId string, region string) (*ProjectStatus, error) { r := ApiGetServiceStatusRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -1725,6 +1883,7 @@ type ApiListAccessKeysRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string credentialsGroup *string } @@ -1746,8 +1905,9 @@ func (r ApiListAccessKeysRequest) Execute() (*ListAccessKeysResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/access-keys" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/access-keys" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1805,6 +1965,17 @@ func (r ApiListAccessKeysRequest) Execute() (*ListAccessKeysResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1871,21 +2042,24 @@ Get a list of access keys for the given project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @return ApiListAccessKeysRequest */ -func (a *APIClient) ListAccessKeys(ctx context.Context, projectId string) ApiListAccessKeysRequest { +func (a *APIClient) ListAccessKeys(ctx context.Context, projectId string, region string) ApiListAccessKeysRequest { return ApiListAccessKeysRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListAccessKeysExecute(ctx context.Context, projectId string) (*ListAccessKeysResponse, error) { +func (a *APIClient) ListAccessKeysExecute(ctx context.Context, projectId string, region string) (*ListAccessKeysResponse, error) { r := ApiListAccessKeysRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -1894,6 +2068,7 @@ type ApiListBucketsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string } func (r ApiListBucketsRequest) Execute() (*ListBucketsResponse, error) { @@ -1909,8 +2084,9 @@ func (r ApiListBucketsRequest) Execute() (*ListBucketsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/buckets" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/buckets" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1965,6 +2141,17 @@ func (r ApiListBucketsRequest) Execute() (*ListBucketsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2031,21 +2218,24 @@ Get the list of all buckets in the given project @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @return ApiListBucketsRequest */ -func (a *APIClient) ListBuckets(ctx context.Context, projectId string) ApiListBucketsRequest { +func (a *APIClient) ListBuckets(ctx context.Context, projectId string, region string) ApiListBucketsRequest { return ApiListBucketsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListBucketsExecute(ctx context.Context, projectId string) (*ListBucketsResponse, error) { +func (a *APIClient) ListBucketsExecute(ctx context.Context, projectId string, region string) (*ListBucketsResponse, error) { r := ApiListBucketsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -2054,6 +2244,7 @@ type ApiListCredentialsGroupsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string } func (r ApiListCredentialsGroupsRequest) Execute() (*ListCredentialsGroupsResponse, error) { @@ -2069,8 +2260,9 @@ func (r ApiListCredentialsGroupsRequest) Execute() (*ListCredentialsGroupsRespon return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/project/{projectId}/credentials-groups" + localVarPath := localBasePath + "/v2/project/{projectId}/regions/{region}/credentials-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2125,6 +2317,17 @@ func (r ApiListCredentialsGroupsRequest) Execute() (*ListCredentialsGroupsRespon Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v ErrorMessage err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2180,21 +2383,24 @@ Get credentials groups inside a project if the project exists @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId STACKIT project ID + @param region STACKIT Region @return ApiListCredentialsGroupsRequest */ -func (a *APIClient) ListCredentialsGroups(ctx context.Context, projectId string) ApiListCredentialsGroupsRequest { +func (a *APIClient) ListCredentialsGroups(ctx context.Context, projectId string, region string) ApiListCredentialsGroupsRequest { return ApiListCredentialsGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListCredentialsGroupsExecute(ctx context.Context, projectId string) (*ListCredentialsGroupsResponse, error) { +func (a *APIClient) ListCredentialsGroupsExecute(ctx context.Context, projectId string, region string) (*ListCredentialsGroupsResponse, error) { r := ApiListCredentialsGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } diff --git a/services/objectstorage/api_default_test.go b/services/objectstorage/api_default_test.go index d4adede15..719792747 100644 --- a/services/objectstorage/api_default_test.go +++ b/services/objectstorage/api_default_test.go @@ -24,9 +24,11 @@ import ( func Test_objectstorage_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CreateAccessKey", func(t *testing.T) { - path := "/v1/project/{projectId}/access-key" + path := "/v2/project/{projectId}/regions/{region}/access-key" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -64,9 +66,10 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" createAccessKeyPayload := CreateAccessKeyPayload{} - resp, reqErr := apiClient.CreateAccessKey(context.Background(), projectId).CreateAccessKeyPayload(createAccessKeyPayload).Execute() + resp, reqErr := apiClient.CreateAccessKey(context.Background(), projectId, region).CreateAccessKeyPayload(createAccessKeyPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -77,9 +80,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateBucket", func(t *testing.T) { - path := "/v1/project/{projectId}/bucket/{bucketName}" + path := "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) bucketNameValue := "bucketName" path = strings.Replace(path, "{"+"bucketName"+"}", url.PathEscape(ParameterValueToString(bucketNameValue, "bucketName")), -1) @@ -119,9 +124,10 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" bucketName := "bucketName" - resp, reqErr := apiClient.CreateBucket(context.Background(), projectId, bucketName).Execute() + resp, reqErr := apiClient.CreateBucket(context.Background(), projectId, region, bucketName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -132,9 +138,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateCredentialsGroup", func(t *testing.T) { - path := "/v1/project/{projectId}/credentials-group" + path := "/v2/project/{projectId}/regions/{region}/credentials-group" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -172,9 +180,10 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" createCredentialsGroupPayload := CreateCredentialsGroupPayload{} - resp, reqErr := apiClient.CreateCredentialsGroup(context.Background(), projectId).CreateCredentialsGroupPayload(createCredentialsGroupPayload).Execute() + resp, reqErr := apiClient.CreateCredentialsGroup(context.Background(), projectId, region).CreateCredentialsGroupPayload(createCredentialsGroupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -185,9 +194,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteAccessKey", func(t *testing.T) { - path := "/v1/project/{projectId}/access-key/{keyId}" + path := "/v2/project/{projectId}/regions/{region}/access-key/{keyId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) keyIdValue := "keyId" path = strings.Replace(path, "{"+"keyId"+"}", url.PathEscape(ParameterValueToString(keyIdValue, "keyId")), -1) @@ -227,9 +238,10 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" keyId := "keyId" - resp, reqErr := apiClient.DeleteAccessKey(context.Background(), projectId, keyId).Execute() + resp, reqErr := apiClient.DeleteAccessKey(context.Background(), projectId, region, keyId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -240,9 +252,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteBucket", func(t *testing.T) { - path := "/v1/project/{projectId}/bucket/{bucketName}" + path := "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) bucketNameValue := "bucketName" path = strings.Replace(path, "{"+"bucketName"+"}", url.PathEscape(ParameterValueToString(bucketNameValue, "bucketName")), -1) @@ -282,9 +296,10 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" bucketName := "bucketName" - resp, reqErr := apiClient.DeleteBucket(context.Background(), projectId, bucketName).Execute() + resp, reqErr := apiClient.DeleteBucket(context.Background(), projectId, region, bucketName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -295,9 +310,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteCredentialsGroup", func(t *testing.T) { - path := "/v1/project/{projectId}/credentials-group/{groupId}" + path := "/v2/project/{projectId}/regions/{region}/credentials-group/{groupId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) groupIdValue := "groupId" path = strings.Replace(path, "{"+"groupId"+"}", url.PathEscape(ParameterValueToString(groupIdValue, "groupId")), -1) @@ -337,9 +354,10 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" groupId := "groupId" - resp, reqErr := apiClient.DeleteCredentialsGroup(context.Background(), projectId, groupId).Execute() + resp, reqErr := apiClient.DeleteCredentialsGroup(context.Background(), projectId, region, groupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -350,9 +368,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DisableService", func(t *testing.T) { - path := "/v1/project/{projectId}" + path := "/v2/project/{projectId}/regions/{region}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -390,8 +410,9 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.DisableService(context.Background(), projectId).Execute() + resp, reqErr := apiClient.DisableService(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -402,9 +423,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService EnableService", func(t *testing.T) { - path := "/v1/project/{projectId}" + path := "/v2/project/{projectId}/regions/{region}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -442,8 +465,9 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.EnableService(context.Background(), projectId).Execute() + resp, reqErr := apiClient.EnableService(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -454,9 +478,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetBucket", func(t *testing.T) { - path := "/v1/project/{projectId}/bucket/{bucketName}" + path := "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) bucketNameValue := "bucketName" path = strings.Replace(path, "{"+"bucketName"+"}", url.PathEscape(ParameterValueToString(bucketNameValue, "bucketName")), -1) @@ -496,9 +522,10 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" bucketName := "bucketName" - resp, reqErr := apiClient.GetBucket(context.Background(), projectId, bucketName).Execute() + resp, reqErr := apiClient.GetBucket(context.Background(), projectId, region, bucketName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -509,9 +536,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetServiceStatus", func(t *testing.T) { - path := "/v1/project/{projectId}" + path := "/v2/project/{projectId}/regions/{region}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -549,8 +578,9 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.GetServiceStatus(context.Background(), projectId).Execute() + resp, reqErr := apiClient.GetServiceStatus(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -561,9 +591,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListAccessKeys", func(t *testing.T) { - path := "/v1/project/{projectId}/access-keys" + path := "/v2/project/{projectId}/regions/{region}/access-keys" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -601,8 +633,9 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.ListAccessKeys(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListAccessKeys(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -613,9 +646,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListBuckets", func(t *testing.T) { - path := "/v1/project/{projectId}/buckets" + path := "/v2/project/{projectId}/regions/{region}/buckets" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -653,8 +688,9 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.ListBuckets(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListBuckets(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -665,9 +701,11 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListCredentialsGroups", func(t *testing.T) { - path := "/v1/project/{projectId}/credentials-groups" + path := "/v2/project/{projectId}/regions/{region}/credentials-groups" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -705,8 +743,9 @@ func Test_objectstorage_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.ListCredentialsGroups(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListCredentialsGroups(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) diff --git a/services/objectstorage/client.go b/services/objectstorage/client.go index 40db4909c..2bdb9c09a 100644 --- a/services/objectstorage/client.go +++ b/services/objectstorage/client.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT Object Storage API API v1.1.0 +// APIClient manages communication with the STACKIT Object Storage API API v2.0.1 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration @@ -66,10 +66,7 @@ func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { } } - err := config.ConfigureRegion(cfg) - if err != nil { - return nil, fmt.Errorf("configuring region: %w", err) - } + // using new regional api, so no region is set here if cfg.HTTPClient == nil { cfg.HTTPClient = &http.Client{} diff --git a/services/objectstorage/configuration.go b/services/objectstorage/configuration.go index 363504330..d3aab1212 100644 --- a/services/objectstorage/configuration.go +++ b/services/objectstorage/configuration.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/go.mod b/services/objectstorage/go.mod index 172fdaaec..7425e1edc 100644 --- a/services/objectstorage/go.mod +++ b/services/objectstorage/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/objectstorage -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/objectstorage/go.sum b/services/objectstorage/go.sum index b7c164325..b7342b5ac 100644 --- a/services/objectstorage/go.sum +++ b/services/objectstorage/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/objectstorage/model_access_key.go b/services/objectstorage/model_access_key.go index 08615c80a..bd272c366 100644 --- a/services/objectstorage/model_access_key.go +++ b/services/objectstorage/model_access_key.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_bucket.go b/services/objectstorage/model_bucket.go index b44817030..100bc70fc 100644 --- a/services/objectstorage/model_bucket.go +++ b/services/objectstorage/model_bucket.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_create_access_key_payload.go b/services/objectstorage/model_create_access_key_payload.go index 509d77682..decb82e28 100644 --- a/services/objectstorage/model_create_access_key_payload.go +++ b/services/objectstorage/model_create_access_key_payload.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_create_access_key_response.go b/services/objectstorage/model_create_access_key_response.go index 585cc7fcb..6d5aff58c 100644 --- a/services/objectstorage/model_create_access_key_response.go +++ b/services/objectstorage/model_create_access_key_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_create_bucket_response.go b/services/objectstorage/model_create_bucket_response.go index 312ec9953..dc9df91ed 100644 --- a/services/objectstorage/model_create_bucket_response.go +++ b/services/objectstorage/model_create_bucket_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_create_credentials_group_payload.go b/services/objectstorage/model_create_credentials_group_payload.go index 3b3610957..cd9b683dc 100644 --- a/services/objectstorage/model_create_credentials_group_payload.go +++ b/services/objectstorage/model_create_credentials_group_payload.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_create_credentials_group_response.go b/services/objectstorage/model_create_credentials_group_response.go index 7b2ef543e..97becee1f 100644 --- a/services/objectstorage/model_create_credentials_group_response.go +++ b/services/objectstorage/model_create_credentials_group_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_credentials_group.go b/services/objectstorage/model_credentials_group.go index 7b2aed62a..7f0ab72a9 100644 --- a/services/objectstorage/model_credentials_group.go +++ b/services/objectstorage/model_credentials_group.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_delete_access_key_response.go b/services/objectstorage/model_delete_access_key_response.go index fd368cdde..6380c652d 100644 --- a/services/objectstorage/model_delete_access_key_response.go +++ b/services/objectstorage/model_delete_access_key_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_delete_bucket_response.go b/services/objectstorage/model_delete_bucket_response.go index f52c49b0d..758d74deb 100644 --- a/services/objectstorage/model_delete_bucket_response.go +++ b/services/objectstorage/model_delete_bucket_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_delete_credentials_group_response.go b/services/objectstorage/model_delete_credentials_group_response.go index 9e00acfd6..95877fda9 100644 --- a/services/objectstorage/model_delete_credentials_group_response.go +++ b/services/objectstorage/model_delete_credentials_group_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_detailed_error.go b/services/objectstorage/model_detailed_error.go index 9cc6c9c00..dc671ebb3 100644 --- a/services/objectstorage/model_detailed_error.go +++ b/services/objectstorage/model_detailed_error.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_error_message.go b/services/objectstorage/model_error_message.go index 14f0f3d7a..627d03eba 100644 --- a/services/objectstorage/model_error_message.go +++ b/services/objectstorage/model_error_message.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_get_bucket_response.go b/services/objectstorage/model_get_bucket_response.go index 30a0b5606..fe77ff4fa 100644 --- a/services/objectstorage/model_get_bucket_response.go +++ b/services/objectstorage/model_get_bucket_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_http_validation_error.go b/services/objectstorage/model_http_validation_error.go index 4439ff495..93e67d4f6 100644 --- a/services/objectstorage/model_http_validation_error.go +++ b/services/objectstorage/model_http_validation_error.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_list_access_keys_response.go b/services/objectstorage/model_list_access_keys_response.go index 853f59f27..3b54ca154 100644 --- a/services/objectstorage/model_list_access_keys_response.go +++ b/services/objectstorage/model_list_access_keys_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_list_buckets_response.go b/services/objectstorage/model_list_buckets_response.go index 599d20ecf..94cb7fffb 100644 --- a/services/objectstorage/model_list_buckets_response.go +++ b/services/objectstorage/model_list_buckets_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_list_credentials_groups_response.go b/services/objectstorage/model_list_credentials_groups_response.go index 605efe663..dfc6e0f48 100644 --- a/services/objectstorage/model_list_credentials_groups_response.go +++ b/services/objectstorage/model_list_credentials_groups_response.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_location_inner.go b/services/objectstorage/model_location_inner.go index ec3fb5212..a1a9b67dd 100644 --- a/services/objectstorage/model_location_inner.go +++ b/services/objectstorage/model_location_inner.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_project_scope.go b/services/objectstorage/model_project_scope.go index a46e9e5aa..fe7b0e05c 100644 --- a/services/objectstorage/model_project_scope.go +++ b/services/objectstorage/model_project_scope.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_project_status.go b/services/objectstorage/model_project_status.go index 8030f2eb0..e0bc51a60 100644 --- a/services/objectstorage/model_project_status.go +++ b/services/objectstorage/model_project_status.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/model_validation_error.go b/services/objectstorage/model_validation_error.go index b7a682498..44c81a575 100644 --- a/services/objectstorage/model_validation_error.go +++ b/services/objectstorage/model_validation_error.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/utils.go b/services/objectstorage/utils.go index 4af60db6d..67b9bb142 100644 --- a/services/objectstorage/utils.go +++ b/services/objectstorage/utils.go @@ -3,7 +3,7 @@ STACKIT Object Storage API STACKIT API to manage the Object Storage -API version: 1.1.0 +API version: 2.0.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/objectstorage/wait/wait.go b/services/objectstorage/wait/wait.go index a05dd14ef..b805e0a43 100644 --- a/services/objectstorage/wait/wait.go +++ b/services/objectstorage/wait/wait.go @@ -13,13 +13,13 @@ import ( // Interface needed for tests type APIClientBucketInterface interface { - GetBucketExecute(ctx context.Context, projectId string, bucketName string) (*objectstorage.GetBucketResponse, error) + GetBucketExecute(ctx context.Context, projectId string, region, bucketName string) (*objectstorage.GetBucketResponse, error) } // CreateBucketWaitHandler will wait for bucket creation -func CreateBucketWaitHandler(ctx context.Context, a APIClientBucketInterface, projectId, bucketName string) *wait.AsyncActionHandler[objectstorage.GetBucketResponse] { +func CreateBucketWaitHandler(ctx context.Context, a APIClientBucketInterface, projectId, region, bucketName string) *wait.AsyncActionHandler[objectstorage.GetBucketResponse] { handler := wait.New(func() (waitFinished bool, response *objectstorage.GetBucketResponse, err error) { - s, err := a.GetBucketExecute(ctx, projectId, bucketName) + s, err := a.GetBucketExecute(ctx, projectId, region, bucketName) if err != nil { return false, nil, err } @@ -30,9 +30,9 @@ func CreateBucketWaitHandler(ctx context.Context, a APIClientBucketInterface, pr } // DeleteBucketWaitHandler will wait for bucket deletion -func DeleteBucketWaitHandler(ctx context.Context, a APIClientBucketInterface, projectId, bucketName string) *wait.AsyncActionHandler[struct{}] { +func DeleteBucketWaitHandler(ctx context.Context, a APIClientBucketInterface, projectId, region, bucketName string) *wait.AsyncActionHandler[struct{}] { handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { - _, err = a.GetBucketExecute(ctx, projectId, bucketName) + _, err = a.GetBucketExecute(ctx, projectId, region, bucketName) if err == nil { return false, nil, nil } diff --git a/services/objectstorage/wait/wait_test.go b/services/objectstorage/wait/wait_test.go index ee18a54f1..8fb10d6a8 100644 --- a/services/objectstorage/wait/wait_test.go +++ b/services/objectstorage/wait/wait_test.go @@ -16,7 +16,7 @@ type apiClientBucketMocked struct { bucketGetFails bool } -func (a *apiClientBucketMocked) GetBucketExecute(_ context.Context, _, _ string) (*objectstorage.GetBucketResponse, error) { +func (a *apiClientBucketMocked) GetBucketExecute(_ context.Context, _, _, _ string) (*objectstorage.GetBucketResponse, error) { if a.bucketGetFails { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, @@ -63,7 +63,7 @@ func TestCreateBucketWaitHandler(t *testing.T) { wantRes = &objectstorage.GetBucketResponse{} } - handler := CreateBucketWaitHandler(context.Background(), apiClient, "", "") + handler := CreateBucketWaitHandler(context.Background(), apiClient, "", "", "") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -101,7 +101,7 @@ func TestDeleteBucketWaitHandler(t *testing.T) { bucketGetFails: tt.bucketGetFails, } - handler := DeleteBucketWaitHandler(context.Background(), apiClient, "", "") + handler := DeleteBucketWaitHandler(context.Background(), apiClient, "", "", "") _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) diff --git a/services/observability/CHANGELOG.md b/services/observability/CHANGELOG.md index 32ef9e595..dda20fe52 100644 --- a/services/observability/CHANGELOG.md +++ b/services/observability/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.3.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.2.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/observability/LICENSE.md b/services/observability/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/observability/LICENSE.md +++ b/services/observability/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/observability/NOTICE.txt b/services/observability/NOTICE.txt index 70b11b4c6..bda9b99ab 100644 --- a/services/observability/NOTICE.txt +++ b/services/observability/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Observability SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/observability/go.mod b/services/observability/go.mod index 15fa0421d..cb7f29699 100644 --- a/services/observability/go.mod +++ b/services/observability/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/observability -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/observability/go.sum b/services/observability/go.sum index b7c164325..b7342b5ac 100644 --- a/services/observability/go.sum +++ b/services/observability/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/opensearch/CHANGELOG.md b/services/opensearch/CHANGELOG.md index c02677c89..21b5b2d8f 100644 --- a/services/opensearch/CHANGELOG.md +++ b/services/opensearch/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.20.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.19.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/opensearch/LICENSE.md b/services/opensearch/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/opensearch/LICENSE.md +++ b/services/opensearch/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/opensearch/NOTICE.txt b/services/opensearch/NOTICE.txt index 61cda5e64..ad0b4aa8d 100644 --- a/services/opensearch/NOTICE.txt +++ b/services/opensearch/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT OpenSearch SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/opensearch/api_default.go b/services/opensearch/api_default.go index 484cd7ac8..2e05598ef 100644 --- a/services/opensearch/api_default.go +++ b/services/opensearch/api_default.go @@ -1740,7 +1740,7 @@ ListOfferings: get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions @return ApiListOfferingsRequest */ func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { diff --git a/services/opensearch/go.mod b/services/opensearch/go.mod index f3c0e13e9..924905e0b 100644 --- a/services/opensearch/go.mod +++ b/services/opensearch/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/opensearch -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/opensearch/go.sum b/services/opensearch/go.sum index b7c164325..b7342b5ac 100644 --- a/services/opensearch/go.sum +++ b/services/opensearch/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/postgresflex/CHANGELOG.md b/services/postgresflex/CHANGELOG.md index 43667b564..b2445050d 100644 --- a/services/postgresflex/CHANGELOG.md +++ b/services/postgresflex/CHANGELOG.md @@ -1,4 +1,10 @@ -## v0.16.1 (2025-xx-yy) +## v0.18.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.17.0 (2025-01-20) +- **Breaking change**: Delete endpoint made private. + +## v0.16.1 (2024-12-19) - **Bugfix:** Correctly handle nullable attributes in model types ## v0.16.0 (2024-10-14) diff --git a/services/postgresflex/LICENSE.md b/services/postgresflex/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/postgresflex/LICENSE.md +++ b/services/postgresflex/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/postgresflex/NOTICE.txt b/services/postgresflex/NOTICE.txt index 6e19651bd..926de4257 100644 --- a/services/postgresflex/NOTICE.txt +++ b/services/postgresflex/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT PostgreSQL Flex SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/postgresflex/api_default.go b/services/postgresflex/api_default.go index 8b01ca2e8..64a30e22f 100644 --- a/services/postgresflex/api_default.go +++ b/services/postgresflex/api_default.go @@ -1003,133 +1003,6 @@ func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, ins return r.Execute() } -type ApiDisableServiceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiDisableServiceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableService") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return newErr - } - - return nil -} - -/* -DisableService: Terminate the Project - -Termination is the deletion of a whole project which causes the deletion of all instances for this project. Only System with permission system.databases-project.remove is able to call this resource - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiDisableServiceRequest -*/ -func (a *APIClient) DisableService(ctx context.Context, projectId string) ApiDisableServiceRequest { - return ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string) error { - r := ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - type ApiForceDeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/postgresflex/api_default_test.go b/services/postgresflex/api_default_test.go index 6a24ae70f..583368d17 100644 --- a/services/postgresflex/api_default_test.go +++ b/services/postgresflex/api_default_test.go @@ -397,52 +397,6 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService DisableService", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for postgresflex_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - reqErr := apiClient.DisableService(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - t.Run("Test DefaultApiService ForceDeleteInstance", func(t *testing.T) { path := "/v1/projects/{projectId}/instances/{instanceId}/force" projectIdValue := "projectId" diff --git a/services/postgresflex/go.mod b/services/postgresflex/go.mod index bbc0160eb..c41f57bd5 100644 --- a/services/postgresflex/go.mod +++ b/services/postgresflex/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/postgresflex -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/postgresflex/go.sum b/services/postgresflex/go.sum index b7c164325..b7342b5ac 100644 --- a/services/postgresflex/go.sum +++ b/services/postgresflex/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/rabbitmq/CHANGELOG.md b/services/rabbitmq/CHANGELOG.md index a3a137bb9..494a7dc50 100644 --- a/services/rabbitmq/CHANGELOG.md +++ b/services/rabbitmq/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.21.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.20.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/rabbitmq/LICENSE.md b/services/rabbitmq/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/rabbitmq/LICENSE.md +++ b/services/rabbitmq/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/rabbitmq/NOTICE.txt b/services/rabbitmq/NOTICE.txt index 2b9732e19..b915fcaa5 100644 --- a/services/rabbitmq/NOTICE.txt +++ b/services/rabbitmq/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT RabbitMQ SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/rabbitmq/api_default.go b/services/rabbitmq/api_default.go index 4dcd750c9..051e41c39 100644 --- a/services/rabbitmq/api_default.go +++ b/services/rabbitmq/api_default.go @@ -1740,7 +1740,7 @@ ListOfferings: get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions @return ApiListOfferingsRequest */ func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { diff --git a/services/rabbitmq/go.mod b/services/rabbitmq/go.mod index 2578ffffa..5f5044dcf 100644 --- a/services/rabbitmq/go.mod +++ b/services/rabbitmq/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/rabbitmq -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/rabbitmq/go.sum b/services/rabbitmq/go.sum index b7c164325..b7342b5ac 100644 --- a/services/rabbitmq/go.sum +++ b/services/rabbitmq/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/redis/CHANGELOG.md b/services/redis/CHANGELOG.md index 49b787e3e..ad58f2b7b 100644 --- a/services/redis/CHANGELOG.md +++ b/services/redis/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.21.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.20.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/redis/LICENSE.md b/services/redis/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/redis/LICENSE.md +++ b/services/redis/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/redis/NOTICE.txt b/services/redis/NOTICE.txt index 76d6d25b0..7e2edd3a8 100644 --- a/services/redis/NOTICE.txt +++ b/services/redis/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Redis SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/redis/api_default.go b/services/redis/api_default.go index e720de76a..cec560b75 100644 --- a/services/redis/api_default.go +++ b/services/redis/api_default.go @@ -1740,7 +1740,7 @@ ListOfferings: get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions @return ApiListOfferingsRequest */ func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { diff --git a/services/redis/go.mod b/services/redis/go.mod index 612de961f..bf165a69f 100644 --- a/services/redis/go.mod +++ b/services/redis/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/redis -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/redis/go.sum b/services/redis/go.sum index b7c164325..b7342b5ac 100644 --- a/services/redis/go.sum +++ b/services/redis/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/resourcemanager/CHANGELOG.md b/services/resourcemanager/CHANGELOG.md index a1f097cc3..810cf95a7 100644 --- a/services/resourcemanager/CHANGELOG.md +++ b/services/resourcemanager/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.13.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.12.0 (2025-01-31) + +- **Breaking Change**: Remove the methods `BffGetContainersOfAFolder` and `BffGetContainersOfAnOrganization` + ## v0.11.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/resourcemanager/LICENSE.md b/services/resourcemanager/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/resourcemanager/LICENSE.md +++ b/services/resourcemanager/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/resourcemanager/NOTICE.txt b/services/resourcemanager/NOTICE.txt index 4d84c5a13..5c5086892 100644 --- a/services/resourcemanager/NOTICE.txt +++ b/services/resourcemanager/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Resource Manager SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/resourcemanager/api_default.go b/services/resourcemanager/api_default.go index 4fe5e103c..67e29a57b 100644 --- a/services/resourcemanager/api_default.go +++ b/services/resourcemanager/api_default.go @@ -27,343 +27,6 @@ import ( // DefaultApiService DefaultApi service type DefaultApiService service -type ApiBffGetContainersOfAFolderRequest struct { - ctx context.Context - apiService *DefaultApiService - id string - limit *float32 - cursor *string -} - -// The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. - -func (r ApiBffGetContainersOfAFolderRequest) Limit(limit float32) ApiBffGetContainersOfAFolderRequest { - r.limit = &limit - return r -} - -// A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - -func (r ApiBffGetContainersOfAFolderRequest) Cursor(cursor string) ApiBffGetContainersOfAFolderRequest { - r.cursor = &cursor - return r -} - -func (r ApiBffGetContainersOfAFolderRequest) Execute() (*ListOrganizationContainersResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOrganizationContainersResponse - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.BffGetContainersOfAFolder") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/bff/folders/{id}/containers" - 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.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") - } - if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") - } - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -BffGetContainersOfAFolder: Get Containers Of A Folder - -Returns all direct resource container under this folder including their metadata. -- Response items will contain all folders first, followed by all projects -- If a folder does not have any containers, an empty items list will be returned - -**Note:** Recursion is not supported - meaning only the next level in hierarchy tree is considered! - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param id Folder identifier - UUID identifier is preferred; containerId is also supported. - @return ApiBffGetContainersOfAFolderRequest -*/ -func (a *APIClient) BffGetContainersOfAFolder(ctx context.Context, id string) ApiBffGetContainersOfAFolderRequest { - return ApiBffGetContainersOfAFolderRequest{ - apiService: a.defaultApi, - ctx: ctx, - id: id, - } -} - -func (a *APIClient) BffGetContainersOfAFolderExecute(ctx context.Context, id string) (*ListOrganizationContainersResponse, error) { - r := ApiBffGetContainersOfAFolderRequest{ - apiService: a.defaultApi, - ctx: ctx, - id: id, - } - return r.Execute() -} - -type ApiBffGetContainersOfAnOrganizationRequest struct { - ctx context.Context - apiService *DefaultApiService - id string - limit *float32 - cursor *string -} - -// The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. - -func (r ApiBffGetContainersOfAnOrganizationRequest) Limit(limit float32) ApiBffGetContainersOfAnOrganizationRequest { - r.limit = &limit - return r -} - -// A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - -func (r ApiBffGetContainersOfAnOrganizationRequest) Cursor(cursor string) ApiBffGetContainersOfAnOrganizationRequest { - r.cursor = &cursor - return r -} - -func (r ApiBffGetContainersOfAnOrganizationRequest) Execute() (*ListOrganizationContainersResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOrganizationContainersResponse - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.BffGetContainersOfAnOrganization") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/bff/organizations/{id}/containers" - 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.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") - } - if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") - } - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -BffGetContainersOfAnOrganization: Get Containers Of An Organization - -Returns all direct resource container under this organization including their metadata. -- Response items will contain all folders first, followed by all projects -- If organization does not have any containers, an empty items list will be returned - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param id Organization identifier - UUID identifier is preferred; containerId is also supported. - @return ApiBffGetContainersOfAnOrganizationRequest -*/ -func (a *APIClient) BffGetContainersOfAnOrganization(ctx context.Context, id string) ApiBffGetContainersOfAnOrganizationRequest { - return ApiBffGetContainersOfAnOrganizationRequest{ - apiService: a.defaultApi, - ctx: ctx, - id: id, - } -} - -func (a *APIClient) BffGetContainersOfAnOrganizationExecute(ctx context.Context, id string) (*ListOrganizationContainersResponse, error) { - r := ApiBffGetContainersOfAnOrganizationRequest{ - apiService: a.defaultApi, - ctx: ctx, - id: id, - } - return r.Execute() -} - type ApiCreateProjectRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/resourcemanager/api_default_test.go b/services/resourcemanager/api_default_test.go index 9e73b199b..108e289dd 100644 --- a/services/resourcemanager/api_default_test.go +++ b/services/resourcemanager/api_default_test.go @@ -23,110 +23,6 @@ import ( func Test_resourcemanager_DefaultApiService(t *testing.T) { - t.Run("Test DefaultApiService BffGetContainersOfAFolder", func(t *testing.T) { - path := "/bff/folders/{id}/containers" - idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ListOrganizationContainersResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for resourcemanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - id := "id" - - resp, reqErr := apiClient.BffGetContainersOfAFolder(context.Background(), id).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService BffGetContainersOfAnOrganization", func(t *testing.T) { - path := "/bff/organizations/{id}/containers" - idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ListOrganizationContainersResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for resourcemanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - id := "id" - - resp, reqErr := apiClient.BffGetContainersOfAnOrganization(context.Background(), id).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - t.Run("Test DefaultApiService CreateProject", func(t *testing.T) { path := "/v2/projects" diff --git a/services/resourcemanager/go.mod b/services/resourcemanager/go.mod index f9bb13f5c..6d79f290b 100644 --- a/services/resourcemanager/go.mod +++ b/services/resourcemanager/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/resourcemanager -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/resourcemanager/go.sum b/services/resourcemanager/go.sum index b7c164325..b7342b5ac 100644 --- a/services/resourcemanager/go.sum +++ b/services/resourcemanager/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/resourcemanager/model_folder_response.go b/services/resourcemanager/model_folder_response.go deleted file mode 100644 index dff1bbdec..000000000 --- a/services/resourcemanager/model_folder_response.go +++ /dev/null @@ -1,293 +0,0 @@ -/* -Resource Manager API - -API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - -API version: 2.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package resourcemanager - -import ( - "encoding/json" - "time" -) - -// checks if the FolderResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &FolderResponse{} - -// FolderResponse struct for FolderResponse -type FolderResponse struct { - // Globally unique, user-friendly identifier. - // REQUIRED - ContainerId *string `json:"containerId"` - // Timestamp at which the folder was created. - // REQUIRED - CreationTime *time.Time `json:"creationTime"` - // Globally unique folder identifier. - // REQUIRED - FolderId *string `json:"folderId"` - // Labels are key-value string pairs that can be attached to a resource container. Some labels may be enforced via policies. - A label key must match the regex `[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - A label value must match the regex `^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - Labels *map[string]string `json:"labels,omitempty"` - // Folder name. - // REQUIRED - Name *string `json:"name"` - // REQUIRED - Parent *Parent `json:"parent"` - // Timestamp at which the folder was last modified. - // REQUIRED - UpdateTime *time.Time `json:"updateTime"` -} - -type _FolderResponse FolderResponse - -// NewFolderResponse instantiates a new FolderResponse object -// This constructor will assign default values to properties that have it defined, -// 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 NewFolderResponse(containerId *string, creationTime *time.Time, folderId *string, name *string, parent *Parent, updateTime *time.Time) *FolderResponse { - this := FolderResponse{} - this.ContainerId = containerId - this.CreationTime = creationTime - this.FolderId = folderId - this.Name = name - this.Parent = parent - this.UpdateTime = updateTime - return &this -} - -// NewFolderResponseWithDefaults instantiates a new FolderResponse object -// This 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 NewFolderResponseWithDefaults() *FolderResponse { - this := FolderResponse{} - return &this -} - -// GetContainerId returns the ContainerId field value -func (o *FolderResponse) GetContainerId() *string { - if o == nil || IsNil(o.ContainerId) { - var ret *string - return ret - } - - return o.ContainerId -} - -// GetContainerIdOk returns a tuple with the ContainerId field value -// and a boolean to check if the value has been set. -func (o *FolderResponse) GetContainerIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerId, true -} - -// SetContainerId sets field value -func (o *FolderResponse) SetContainerId(v *string) { - o.ContainerId = v -} - -// GetCreationTime returns the CreationTime field value -func (o *FolderResponse) GetCreationTime() *time.Time { - if o == nil || IsNil(o.CreationTime) { - var ret *time.Time - return ret - } - - return o.CreationTime -} - -// GetCreationTimeOk returns a tuple with the CreationTime field value -// and a boolean to check if the value has been set. -func (o *FolderResponse) GetCreationTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreationTime, true -} - -// SetCreationTime sets field value -func (o *FolderResponse) SetCreationTime(v *time.Time) { - o.CreationTime = v -} - -// GetFolderId returns the FolderId field value -func (o *FolderResponse) GetFolderId() *string { - if o == nil || IsNil(o.FolderId) { - var ret *string - return ret - } - - return o.FolderId -} - -// GetFolderIdOk returns a tuple with the FolderId field value -// and a boolean to check if the value has been set. -func (o *FolderResponse) GetFolderIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.FolderId, true -} - -// SetFolderId sets field value -func (o *FolderResponse) SetFolderId(v *string) { - o.FolderId = v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *FolderResponse) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels -} - -// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FolderResponse) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *FolderResponse) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *FolderResponse) SetLabels(v *map[string]string) { - o.Labels = v -} - -// GetName returns the Name field value -func (o *FolderResponse) 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 -// and a boolean to check if the value has been set. -func (o *FolderResponse) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true -} - -// SetName sets field value -func (o *FolderResponse) SetName(v *string) { - o.Name = v -} - -// GetParent returns the Parent field value -func (o *FolderResponse) GetParent() *Parent { - if o == nil || IsNil(o.Parent) { - var ret *Parent - return ret - } - - return o.Parent -} - -// GetParentOk returns a tuple with the Parent field value -// and a boolean to check if the value has been set. -func (o *FolderResponse) GetParentOk() (*Parent, bool) { - if o == nil { - return nil, false - } - return o.Parent, true -} - -// SetParent sets field value -func (o *FolderResponse) SetParent(v *Parent) { - o.Parent = v -} - -// GetUpdateTime returns the UpdateTime field value -func (o *FolderResponse) GetUpdateTime() *time.Time { - if o == nil || IsNil(o.UpdateTime) { - var ret *time.Time - return ret - } - - return o.UpdateTime -} - -// GetUpdateTimeOk returns a tuple with the UpdateTime field value -// and a boolean to check if the value has been set. -func (o *FolderResponse) GetUpdateTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.UpdateTime, true -} - -// SetUpdateTime sets field value -func (o *FolderResponse) SetUpdateTime(v *time.Time) { - o.UpdateTime = v -} - -func (o FolderResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["containerId"] = o.ContainerId - toSerialize["creationTime"] = o.CreationTime - toSerialize["folderId"] = o.FolderId - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - toSerialize["parent"] = o.Parent - toSerialize["updateTime"] = o.UpdateTime - return toSerialize, nil -} - -type NullableFolderResponse struct { - value *FolderResponse - isSet bool -} - -func (v NullableFolderResponse) Get() *FolderResponse { - return v.value -} - -func (v *NullableFolderResponse) Set(val *FolderResponse) { - v.value = val - v.isSet = true -} - -func (v NullableFolderResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableFolderResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFolderResponse(val *FolderResponse) *NullableFolderResponse { - return &NullableFolderResponse{value: val, isSet: true} -} - -func (v NullableFolderResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFolderResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/resourcemanager/model_list_organization_containers_response.go b/services/resourcemanager/model_list_organization_containers_response.go deleted file mode 100644 index 26a97a475..000000000 --- a/services/resourcemanager/model_list_organization_containers_response.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -Resource Manager API - -API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - -API version: 2.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package resourcemanager - -import ( - "encoding/json" -) - -// checks if the ListOrganizationContainersResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOrganizationContainersResponse{} - -// ListOrganizationContainersResponse struct for ListOrganizationContainersResponse -type ListOrganizationContainersResponse struct { - // A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - // REQUIRED - Cursor *string `json:"cursor"` - // REQUIRED - Items *[]ListOrganizationContainersResponseItemsInner `json:"items"` - // The maximum number of projects to return in the response. If not present, an appropriate default will be used. - // REQUIRED - Limit *float64 `json:"limit"` -} - -type _ListOrganizationContainersResponse ListOrganizationContainersResponse - -// NewListOrganizationContainersResponse instantiates a new ListOrganizationContainersResponse object -// This constructor will assign default values to properties that have it defined, -// 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 NewListOrganizationContainersResponse(cursor *string, items *[]ListOrganizationContainersResponseItemsInner, limit *float64) *ListOrganizationContainersResponse { - this := ListOrganizationContainersResponse{} - this.Cursor = cursor - this.Items = items - this.Limit = limit - return &this -} - -// NewListOrganizationContainersResponseWithDefaults instantiates a new ListOrganizationContainersResponse object -// This 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 NewListOrganizationContainersResponseWithDefaults() *ListOrganizationContainersResponse { - this := ListOrganizationContainersResponse{} - var limit float64 = 50 - this.Limit = &limit - return &this -} - -// GetCursor returns the Cursor field value -func (o *ListOrganizationContainersResponse) GetCursor() *string { - if o == nil || IsNil(o.Cursor) { - var ret *string - return ret - } - - return o.Cursor -} - -// GetCursorOk returns a tuple with the Cursor field value -// and a boolean to check if the value has been set. -func (o *ListOrganizationContainersResponse) GetCursorOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Cursor, true -} - -// SetCursor sets field value -func (o *ListOrganizationContainersResponse) SetCursor(v *string) { - o.Cursor = v -} - -// GetItems returns the Items field value -func (o *ListOrganizationContainersResponse) GetItems() *[]ListOrganizationContainersResponseItemsInner { - if o == nil || IsNil(o.Items) { - var ret *[]ListOrganizationContainersResponseItemsInner - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOrganizationContainersResponse) GetItemsOk() (*[]ListOrganizationContainersResponseItemsInner, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOrganizationContainersResponse) SetItems(v *[]ListOrganizationContainersResponseItemsInner) { - o.Items = v -} - -// GetLimit returns the Limit field value -func (o *ListOrganizationContainersResponse) GetLimit() *float64 { - if o == nil || IsNil(o.Limit) { - var ret *float64 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOrganizationContainersResponse) GetLimitOk() (*float64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true -} - -// SetLimit sets field value -func (o *ListOrganizationContainersResponse) SetLimit(v *float64) { - o.Limit = v -} - -func (o ListOrganizationContainersResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["cursor"] = o.Cursor - toSerialize["items"] = o.Items - toSerialize["limit"] = o.Limit - return toSerialize, nil -} - -type NullableListOrganizationContainersResponse struct { - value *ListOrganizationContainersResponse - isSet bool -} - -func (v NullableListOrganizationContainersResponse) Get() *ListOrganizationContainersResponse { - return v.value -} - -func (v *NullableListOrganizationContainersResponse) Set(val *ListOrganizationContainersResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOrganizationContainersResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOrganizationContainersResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOrganizationContainersResponse(val *ListOrganizationContainersResponse) *NullableListOrganizationContainersResponse { - return &NullableListOrganizationContainersResponse{value: val, isSet: true} -} - -func (v NullableListOrganizationContainersResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOrganizationContainersResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/resourcemanager/model_list_organization_containers_response_items_inner.go b/services/resourcemanager/model_list_organization_containers_response_items_inner.go deleted file mode 100644 index 45a117720..000000000 --- a/services/resourcemanager/model_list_organization_containers_response_items_inner.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Resource Manager API - -API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - -API version: 2.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package resourcemanager - -import ( - "encoding/json" - "fmt" -) - -// ListOrganizationContainersResponseItemsInner struct for ListOrganizationContainersResponseItemsInner -type ListOrganizationContainersResponseItemsInner struct { - ListOrganizationContainersResponseItemsInnerAnyOf *ListOrganizationContainersResponseItemsInnerAnyOf - ListOrganizationContainersResponseItemsInnerAnyOf1 *ListOrganizationContainersResponseItemsInnerAnyOf1 -} - -// Unmarshal JSON data into any of the pointers in the struct -func (dst *ListOrganizationContainersResponseItemsInner) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal JSON data into ListOrganizationContainersResponseItemsInnerAnyOf - err = json.Unmarshal(data, &dst.ListOrganizationContainersResponseItemsInnerAnyOf) - if err == nil { - jsonListOrganizationContainersResponseItemsInnerAnyOf, _ := json.Marshal(dst.ListOrganizationContainersResponseItemsInnerAnyOf) - if string(jsonListOrganizationContainersResponseItemsInnerAnyOf) == "{}" { // empty struct - dst.ListOrganizationContainersResponseItemsInnerAnyOf = nil - } else { - return nil // data stored in dst.ListOrganizationContainersResponseItemsInnerAnyOf, return on the first match - } - } else { - dst.ListOrganizationContainersResponseItemsInnerAnyOf = nil - } - - // try to unmarshal JSON data into ListOrganizationContainersResponseItemsInnerAnyOf1 - err = json.Unmarshal(data, &dst.ListOrganizationContainersResponseItemsInnerAnyOf1) - if err == nil { - jsonListOrganizationContainersResponseItemsInnerAnyOf1, _ := json.Marshal(dst.ListOrganizationContainersResponseItemsInnerAnyOf1) - if string(jsonListOrganizationContainersResponseItemsInnerAnyOf1) == "{}" { // empty struct - dst.ListOrganizationContainersResponseItemsInnerAnyOf1 = nil - } else { - return nil // data stored in dst.ListOrganizationContainersResponseItemsInnerAnyOf1, return on the first match - } - } else { - dst.ListOrganizationContainersResponseItemsInnerAnyOf1 = nil - } - - return fmt.Errorf("data failed to match schemas in anyOf(ListOrganizationContainersResponseItemsInner)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src *ListOrganizationContainersResponseItemsInner) MarshalJSON() ([]byte, error) { - if src.ListOrganizationContainersResponseItemsInnerAnyOf != nil { - return json.Marshal(&src.ListOrganizationContainersResponseItemsInnerAnyOf) - } - - if src.ListOrganizationContainersResponseItemsInnerAnyOf1 != nil { - return json.Marshal(&src.ListOrganizationContainersResponseItemsInnerAnyOf1) - } - - return nil, nil // no data in anyOf schemas -} - -type NullableListOrganizationContainersResponseItemsInner struct { - value *ListOrganizationContainersResponseItemsInner - isSet bool -} - -func (v NullableListOrganizationContainersResponseItemsInner) Get() *ListOrganizationContainersResponseItemsInner { - return v.value -} - -func (v *NullableListOrganizationContainersResponseItemsInner) Set(val *ListOrganizationContainersResponseItemsInner) { - v.value = val - v.isSet = true -} - -func (v NullableListOrganizationContainersResponseItemsInner) IsSet() bool { - return v.isSet -} - -func (v *NullableListOrganizationContainersResponseItemsInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOrganizationContainersResponseItemsInner(val *ListOrganizationContainersResponseItemsInner) *NullableListOrganizationContainersResponseItemsInner { - return &NullableListOrganizationContainersResponseItemsInner{value: val, isSet: true} -} - -func (v NullableListOrganizationContainersResponseItemsInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOrganizationContainersResponseItemsInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/resourcemanager/model_list_organization_containers_response_items_inner_any_of.go b/services/resourcemanager/model_list_organization_containers_response_items_inner_any_of.go deleted file mode 100644 index 41dab3a83..000000000 --- a/services/resourcemanager/model_list_organization_containers_response_items_inner_any_of.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Resource Manager API - -API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - -API version: 2.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package resourcemanager - -import ( - "encoding/json" -) - -// checks if the ListOrganizationContainersResponseItemsInnerAnyOf type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOrganizationContainersResponseItemsInnerAnyOf{} - -// ListOrganizationContainersResponseItemsInnerAnyOf struct for ListOrganizationContainersResponseItemsInnerAnyOf -type ListOrganizationContainersResponseItemsInnerAnyOf struct { - // REQUIRED - Item *FolderResponse `json:"item"` - // Resource container type. - // REQUIRED - Type *string `json:"type"` -} - -type _ListOrganizationContainersResponseItemsInnerAnyOf ListOrganizationContainersResponseItemsInnerAnyOf - -// NewListOrganizationContainersResponseItemsInnerAnyOf instantiates a new ListOrganizationContainersResponseItemsInnerAnyOf object -// This constructor will assign default values to properties that have it defined, -// 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 NewListOrganizationContainersResponseItemsInnerAnyOf(item *FolderResponse, type_ *string) *ListOrganizationContainersResponseItemsInnerAnyOf { - this := ListOrganizationContainersResponseItemsInnerAnyOf{} - this.Item = item - this.Type = type_ - return &this -} - -// NewListOrganizationContainersResponseItemsInnerAnyOfWithDefaults instantiates a new ListOrganizationContainersResponseItemsInnerAnyOf object -// This 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 NewListOrganizationContainersResponseItemsInnerAnyOfWithDefaults() *ListOrganizationContainersResponseItemsInnerAnyOf { - this := ListOrganizationContainersResponseItemsInnerAnyOf{} - return &this -} - -// GetItem returns the Item field value -func (o *ListOrganizationContainersResponseItemsInnerAnyOf) GetItem() *FolderResponse { - if o == nil || IsNil(o.Item) { - var ret *FolderResponse - return ret - } - - return o.Item -} - -// GetItemOk returns a tuple with the Item field value -// and a boolean to check if the value has been set. -func (o *ListOrganizationContainersResponseItemsInnerAnyOf) GetItemOk() (*FolderResponse, bool) { - if o == nil { - return nil, false - } - return o.Item, true -} - -// SetItem sets field value -func (o *ListOrganizationContainersResponseItemsInnerAnyOf) SetItem(v *FolderResponse) { - o.Item = v -} - -// GetType returns the Type field value -func (o *ListOrganizationContainersResponseItemsInnerAnyOf) 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 -// and a boolean to check if the value has been set. -func (o *ListOrganizationContainersResponseItemsInnerAnyOf) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true -} - -// SetType sets field value -func (o *ListOrganizationContainersResponseItemsInnerAnyOf) SetType(v *string) { - o.Type = v -} - -func (o ListOrganizationContainersResponseItemsInnerAnyOf) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["item"] = o.Item - toSerialize["type"] = o.Type - return toSerialize, nil -} - -type NullableListOrganizationContainersResponseItemsInnerAnyOf struct { - value *ListOrganizationContainersResponseItemsInnerAnyOf - isSet bool -} - -func (v NullableListOrganizationContainersResponseItemsInnerAnyOf) Get() *ListOrganizationContainersResponseItemsInnerAnyOf { - return v.value -} - -func (v *NullableListOrganizationContainersResponseItemsInnerAnyOf) Set(val *ListOrganizationContainersResponseItemsInnerAnyOf) { - v.value = val - v.isSet = true -} - -func (v NullableListOrganizationContainersResponseItemsInnerAnyOf) IsSet() bool { - return v.isSet -} - -func (v *NullableListOrganizationContainersResponseItemsInnerAnyOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOrganizationContainersResponseItemsInnerAnyOf(val *ListOrganizationContainersResponseItemsInnerAnyOf) *NullableListOrganizationContainersResponseItemsInnerAnyOf { - return &NullableListOrganizationContainersResponseItemsInnerAnyOf{value: val, isSet: true} -} - -func (v NullableListOrganizationContainersResponseItemsInnerAnyOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOrganizationContainersResponseItemsInnerAnyOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/resourcemanager/model_list_organization_containers_response_items_inner_any_of_1.go b/services/resourcemanager/model_list_organization_containers_response_items_inner_any_of_1.go deleted file mode 100644 index 864e0f690..000000000 --- a/services/resourcemanager/model_list_organization_containers_response_items_inner_any_of_1.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Resource Manager API - -API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - -API version: 2.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package resourcemanager - -import ( - "encoding/json" -) - -// checks if the ListOrganizationContainersResponseItemsInnerAnyOf1 type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOrganizationContainersResponseItemsInnerAnyOf1{} - -// ListOrganizationContainersResponseItemsInnerAnyOf1 struct for ListOrganizationContainersResponseItemsInnerAnyOf1 -type ListOrganizationContainersResponseItemsInnerAnyOf1 struct { - // REQUIRED - Item *Project `json:"item"` - // Resource container type. - // REQUIRED - Type *string `json:"type"` -} - -type _ListOrganizationContainersResponseItemsInnerAnyOf1 ListOrganizationContainersResponseItemsInnerAnyOf1 - -// NewListOrganizationContainersResponseItemsInnerAnyOf1 instantiates a new ListOrganizationContainersResponseItemsInnerAnyOf1 object -// This constructor will assign default values to properties that have it defined, -// 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 NewListOrganizationContainersResponseItemsInnerAnyOf1(item *Project, type_ *string) *ListOrganizationContainersResponseItemsInnerAnyOf1 { - this := ListOrganizationContainersResponseItemsInnerAnyOf1{} - this.Item = item - this.Type = type_ - return &this -} - -// NewListOrganizationContainersResponseItemsInnerAnyOf1WithDefaults instantiates a new ListOrganizationContainersResponseItemsInnerAnyOf1 object -// This 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 NewListOrganizationContainersResponseItemsInnerAnyOf1WithDefaults() *ListOrganizationContainersResponseItemsInnerAnyOf1 { - this := ListOrganizationContainersResponseItemsInnerAnyOf1{} - return &this -} - -// GetItem returns the Item field value -func (o *ListOrganizationContainersResponseItemsInnerAnyOf1) GetItem() *Project { - if o == nil || IsNil(o.Item) { - var ret *Project - return ret - } - - return o.Item -} - -// GetItemOk returns a tuple with the Item field value -// and a boolean to check if the value has been set. -func (o *ListOrganizationContainersResponseItemsInnerAnyOf1) GetItemOk() (*Project, bool) { - if o == nil { - return nil, false - } - return o.Item, true -} - -// SetItem sets field value -func (o *ListOrganizationContainersResponseItemsInnerAnyOf1) SetItem(v *Project) { - o.Item = v -} - -// GetType returns the Type field value -func (o *ListOrganizationContainersResponseItemsInnerAnyOf1) 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 -// and a boolean to check if the value has been set. -func (o *ListOrganizationContainersResponseItemsInnerAnyOf1) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true -} - -// SetType sets field value -func (o *ListOrganizationContainersResponseItemsInnerAnyOf1) SetType(v *string) { - o.Type = v -} - -func (o ListOrganizationContainersResponseItemsInnerAnyOf1) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["item"] = o.Item - toSerialize["type"] = o.Type - return toSerialize, nil -} - -type NullableListOrganizationContainersResponseItemsInnerAnyOf1 struct { - value *ListOrganizationContainersResponseItemsInnerAnyOf1 - isSet bool -} - -func (v NullableListOrganizationContainersResponseItemsInnerAnyOf1) Get() *ListOrganizationContainersResponseItemsInnerAnyOf1 { - return v.value -} - -func (v *NullableListOrganizationContainersResponseItemsInnerAnyOf1) Set(val *ListOrganizationContainersResponseItemsInnerAnyOf1) { - v.value = val - v.isSet = true -} - -func (v NullableListOrganizationContainersResponseItemsInnerAnyOf1) IsSet() bool { - return v.isSet -} - -func (v *NullableListOrganizationContainersResponseItemsInnerAnyOf1) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOrganizationContainersResponseItemsInnerAnyOf1(val *ListOrganizationContainersResponseItemsInnerAnyOf1) *NullableListOrganizationContainersResponseItemsInnerAnyOf1 { - return &NullableListOrganizationContainersResponseItemsInnerAnyOf1{value: val, isSet: true} -} - -func (v NullableListOrganizationContainersResponseItemsInnerAnyOf1) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOrganizationContainersResponseItemsInnerAnyOf1) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/runcommand/CHANGELOG.md b/services/runcommand/CHANGELOG.md index 0f43c7e25..7086aa797 100644 --- a/services/runcommand/CHANGELOG.md +++ b/services/runcommand/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.3.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.2.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/runcommand/LICENSE.md b/services/runcommand/LICENSE.md index bc892668d..7e2f06484 100644 --- a/services/runcommand/LICENSE.md +++ b/services/runcommand/LICENSE.md @@ -2,180 +2,180 @@ Version 2.0, January 2004 http://www.apache.org/licenses/ - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" @@ -186,16 +186,16 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/runcommand/NOTICE.txt b/services/runcommand/NOTICE.txt index 3776bf9f2..2c53f1c0c 100644 --- a/services/runcommand/NOTICE.txt +++ b/services/runcommand/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Run Command SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/runcommand/go.mod b/services/runcommand/go.mod index cc890c887..4ae50ee90 100644 --- a/services/runcommand/go.mod +++ b/services/runcommand/go.mod @@ -1,8 +1,8 @@ module github.com/stackitcloud/stackit-sdk-go/services/runcommand -go 1.18 +go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/services/runcommand/go.sum b/services/runcommand/go.sum index 318b353d7..b7342b5ac 100644 --- a/services/runcommand/go.sum +++ b/services/runcommand/go.sum @@ -1,7 +1,8 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/secretsmanager/CHANGELOG.md b/services/secretsmanager/CHANGELOG.md index a5f0f79e6..23a2e2d75 100644 --- a/services/secretsmanager/CHANGELOG.md +++ b/services/secretsmanager/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.11.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.10.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/secretsmanager/LICENSE.md b/services/secretsmanager/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/secretsmanager/LICENSE.md +++ b/services/secretsmanager/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/secretsmanager/NOTICE.txt b/services/secretsmanager/NOTICE.txt index b400f07df..6c227bec5 100644 --- a/services/secretsmanager/NOTICE.txt +++ b/services/secretsmanager/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Secrets Manager SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/secretsmanager/go.mod b/services/secretsmanager/go.mod index 5e61ceb85..f3a9d78f3 100644 --- a/services/secretsmanager/go.mod +++ b/services/secretsmanager/go.mod @@ -1,8 +1,8 @@ module github.com/stackitcloud/stackit-sdk-go/services/secretsmanager -go 1.18 +go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/services/secretsmanager/go.sum b/services/secretsmanager/go.sum index 318b353d7..b7342b5ac 100644 --- a/services/secretsmanager/go.sum +++ b/services/secretsmanager/go.sum @@ -1,7 +1,8 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/serverbackup/CHANGELOG.md b/services/serverbackup/CHANGELOG.md index 71559b3d3..f990fe20c 100644 --- a/services/serverbackup/CHANGELOG.md +++ b/services/serverbackup/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.6.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.5.0 (2025-01-14) + +- **Feature:** Add new method: `GetServiceResource` + ## v0.4.0 (2024-12-17) - **Feature:** Add support for managing `BackupPolicy` resources diff --git a/services/serverbackup/LICENSE.md b/services/serverbackup/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/serverbackup/LICENSE.md +++ b/services/serverbackup/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/serverbackup/NOTICE.txt b/services/serverbackup/NOTICE.txt index b2adc11b6..edc14ae54 100644 --- a/services/serverbackup/NOTICE.txt +++ b/services/serverbackup/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Server Backup SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/serverbackup/api_default.go b/services/serverbackup/api_default.go index 20a82327a..c554875c9 100644 --- a/services/serverbackup/api_default.go +++ b/services/serverbackup/api_default.go @@ -1336,6 +1336,126 @@ func (a *APIClient) GetBackupScheduleExecute(ctx context.Context, projectId stri return r.Execute() } +type ApiGetServiceResourceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string +} + +func (r ApiGetServiceResourceRequest) Execute() (*GetBackupServiceResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupServiceResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceResource") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetServiceResource: get backup service details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiGetServiceResourceRequest +*/ +func (a *APIClient) GetServiceResource(ctx context.Context, projectId string, serverId string) ApiGetServiceResourceRequest { + return ApiGetServiceResourceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +func (a *APIClient) GetServiceResourceExecute(ctx context.Context, projectId string, serverId string) (*GetBackupServiceResponse, error) { + r := ApiGetServiceResourceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } + return r.Execute() +} + type ApiListBackupPoliciesRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/serverbackup/api_default_test.go b/services/serverbackup/api_default_test.go index 563dc8905..6dbe998a6 100644 --- a/services/serverbackup/api_default_test.go +++ b/services/serverbackup/api_default_test.go @@ -604,6 +604,61 @@ func Test_serverbackup_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService GetServiceResource", func(t *testing.T) { + path := "/v1/projects/{projectId}/servers/{serverId}/service" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetBackupServiceResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for serverbackup_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + serverId := "serverId" + + resp, reqErr := apiClient.GetServiceResource(context.Background(), projectId, serverId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService ListBackupPolicies", func(t *testing.T) { path := "/v1/projects/{projectId}/backup-policies" projectIdValue := "projectId" diff --git a/services/serverbackup/go.mod b/services/serverbackup/go.mod index a4db27171..86f9ef581 100644 --- a/services/serverbackup/go.mod +++ b/services/serverbackup/go.mod @@ -1,8 +1,8 @@ module github.com/stackitcloud/stackit-sdk-go/services/serverbackup -go 1.18 +go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/services/serverbackup/go.sum b/services/serverbackup/go.sum index 318b353d7..b7342b5ac 100644 --- a/services/serverbackup/go.sum +++ b/services/serverbackup/go.sum @@ -1,7 +1,8 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/serverbackup/model_get_backup_service_response.go b/services/serverbackup/model_get_backup_service_response.go new file mode 100644 index 000000000..0981fbc25 --- /dev/null +++ b/services/serverbackup/model_get_backup_service_response.go @@ -0,0 +1,116 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package serverbackup + +import ( + "encoding/json" +) + +// checks if the GetBackupServiceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupServiceResponse{} + +// GetBackupServiceResponse struct for GetBackupServiceResponse +type GetBackupServiceResponse struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// NewGetBackupServiceResponse instantiates a new GetBackupServiceResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewGetBackupServiceResponse() *GetBackupServiceResponse { + this := GetBackupServiceResponse{} + return &this +} + +// NewGetBackupServiceResponseWithDefaults instantiates a new GetBackupServiceResponse object +// This 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 NewGetBackupServiceResponseWithDefaults() *GetBackupServiceResponse { + this := GetBackupServiceResponse{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *GetBackupServiceResponse) 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 *GetBackupServiceResponse) 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 *GetBackupServiceResponse) 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 *GetBackupServiceResponse) SetEnabled(v *bool) { + o.Enabled = v +} + +func (o GetBackupServiceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableGetBackupServiceResponse struct { + value *GetBackupServiceResponse + isSet bool +} + +func (v NullableGetBackupServiceResponse) Get() *GetBackupServiceResponse { + return v.value +} + +func (v *NullableGetBackupServiceResponse) Set(val *GetBackupServiceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupServiceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupServiceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupServiceResponse(val *GetBackupServiceResponse) *NullableGetBackupServiceResponse { + return &NullableGetBackupServiceResponse{value: val, isSet: true} +} + +func (v NullableGetBackupServiceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupServiceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverupdate/CHANGELOG.md b/services/serverupdate/CHANGELOG.md index ba4411666..ffb5cd0a5 100644 --- a/services/serverupdate/CHANGELOG.md +++ b/services/serverupdate/CHANGELOG.md @@ -1,3 +1,15 @@ +## v0.5.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.4.0 (2025-02-05) + +- **Breaking Change**: Remove field `BackupProperties` from `CreateUpdatePayload` model +- **Fix**: Remove field `Id` from `CreateUpdateSchedulePayload` model + +## v0.3.0 (2025-01-14) + +- **Feature:** Add new method: `GetServiceResource` + ## v0.2.3 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/serverupdate/LICENSE.md b/services/serverupdate/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/serverupdate/LICENSE.md +++ b/services/serverupdate/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/serverupdate/NOTICE.txt b/services/serverupdate/NOTICE.txt index 15e2d5ec4..4c8230fd0 100644 --- a/services/serverupdate/NOTICE.txt +++ b/services/serverupdate/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Server Update SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/serverupdate/api_default.go b/services/serverupdate/api_default.go index b65d3113b..7a69fe360 100644 --- a/services/serverupdate/api_default.go +++ b/services/serverupdate/api_default.go @@ -853,6 +853,126 @@ func (a *APIClient) EnableServiceResourceExecute(ctx context.Context, projectId return r.Execute() } +type ApiGetServiceResourceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string +} + +func (r ApiGetServiceResourceRequest) Execute() (*GetUpdateServiceResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetUpdateServiceResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceResource") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetServiceResource: get update service details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiGetServiceResourceRequest +*/ +func (a *APIClient) GetServiceResource(ctx context.Context, projectId string, serverId string) ApiGetServiceResourceRequest { + return ApiGetServiceResourceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +func (a *APIClient) GetServiceResourceExecute(ctx context.Context, projectId string, serverId string) (*GetUpdateServiceResponse, error) { + r := ApiGetServiceResourceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } + return r.Execute() +} + type ApiGetUpdateRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/serverupdate/api_default_test.go b/services/serverupdate/api_default_test.go index 41d3752c4..474aad30c 100644 --- a/services/serverupdate/api_default_test.go +++ b/services/serverupdate/api_default_test.go @@ -381,6 +381,61 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService GetServiceResource", func(t *testing.T) { + path := "/v1/projects/{projectId}/servers/{serverId}/service" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetUpdateServiceResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for serverupdate_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + serverId := "serverId" + + resp, reqErr := apiClient.GetServiceResource(context.Background(), projectId, serverId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService GetUpdate", func(t *testing.T) { path := "/v1/projects/{projectId}/servers/{serverId}/updates/{updateId}" projectIdValue := "projectId" diff --git a/services/serverupdate/go.mod b/services/serverupdate/go.mod index 405387079..26dff92cc 100644 --- a/services/serverupdate/go.mod +++ b/services/serverupdate/go.mod @@ -1,8 +1,8 @@ module github.com/stackitcloud/stackit-sdk-go/services/serverupdate -go 1.18 +go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/services/serverupdate/go.sum b/services/serverupdate/go.sum index 318b353d7..b7342b5ac 100644 --- a/services/serverupdate/go.sum +++ b/services/serverupdate/go.sum @@ -1,7 +1,8 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/serverupdate/model_backup_properties.go b/services/serverupdate/model_backup_properties.go deleted file mode 100644 index b690bfbe5..000000000 --- a/services/serverupdate/model_backup_properties.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -STACKIT Server Update Management API - -API endpoints for Server Update Operations on STACKIT Servers. - -API version: 1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package serverupdate - -import ( - "encoding/json" -) - -// checks if the BackupProperties type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BackupProperties{} - -// BackupProperties struct for BackupProperties -type BackupProperties struct { - // Max 255 characters - // REQUIRED - Name *string `json:"name"` - // Values are set in days (1-36500) - // Can be cast to int32 without loss of precision. - // REQUIRED - RetentionPeriod *int64 `json:"retentionPeriod"` - VolumeIds *[]string `json:"volumeIds,omitempty"` -} - -type _BackupProperties BackupProperties - -// NewBackupProperties instantiates a new BackupProperties object -// This constructor will assign default values to properties that have it defined, -// 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 NewBackupProperties(name *string, retentionPeriod *int64) *BackupProperties { - this := BackupProperties{} - this.Name = name - this.RetentionPeriod = retentionPeriod - return &this -} - -// NewBackupPropertiesWithDefaults instantiates a new BackupProperties object -// This 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 NewBackupPropertiesWithDefaults() *BackupProperties { - this := BackupProperties{} - return &this -} - -// GetName returns the Name field value -func (o *BackupProperties) 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 -// and a boolean to check if the value has been set. -func (o *BackupProperties) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true -} - -// SetName sets field value -func (o *BackupProperties) SetName(v *string) { - o.Name = v -} - -// GetRetentionPeriod returns the RetentionPeriod field value -func (o *BackupProperties) GetRetentionPeriod() *int64 { - if o == nil || IsNil(o.RetentionPeriod) { - var ret *int64 - return ret - } - - return o.RetentionPeriod -} - -// GetRetentionPeriodOk returns a tuple with the RetentionPeriod field value -// and a boolean to check if the value has been set. -func (o *BackupProperties) GetRetentionPeriodOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.RetentionPeriod, true -} - -// SetRetentionPeriod sets field value -func (o *BackupProperties) SetRetentionPeriod(v *int64) { - o.RetentionPeriod = v -} - -// GetVolumeIds returns the VolumeIds field value if set, zero value otherwise. -func (o *BackupProperties) GetVolumeIds() *[]string { - if o == nil || IsNil(o.VolumeIds) { - var ret *[]string - return ret - } - return o.VolumeIds -} - -// GetVolumeIdsOk returns a tuple with the VolumeIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BackupProperties) GetVolumeIdsOk() (*[]string, bool) { - if o == nil || IsNil(o.VolumeIds) { - return nil, false - } - return o.VolumeIds, true -} - -// HasVolumeIds returns a boolean if a field has been set. -func (o *BackupProperties) HasVolumeIds() bool { - if o != nil && !IsNil(o.VolumeIds) { - return true - } - - return false -} - -// SetVolumeIds gets a reference to the given []string and assigns it to the VolumeIds field. -func (o *BackupProperties) SetVolumeIds(v *[]string) { - o.VolumeIds = v -} - -func (o BackupProperties) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - toSerialize["retentionPeriod"] = o.RetentionPeriod - if !IsNil(o.VolumeIds) { - toSerialize["volumeIds"] = o.VolumeIds - } - return toSerialize, nil -} - -type NullableBackupProperties struct { - value *BackupProperties - isSet bool -} - -func (v NullableBackupProperties) Get() *BackupProperties { - return v.value -} - -func (v *NullableBackupProperties) Set(val *BackupProperties) { - v.value = val - v.isSet = true -} - -func (v NullableBackupProperties) IsSet() bool { - return v.isSet -} - -func (v *NullableBackupProperties) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBackupProperties(val *BackupProperties) *NullableBackupProperties { - return &NullableBackupProperties{value: val, isSet: true} -} - -func (v NullableBackupProperties) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBackupProperties) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/serverupdate/model_create_update_payload.go b/services/serverupdate/model_create_update_payload.go index 9a919eec7..52e2ed62c 100644 --- a/services/serverupdate/model_create_update_payload.go +++ b/services/serverupdate/model_create_update_payload.go @@ -19,8 +19,7 @@ var _ MappedNullable = &CreateUpdatePayload{} // CreateUpdatePayload struct for CreateUpdatePayload type CreateUpdatePayload struct { - BackupBeforeUpdate *bool `json:"backupBeforeUpdate,omitempty"` - BackupProperties *BackupProperties `json:"backupProperties,omitempty"` + BackupBeforeUpdate *bool `json:"backupBeforeUpdate,omitempty"` // Can be cast to int32 without loss of precision. // REQUIRED MaintenanceWindow *int64 `json:"maintenanceWindow"` @@ -78,38 +77,6 @@ func (o *CreateUpdatePayload) SetBackupBeforeUpdate(v *bool) { o.BackupBeforeUpdate = v } -// GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. -func (o *CreateUpdatePayload) GetBackupProperties() *BackupProperties { - if o == nil || IsNil(o.BackupProperties) { - var ret *BackupProperties - return ret - } - return o.BackupProperties -} - -// GetBackupPropertiesOk returns a tuple with the BackupProperties field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateUpdatePayload) GetBackupPropertiesOk() (*BackupProperties, bool) { - if o == nil || IsNil(o.BackupProperties) { - return nil, false - } - return o.BackupProperties, true -} - -// HasBackupProperties returns a boolean if a field has been set. -func (o *CreateUpdatePayload) HasBackupProperties() bool { - if o != nil && !IsNil(o.BackupProperties) { - return true - } - - return false -} - -// SetBackupProperties gets a reference to the given BackupProperties and assigns it to the BackupProperties field. -func (o *CreateUpdatePayload) SetBackupProperties(v *BackupProperties) { - o.BackupProperties = v -} - // GetMaintenanceWindow returns the MaintenanceWindow field value func (o *CreateUpdatePayload) GetMaintenanceWindow() *int64 { if o == nil || IsNil(o.MaintenanceWindow) { @@ -139,9 +106,6 @@ func (o CreateUpdatePayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.BackupBeforeUpdate) { toSerialize["backupBeforeUpdate"] = o.BackupBeforeUpdate } - if !IsNil(o.BackupProperties) { - toSerialize["backupProperties"] = o.BackupProperties - } toSerialize["maintenanceWindow"] = o.MaintenanceWindow return toSerialize, nil } diff --git a/services/serverupdate/model_create_update_schedule_payload.go b/services/serverupdate/model_create_update_schedule_payload.go index cdea3b566..5f07ff31a 100644 --- a/services/serverupdate/model_create_update_schedule_payload.go +++ b/services/serverupdate/model_create_update_schedule_payload.go @@ -22,8 +22,6 @@ type CreateUpdateSchedulePayload struct { // REQUIRED Enabled *bool `json:"enabled"` // Can be cast to int32 without loss of precision. - Id *int64 `json:"id,omitempty"` - // Can be cast to int32 without loss of precision. // REQUIRED MaintenanceWindow *int64 `json:"maintenanceWindow"` // REQUIRED @@ -79,38 +77,6 @@ func (o *CreateUpdateSchedulePayload) SetEnabled(v *bool) { o.Enabled = v } -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateUpdateSchedulePayload) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - 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 *CreateUpdateSchedulePayload) GetIdOk() (*int64, 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 *CreateUpdateSchedulePayload) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *CreateUpdateSchedulePayload) SetId(v *int64) { - o.Id = v -} - // GetMaintenanceWindow returns the MaintenanceWindow field value func (o *CreateUpdateSchedulePayload) GetMaintenanceWindow() *int64 { if o == nil || IsNil(o.MaintenanceWindow) { @@ -186,9 +152,6 @@ func (o *CreateUpdateSchedulePayload) SetRrule(v *string) { func (o CreateUpdateSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["enabled"] = o.Enabled - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } toSerialize["maintenanceWindow"] = o.MaintenanceWindow toSerialize["name"] = o.Name toSerialize["rrule"] = o.Rrule diff --git a/services/serverupdate/model_get_update_service_response.go b/services/serverupdate/model_get_update_service_response.go new file mode 100644 index 000000000..d270a7a0a --- /dev/null +++ b/services/serverupdate/model_get_update_service_response.go @@ -0,0 +1,116 @@ +/* +STACKIT Server Update Management API + +API endpoints for Server Update Operations on STACKIT Servers. + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package serverupdate + +import ( + "encoding/json" +) + +// checks if the GetUpdateServiceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetUpdateServiceResponse{} + +// GetUpdateServiceResponse struct for GetUpdateServiceResponse +type GetUpdateServiceResponse struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// NewGetUpdateServiceResponse instantiates a new GetUpdateServiceResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewGetUpdateServiceResponse() *GetUpdateServiceResponse { + this := GetUpdateServiceResponse{} + return &this +} + +// NewGetUpdateServiceResponseWithDefaults instantiates a new GetUpdateServiceResponse object +// This 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 NewGetUpdateServiceResponseWithDefaults() *GetUpdateServiceResponse { + this := GetUpdateServiceResponse{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *GetUpdateServiceResponse) 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 *GetUpdateServiceResponse) 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 *GetUpdateServiceResponse) 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 *GetUpdateServiceResponse) SetEnabled(v *bool) { + o.Enabled = v +} + +func (o GetUpdateServiceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableGetUpdateServiceResponse struct { + value *GetUpdateServiceResponse + isSet bool +} + +func (v NullableGetUpdateServiceResponse) Get() *GetUpdateServiceResponse { + return v.value +} + +func (v *NullableGetUpdateServiceResponse) Set(val *GetUpdateServiceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetUpdateServiceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetUpdateServiceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetUpdateServiceResponse(val *GetUpdateServiceResponse) *NullableGetUpdateServiceResponse { + return &NullableGetUpdateServiceResponse{value: val, isSet: true} +} + +func (v NullableGetUpdateServiceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetUpdateServiceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverupdate/model_update_schedule.go b/services/serverupdate/model_update_schedule.go index ec9670f93..4c4069d06 100644 --- a/services/serverupdate/model_update_schedule.go +++ b/services/serverupdate/model_update_schedule.go @@ -22,14 +22,15 @@ type UpdateSchedule struct { // REQUIRED Enabled *bool `json:"enabled"` // Can be cast to int32 without loss of precision. - Id *int64 `json:"id,omitempty"` - // Can be cast to int32 without loss of precision. // REQUIRED MaintenanceWindow *int64 `json:"maintenanceWindow"` // REQUIRED Name *string `json:"name"` // REQUIRED Rrule *string `json:"rrule"` + // Can be cast to int32 without loss of precision. + // REQUIRED + Id *int64 `json:"id"` } type _UpdateSchedule UpdateSchedule @@ -38,12 +39,13 @@ type _UpdateSchedule UpdateSchedule // This constructor will assign default values to properties that have it defined, // 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 NewUpdateSchedule(enabled *bool, maintenanceWindow *int64, name *string, rrule *string) *UpdateSchedule { +func NewUpdateSchedule(enabled *bool, maintenanceWindow *int64, name *string, rrule *string, id *int64) *UpdateSchedule { this := UpdateSchedule{} this.Enabled = enabled this.MaintenanceWindow = maintenanceWindow this.Name = name this.Rrule = rrule + this.Id = id return &this } @@ -79,38 +81,6 @@ func (o *UpdateSchedule) SetEnabled(v *bool) { o.Enabled = v } -// GetId returns the Id field value if set, zero value otherwise. -func (o *UpdateSchedule) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - 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 *UpdateSchedule) GetIdOk() (*int64, 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 *UpdateSchedule) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *UpdateSchedule) SetId(v *int64) { - o.Id = v -} - // GetMaintenanceWindow returns the MaintenanceWindow field value func (o *UpdateSchedule) GetMaintenanceWindow() *int64 { if o == nil || IsNil(o.MaintenanceWindow) { @@ -183,15 +153,37 @@ func (o *UpdateSchedule) SetRrule(v *string) { o.Rrule = v } +// GetId returns the Id field value +func (o *UpdateSchedule) GetId() *int64 { + if o == nil || IsNil(o.Id) { + var ret *int64 + 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 *UpdateSchedule) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *UpdateSchedule) SetId(v *int64) { + o.Id = v +} + func (o UpdateSchedule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["enabled"] = o.Enabled - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } toSerialize["maintenanceWindow"] = o.MaintenanceWindow toSerialize["name"] = o.Name toSerialize["rrule"] = o.Rrule + toSerialize["id"] = o.Id return toSerialize, nil } diff --git a/services/serverupdate/model_update_schedule_all_of.go b/services/serverupdate/model_update_schedule_all_of.go new file mode 100644 index 000000000..eaf70e146 --- /dev/null +++ b/services/serverupdate/model_update_schedule_all_of.go @@ -0,0 +1,111 @@ +/* +STACKIT Server Update Management API + +API endpoints for Server Update Operations on STACKIT Servers. + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package serverupdate + +import ( + "encoding/json" +) + +// checks if the UpdateScheduleAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateScheduleAllOf{} + +// UpdateScheduleAllOf struct for UpdateScheduleAllOf +type UpdateScheduleAllOf struct { + // Can be cast to int32 without loss of precision. + // REQUIRED + Id *int64 `json:"id"` +} + +type _UpdateScheduleAllOf UpdateScheduleAllOf + +// NewUpdateScheduleAllOf instantiates a new UpdateScheduleAllOf object +// This constructor will assign default values to properties that have it defined, +// 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 NewUpdateScheduleAllOf(id *int64) *UpdateScheduleAllOf { + this := UpdateScheduleAllOf{} + this.Id = id + return &this +} + +// NewUpdateScheduleAllOfWithDefaults instantiates a new UpdateScheduleAllOf object +// This 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 NewUpdateScheduleAllOfWithDefaults() *UpdateScheduleAllOf { + this := UpdateScheduleAllOf{} + return &this +} + +// GetId returns the Id field value +func (o *UpdateScheduleAllOf) GetId() *int64 { + if o == nil || IsNil(o.Id) { + var ret *int64 + 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 *UpdateScheduleAllOf) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *UpdateScheduleAllOf) SetId(v *int64) { + o.Id = v +} + +func (o UpdateScheduleAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +type NullableUpdateScheduleAllOf struct { + value *UpdateScheduleAllOf + isSet bool +} + +func (v NullableUpdateScheduleAllOf) Get() *UpdateScheduleAllOf { + return v.value +} + +func (v *NullableUpdateScheduleAllOf) Set(val *UpdateScheduleAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateScheduleAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateScheduleAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateScheduleAllOf(val *UpdateScheduleAllOf) *NullableUpdateScheduleAllOf { + return &NullableUpdateScheduleAllOf{value: val, isSet: true} +} + +func (v NullableUpdateScheduleAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateScheduleAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverupdate/model_update_schedule_create_request.go b/services/serverupdate/model_update_schedule_create_request.go new file mode 100644 index 000000000..211102427 --- /dev/null +++ b/services/serverupdate/model_update_schedule_create_request.go @@ -0,0 +1,195 @@ +/* +STACKIT Server Update Management API + +API endpoints for Server Update Operations on STACKIT Servers. + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package serverupdate + +import ( + "encoding/json" +) + +// checks if the UpdateScheduleCreateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateScheduleCreateRequest{} + +// UpdateScheduleCreateRequest struct for UpdateScheduleCreateRequest +type UpdateScheduleCreateRequest struct { + // REQUIRED + Enabled *bool `json:"enabled"` + // Can be cast to int32 without loss of precision. + // REQUIRED + MaintenanceWindow *int64 `json:"maintenanceWindow"` + // REQUIRED + Name *string `json:"name"` + // REQUIRED + Rrule *string `json:"rrule"` +} + +type _UpdateScheduleCreateRequest UpdateScheduleCreateRequest + +// NewUpdateScheduleCreateRequest instantiates a new UpdateScheduleCreateRequest object +// This constructor will assign default values to properties that have it defined, +// 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 NewUpdateScheduleCreateRequest(enabled *bool, maintenanceWindow *int64, name *string, rrule *string) *UpdateScheduleCreateRequest { + this := UpdateScheduleCreateRequest{} + this.Enabled = enabled + this.MaintenanceWindow = maintenanceWindow + this.Name = name + this.Rrule = rrule + return &this +} + +// NewUpdateScheduleCreateRequestWithDefaults instantiates a new UpdateScheduleCreateRequest object +// This 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 NewUpdateScheduleCreateRequestWithDefaults() *UpdateScheduleCreateRequest { + this := UpdateScheduleCreateRequest{} + return &this +} + +// GetEnabled returns the Enabled field value +func (o *UpdateScheduleCreateRequest) 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 +// and a boolean to check if the value has been set. +func (o *UpdateScheduleCreateRequest) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.Enabled, true +} + +// SetEnabled sets field value +func (o *UpdateScheduleCreateRequest) SetEnabled(v *bool) { + o.Enabled = v +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value +func (o *UpdateScheduleCreateRequest) GetMaintenanceWindow() *int64 { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret *int64 + return ret + } + + return o.MaintenanceWindow +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value +// and a boolean to check if the value has been set. +func (o *UpdateScheduleCreateRequest) GetMaintenanceWindowOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MaintenanceWindow, true +} + +// SetMaintenanceWindow sets field value +func (o *UpdateScheduleCreateRequest) SetMaintenanceWindow(v *int64) { + o.MaintenanceWindow = v +} + +// GetName returns the Name field value +func (o *UpdateScheduleCreateRequest) 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 +// and a boolean to check if the value has been set. +func (o *UpdateScheduleCreateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *UpdateScheduleCreateRequest) SetName(v *string) { + o.Name = v +} + +// GetRrule returns the Rrule field value +func (o *UpdateScheduleCreateRequest) GetRrule() *string { + if o == nil || IsNil(o.Rrule) { + var ret *string + return ret + } + + return o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value +// and a boolean to check if the value has been set. +func (o *UpdateScheduleCreateRequest) GetRruleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rrule, true +} + +// SetRrule sets field value +func (o *UpdateScheduleCreateRequest) SetRrule(v *string) { + o.Rrule = v +} + +func (o UpdateScheduleCreateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["enabled"] = o.Enabled + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + toSerialize["name"] = o.Name + toSerialize["rrule"] = o.Rrule + return toSerialize, nil +} + +type NullableUpdateScheduleCreateRequest struct { + value *UpdateScheduleCreateRequest + isSet bool +} + +func (v NullableUpdateScheduleCreateRequest) Get() *UpdateScheduleCreateRequest { + return v.value +} + +func (v *NullableUpdateScheduleCreateRequest) Set(val *UpdateScheduleCreateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateScheduleCreateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateScheduleCreateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateScheduleCreateRequest(val *UpdateScheduleCreateRequest) *NullableUpdateScheduleCreateRequest { + return &NullableUpdateScheduleCreateRequest{value: val, isSet: true} +} + +func (v NullableUpdateScheduleCreateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateScheduleCreateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverupdate/model_update_update_schedule_payload.go b/services/serverupdate/model_update_update_schedule_payload.go index 75d67b1bd..b928d8f82 100644 --- a/services/serverupdate/model_update_update_schedule_payload.go +++ b/services/serverupdate/model_update_update_schedule_payload.go @@ -22,8 +22,6 @@ type UpdateUpdateSchedulePayload struct { // REQUIRED Enabled *bool `json:"enabled"` // Can be cast to int32 without loss of precision. - Id *int64 `json:"id,omitempty"` - // Can be cast to int32 without loss of precision. // REQUIRED MaintenanceWindow *int64 `json:"maintenanceWindow"` // REQUIRED @@ -79,38 +77,6 @@ func (o *UpdateUpdateSchedulePayload) SetEnabled(v *bool) { o.Enabled = v } -// GetId returns the Id field value if set, zero value otherwise. -func (o *UpdateUpdateSchedulePayload) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - 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 *UpdateUpdateSchedulePayload) GetIdOk() (*int64, 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 *UpdateUpdateSchedulePayload) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *UpdateUpdateSchedulePayload) SetId(v *int64) { - o.Id = v -} - // GetMaintenanceWindow returns the MaintenanceWindow field value func (o *UpdateUpdateSchedulePayload) GetMaintenanceWindow() *int64 { if o == nil || IsNil(o.MaintenanceWindow) { @@ -186,9 +152,6 @@ func (o *UpdateUpdateSchedulePayload) SetRrule(v *string) { func (o UpdateUpdateSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["enabled"] = o.Enabled - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } toSerialize["maintenanceWindow"] = o.MaintenanceWindow toSerialize["name"] = o.Name toSerialize["rrule"] = o.Rrule diff --git a/services/serviceaccount/CHANGELOG.md b/services/serviceaccount/CHANGELOG.md index ea2f24a8b..5f18497d0 100644 --- a/services/serviceaccount/CHANGELOG.md +++ b/services/serviceaccount/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.6.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.5.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/serviceaccount/LICENSE.md b/services/serviceaccount/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/serviceaccount/LICENSE.md +++ b/services/serviceaccount/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/serviceaccount/NOTICE.txt b/services/serviceaccount/NOTICE.txt index 9693a0cbe..b2b960aa6 100644 --- a/services/serviceaccount/NOTICE.txt +++ b/services/serviceaccount/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Service Account SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/serviceaccount/go.mod b/services/serviceaccount/go.mod index 42c01abf9..6ae5572af 100644 --- a/services/serviceaccount/go.mod +++ b/services/serviceaccount/go.mod @@ -1,8 +1,8 @@ module github.com/stackitcloud/stackit-sdk-go/services/serviceaccount -go 1.18 +go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/services/serviceaccount/go.sum b/services/serviceaccount/go.sum index 318b353d7..b7342b5ac 100644 --- a/services/serviceaccount/go.sum +++ b/services/serviceaccount/go.sum @@ -1,7 +1,8 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/serviceenablement/CHANGELOG.md b/services/serviceenablement/CHANGELOG.md index b0ef5b81a..3261a236c 100644 --- a/services/serviceenablement/CHANGELOG.md +++ b/services/serviceenablement/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.5.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + ## v0.4.0 (2024-12-05) - **Feature:** Add support for region eu02 diff --git a/services/serviceenablement/LICENSE.md b/services/serviceenablement/LICENSE.md index bc892668d..7e2f06484 100644 --- a/services/serviceenablement/LICENSE.md +++ b/services/serviceenablement/LICENSE.md @@ -2,180 +2,180 @@ Version 2.0, January 2004 http://www.apache.org/licenses/ - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" @@ -186,16 +186,16 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/serviceenablement/NOTICE.txt b/services/serviceenablement/NOTICE.txt index f03cf22d9..f188eebcc 100644 --- a/services/serviceenablement/NOTICE.txt +++ b/services/serviceenablement/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Service Enablement SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/serviceenablement/go.mod b/services/serviceenablement/go.mod index 43e6a17b6..dab223139 100644 --- a/services/serviceenablement/go.mod +++ b/services/serviceenablement/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/serviceenablement -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/serviceenablement/go.sum b/services/serviceenablement/go.sum index b7c164325..b7342b5ac 100644 --- a/services/serviceenablement/go.sum +++ b/services/serviceenablement/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/ske/CHANGELOG.md b/services/ske/CHANGELOG.md index d8bd46208..5fec648e4 100644 --- a/services/ske/CHANGELOG.md +++ b/services/ske/CHANGELOG.md @@ -1,3 +1,16 @@ +## v0.22.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.21.1 (2025-01-23) +- Use current SKE API + +## v0.21.0 (2025-01-21) + +- **Removal:** The following methods were removed after deprecation (2024-04-16) and [`serviceenablement` SDK](https://github.com/stackitcloud/stackit-sdk-go/tree/main/services/serviceenablement) must be used instead. + - `DisableService` + - `EnableService` + - `GetServiceStatus` + ## v0.20.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/ske/LICENSE.md b/services/ske/LICENSE.md index 0611432d8..7e2f06484 100644 --- a/services/ske/LICENSE.md +++ b/services/ske/LICENSE.md @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/services/ske/NOTICE.txt b/services/ske/NOTICE.txt index fff4b72e0..d61a31bc5 100644 --- a/services/ske/NOTICE.txt +++ b/services/ske/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT Kubernetes SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/ske/api_default.go b/services/ske/api_default.go index c774162b8..8aa74ccff 100644 --- a/services/ske/api_default.go +++ b/services/ske/api_default.go @@ -612,602 +612,27 @@ func (a *APIClient) DeleteClusterExecute(ctx context.Context, projectId string, return r.Execute() } -type ApiDisableServiceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiDisableServiceRequest) Execute() (map[string]interface{}, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableService") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v map[string]interface{} - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v RuntimeError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -DisableService: Delete a project - -Deprecated: This endpoint is deprecated since 2024-04-11. Use the service-enablement API instead. - -Deletes the SKE project specified by `projectId`. Deleting a project deletes all corresponding shoots. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @return ApiDisableServiceRequest -*/ -func (a *APIClient) DisableService(ctx context.Context, projectId string) ApiDisableServiceRequest { - return ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -/* -Deprecated: This endpoint is deprecated since 2024-04-11. Use the service-enablement API instead. - -Deletes the SKE project specified by `projectId`. Deleting a project deletes all corresponding shoots. -*/ -func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { - r := ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ApiEnableServiceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiEnableServiceRequest) Execute() (*ProjectResponse, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ProjectResponse - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EnableService") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v map[string]interface{} - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v RuntimeError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -EnableService: Create a Project - -Deprecated: This endpoint is deprecated since 2024-04-11. Use the service-enablement API instead. - -Returns creation state of Project specified by `projectId`. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @return ApiEnableServiceRequest -*/ -func (a *APIClient) EnableService(ctx context.Context, projectId string) ApiEnableServiceRequest { - return ApiEnableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -/* -Deprecated: This endpoint is deprecated since 2024-04-11. Use the service-enablement API instead. - -Returns creation state of Project specified by `projectId`. -*/ -func (a *APIClient) EnableServiceExecute(ctx context.Context, projectId string) (*ProjectResponse, error) { - r := ApiEnableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - -type ApiGetClusterRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - clusterName string -} - -func (r ApiGetClusterRequest) Execute() (*Cluster, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Cluster - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCluster") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - var v RuntimeError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -GetCluster: Get a cluster - -Get Kubernetes cluster for the specified identifier, belonging to the project specified by `projectId`. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param clusterName - @return ApiGetClusterRequest -*/ -func (a *APIClient) GetCluster(ctx context.Context, projectId string, clusterName string) ApiGetClusterRequest { - return ApiGetClusterRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - clusterName: clusterName, - } -} - -func (a *APIClient) GetClusterExecute(ctx context.Context, projectId string, clusterName string) (*Cluster, error) { - r := ApiGetClusterRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - clusterName: clusterName, - } - return r.Execute() -} - -type ApiGetCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - clusterName string -} - -func (r ApiGetCredentialsRequest) Execute() (*Credentials, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Credentials - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/credentials" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v map[string]interface{} - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v map[string]interface{} - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v RuntimeError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -GetCredentials: Get credentials for a cluster - -Deprecated: This endpoint is deprecated since 2024-01-26. It will not work for clusters with Kubernetes v1.27+, or if the new endpoints for kubeconfig or credentials rotation have already been used. Use [kubeconfig](#tag/Credentials/operation/SkeService_CreateKubeconfig) instead to obtain a kubeconfig. For more information, see [How to rotate SKE credentials](https://docs.stackit.cloud/display/STACKIT/How+to+rotate+SKE+credentials). - -Get credentials for the cluster specified by `clusterName`, belonging to the project specified by `projectId`. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param clusterName - @return ApiGetCredentialsRequest -*/ -func (a *APIClient) GetCredentials(ctx context.Context, projectId string, clusterName string) ApiGetCredentialsRequest { - return ApiGetCredentialsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - clusterName: clusterName, - } -} - -/* -Deprecated: This endpoint is deprecated since 2024-01-26. It will not work for clusters with Kubernetes v1.27+, or if the new endpoints for kubeconfig or credentials rotation have already been used. Use [kubeconfig](#tag/Credentials/operation/SkeService_CreateKubeconfig) instead to obtain a kubeconfig. For more information, see [How to rotate SKE credentials](https://docs.stackit.cloud/display/STACKIT/How+to+rotate+SKE+credentials). - -Get credentials for the cluster specified by `clusterName`, belonging to the project specified by `projectId`. -*/ -func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, clusterName string) (*Credentials, error) { - r := ApiGetCredentialsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - clusterName: clusterName, - } - return r.Execute() -} - -type ApiGetLoginKubeconfigRequest struct { +type ApiGetClusterRequest struct { ctx context.Context apiService *DefaultApiService projectId string clusterName string } -func (r ApiGetLoginKubeconfigRequest) Execute() (*LoginKubeconfig, error) { +func (r ApiGetClusterRequest) Execute() (*Cluster, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *LoginKubeconfig + localVarReturnValue *Cluster ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLoginKubeconfig") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCluster") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login" + localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) @@ -1289,17 +714,17 @@ func (r ApiGetLoginKubeconfigRequest) Execute() (*LoginKubeconfig, error) { } /* -GetLoginKubeconfig: Get a kubeconfig for use with the STACKIT CLI +GetCluster: Get a cluster -A kubeconfig retrieved using this endpoint does not contain any credentials and instead obtains valid credentials via the STACKIT CLI. +Get Kubernetes cluster for the specified identifier, belonging to the project specified by `projectId`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId @param clusterName - @return ApiGetLoginKubeconfigRequest + @return ApiGetClusterRequest */ -func (a *APIClient) GetLoginKubeconfig(ctx context.Context, projectId string, clusterName string) ApiGetLoginKubeconfigRequest { - return ApiGetLoginKubeconfigRequest{ +func (a *APIClient) GetCluster(ctx context.Context, projectId string, clusterName string) ApiGetClusterRequest { + return ApiGetClusterRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -1307,8 +732,8 @@ func (a *APIClient) GetLoginKubeconfig(ctx context.Context, projectId string, cl } } -func (a *APIClient) GetLoginKubeconfigExecute(ctx context.Context, projectId string, clusterName string) (*LoginKubeconfig, error) { - r := ApiGetLoginKubeconfigRequest{ +func (a *APIClient) GetClusterExecute(ctx context.Context, projectId string, clusterName string) (*Cluster, error) { + r := ApiGetClusterRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -1317,27 +742,29 @@ func (a *APIClient) GetLoginKubeconfigExecute(ctx context.Context, projectId str return r.Execute() } -type ApiGetServiceStatusRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type ApiGetLoginKubeconfigRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + clusterName string } -func (r ApiGetServiceStatusRequest) Execute() (*ProjectResponse, error) { +func (r ApiGetLoginKubeconfigRequest) Execute() (*LoginKubeconfig, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ProjectResponse + localVarReturnValue *LoginKubeconfig ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceStatus") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLoginKubeconfig") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}" + localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1392,17 +819,6 @@ func (r ApiGetServiceStatusRequest) Execute() (*ProjectResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 404 { - var v map[string]interface{} - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1428,34 +844,30 @@ func (r ApiGetServiceStatusRequest) Execute() (*ProjectResponse, error) { } /* -GetServiceStatus: Get a Project - -Deprecated: This endpoint is deprecated since 2024-04-11. Use the service-enablement API instead. +GetLoginKubeconfig: Get a kubeconfig for use with the STACKIT CLI -Get a Project specified by `projectId`. +A kubeconfig retrieved using this endpoint does not contain any credentials and instead obtains valid credentials via the STACKIT CLI. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @return ApiGetServiceStatusRequest + @param clusterName + @return ApiGetLoginKubeconfigRequest */ -func (a *APIClient) GetServiceStatus(ctx context.Context, projectId string) ApiGetServiceStatusRequest { - return ApiGetServiceStatusRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) GetLoginKubeconfig(ctx context.Context, projectId string, clusterName string) ApiGetLoginKubeconfigRequest { + return ApiGetLoginKubeconfigRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + clusterName: clusterName, } } -/* -Deprecated: This endpoint is deprecated since 2024-04-11. Use the service-enablement API instead. - -Get a Project specified by `projectId`. -*/ -func (a *APIClient) GetServiceStatusExecute(ctx context.Context, projectId string) (*ProjectResponse, error) { - r := ApiGetServiceStatusRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) GetLoginKubeconfigExecute(ctx context.Context, projectId string, clusterName string) (*LoginKubeconfig, error) { + r := ApiGetLoginKubeconfigRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + clusterName: clusterName, } return r.Execute() } @@ -2301,151 +1713,3 @@ func (a *APIClient) TriggerReconcileExecute(ctx context.Context, projectId strin } return r.Execute() } - -type ApiTriggerRotateCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - clusterName string -} - -func (r ApiTriggerRotateCredentialsRequest) Execute() (map[string]interface{}, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TriggerRotateCredentials") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/rotate-credentials" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 404 { - var v map[string]interface{} - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v RuntimeError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -TriggerRotateCredentials: Rotate cluster credentials - -Deprecated: This endpoint is deprecated since 2024-01-26. It will not work for clusters with Kubernetes v1.27+, or if the new endpoints for kubeconfig or credentials rotation have already been used. Use [start-credentials-rotation](#tag/Credentials/operation/SkeService_StartClusterCredentialsRotation) instead to rotate all cluster credentials. For more information, see [How to rotate SKE credentials](https://docs.stackit.cloud/display/STACKIT/How+to+rotate+SKE+credentials). - -Trigger credential rotation. The old credentials (kubeconfig) will be invalid after the operation. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param clusterName - @return ApiTriggerRotateCredentialsRequest -*/ -func (a *APIClient) TriggerRotateCredentials(ctx context.Context, projectId string, clusterName string) ApiTriggerRotateCredentialsRequest { - return ApiTriggerRotateCredentialsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - clusterName: clusterName, - } -} - -/* -Deprecated: This endpoint is deprecated since 2024-01-26. It will not work for clusters with Kubernetes v1.27+, or if the new endpoints for kubeconfig or credentials rotation have already been used. Use [start-credentials-rotation](#tag/Credentials/operation/SkeService_StartClusterCredentialsRotation) instead to rotate all cluster credentials. For more information, see [How to rotate SKE credentials](https://docs.stackit.cloud/display/STACKIT/How+to+rotate+SKE+credentials). - -Trigger credential rotation. The old credentials (kubeconfig) will be invalid after the operation. -*/ -func (a *APIClient) TriggerRotateCredentialsExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) { - r := ApiTriggerRotateCredentialsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - clusterName: clusterName, - } - return r.Execute() -} diff --git a/services/ske/api_default_test.go b/services/ske/api_default_test.go index 3f6161efb..df4f74c4f 100644 --- a/services/ske/api_default_test.go +++ b/services/ske/api_default_test.go @@ -245,110 +245,6 @@ func Test_ske_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService DisableService", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := map[string]interface{}{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for ske_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - resp, reqErr := apiClient.DisableService(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService EnableService", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ProjectResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for ske_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - resp, reqErr := apiClient.EnableService(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - t.Run("Test DefaultApiService GetCluster", func(t *testing.T) { path := "/v1/projects/{projectId}/clusters/{clusterName}" projectIdValue := "projectId" @@ -404,61 +300,6 @@ func Test_ske_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetCredentials", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/credentials" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Credentials{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for ske_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - clusterName := "clusterName" - - resp, reqErr := apiClient.GetCredentials(context.Background(), projectId, clusterName).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - t.Run("Test DefaultApiService GetLoginKubeconfig", func(t *testing.T) { path := "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login" projectIdValue := "projectId" @@ -514,58 +355,6 @@ func Test_ske_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetServiceStatus", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ProjectResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for ske_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - resp, reqErr := apiClient.GetServiceStatus(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - t.Run("Test DefaultApiService ListClusters", func(t *testing.T) { path := "/v1/projects/{projectId}/clusters" projectIdValue := "projectId" @@ -886,59 +675,4 @@ func Test_ske_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService TriggerRotateCredentials", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/rotate-credentials" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := map[string]interface{}{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for ske_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - clusterName := "clusterName" - - resp, reqErr := apiClient.TriggerRotateCredentials(context.Background(), projectId, clusterName).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - } diff --git a/services/ske/go.mod b/services/ske/go.mod index dde30f356..28d91364d 100644 --- a/services/ske/go.mod +++ b/services/ske/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/ske -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/ske/go.sum b/services/ske/go.sum index b7c164325..b7342b5ac 100644 --- a/services/ske/go.sum +++ b/services/ske/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/ske/model_cluster_status.go b/services/ske/model_cluster_status.go index 87f3bafdd..8512eb376 100644 --- a/services/ske/model_cluster_status.go +++ b/services/ske/model_cluster_status.go @@ -12,6 +12,7 @@ package ske import ( "encoding/json" + "time" ) // checks if the ClusterStatus type satisfies the MappedNullable interface at compile time @@ -21,10 +22,12 @@ var _ MappedNullable = &ClusterStatus{} type ClusterStatus struct { Aggregated *ClusterStatusState `json:"aggregated,omitempty"` // Format: `2024-02-15T11:06:29Z` - CreationTime *string `json:"creationTime,omitempty"` + CreationTime *time.Time `json:"creationTime,omitempty"` CredentialsRotation *CredentialsRotationState `json:"credentialsRotation,omitempty"` - Error *RuntimeError `json:"error,omitempty"` - Hibernated *bool `json:"hibernated,omitempty"` + // The outgoing network ranges (in CIDR notation) of traffic originating from workload on the cluster. + EgressAddressRanges *[]string `json:"egressAddressRanges,omitempty"` + Error *RuntimeError `json:"error,omitempty"` + Hibernated *bool `json:"hibernated,omitempty"` } // NewClusterStatus instantiates a new ClusterStatus object @@ -81,9 +84,9 @@ func (o *ClusterStatus) SetAggregated(v *ClusterStatusState) { } // GetCreationTime returns the CreationTime field value if set, zero value otherwise. -func (o *ClusterStatus) GetCreationTime() *string { +func (o *ClusterStatus) GetCreationTime() *time.Time { if o == nil || IsNil(o.CreationTime) { - var ret *string + var ret *time.Time return ret } return o.CreationTime @@ -91,7 +94,7 @@ func (o *ClusterStatus) GetCreationTime() *string { // GetCreationTimeOk returns a tuple with the CreationTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClusterStatus) GetCreationTimeOk() (*string, bool) { +func (o *ClusterStatus) GetCreationTimeOk() (*time.Time, bool) { if o == nil || IsNil(o.CreationTime) { return nil, false } @@ -107,8 +110,8 @@ func (o *ClusterStatus) HasCreationTime() bool { return false } -// SetCreationTime gets a reference to the given string and assigns it to the CreationTime field. -func (o *ClusterStatus) SetCreationTime(v *string) { +// SetCreationTime gets a reference to the given time.Time and assigns it to the CreationTime field. +func (o *ClusterStatus) SetCreationTime(v *time.Time) { o.CreationTime = v } @@ -144,6 +147,38 @@ func (o *ClusterStatus) SetCredentialsRotation(v *CredentialsRotationState) { o.CredentialsRotation = v } +// GetEgressAddressRanges returns the EgressAddressRanges field value if set, zero value otherwise. +func (o *ClusterStatus) GetEgressAddressRanges() *[]string { + if o == nil || IsNil(o.EgressAddressRanges) { + var ret *[]string + return ret + } + return o.EgressAddressRanges +} + +// GetEgressAddressRangesOk returns a tuple with the EgressAddressRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterStatus) GetEgressAddressRangesOk() (*[]string, bool) { + if o == nil || IsNil(o.EgressAddressRanges) { + return nil, false + } + return o.EgressAddressRanges, true +} + +// HasEgressAddressRanges returns a boolean if a field has been set. +func (o *ClusterStatus) HasEgressAddressRanges() bool { + if o != nil && !IsNil(o.EgressAddressRanges) { + return true + } + + return false +} + +// SetEgressAddressRanges gets a reference to the given []string and assigns it to the EgressAddressRanges field. +func (o *ClusterStatus) SetEgressAddressRanges(v *[]string) { + o.EgressAddressRanges = v +} + // GetError returns the Error field value if set, zero value otherwise. func (o *ClusterStatus) GetError() *RuntimeError { if o == nil || IsNil(o.Error) { @@ -219,6 +254,9 @@ func (o ClusterStatus) ToMap() (map[string]interface{}, error) { if !IsNil(o.CredentialsRotation) { toSerialize["credentialsRotation"] = o.CredentialsRotation } + if !IsNil(o.EgressAddressRanges) { + toSerialize["egressAddressRanges"] = o.EgressAddressRanges + } if !IsNil(o.Error) { toSerialize["error"] = o.Error } diff --git a/services/ske/model_credentials.go b/services/ske/model_credentials.go deleted file mode 100644 index d574f2d88..000000000 --- a/services/ske/model_credentials.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -SKE-API - -The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - -API version: 1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ske - -import ( - "encoding/json" -) - -// checks if the Credentials type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Credentials{} - -// Credentials struct for Credentials -type Credentials struct { - CertificateAuthorityData *string `json:"certificateAuthorityData,omitempty"` - // This string contains the kubeconfig as yaml. - Kubeconfig *string `json:"kubeconfig,omitempty"` - Server *string `json:"server,omitempty"` - Token *string `json:"token,omitempty"` -} - -// NewCredentials instantiates a new Credentials object -// This constructor will assign default values to properties that have it defined, -// 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 NewCredentials() *Credentials { - this := Credentials{} - return &this -} - -// NewCredentialsWithDefaults instantiates a new Credentials object -// This 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 NewCredentialsWithDefaults() *Credentials { - this := Credentials{} - return &this -} - -// GetCertificateAuthorityData returns the CertificateAuthorityData field value if set, zero value otherwise. -func (o *Credentials) GetCertificateAuthorityData() *string { - if o == nil || IsNil(o.CertificateAuthorityData) { - var ret *string - return ret - } - return o.CertificateAuthorityData -} - -// GetCertificateAuthorityDataOk returns a tuple with the CertificateAuthorityData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Credentials) GetCertificateAuthorityDataOk() (*string, bool) { - if o == nil || IsNil(o.CertificateAuthorityData) { - return nil, false - } - return o.CertificateAuthorityData, true -} - -// HasCertificateAuthorityData returns a boolean if a field has been set. -func (o *Credentials) HasCertificateAuthorityData() bool { - if o != nil && !IsNil(o.CertificateAuthorityData) { - return true - } - - return false -} - -// SetCertificateAuthorityData gets a reference to the given string and assigns it to the CertificateAuthorityData field. -func (o *Credentials) SetCertificateAuthorityData(v *string) { - o.CertificateAuthorityData = v -} - -// GetKubeconfig returns the Kubeconfig field value if set, zero value otherwise. -func (o *Credentials) GetKubeconfig() *string { - if o == nil || IsNil(o.Kubeconfig) { - var ret *string - return ret - } - return o.Kubeconfig -} - -// GetKubeconfigOk returns a tuple with the Kubeconfig field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Credentials) GetKubeconfigOk() (*string, bool) { - if o == nil || IsNil(o.Kubeconfig) { - return nil, false - } - return o.Kubeconfig, true -} - -// HasKubeconfig returns a boolean if a field has been set. -func (o *Credentials) HasKubeconfig() bool { - if o != nil && !IsNil(o.Kubeconfig) { - return true - } - - return false -} - -// SetKubeconfig gets a reference to the given string and assigns it to the Kubeconfig field. -func (o *Credentials) SetKubeconfig(v *string) { - o.Kubeconfig = v -} - -// GetServer returns the Server field value if set, zero value otherwise. -func (o *Credentials) GetServer() *string { - if o == nil || IsNil(o.Server) { - var ret *string - return ret - } - return o.Server -} - -// GetServerOk returns a tuple with the Server field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Credentials) GetServerOk() (*string, bool) { - if o == nil || IsNil(o.Server) { - return nil, false - } - return o.Server, true -} - -// HasServer returns a boolean if a field has been set. -func (o *Credentials) HasServer() bool { - if o != nil && !IsNil(o.Server) { - return true - } - - return false -} - -// SetServer gets a reference to the given string and assigns it to the Server field. -func (o *Credentials) SetServer(v *string) { - o.Server = v -} - -// GetToken returns the Token field value if set, zero value otherwise. -func (o *Credentials) 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 *Credentials) 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 *Credentials) 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 *Credentials) SetToken(v *string) { - o.Token = v -} - -func (o Credentials) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CertificateAuthorityData) { - toSerialize["certificateAuthorityData"] = o.CertificateAuthorityData - } - if !IsNil(o.Kubeconfig) { - toSerialize["kubeconfig"] = o.Kubeconfig - } - if !IsNil(o.Server) { - toSerialize["server"] = o.Server - } - if !IsNil(o.Token) { - toSerialize["token"] = o.Token - } - return toSerialize, nil -} - -type NullableCredentials struct { - value *Credentials - isSet bool -} - -func (v NullableCredentials) Get() *Credentials { - return v.value -} - -func (v *NullableCredentials) Set(val *Credentials) { - v.value = val - v.isSet = true -} - -func (v NullableCredentials) IsSet() bool { - return v.isSet -} - -func (v *NullableCredentials) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCredentials(val *Credentials) *NullableCredentials { - return &NullableCredentials{value: val, isSet: true} -} - -func (v NullableCredentials) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCredentials) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/ske/model_credentials_rotation_state.go b/services/ske/model_credentials_rotation_state.go index e77ca6c93..d71f40d3e 100644 --- a/services/ske/model_credentials_rotation_state.go +++ b/services/ske/model_credentials_rotation_state.go @@ -12,6 +12,7 @@ package ske import ( "encoding/json" + "time" ) // checks if the CredentialsRotationState type satisfies the MappedNullable interface at compile time @@ -20,10 +21,10 @@ var _ MappedNullable = &CredentialsRotationState{} // CredentialsRotationState struct for CredentialsRotationState type CredentialsRotationState struct { // Format: `2024-02-15T11:06:29Z` - LastCompletionTime *string `json:"lastCompletionTime,omitempty"` + LastCompletionTime *time.Time `json:"lastCompletionTime,omitempty"` // Format: `2024-02-15T11:06:29Z` - LastInitiationTime *string `json:"lastInitiationTime,omitempty"` - // Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. Using the deprecated [rotate-credentials](#tag/Credentials/operation/SkeService_GetClusterCredentials) endpoint will not update this status field. + LastInitiationTime *time.Time `json:"lastInitiationTime,omitempty"` + // Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. Phase *string `json:"phase,omitempty"` } @@ -45,9 +46,9 @@ func NewCredentialsRotationStateWithDefaults() *CredentialsRotationState { } // GetLastCompletionTime returns the LastCompletionTime field value if set, zero value otherwise. -func (o *CredentialsRotationState) GetLastCompletionTime() *string { +func (o *CredentialsRotationState) GetLastCompletionTime() *time.Time { if o == nil || IsNil(o.LastCompletionTime) { - var ret *string + var ret *time.Time return ret } return o.LastCompletionTime @@ -55,7 +56,7 @@ func (o *CredentialsRotationState) GetLastCompletionTime() *string { // GetLastCompletionTimeOk returns a tuple with the LastCompletionTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CredentialsRotationState) GetLastCompletionTimeOk() (*string, bool) { +func (o *CredentialsRotationState) GetLastCompletionTimeOk() (*time.Time, bool) { if o == nil || IsNil(o.LastCompletionTime) { return nil, false } @@ -71,15 +72,15 @@ func (o *CredentialsRotationState) HasLastCompletionTime() bool { return false } -// SetLastCompletionTime gets a reference to the given string and assigns it to the LastCompletionTime field. -func (o *CredentialsRotationState) SetLastCompletionTime(v *string) { +// SetLastCompletionTime gets a reference to the given time.Time and assigns it to the LastCompletionTime field. +func (o *CredentialsRotationState) SetLastCompletionTime(v *time.Time) { o.LastCompletionTime = v } // GetLastInitiationTime returns the LastInitiationTime field value if set, zero value otherwise. -func (o *CredentialsRotationState) GetLastInitiationTime() *string { +func (o *CredentialsRotationState) GetLastInitiationTime() *time.Time { if o == nil || IsNil(o.LastInitiationTime) { - var ret *string + var ret *time.Time return ret } return o.LastInitiationTime @@ -87,7 +88,7 @@ func (o *CredentialsRotationState) GetLastInitiationTime() *string { // GetLastInitiationTimeOk returns a tuple with the LastInitiationTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CredentialsRotationState) GetLastInitiationTimeOk() (*string, bool) { +func (o *CredentialsRotationState) GetLastInitiationTimeOk() (*time.Time, bool) { if o == nil || IsNil(o.LastInitiationTime) { return nil, false } @@ -103,8 +104,8 @@ func (o *CredentialsRotationState) HasLastInitiationTime() bool { return false } -// SetLastInitiationTime gets a reference to the given string and assigns it to the LastInitiationTime field. -func (o *CredentialsRotationState) SetLastInitiationTime(v *string) { +// SetLastInitiationTime gets a reference to the given time.Time and assigns it to the LastInitiationTime field. +func (o *CredentialsRotationState) SetLastInitiationTime(v *time.Time) { o.LastInitiationTime = v } diff --git a/services/ske/model_kubeconfig.go b/services/ske/model_kubeconfig.go index a347eb05d..696a43da8 100644 --- a/services/ske/model_kubeconfig.go +++ b/services/ske/model_kubeconfig.go @@ -12,6 +12,7 @@ package ske import ( "encoding/json" + "time" ) // checks if the Kubeconfig type satisfies the MappedNullable interface at compile time @@ -19,8 +20,8 @@ var _ MappedNullable = &Kubeconfig{} // Kubeconfig struct for Kubeconfig type Kubeconfig struct { - ExpirationTimestamp *string `json:"expirationTimestamp,omitempty"` - Kubeconfig *string `json:"kubeconfig,omitempty"` + ExpirationTimestamp *time.Time `json:"expirationTimestamp,omitempty"` + Kubeconfig *string `json:"kubeconfig,omitempty"` } // NewKubeconfig instantiates a new Kubeconfig object @@ -41,9 +42,9 @@ func NewKubeconfigWithDefaults() *Kubeconfig { } // GetExpirationTimestamp returns the ExpirationTimestamp field value if set, zero value otherwise. -func (o *Kubeconfig) GetExpirationTimestamp() *string { +func (o *Kubeconfig) GetExpirationTimestamp() *time.Time { if o == nil || IsNil(o.ExpirationTimestamp) { - var ret *string + var ret *time.Time return ret } return o.ExpirationTimestamp @@ -51,7 +52,7 @@ func (o *Kubeconfig) GetExpirationTimestamp() *string { // GetExpirationTimestampOk returns a tuple with the ExpirationTimestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Kubeconfig) GetExpirationTimestampOk() (*string, bool) { +func (o *Kubeconfig) GetExpirationTimestampOk() (*time.Time, bool) { if o == nil || IsNil(o.ExpirationTimestamp) { return nil, false } @@ -67,8 +68,8 @@ func (o *Kubeconfig) HasExpirationTimestamp() bool { return false } -// SetExpirationTimestamp gets a reference to the given string and assigns it to the ExpirationTimestamp field. -func (o *Kubeconfig) SetExpirationTimestamp(v *string) { +// SetExpirationTimestamp gets a reference to the given time.Time and assigns it to the ExpirationTimestamp field. +func (o *Kubeconfig) SetExpirationTimestamp(v *time.Time) { o.ExpirationTimestamp = v } diff --git a/services/ske/model_kubernetes_version.go b/services/ske/model_kubernetes_version.go index 281781e2f..0a0f106f8 100644 --- a/services/ske/model_kubernetes_version.go +++ b/services/ske/model_kubernetes_version.go @@ -12,6 +12,7 @@ package ske import ( "encoding/json" + "time" ) // checks if the KubernetesVersion type satisfies the MappedNullable interface at compile time @@ -19,7 +20,7 @@ var _ MappedNullable = &KubernetesVersion{} // KubernetesVersion struct for KubernetesVersion type KubernetesVersion struct { - ExpirationDate *string `json:"expirationDate,omitempty"` + ExpirationDate *time.Time `json:"expirationDate,omitempty"` FeatureGates *map[string]string `json:"featureGates,omitempty"` State *string `json:"state,omitempty"` Version *string `json:"version,omitempty"` @@ -43,9 +44,9 @@ func NewKubernetesVersionWithDefaults() *KubernetesVersion { } // GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. -func (o *KubernetesVersion) GetExpirationDate() *string { +func (o *KubernetesVersion) GetExpirationDate() *time.Time { if o == nil || IsNil(o.ExpirationDate) { - var ret *string + var ret *time.Time return ret } return o.ExpirationDate @@ -53,7 +54,7 @@ func (o *KubernetesVersion) GetExpirationDate() *string { // GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *KubernetesVersion) GetExpirationDateOk() (*string, bool) { +func (o *KubernetesVersion) GetExpirationDateOk() (*time.Time, bool) { if o == nil || IsNil(o.ExpirationDate) { return nil, false } @@ -69,8 +70,8 @@ func (o *KubernetesVersion) HasExpirationDate() bool { return false } -// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. -func (o *KubernetesVersion) SetExpirationDate(v *string) { +// SetExpirationDate gets a reference to the given time.Time and assigns it to the ExpirationDate field. +func (o *KubernetesVersion) SetExpirationDate(v *time.Time) { o.ExpirationDate = v } diff --git a/services/ske/model_machine_image_version.go b/services/ske/model_machine_image_version.go index 3286333a7..ea606be9c 100644 --- a/services/ske/model_machine_image_version.go +++ b/services/ske/model_machine_image_version.go @@ -12,6 +12,7 @@ package ske import ( "encoding/json" + "time" ) // checks if the MachineImageVersion type satisfies the MappedNullable interface at compile time @@ -19,10 +20,10 @@ var _ MappedNullable = &MachineImageVersion{} // MachineImageVersion struct for MachineImageVersion type MachineImageVersion struct { - Cri *[]CRI `json:"cri,omitempty"` - ExpirationDate *string `json:"expirationDate,omitempty"` - State *string `json:"state,omitempty"` - Version *string `json:"version,omitempty"` + Cri *[]CRI `json:"cri,omitempty"` + ExpirationDate *time.Time `json:"expirationDate,omitempty"` + State *string `json:"state,omitempty"` + Version *string `json:"version,omitempty"` } // NewMachineImageVersion instantiates a new MachineImageVersion object @@ -75,9 +76,9 @@ func (o *MachineImageVersion) SetCri(v *[]CRI) { } // GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. -func (o *MachineImageVersion) GetExpirationDate() *string { +func (o *MachineImageVersion) GetExpirationDate() *time.Time { if o == nil || IsNil(o.ExpirationDate) { - var ret *string + var ret *time.Time return ret } return o.ExpirationDate @@ -85,7 +86,7 @@ func (o *MachineImageVersion) GetExpirationDate() *string { // GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineImageVersion) GetExpirationDateOk() (*string, bool) { +func (o *MachineImageVersion) GetExpirationDateOk() (*time.Time, bool) { if o == nil || IsNil(o.ExpirationDate) { return nil, false } @@ -101,8 +102,8 @@ func (o *MachineImageVersion) HasExpirationDate() bool { return false } -// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. -func (o *MachineImageVersion) SetExpirationDate(v *string) { +// SetExpirationDate gets a reference to the given time.Time and assigns it to the ExpirationDate field. +func (o *MachineImageVersion) SetExpirationDate(v *time.Time) { o.ExpirationDate = v } diff --git a/services/ske/model_machine_type.go b/services/ske/model_machine_type.go index d96892935..191cfa24a 100644 --- a/services/ske/model_machine_type.go +++ b/services/ske/model_machine_type.go @@ -20,10 +20,13 @@ var _ MappedNullable = &MachineType{} // MachineType struct for MachineType type MachineType struct { Architecture *string `json:"architecture,omitempty"` - Cpu *int64 `json:"cpu,omitempty"` - Gpu *int64 `json:"gpu,omitempty"` - Memory *int64 `json:"memory,omitempty"` - Name *string `json:"name,omitempty"` + // Can be cast to int32 without loss of precision. + Cpu *int64 `json:"cpu,omitempty"` + // Can be cast to int32 without loss of precision. + Gpu *int64 `json:"gpu,omitempty"` + // Can be cast to int32 without loss of precision. + Memory *int64 `json:"memory,omitempty"` + Name *string `json:"name,omitempty"` } // NewMachineType instantiates a new MachineType object diff --git a/services/ske/model_nodepool.go b/services/ske/model_nodepool.go index fe7811f5d..cde0c4aec 100644 --- a/services/ske/model_nodepool.go +++ b/services/ske/model_nodepool.go @@ -26,11 +26,15 @@ type Nodepool struct { Cri *CRI `json:"cri,omitempty"` Labels *map[string]string `json:"labels,omitempty"` // REQUIRED - Machine *Machine `json:"machine"` - MaxSurge *int64 `json:"maxSurge,omitempty"` - MaxUnavailable *int64 `json:"maxUnavailable,omitempty"` + Machine *Machine `json:"machine"` + // Can be cast to int32 without loss of precision. + MaxSurge *int64 `json:"maxSurge,omitempty"` + // Can be cast to int32 without loss of precision. + MaxUnavailable *int64 `json:"maxUnavailable,omitempty"` + // Can be cast to int32 without loss of precision. // REQUIRED Maximum *int64 `json:"maximum"` + // Can be cast to int32 without loss of precision. // REQUIRED Minimum *int64 `json:"minimum"` // Maximum 15 chars diff --git a/services/ske/model_project_response.go b/services/ske/model_project_response.go deleted file mode 100644 index fd7276b79..000000000 --- a/services/ske/model_project_response.go +++ /dev/null @@ -1,156 +0,0 @@ -/* -SKE-API - -The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - -API version: 1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ske - -import ( - "encoding/json" -) - -// checks if the ProjectResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ProjectResponse{} - -// ProjectResponse struct for ProjectResponse -type ProjectResponse struct { - ProjectId *string `json:"projectId,omitempty"` - State *ProjectState `json:"state,omitempty"` -} - -// NewProjectResponse instantiates a new ProjectResponse object -// This constructor will assign default values to properties that have it defined, -// 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 NewProjectResponse() *ProjectResponse { - this := ProjectResponse{} - var state ProjectState = PROJECTSTATE_UNSPECIFIED - this.State = &state - return &this -} - -// NewProjectResponseWithDefaults instantiates a new ProjectResponse object -// This 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 NewProjectResponseWithDefaults() *ProjectResponse { - this := ProjectResponse{} - var state ProjectState = PROJECTSTATE_UNSPECIFIED - this.State = &state - return &this -} - -// GetProjectId returns the ProjectId field value if set, zero value otherwise. -func (o *ProjectResponse) 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 *ProjectResponse) 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 *ProjectResponse) 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 *ProjectResponse) SetProjectId(v *string) { - o.ProjectId = v -} - -// GetState returns the State field value if set, zero value otherwise. -func (o *ProjectResponse) GetState() *ProjectState { - if o == nil || IsNil(o.State) { - var ret *ProjectState - 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 *ProjectResponse) GetStateOk() (*ProjectState, 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 *ProjectResponse) HasState() bool { - if o != nil && !IsNil(o.State) { - return true - } - - return false -} - -// SetState gets a reference to the given ProjectState and assigns it to the State field. -func (o *ProjectResponse) SetState(v *ProjectState) { - o.State = v -} - -func (o ProjectResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.ProjectId) { - toSerialize["projectId"] = o.ProjectId - } - if !IsNil(o.State) { - toSerialize["state"] = o.State - } - return toSerialize, nil -} - -type NullableProjectResponse struct { - value *ProjectResponse - isSet bool -} - -func (v NullableProjectResponse) Get() *ProjectResponse { - return v.value -} - -func (v *NullableProjectResponse) Set(val *ProjectResponse) { - v.value = val - v.isSet = true -} - -func (v NullableProjectResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableProjectResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProjectResponse(val *ProjectResponse) *NullableProjectResponse { - return &NullableProjectResponse{value: val, isSet: true} -} - -func (v NullableProjectResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProjectResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/ske/model_project_state.go b/services/ske/model_project_state.go deleted file mode 100644 index 3d26eb7ec..000000000 --- a/services/ske/model_project_state.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -SKE-API - -The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - -API version: 1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ske - -import ( - "encoding/json" - "fmt" -) - -// ProjectState the model 'ProjectState' -type ProjectState string - -// List of ProjectState -const ( - PROJECTSTATE_UNSPECIFIED ProjectState = "STATE_UNSPECIFIED" - PROJECTSTATE_CREATING ProjectState = "STATE_CREATING" - PROJECTSTATE_CREATED ProjectState = "STATE_CREATED" - PROJECTSTATE_DELETING ProjectState = "STATE_DELETING" - PROJECTSTATE_FAILED ProjectState = "STATE_FAILED" -) - -// All allowed values of ProjectState enum -var AllowedProjectStateEnumValues = []ProjectState{ - "STATE_UNSPECIFIED", - "STATE_CREATING", - "STATE_CREATED", - "STATE_DELETING", - "STATE_FAILED", -} - -func (v *ProjectState) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - // Allow unmarshalling zero value for testing purposes - var zeroValue string - if value == zeroValue { - return nil - } - enumTypeValue := ProjectState(value) - for _, existing := range AllowedProjectStateEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ProjectState", value) -} - -// NewProjectStateFromValue returns a pointer to a valid ProjectState -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewProjectStateFromValue(v string) (*ProjectState, error) { - ev := ProjectState(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ProjectState: valid values are %v", v, AllowedProjectStateEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ProjectState) IsValid() bool { - for _, existing := range AllowedProjectStateEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ProjectState value -func (v ProjectState) Ptr() *ProjectState { - return &v -} - -type NullableProjectState struct { - value *ProjectState - isSet bool -} - -func (v NullableProjectState) Get() *ProjectState { - return v.value -} - -func (v *NullableProjectState) Set(val *ProjectState) { - v.value = val - v.isSet = true -} - -func (v NullableProjectState) IsSet() bool { - return v.isSet -} - -func (v *NullableProjectState) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProjectState(val *ProjectState) *NullableProjectState { - return &NullableProjectState{value: val, isSet: true} -} - -func (v NullableProjectState) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProjectState) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/ske/model_time_window.go b/services/ske/model_time_window.go index 934158297..cd9369023 100644 --- a/services/ske/model_time_window.go +++ b/services/ske/model_time_window.go @@ -12,6 +12,7 @@ package ske import ( "encoding/json" + "time" ) // checks if the TimeWindow type satisfies the MappedNullable interface at compile time @@ -20,9 +21,9 @@ var _ MappedNullable = &TimeWindow{} // TimeWindow struct for TimeWindow type TimeWindow struct { // REQUIRED - End *string `json:"end"` + End *time.Time `json:"end"` // REQUIRED - Start *string `json:"start"` + Start *time.Time `json:"start"` } type _TimeWindow TimeWindow @@ -31,7 +32,7 @@ type _TimeWindow TimeWindow // This constructor will assign default values to properties that have it defined, // 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 NewTimeWindow(end *string, start *string) *TimeWindow { +func NewTimeWindow(end *time.Time, start *time.Time) *TimeWindow { this := TimeWindow{} this.End = end this.Start = start @@ -47,9 +48,9 @@ func NewTimeWindowWithDefaults() *TimeWindow { } // GetEnd returns the End field value -func (o *TimeWindow) GetEnd() *string { +func (o *TimeWindow) GetEnd() *time.Time { if o == nil || IsNil(o.End) { - var ret *string + var ret *time.Time return ret } @@ -58,7 +59,7 @@ func (o *TimeWindow) GetEnd() *string { // GetEndOk returns a tuple with the End field value // and a boolean to check if the value has been set. -func (o *TimeWindow) GetEndOk() (*string, bool) { +func (o *TimeWindow) GetEndOk() (*time.Time, bool) { if o == nil { return nil, false } @@ -66,14 +67,14 @@ func (o *TimeWindow) GetEndOk() (*string, bool) { } // SetEnd sets field value -func (o *TimeWindow) SetEnd(v *string) { +func (o *TimeWindow) SetEnd(v *time.Time) { o.End = v } // GetStart returns the Start field value -func (o *TimeWindow) GetStart() *string { +func (o *TimeWindow) GetStart() *time.Time { if o == nil || IsNil(o.Start) { - var ret *string + var ret *time.Time return ret } @@ -82,7 +83,7 @@ func (o *TimeWindow) GetStart() *string { // GetStartOk returns a tuple with the Start field value // and a boolean to check if the value has been set. -func (o *TimeWindow) GetStartOk() (*string, bool) { +func (o *TimeWindow) GetStartOk() (*time.Time, bool) { if o == nil { return nil, false } @@ -90,7 +91,7 @@ func (o *TimeWindow) GetStartOk() (*string, bool) { } // SetStart sets field value -func (o *TimeWindow) SetStart(v *string) { +func (o *TimeWindow) SetStart(v *time.Time) { o.Start = v } diff --git a/services/ske/model_volume.go b/services/ske/model_volume.go index 9964c8781..1d610d266 100644 --- a/services/ske/model_volume.go +++ b/services/ske/model_volume.go @@ -19,6 +19,7 @@ var _ MappedNullable = &Volume{} // Volume struct for Volume type Volume struct { + // Can be cast to int32 without loss of precision. // REQUIRED Size *int64 `json:"size"` // For valid values please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `volumeTypes`. diff --git a/services/ske/wait/wait.go b/services/ske/wait/wait.go index 8ec9529a1..3750bb475 100644 --- a/services/ske/wait/wait.go +++ b/services/ske/wait/wait.go @@ -3,10 +3,8 @@ package wait import ( "context" "fmt" - "net/http" "time" - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/ske" ) @@ -26,10 +24,6 @@ const ( InvalidArgusInstanceErrorCode = "SKE_ARGUS_INSTANCE_NOT_FOUND" ) -type APIClientProjectInterface interface { - GetServiceStatusExecute(ctx context.Context, projectId string) (*ske.ProjectResponse, error) -} - type APIClientClusterInterface interface { GetClusterExecute(ctx context.Context, projectId, name string) (*ske.Cluster, error) ListClustersExecute(ctx context.Context, projectId string) (*ske.ListClustersResponse, error) @@ -85,46 +79,6 @@ func DeleteClusterWaitHandler(ctx context.Context, a APIClientClusterInterface, return handler } -// EnableServiceWaitHandler will wait for service enablement -func EnableServiceWaitHandler(ctx context.Context, a APIClientProjectInterface, projectId string) *wait.AsyncActionHandler[ske.ProjectResponse] { - handler := wait.New(func() (waitFinished bool, response *ske.ProjectResponse, err error) { - s, err := a.GetServiceStatusExecute(ctx, projectId) - if err != nil { - return false, nil, err - } - state := *s.State - switch state { - case StateDeleting, StateFailed: - return false, nil, fmt.Errorf("received state: %s for project Id: %s", state, projectId) - case StateCreated: - return true, s, nil - } - return false, nil, nil - }) - handler.SetTimeout(15 * time.Minute) - return handler -} - -// DisableServiceWaitHandler will wait for service disablement -func DisableServiceWaitHandler(ctx context.Context, a APIClientProjectInterface, projectId string) *wait.AsyncActionHandler[struct{}] { - handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { - _, err = a.GetServiceStatusExecute(ctx, projectId) - if err == nil { - return false, nil, nil - } - oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped - if !ok { - return false, nil, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError in delete wait.AsyncHandler, %w", err) - } - if oapiErr.StatusCode == http.StatusNotFound || oapiErr.StatusCode == http.StatusForbidden { - return true, nil, nil - } - return false, nil, err - }) - handler.SetTimeout(15 * time.Minute) - return handler -} - // RotateCredentialsWaitHandler will wait for credentials rotation func RotateCredentialsWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { diff --git a/services/ske/wait/wait_test.go b/services/ske/wait/wait_test.go index 36b5103b4..84b644209 100644 --- a/services/ske/wait/wait_test.go +++ b/services/ske/wait/wait_test.go @@ -67,31 +67,6 @@ func (a *apiClientClusterMocked) ListClustersExecute(_ context.Context, _ string }, nil } -// Used for testing cluster operations -type apiClientProjectMocked struct { - getFails bool - getNotFound bool - resourceState string -} - -func (a *apiClientProjectMocked) GetServiceStatusExecute(_ context.Context, _ string) (*ske.ProjectResponse, error) { - if a.getFails { - return nil, &oapierror.GenericOpenAPIError{ - StatusCode: http.StatusInternalServerError, - } - } - if a.getNotFound { - return nil, &oapierror.GenericOpenAPIError{ - StatusCode: http.StatusNotFound, - } - } - rs := ske.ProjectState(a.resourceState) - return &ske.ProjectResponse{ - ProjectId: utils.Ptr("pid"), - State: &rs, - }, nil -} - func TestCreateOrUpdateClusterWaitHandler(t *testing.T) { tests := []struct { desc string @@ -186,115 +161,6 @@ func TestCreateOrUpdateClusterWaitHandler(t *testing.T) { } } -func TestCreateProjectWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - resourceState string - wantErr bool - wantResp bool - }{ - { - desc: "create_succeeded", - getFails: false, - resourceState: StateCreated, - wantErr: false, - wantResp: true, - }, - { - desc: "create_failed", - getFails: false, - wantErr: true, - wantResp: false, - }, - { - desc: "get_fails", - getFails: true, - wantErr: true, - wantResp: false, - }, - { - desc: "timeout", - getFails: false, - resourceState: "ANOTHER STATE", - wantErr: true, - wantResp: false, - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - apiClient := &apiClientProjectMocked{ - getFails: tt.getFails, - resourceState: tt.resourceState, - } - var wantRes *ske.ProjectResponse - rs := ske.ProjectState(tt.resourceState) - if tt.wantResp { - wantRes = &ske.ProjectResponse{ - ProjectId: utils.Ptr("pid"), - State: &rs, - } - } - - handler := EnableServiceWaitHandler(context.Background(), apiClient, "") - - gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %+v, want %+v", gotRes, wantRes) - } - }) - } -} - -func TestDeleteProjectWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - getNotFound bool - wantErr bool - resourceState string - }{ - { - desc: "delete_succeeded", - getFails: false, - getNotFound: true, - wantErr: false, - }, - { - desc: "get_fails", - getFails: true, - wantErr: true, - }, - { - desc: "timeout", - getFails: false, - wantErr: true, - resourceState: "ANOTHER STATE", - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - apiClient := &apiClientProjectMocked{ - getFails: tt.getFails, - getNotFound: tt.getNotFound, - resourceState: tt.resourceState, - } - - handler := DisableServiceWaitHandler(context.Background(), apiClient, "") - - _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} - func TestRotateCredentialsWaitHandler(t *testing.T) { tests := []struct { desc string diff --git a/services/sqlserverflex/CHANGELOG.md b/services/sqlserverflex/CHANGELOG.md index 7d6dfbe84..8afc94a13 100644 --- a/services/sqlserverflex/CHANGELOG.md +++ b/services/sqlserverflex/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.10.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.9.0 (2025-01-20) + +- **Breaking change**: Delete endpoint made private. + ## v0.8.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/sqlserverflex/LICENSE.md b/services/sqlserverflex/LICENSE.md index bc892668d..7e2f06484 100644 --- a/services/sqlserverflex/LICENSE.md +++ b/services/sqlserverflex/LICENSE.md @@ -2,180 +2,180 @@ Version 2.0, January 2004 http://www.apache.org/licenses/ - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" @@ -186,16 +186,16 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Schwarz IT KG +Copyright 2025 Schwarz IT KG - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/sqlserverflex/NOTICE.txt b/services/sqlserverflex/NOTICE.txt index 64d737e30..2d99715a4 100644 --- a/services/sqlserverflex/NOTICE.txt +++ b/services/sqlserverflex/NOTICE.txt @@ -1,2 +1,2 @@ STACKIT SQL Server Flex SDK for Go -Copyright 2024 Schwarz IT KG \ No newline at end of file +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/sqlserverflex/api_default.go b/services/sqlserverflex/api_default.go index 7a2cdb381..a7c6cd604 100644 --- a/services/sqlserverflex/api_default.go +++ b/services/sqlserverflex/api_default.go @@ -3209,122 +3209,6 @@ func (a *APIClient) ResetUserExecute(ctx context.Context, projectId string, inst return r.Execute() } -type ApiTerminateProjectRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiTerminateProjectRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TerminateProject") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 500 { - var v InstanceError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return newErr - } - - return nil -} - -/* -TerminateProject: Terminate the Project - -Termination is the deletion of a whole project which causes the deletion of all instances for this project. Only System with permission system.databases-project.remove is able to call this resource - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiTerminateProjectRequest -*/ -func (a *APIClient) TerminateProject(ctx context.Context, projectId string) ApiTerminateProjectRequest { - return ApiTerminateProjectRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) TerminateProjectExecute(ctx context.Context, projectId string) error { - r := ApiTerminateProjectRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - type ApiTriggerDatabaseBackupRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/sqlserverflex/api_default_test.go b/services/sqlserverflex/api_default_test.go index 13dbec41e..61cdb096d 100644 --- a/services/sqlserverflex/api_default_test.go +++ b/services/sqlserverflex/api_default_test.go @@ -1280,52 +1280,6 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService TerminateProject", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for sqlserverflex_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - reqErr := apiClient.TerminateProject(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - t.Run("Test DefaultApiService TriggerDatabaseBackup", func(t *testing.T) { path := "/v1/projects/{projectId}/instances/{instanceId}/backups/databases/{databaseName}" projectIdValue := "projectId" diff --git a/services/sqlserverflex/go.mod b/services/sqlserverflex/go.mod index daf1137e3..bf4ed48c1 100644 --- a/services/sqlserverflex/go.mod +++ b/services/sqlserverflex/go.mod @@ -1,10 +1,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex -go 1.18 +go 1.21 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + github.com/stackitcloud/stackit-sdk-go/core v0.15.1 ) require ( diff --git a/services/sqlserverflex/go.sum b/services/sqlserverflex/go.sum index b7c164325..b7342b5ac 100644 --- a/services/sqlserverflex/go.sum +++ b/services/sqlserverflex/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= -github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/stackitmarketplace/.openapi-generator/VERSION b/services/stackitmarketplace/.openapi-generator/VERSION new file mode 100644 index 000000000..cd802a1ec --- /dev/null +++ b/services/stackitmarketplace/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/services/stackitmarketplace/CHANGELOG.md b/services/stackitmarketplace/CHANGELOG.md new file mode 100644 index 000000000..4d43949c2 --- /dev/null +++ b/services/stackitmarketplace/CHANGELOG.md @@ -0,0 +1,6 @@ +## v0.2.0 (2025-02-21) +- **New:** Minimal go version is now Go 1.21 + +## v0.1.0 (2025-01-10) + +- **New**: STACKIT Marketplace module can be used to manage the STACKIT Marketplace. diff --git a/services/stackitmarketplace/LICENSE.md b/services/stackitmarketplace/LICENSE.md new file mode 100644 index 000000000..7e2f06484 --- /dev/null +++ b/services/stackitmarketplace/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2025 Schwarz IT KG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/stackitmarketplace/NOTICE.txt b/services/stackitmarketplace/NOTICE.txt new file mode 100644 index 000000000..f28889f0e --- /dev/null +++ b/services/stackitmarketplace/NOTICE.txt @@ -0,0 +1,2 @@ +STACKIT Marketplace SDK for Go +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/stackitmarketplace/api_default.go b/services/stackitmarketplace/api_default.go new file mode 100644 index 000000000..36df22382 --- /dev/null +++ b/services/stackitmarketplace/api_default.go @@ -0,0 +1,1058 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiApproveSubscriptionRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + subscriptionId string +} + +func (r ApiApproveSubscriptionRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ApproveSubscription") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/vendors/projects/{projectId}/subscriptions/{subscriptionId}/approve" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscriptionId"+"}", url.PathEscape(ParameterValueToString(r.subscriptionId, "subscriptionId")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +ApproveSubscription: Approve a subscription + +Approve a pending subscription. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The project ID. + @param subscriptionId The subscription ID. + @return ApiApproveSubscriptionRequest +*/ +func (a *APIClient) ApproveSubscription(ctx context.Context, projectId string, subscriptionId string) ApiApproveSubscriptionRequest { + return ApiApproveSubscriptionRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + subscriptionId: subscriptionId, + } +} + +func (a *APIClient) ApproveSubscriptionExecute(ctx context.Context, projectId string, subscriptionId string) error { + r := ApiApproveSubscriptionRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + subscriptionId: subscriptionId, + } + return r.Execute() +} + +type ApiGetCatalogProductRequest struct { + ctx context.Context + apiService *DefaultApiService + productId string + locale *string +} + +// The language of the response. + +func (r ApiGetCatalogProductRequest) Locale(locale string) ApiGetCatalogProductRequest { + r.locale = &locale + return r +} + +func (r ApiGetCatalogProductRequest) Execute() (*CatalogProductDetail, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CatalogProductDetail + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCatalogProduct") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/catalog/products/{productId}" + localVarPath = strings.Replace(localVarPath, "{"+"productId"+"}", url.PathEscape(ParameterValueToString(r.productId, "productId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.locale != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "locale", r.locale, "") + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetCatalogProduct: Get a product + +Get a product. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param productId The product ID. + @return ApiGetCatalogProductRequest +*/ +func (a *APIClient) GetCatalogProduct(ctx context.Context, productId string) ApiGetCatalogProductRequest { + return ApiGetCatalogProductRequest{ + apiService: a.defaultApi, + ctx: ctx, + productId: productId, + } +} + +func (a *APIClient) GetCatalogProductExecute(ctx context.Context, productId string) (*CatalogProductDetail, error) { + r := ApiGetCatalogProductRequest{ + apiService: a.defaultApi, + ctx: ctx, + productId: productId, + } + return r.Execute() +} + +type ApiGetVendorSubscriptionRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + subscriptionId string +} + +func (r ApiGetVendorSubscriptionRequest) Execute() (*VendorSubscription, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VendorSubscription + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVendorSubscription") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/vendors/projects/{projectId}/subscriptions/{subscriptionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscriptionId"+"}", url.PathEscape(ParameterValueToString(r.subscriptionId, "subscriptionId")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetVendorSubscription: Get a subscription + +Get a subscription. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The project ID. + @param subscriptionId The subscription ID. + @return ApiGetVendorSubscriptionRequest +*/ +func (a *APIClient) GetVendorSubscription(ctx context.Context, projectId string, subscriptionId string) ApiGetVendorSubscriptionRequest { + return ApiGetVendorSubscriptionRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + subscriptionId: subscriptionId, + } +} + +func (a *APIClient) GetVendorSubscriptionExecute(ctx context.Context, projectId string, subscriptionId string) (*VendorSubscription, error) { + r := ApiGetVendorSubscriptionRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + subscriptionId: subscriptionId, + } + return r.Execute() +} + +type ApiListCatalogProductsRequest struct { + ctx context.Context + apiService *DefaultApiService + cursor *string + limit *float32 + locale *string + filter *string +} + +// A pagination cursor that represents a position in the dataset. If given, results will be returned from the item after the cursor. If not given, results will be returned from the beginning. + +func (r ApiListCatalogProductsRequest) Cursor(cursor string) ApiListCatalogProductsRequest { + r.cursor = &cursor + return r +} + +// The maximum number of items to return in the response. If maximum is exceeded, maximum is used. + +func (r ApiListCatalogProductsRequest) Limit(limit float32) ApiListCatalogProductsRequest { + r.limit = &limit + return r +} + +// The language of the response. + +func (r ApiListCatalogProductsRequest) Locale(locale string) ApiListCatalogProductsRequest { + r.locale = &locale + return r +} + +// Filter the products based on attributes. E.g `deliveryMethod eq \"SAAS\"`. The supported attributes are `deliveryMethod`, `priceType`, `category`, `vendorId`, `vendorName`, and `name`. The supported operators are `eq`. Filters can be joined with `and` or `or`. + +func (r ApiListCatalogProductsRequest) Filter(filter string) ApiListCatalogProductsRequest { + r.filter = &filter + return r +} + +func (r ApiListCatalogProductsRequest) Execute() (*ListCatalogProductsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCatalogProductsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCatalogProducts") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/catalog/products" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.locale != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "locale", r.locale, "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListCatalogProducts: List all products + +List all products. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListCatalogProductsRequest +*/ +func (a *APIClient) ListCatalogProducts(ctx context.Context) ApiListCatalogProductsRequest { + return ApiListCatalogProductsRequest{ + apiService: a.defaultApi, + ctx: ctx, + } +} + +func (a *APIClient) ListCatalogProductsExecute(ctx context.Context) (*ListCatalogProductsResponse, error) { + r := ApiListCatalogProductsRequest{ + apiService: a.defaultApi, + ctx: ctx, + } + return r.Execute() +} + +type ApiListVendorSubscriptionsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + cursor *string + limit *float32 + productId *string +} + +// A pagination cursor that represents a position in the dataset. If given, results will be returned from the item after the cursor. If not given, results will be returned from the beginning. + +func (r ApiListVendorSubscriptionsRequest) Cursor(cursor string) ApiListVendorSubscriptionsRequest { + r.cursor = &cursor + return r +} + +// The maximum number of items to return in the response. If maximum is exceeded, maximum is used. + +func (r ApiListVendorSubscriptionsRequest) Limit(limit float32) ApiListVendorSubscriptionsRequest { + r.limit = &limit + return r +} + +// The product ID. + +func (r ApiListVendorSubscriptionsRequest) ProductId(productId string) ApiListVendorSubscriptionsRequest { + r.productId = &productId + return r +} + +func (r ApiListVendorSubscriptionsRequest) Execute() (*ListVendorSubscriptionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListVendorSubscriptionsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListVendorSubscriptions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/vendors/projects/{projectId}/subscriptions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.productId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "productId", r.productId, "") + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListVendorSubscriptions: List all subscriptions + +List all subscriptions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The project ID. + @return ApiListVendorSubscriptionsRequest +*/ +func (a *APIClient) ListVendorSubscriptions(ctx context.Context, projectId string) ApiListVendorSubscriptionsRequest { + return ApiListVendorSubscriptionsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) ListVendorSubscriptionsExecute(ctx context.Context, projectId string) (*ListVendorSubscriptionsResponse, error) { + r := ApiListVendorSubscriptionsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiResolveCustomerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + resolveCustomerPayload *ResolveCustomerPayload +} + +func (r ApiResolveCustomerRequest) ResolveCustomerPayload(resolveCustomerPayload ResolveCustomerPayload) ApiResolveCustomerRequest { + r.resolveCustomerPayload = &resolveCustomerPayload + return r +} + +func (r ApiResolveCustomerRequest) Execute() (*VendorSubscription, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VendorSubscription + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ResolveCustomer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/vendors/projects/{projectId}/resolve-customer" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.resolveCustomerPayload == nil { + return localVarReturnValue, fmt.Errorf("resolveCustomerPayload 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.resolveCustomerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ResolveCustomer: Resolve customer + +Get details about the requested subscription. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The project ID. + @return ApiResolveCustomerRequest +*/ +func (a *APIClient) ResolveCustomer(ctx context.Context, projectId string) ApiResolveCustomerRequest { + return ApiResolveCustomerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) ResolveCustomerExecute(ctx context.Context, projectId string) (*VendorSubscription, error) { + r := ApiResolveCustomerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} diff --git a/services/stackitmarketplace/api_default_test.go b/services/stackitmarketplace/api_default_test.go new file mode 100644 index 000000000..d9d948744 --- /dev/null +++ b/services/stackitmarketplace/api_default_test.go @@ -0,0 +1,335 @@ +/* +STACKIT Marketplace API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package stackitmarketplace + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +func Test_stackitmarketplace_DefaultApiService(t *testing.T) { + + t.Run("Test DefaultApiService ApproveSubscription", func(t *testing.T) { + path := "/v1/vendors/projects/{projectId}/subscriptions/{subscriptionId}/approve" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + subscriptionIdValue := "subscriptionId" + path = strings.Replace(path, "{"+"subscriptionId"+"}", url.PathEscape(ParameterValueToString(subscriptionIdValue, "subscriptionId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for stackitmarketplace_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + subscriptionId := "subscriptionId" + + reqErr := apiClient.ApproveSubscription(context.Background(), projectId, subscriptionId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService GetCatalogProduct", func(t *testing.T) { + path := "/v1/catalog/products/{productId}" + productIdValue := "productId" + path = strings.Replace(path, "{"+"productId"+"}", url.PathEscape(ParameterValueToString(productIdValue, "productId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := CatalogProductDetail{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for stackitmarketplace_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + productId := "productId" + + resp, reqErr := apiClient.GetCatalogProduct(context.Background(), productId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetVendorSubscription", func(t *testing.T) { + path := "/v1/vendors/projects/{projectId}/subscriptions/{subscriptionId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + subscriptionIdValue := "subscriptionId" + path = strings.Replace(path, "{"+"subscriptionId"+"}", url.PathEscape(ParameterValueToString(subscriptionIdValue, "subscriptionId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := VendorSubscription{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for stackitmarketplace_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + subscriptionId := "subscriptionId" + + resp, reqErr := apiClient.GetVendorSubscription(context.Background(), projectId, subscriptionId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListCatalogProducts", func(t *testing.T) { + path := "/v1/catalog/products" + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListCatalogProductsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for stackitmarketplace_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + resp, reqErr := apiClient.ListCatalogProducts(context.Background()).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListVendorSubscriptions", func(t *testing.T) { + path := "/v1/vendors/projects/{projectId}/subscriptions" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListVendorSubscriptionsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for stackitmarketplace_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.ListVendorSubscriptions(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ResolveCustomer", func(t *testing.T) { + path := "/v1/vendors/projects/{projectId}/resolve-customer" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := VendorSubscription{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for stackitmarketplace_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + resolveCustomerPayload := ResolveCustomerPayload{} + + resp, reqErr := apiClient.ResolveCustomer(context.Background(), projectId).ResolveCustomerPayload(resolveCustomerPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + +} diff --git a/services/stackitmarketplace/client.go b/services/stackitmarketplace/client.go new file mode 100644 index 000000000..e99ec2ce5 --- /dev/null +++ b/services/stackitmarketplace/client.go @@ -0,0 +1,631 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Marketplace API API v1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + defaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. +// Optionally receives configuration options +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + c.defaultApi = (*DefaultApiService)(&c.common) + + return c, nil +} + +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 { + dump, err := httputil.DumpRequestOut(request, true) + 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 + } + + 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() *config.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, fmt.Errorf("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, fmt.Errorf("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 fmt.Errorf("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 fmt.Errorf("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 +} + +// 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) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s", 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) +} diff --git a/services/stackitmarketplace/configuration.go b/services/stackitmarketplace/configuration.go new file mode 100644 index 000000000..108ac6e3e --- /dev/null +++ b/services/stackitmarketplace/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://stackit-marketplace.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/stackitmarketplace/go.mod b/services/stackitmarketplace/go.mod new file mode 100644 index 000000000..4ed882fca --- /dev/null +++ b/services/stackitmarketplace/go.mod @@ -0,0 +1,10 @@ +module github.com/stackitcloud/stackit-sdk-go/services/stackitmarketplace + +go 1.21 + +require github.com/stackitcloud/stackit-sdk-go/core v0.15.1 + +require ( + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/google/uuid v1.6.0 // indirect +) diff --git a/services/stackitmarketplace/go.sum b/services/stackitmarketplace/go.sum new file mode 100644 index 000000000..b7342b5ac --- /dev/null +++ b/services/stackitmarketplace/go.sum @@ -0,0 +1,8 @@ +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1 h1:hIj/k/JXEuYmud3VWo3lr7Cfj2hfl4gG9nUIzcaZ9pM= +github.com/stackitcloud/stackit-sdk-go/core v0.15.1/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/stackitmarketplace/model_catalog_pricing_option_highlight.go b/services/stackitmarketplace/model_catalog_pricing_option_highlight.go new file mode 100644 index 000000000..efe0561b1 --- /dev/null +++ b/services/stackitmarketplace/model_catalog_pricing_option_highlight.go @@ -0,0 +1,117 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogPricingOptionHighlight type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogPricingOptionHighlight{} + +// CatalogPricingOptionHighlight struct for CatalogPricingOptionHighlight +type CatalogPricingOptionHighlight struct { + // The highlight content. + HighlightContent *string `json:"highlightContent,omitempty"` +} + +// NewCatalogPricingOptionHighlight instantiates a new CatalogPricingOptionHighlight object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogPricingOptionHighlight() *CatalogPricingOptionHighlight { + this := CatalogPricingOptionHighlight{} + return &this +} + +// NewCatalogPricingOptionHighlightWithDefaults instantiates a new CatalogPricingOptionHighlight object +// This 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 NewCatalogPricingOptionHighlightWithDefaults() *CatalogPricingOptionHighlight { + this := CatalogPricingOptionHighlight{} + return &this +} + +// GetHighlightContent returns the HighlightContent field value if set, zero value otherwise. +func (o *CatalogPricingOptionHighlight) GetHighlightContent() *string { + if o == nil || IsNil(o.HighlightContent) { + var ret *string + return ret + } + return o.HighlightContent +} + +// GetHighlightContentOk returns a tuple with the HighlightContent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogPricingOptionHighlight) GetHighlightContentOk() (*string, bool) { + if o == nil || IsNil(o.HighlightContent) { + return nil, false + } + return o.HighlightContent, true +} + +// HasHighlightContent returns a boolean if a field has been set. +func (o *CatalogPricingOptionHighlight) HasHighlightContent() bool { + if o != nil && !IsNil(o.HighlightContent) { + return true + } + + return false +} + +// SetHighlightContent gets a reference to the given string and assigns it to the HighlightContent field. +func (o *CatalogPricingOptionHighlight) SetHighlightContent(v *string) { + o.HighlightContent = v +} + +func (o CatalogPricingOptionHighlight) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HighlightContent) { + toSerialize["highlightContent"] = o.HighlightContent + } + return toSerialize, nil +} + +type NullableCatalogPricingOptionHighlight struct { + value *CatalogPricingOptionHighlight + isSet bool +} + +func (v NullableCatalogPricingOptionHighlight) Get() *CatalogPricingOptionHighlight { + return v.value +} + +func (v *NullableCatalogPricingOptionHighlight) Set(val *CatalogPricingOptionHighlight) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogPricingOptionHighlight) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogPricingOptionHighlight) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogPricingOptionHighlight(val *CatalogPricingOptionHighlight) *NullableCatalogPricingOptionHighlight { + return &NullableCatalogPricingOptionHighlight{value: val, isSet: true} +} + +func (v NullableCatalogPricingOptionHighlight) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogPricingOptionHighlight) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_catalog_product_detail.go b/services/stackitmarketplace/model_catalog_product_detail.go new file mode 100644 index 000000000..0bd1026d9 --- /dev/null +++ b/services/stackitmarketplace/model_catalog_product_detail.go @@ -0,0 +1,680 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogProductDetail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogProductDetail{} + +// CatalogProductDetail struct for CatalogProductDetail +type CatalogProductDetail struct { + // The list of categories associated to the product. + Categories *[]string `json:"categories,omitempty"` + // The product type. For reference: SAAS - Software as a Service, SAI - STACKIT Application Image + // REQUIRED + DeliveryMethod *string `json:"deliveryMethod"` + // The product description. + // REQUIRED + Description *string `json:"description"` + // The documentation URL. + // REQUIRED + DocumentationUrl *string `json:"documentationUrl"` + // The list of highlights. + // REQUIRED + Highlights *[]CatalogProductHighlight `json:"highlights"` + // If true, the product is not fully integrated but only listed. Product listings may not have prices and support information. + // REQUIRED + IsProductListing *bool `json:"isProductListing"` + // The lifecycle state of the product. + // REQUIRED + LifecycleState *string `json:"lifecycleState"` + // The logo base64 encoded. + // REQUIRED + Logo *string `json:"logo"` + // The product name. + // REQUIRED + Name *string `json:"name"` + // The list of pricing options. + // REQUIRED + PricingOptions *[]CatalogProductPricingOption `json:"pricingOptions"` + // The product ID. + // REQUIRED + ProductId *string `json:"productId"` + // The short summary of the product. + // REQUIRED + Summary *string `json:"summary"` + // The e-mail address for support inquiries. + SupportEmail *string `json:"supportEmail,omitempty"` + // The support FAQ URL. + SupportFaq *string `json:"supportFaq,omitempty"` + // The phone number for support inquiries. + SupportPhone *string `json:"supportPhone,omitempty"` + // The list of support resources. + SupportResources *[]CatalogProductSupportResource `json:"supportResources,omitempty"` + // REQUIRED + Vendor *CatalogProductDetailsVendor `json:"vendor"` + // The list of terms of use. + VendorTerms *[]CatalogProductVendorTerms `json:"vendorTerms,omitempty"` + // The video URL. + // REQUIRED + VideoUrl *string `json:"videoUrl"` +} + +type _CatalogProductDetail CatalogProductDetail + +// NewCatalogProductDetail instantiates a new CatalogProductDetail object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogProductDetail(deliveryMethod *string, description *string, documentationUrl *string, highlights *[]CatalogProductHighlight, isProductListing *bool, lifecycleState *string, logo *string, name *string, pricingOptions *[]CatalogProductPricingOption, productId *string, summary *string, vendor *CatalogProductDetailsVendor, videoUrl *string) *CatalogProductDetail { + this := CatalogProductDetail{} + this.DeliveryMethod = deliveryMethod + this.Description = description + this.DocumentationUrl = documentationUrl + this.Highlights = highlights + this.IsProductListing = isProductListing + this.LifecycleState = lifecycleState + this.Logo = logo + this.Name = name + this.PricingOptions = pricingOptions + this.ProductId = productId + this.Summary = summary + this.Vendor = vendor + this.VideoUrl = videoUrl + return &this +} + +// NewCatalogProductDetailWithDefaults instantiates a new CatalogProductDetail object +// This 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 NewCatalogProductDetailWithDefaults() *CatalogProductDetail { + this := CatalogProductDetail{} + return &this +} + +// GetCategories returns the Categories field value if set, zero value otherwise. +func (o *CatalogProductDetail) 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 *CatalogProductDetail) 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 *CatalogProductDetail) 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 *CatalogProductDetail) SetCategories(v *[]string) { + o.Categories = v +} + +// GetDeliveryMethod returns the DeliveryMethod field value +func (o *CatalogProductDetail) GetDeliveryMethod() *string { + if o == nil || IsNil(o.DeliveryMethod) { + var ret *string + return ret + } + + return o.DeliveryMethod +} + +// GetDeliveryMethodOk returns a tuple with the DeliveryMethod field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetDeliveryMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DeliveryMethod, true +} + +// SetDeliveryMethod sets field value +func (o *CatalogProductDetail) SetDeliveryMethod(v *string) { + o.DeliveryMethod = v +} + +// GetDescription returns the Description field value +func (o *CatalogProductDetail) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description, true +} + +// SetDescription sets field value +func (o *CatalogProductDetail) SetDescription(v *string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value +func (o *CatalogProductDetail) GetDocumentationUrl() *string { + if o == nil || IsNil(o.DocumentationUrl) { + var ret *string + return ret + } + + return o.DocumentationUrl +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DocumentationUrl, true +} + +// SetDocumentationUrl sets field value +func (o *CatalogProductDetail) SetDocumentationUrl(v *string) { + o.DocumentationUrl = v +} + +// GetHighlights returns the Highlights field value +func (o *CatalogProductDetail) GetHighlights() *[]CatalogProductHighlight { + if o == nil || IsNil(o.Highlights) { + var ret *[]CatalogProductHighlight + return ret + } + + return o.Highlights +} + +// GetHighlightsOk returns a tuple with the Highlights field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetHighlightsOk() (*[]CatalogProductHighlight, bool) { + if o == nil { + return nil, false + } + return o.Highlights, true +} + +// SetHighlights sets field value +func (o *CatalogProductDetail) SetHighlights(v *[]CatalogProductHighlight) { + o.Highlights = v +} + +// GetIsProductListing returns the IsProductListing field value +func (o *CatalogProductDetail) GetIsProductListing() *bool { + if o == nil || IsNil(o.IsProductListing) { + var ret *bool + return ret + } + + return o.IsProductListing +} + +// GetIsProductListingOk returns a tuple with the IsProductListing field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetIsProductListingOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsProductListing, true +} + +// SetIsProductListing sets field value +func (o *CatalogProductDetail) SetIsProductListing(v *bool) { + o.IsProductListing = v +} + +// GetLifecycleState returns the LifecycleState field value +func (o *CatalogProductDetail) GetLifecycleState() *string { + if o == nil || IsNil(o.LifecycleState) { + var ret *string + return ret + } + + return o.LifecycleState +} + +// GetLifecycleStateOk returns a tuple with the LifecycleState field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetLifecycleStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LifecycleState, true +} + +// SetLifecycleState sets field value +func (o *CatalogProductDetail) SetLifecycleState(v *string) { + o.LifecycleState = v +} + +// GetLogo returns the Logo field value +func (o *CatalogProductDetail) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetLogoOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Logo, true +} + +// SetLogo sets field value +func (o *CatalogProductDetail) SetLogo(v *string) { + o.Logo = v +} + +// GetName returns the Name field value +func (o *CatalogProductDetail) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CatalogProductDetail) SetName(v *string) { + o.Name = v +} + +// GetPricingOptions returns the PricingOptions field value +func (o *CatalogProductDetail) GetPricingOptions() *[]CatalogProductPricingOption { + if o == nil || IsNil(o.PricingOptions) { + var ret *[]CatalogProductPricingOption + return ret + } + + return o.PricingOptions +} + +// GetPricingOptionsOk returns a tuple with the PricingOptions field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetPricingOptionsOk() (*[]CatalogProductPricingOption, bool) { + if o == nil { + return nil, false + } + return o.PricingOptions, true +} + +// SetPricingOptions sets field value +func (o *CatalogProductDetail) SetPricingOptions(v *[]CatalogProductPricingOption) { + o.PricingOptions = v +} + +// GetProductId returns the ProductId field value +func (o *CatalogProductDetail) GetProductId() *string { + if o == nil || IsNil(o.ProductId) { + var ret *string + return ret + } + + return o.ProductId +} + +// GetProductIdOk returns a tuple with the ProductId field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetProductIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProductId, true +} + +// SetProductId sets field value +func (o *CatalogProductDetail) SetProductId(v *string) { + o.ProductId = v +} + +// GetSummary returns the Summary field value +func (o *CatalogProductDetail) GetSummary() *string { + if o == nil || IsNil(o.Summary) { + var ret *string + return ret + } + + return o.Summary +} + +// GetSummaryOk returns a tuple with the Summary field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetSummaryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Summary, true +} + +// SetSummary sets field value +func (o *CatalogProductDetail) SetSummary(v *string) { + o.Summary = v +} + +// GetSupportEmail returns the SupportEmail field value if set, zero value otherwise. +func (o *CatalogProductDetail) GetSupportEmail() *string { + if o == nil || IsNil(o.SupportEmail) { + var ret *string + return ret + } + return o.SupportEmail +} + +// GetSupportEmailOk returns a tuple with the SupportEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetSupportEmailOk() (*string, bool) { + if o == nil || IsNil(o.SupportEmail) { + return nil, false + } + return o.SupportEmail, true +} + +// HasSupportEmail returns a boolean if a field has been set. +func (o *CatalogProductDetail) HasSupportEmail() bool { + if o != nil && !IsNil(o.SupportEmail) { + return true + } + + return false +} + +// SetSupportEmail gets a reference to the given string and assigns it to the SupportEmail field. +func (o *CatalogProductDetail) SetSupportEmail(v *string) { + o.SupportEmail = v +} + +// GetSupportFaq returns the SupportFaq field value if set, zero value otherwise. +func (o *CatalogProductDetail) GetSupportFaq() *string { + if o == nil || IsNil(o.SupportFaq) { + var ret *string + return ret + } + return o.SupportFaq +} + +// GetSupportFaqOk returns a tuple with the SupportFaq field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetSupportFaqOk() (*string, bool) { + if o == nil || IsNil(o.SupportFaq) { + return nil, false + } + return o.SupportFaq, true +} + +// HasSupportFaq returns a boolean if a field has been set. +func (o *CatalogProductDetail) HasSupportFaq() bool { + if o != nil && !IsNil(o.SupportFaq) { + return true + } + + return false +} + +// SetSupportFaq gets a reference to the given string and assigns it to the SupportFaq field. +func (o *CatalogProductDetail) SetSupportFaq(v *string) { + o.SupportFaq = v +} + +// GetSupportPhone returns the SupportPhone field value if set, zero value otherwise. +func (o *CatalogProductDetail) GetSupportPhone() *string { + if o == nil || IsNil(o.SupportPhone) { + var ret *string + return ret + } + return o.SupportPhone +} + +// GetSupportPhoneOk returns a tuple with the SupportPhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetSupportPhoneOk() (*string, bool) { + if o == nil || IsNil(o.SupportPhone) { + return nil, false + } + return o.SupportPhone, true +} + +// HasSupportPhone returns a boolean if a field has been set. +func (o *CatalogProductDetail) HasSupportPhone() bool { + if o != nil && !IsNil(o.SupportPhone) { + return true + } + + return false +} + +// SetSupportPhone gets a reference to the given string and assigns it to the SupportPhone field. +func (o *CatalogProductDetail) SetSupportPhone(v *string) { + o.SupportPhone = v +} + +// GetSupportResources returns the SupportResources field value if set, zero value otherwise. +func (o *CatalogProductDetail) GetSupportResources() *[]CatalogProductSupportResource { + if o == nil || IsNil(o.SupportResources) { + var ret *[]CatalogProductSupportResource + return ret + } + return o.SupportResources +} + +// GetSupportResourcesOk returns a tuple with the SupportResources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetSupportResourcesOk() (*[]CatalogProductSupportResource, bool) { + if o == nil || IsNil(o.SupportResources) { + return nil, false + } + return o.SupportResources, true +} + +// HasSupportResources returns a boolean if a field has been set. +func (o *CatalogProductDetail) HasSupportResources() bool { + if o != nil && !IsNil(o.SupportResources) { + return true + } + + return false +} + +// SetSupportResources gets a reference to the given []CatalogProductSupportResource and assigns it to the SupportResources field. +func (o *CatalogProductDetail) SetSupportResources(v *[]CatalogProductSupportResource) { + o.SupportResources = v +} + +// GetVendor returns the Vendor field value +func (o *CatalogProductDetail) GetVendor() *CatalogProductDetailsVendor { + if o == nil || IsNil(o.Vendor) { + var ret *CatalogProductDetailsVendor + return ret + } + + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetVendorOk() (*CatalogProductDetailsVendor, bool) { + if o == nil { + return nil, false + } + return o.Vendor, true +} + +// SetVendor sets field value +func (o *CatalogProductDetail) SetVendor(v *CatalogProductDetailsVendor) { + o.Vendor = v +} + +// GetVendorTerms returns the VendorTerms field value if set, zero value otherwise. +func (o *CatalogProductDetail) GetVendorTerms() *[]CatalogProductVendorTerms { + if o == nil || IsNil(o.VendorTerms) { + var ret *[]CatalogProductVendorTerms + return ret + } + return o.VendorTerms +} + +// GetVendorTermsOk returns a tuple with the VendorTerms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetVendorTermsOk() (*[]CatalogProductVendorTerms, bool) { + if o == nil || IsNil(o.VendorTerms) { + return nil, false + } + return o.VendorTerms, true +} + +// HasVendorTerms returns a boolean if a field has been set. +func (o *CatalogProductDetail) HasVendorTerms() bool { + if o != nil && !IsNil(o.VendorTerms) { + return true + } + + return false +} + +// SetVendorTerms gets a reference to the given []CatalogProductVendorTerms and assigns it to the VendorTerms field. +func (o *CatalogProductDetail) SetVendorTerms(v *[]CatalogProductVendorTerms) { + o.VendorTerms = v +} + +// GetVideoUrl returns the VideoUrl field value +func (o *CatalogProductDetail) GetVideoUrl() *string { + if o == nil || IsNil(o.VideoUrl) { + var ret *string + return ret + } + + return o.VideoUrl +} + +// GetVideoUrlOk returns a tuple with the VideoUrl field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetail) GetVideoUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VideoUrl, true +} + +// SetVideoUrl sets field value +func (o *CatalogProductDetail) SetVideoUrl(v *string) { + o.VideoUrl = v +} + +func (o CatalogProductDetail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Categories) { + toSerialize["categories"] = o.Categories + } + toSerialize["deliveryMethod"] = o.DeliveryMethod + toSerialize["description"] = o.Description + toSerialize["documentationUrl"] = o.DocumentationUrl + toSerialize["highlights"] = o.Highlights + toSerialize["isProductListing"] = o.IsProductListing + toSerialize["lifecycleState"] = o.LifecycleState + toSerialize["logo"] = o.Logo + toSerialize["name"] = o.Name + toSerialize["pricingOptions"] = o.PricingOptions + toSerialize["productId"] = o.ProductId + toSerialize["summary"] = o.Summary + if !IsNil(o.SupportEmail) { + toSerialize["supportEmail"] = o.SupportEmail + } + if !IsNil(o.SupportFaq) { + toSerialize["supportFaq"] = o.SupportFaq + } + if !IsNil(o.SupportPhone) { + toSerialize["supportPhone"] = o.SupportPhone + } + if !IsNil(o.SupportResources) { + toSerialize["supportResources"] = o.SupportResources + } + toSerialize["vendor"] = o.Vendor + if !IsNil(o.VendorTerms) { + toSerialize["vendorTerms"] = o.VendorTerms + } + toSerialize["videoUrl"] = o.VideoUrl + return toSerialize, nil +} + +type NullableCatalogProductDetail struct { + value *CatalogProductDetail + isSet bool +} + +func (v NullableCatalogProductDetail) Get() *CatalogProductDetail { + return v.value +} + +func (v *NullableCatalogProductDetail) Set(val *CatalogProductDetail) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogProductDetail) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogProductDetail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogProductDetail(val *CatalogProductDetail) *NullableCatalogProductDetail { + return &NullableCatalogProductDetail{value: val, isSet: true} +} + +func (v NullableCatalogProductDetail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogProductDetail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_catalog_product_details_vendor.go b/services/stackitmarketplace/model_catalog_product_details_vendor.go new file mode 100644 index 000000000..36ea655f0 --- /dev/null +++ b/services/stackitmarketplace/model_catalog_product_details_vendor.go @@ -0,0 +1,256 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogProductDetailsVendor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogProductDetailsVendor{} + +// CatalogProductDetailsVendor struct for CatalogProductDetailsVendor +type CatalogProductDetailsVendor struct { + // The vendor description. + // REQUIRED + Description *string `json:"description"` + // The vendor logo base64 encoded. + // REQUIRED + Logo *string `json:"logo"` + // The vendor name. + // REQUIRED + Name *string `json:"name"` + // The vendor ID. + // REQUIRED + VendorId *string `json:"vendorId"` + // The vendor video URL. + // REQUIRED + VideoUrl *string `json:"videoUrl"` + // The vendor website URL. + // REQUIRED + WebsiteUrl *string `json:"websiteUrl"` +} + +type _CatalogProductDetailsVendor CatalogProductDetailsVendor + +// NewCatalogProductDetailsVendor instantiates a new CatalogProductDetailsVendor object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogProductDetailsVendor(description *string, logo *string, name *string, vendorId *string, videoUrl *string, websiteUrl *string) *CatalogProductDetailsVendor { + this := CatalogProductDetailsVendor{} + this.Description = description + this.Logo = logo + this.Name = name + this.VendorId = vendorId + this.VideoUrl = videoUrl + this.WebsiteUrl = websiteUrl + return &this +} + +// NewCatalogProductDetailsVendorWithDefaults instantiates a new CatalogProductDetailsVendor object +// This 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 NewCatalogProductDetailsVendorWithDefaults() *CatalogProductDetailsVendor { + this := CatalogProductDetailsVendor{} + return &this +} + +// GetDescription returns the Description field value +func (o *CatalogProductDetailsVendor) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductDetailsVendor) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description, true +} + +// SetDescription sets field value +func (o *CatalogProductDetailsVendor) SetDescription(v *string) { + o.Description = v +} + +// GetLogo returns the Logo field value +func (o *CatalogProductDetailsVendor) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductDetailsVendor) GetLogoOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Logo, true +} + +// SetLogo sets field value +func (o *CatalogProductDetailsVendor) SetLogo(v *string) { + o.Logo = v +} + +// GetName returns the Name field value +func (o *CatalogProductDetailsVendor) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductDetailsVendor) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CatalogProductDetailsVendor) SetName(v *string) { + o.Name = v +} + +// GetVendorId returns the VendorId field value +func (o *CatalogProductDetailsVendor) GetVendorId() *string { + if o == nil || IsNil(o.VendorId) { + var ret *string + return ret + } + + return o.VendorId +} + +// GetVendorIdOk returns a tuple with the VendorId field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetailsVendor) GetVendorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VendorId, true +} + +// SetVendorId sets field value +func (o *CatalogProductDetailsVendor) SetVendorId(v *string) { + o.VendorId = v +} + +// GetVideoUrl returns the VideoUrl field value +func (o *CatalogProductDetailsVendor) GetVideoUrl() *string { + if o == nil || IsNil(o.VideoUrl) { + var ret *string + return ret + } + + return o.VideoUrl +} + +// GetVideoUrlOk returns a tuple with the VideoUrl field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetailsVendor) GetVideoUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VideoUrl, true +} + +// SetVideoUrl sets field value +func (o *CatalogProductDetailsVendor) SetVideoUrl(v *string) { + o.VideoUrl = v +} + +// GetWebsiteUrl returns the WebsiteUrl field value +func (o *CatalogProductDetailsVendor) GetWebsiteUrl() *string { + if o == nil || IsNil(o.WebsiteUrl) { + var ret *string + return ret + } + + return o.WebsiteUrl +} + +// GetWebsiteUrlOk returns a tuple with the WebsiteUrl field value +// and a boolean to check if the value has been set. +func (o *CatalogProductDetailsVendor) GetWebsiteUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebsiteUrl, true +} + +// SetWebsiteUrl sets field value +func (o *CatalogProductDetailsVendor) SetWebsiteUrl(v *string) { + o.WebsiteUrl = v +} + +func (o CatalogProductDetailsVendor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["logo"] = o.Logo + toSerialize["name"] = o.Name + toSerialize["vendorId"] = o.VendorId + toSerialize["videoUrl"] = o.VideoUrl + toSerialize["websiteUrl"] = o.WebsiteUrl + return toSerialize, nil +} + +type NullableCatalogProductDetailsVendor struct { + value *CatalogProductDetailsVendor + isSet bool +} + +func (v NullableCatalogProductDetailsVendor) Get() *CatalogProductDetailsVendor { + return v.value +} + +func (v *NullableCatalogProductDetailsVendor) Set(val *CatalogProductDetailsVendor) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogProductDetailsVendor) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogProductDetailsVendor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogProductDetailsVendor(val *CatalogProductDetailsVendor) *NullableCatalogProductDetailsVendor { + return &NullableCatalogProductDetailsVendor{value: val, isSet: true} +} + +func (v NullableCatalogProductDetailsVendor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogProductDetailsVendor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_catalog_product_highlight.go b/services/stackitmarketplace/model_catalog_product_highlight.go new file mode 100644 index 000000000..6ae27a777 --- /dev/null +++ b/services/stackitmarketplace/model_catalog_product_highlight.go @@ -0,0 +1,191 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogProductHighlight type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogProductHighlight{} + +// CatalogProductHighlight struct for CatalogProductHighlight +type CatalogProductHighlight struct { + // The highlight content. + HighlightContent *string `json:"highlightContent,omitempty"` + // The highlight icon. + HighlightIcon *string `json:"highlightIcon,omitempty"` + // The highlight title. + HighlightTitle *string `json:"highlightTitle,omitempty"` +} + +// NewCatalogProductHighlight instantiates a new CatalogProductHighlight object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogProductHighlight() *CatalogProductHighlight { + this := CatalogProductHighlight{} + return &this +} + +// NewCatalogProductHighlightWithDefaults instantiates a new CatalogProductHighlight object +// This 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 NewCatalogProductHighlightWithDefaults() *CatalogProductHighlight { + this := CatalogProductHighlight{} + return &this +} + +// GetHighlightContent returns the HighlightContent field value if set, zero value otherwise. +func (o *CatalogProductHighlight) GetHighlightContent() *string { + if o == nil || IsNil(o.HighlightContent) { + var ret *string + return ret + } + return o.HighlightContent +} + +// GetHighlightContentOk returns a tuple with the HighlightContent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductHighlight) GetHighlightContentOk() (*string, bool) { + if o == nil || IsNil(o.HighlightContent) { + return nil, false + } + return o.HighlightContent, true +} + +// HasHighlightContent returns a boolean if a field has been set. +func (o *CatalogProductHighlight) HasHighlightContent() bool { + if o != nil && !IsNil(o.HighlightContent) { + return true + } + + return false +} + +// SetHighlightContent gets a reference to the given string and assigns it to the HighlightContent field. +func (o *CatalogProductHighlight) SetHighlightContent(v *string) { + o.HighlightContent = v +} + +// GetHighlightIcon returns the HighlightIcon field value if set, zero value otherwise. +func (o *CatalogProductHighlight) GetHighlightIcon() *string { + if o == nil || IsNil(o.HighlightIcon) { + var ret *string + return ret + } + return o.HighlightIcon +} + +// GetHighlightIconOk returns a tuple with the HighlightIcon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductHighlight) GetHighlightIconOk() (*string, bool) { + if o == nil || IsNil(o.HighlightIcon) { + return nil, false + } + return o.HighlightIcon, true +} + +// HasHighlightIcon returns a boolean if a field has been set. +func (o *CatalogProductHighlight) HasHighlightIcon() bool { + if o != nil && !IsNil(o.HighlightIcon) { + return true + } + + return false +} + +// SetHighlightIcon gets a reference to the given string and assigns it to the HighlightIcon field. +func (o *CatalogProductHighlight) SetHighlightIcon(v *string) { + o.HighlightIcon = v +} + +// GetHighlightTitle returns the HighlightTitle field value if set, zero value otherwise. +func (o *CatalogProductHighlight) GetHighlightTitle() *string { + if o == nil || IsNil(o.HighlightTitle) { + var ret *string + return ret + } + return o.HighlightTitle +} + +// GetHighlightTitleOk returns a tuple with the HighlightTitle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductHighlight) GetHighlightTitleOk() (*string, bool) { + if o == nil || IsNil(o.HighlightTitle) { + return nil, false + } + return o.HighlightTitle, true +} + +// HasHighlightTitle returns a boolean if a field has been set. +func (o *CatalogProductHighlight) HasHighlightTitle() bool { + if o != nil && !IsNil(o.HighlightTitle) { + return true + } + + return false +} + +// SetHighlightTitle gets a reference to the given string and assigns it to the HighlightTitle field. +func (o *CatalogProductHighlight) SetHighlightTitle(v *string) { + o.HighlightTitle = v +} + +func (o CatalogProductHighlight) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HighlightContent) { + toSerialize["highlightContent"] = o.HighlightContent + } + if !IsNil(o.HighlightIcon) { + toSerialize["highlightIcon"] = o.HighlightIcon + } + if !IsNil(o.HighlightTitle) { + toSerialize["highlightTitle"] = o.HighlightTitle + } + return toSerialize, nil +} + +type NullableCatalogProductHighlight struct { + value *CatalogProductHighlight + isSet bool +} + +func (v NullableCatalogProductHighlight) Get() *CatalogProductHighlight { + return v.value +} + +func (v *NullableCatalogProductHighlight) Set(val *CatalogProductHighlight) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogProductHighlight) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogProductHighlight) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogProductHighlight(val *CatalogProductHighlight) *NullableCatalogProductHighlight { + return &NullableCatalogProductHighlight{value: val, isSet: true} +} + +func (v NullableCatalogProductHighlight) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogProductHighlight) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_catalog_product_overview.go b/services/stackitmarketplace/model_catalog_product_overview.go new file mode 100644 index 000000000..133bdc066 --- /dev/null +++ b/services/stackitmarketplace/model_catalog_product_overview.go @@ -0,0 +1,292 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogProductOverview type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogProductOverview{} + +// CatalogProductOverview struct for CatalogProductOverview +type CatalogProductOverview struct { + // The product type. For reference: SAAS - Software as a Service, SAI - STACKIT Application Image + // REQUIRED + DeliveryMethod *string `json:"deliveryMethod"` + // The lifecycle state of the product. + // REQUIRED + LifecycleState *string `json:"lifecycleState"` + // The logo base64 encoded. + Logo *string `json:"logo,omitempty"` + // The product name. + // REQUIRED + Name *string `json:"name"` + // The product ID. + // REQUIRED + ProductId *string `json:"productId"` + // The short summary of the product. + // REQUIRED + Summary *string `json:"summary"` + // REQUIRED + Vendor *CatalogProductOverviewVendor `json:"vendor"` +} + +type _CatalogProductOverview CatalogProductOverview + +// NewCatalogProductOverview instantiates a new CatalogProductOverview object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogProductOverview(deliveryMethod *string, lifecycleState *string, name *string, productId *string, summary *string, vendor *CatalogProductOverviewVendor) *CatalogProductOverview { + this := CatalogProductOverview{} + this.DeliveryMethod = deliveryMethod + this.LifecycleState = lifecycleState + this.Name = name + this.ProductId = productId + this.Summary = summary + this.Vendor = vendor + return &this +} + +// NewCatalogProductOverviewWithDefaults instantiates a new CatalogProductOverview object +// This 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 NewCatalogProductOverviewWithDefaults() *CatalogProductOverview { + this := CatalogProductOverview{} + return &this +} + +// GetDeliveryMethod returns the DeliveryMethod field value +func (o *CatalogProductOverview) GetDeliveryMethod() *string { + if o == nil || IsNil(o.DeliveryMethod) { + var ret *string + return ret + } + + return o.DeliveryMethod +} + +// GetDeliveryMethodOk returns a tuple with the DeliveryMethod field value +// and a boolean to check if the value has been set. +func (o *CatalogProductOverview) GetDeliveryMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DeliveryMethod, true +} + +// SetDeliveryMethod sets field value +func (o *CatalogProductOverview) SetDeliveryMethod(v *string) { + o.DeliveryMethod = v +} + +// GetLifecycleState returns the LifecycleState field value +func (o *CatalogProductOverview) GetLifecycleState() *string { + if o == nil || IsNil(o.LifecycleState) { + var ret *string + return ret + } + + return o.LifecycleState +} + +// GetLifecycleStateOk returns a tuple with the LifecycleState field value +// and a boolean to check if the value has been set. +func (o *CatalogProductOverview) GetLifecycleStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LifecycleState, true +} + +// SetLifecycleState sets field value +func (o *CatalogProductOverview) SetLifecycleState(v *string) { + o.LifecycleState = v +} + +// GetLogo returns the Logo field value if set, zero value otherwise. +func (o *CatalogProductOverview) 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 *CatalogProductOverview) 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 *CatalogProductOverview) 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 *CatalogProductOverview) SetLogo(v *string) { + o.Logo = v +} + +// GetName returns the Name field value +func (o *CatalogProductOverview) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductOverview) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CatalogProductOverview) SetName(v *string) { + o.Name = v +} + +// GetProductId returns the ProductId field value +func (o *CatalogProductOverview) GetProductId() *string { + if o == nil || IsNil(o.ProductId) { + var ret *string + return ret + } + + return o.ProductId +} + +// GetProductIdOk returns a tuple with the ProductId field value +// and a boolean to check if the value has been set. +func (o *CatalogProductOverview) GetProductIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProductId, true +} + +// SetProductId sets field value +func (o *CatalogProductOverview) SetProductId(v *string) { + o.ProductId = v +} + +// GetSummary returns the Summary field value +func (o *CatalogProductOverview) GetSummary() *string { + if o == nil || IsNil(o.Summary) { + var ret *string + return ret + } + + return o.Summary +} + +// GetSummaryOk returns a tuple with the Summary field value +// and a boolean to check if the value has been set. +func (o *CatalogProductOverview) GetSummaryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Summary, true +} + +// SetSummary sets field value +func (o *CatalogProductOverview) SetSummary(v *string) { + o.Summary = v +} + +// GetVendor returns the Vendor field value +func (o *CatalogProductOverview) GetVendor() *CatalogProductOverviewVendor { + if o == nil || IsNil(o.Vendor) { + var ret *CatalogProductOverviewVendor + return ret + } + + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value +// and a boolean to check if the value has been set. +func (o *CatalogProductOverview) GetVendorOk() (*CatalogProductOverviewVendor, bool) { + if o == nil { + return nil, false + } + return o.Vendor, true +} + +// SetVendor sets field value +func (o *CatalogProductOverview) SetVendor(v *CatalogProductOverviewVendor) { + o.Vendor = v +} + +func (o CatalogProductOverview) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["deliveryMethod"] = o.DeliveryMethod + toSerialize["lifecycleState"] = o.LifecycleState + if !IsNil(o.Logo) { + toSerialize["logo"] = o.Logo + } + toSerialize["name"] = o.Name + toSerialize["productId"] = o.ProductId + toSerialize["summary"] = o.Summary + toSerialize["vendor"] = o.Vendor + return toSerialize, nil +} + +type NullableCatalogProductOverview struct { + value *CatalogProductOverview + isSet bool +} + +func (v NullableCatalogProductOverview) Get() *CatalogProductOverview { + return v.value +} + +func (v *NullableCatalogProductOverview) Set(val *CatalogProductOverview) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogProductOverview) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogProductOverview) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogProductOverview(val *CatalogProductOverview) *NullableCatalogProductOverview { + return &NullableCatalogProductOverview{value: val, isSet: true} +} + +func (v NullableCatalogProductOverview) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogProductOverview) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_catalog_product_overview_vendor.go b/services/stackitmarketplace/model_catalog_product_overview_vendor.go new file mode 100644 index 000000000..dc7bbb802 --- /dev/null +++ b/services/stackitmarketplace/model_catalog_product_overview_vendor.go @@ -0,0 +1,169 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogProductOverviewVendor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogProductOverviewVendor{} + +// CatalogProductOverviewVendor struct for CatalogProductOverviewVendor +type CatalogProductOverviewVendor struct { + // The vendor name. + // REQUIRED + Name *string `json:"name"` + // The vendor ID. + // REQUIRED + VendorId *string `json:"vendorId"` + // The vendor website URL. + // REQUIRED + WebsiteUrl *string `json:"websiteUrl"` +} + +type _CatalogProductOverviewVendor CatalogProductOverviewVendor + +// NewCatalogProductOverviewVendor instantiates a new CatalogProductOverviewVendor object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogProductOverviewVendor(name *string, vendorId *string, websiteUrl *string) *CatalogProductOverviewVendor { + this := CatalogProductOverviewVendor{} + this.Name = name + this.VendorId = vendorId + this.WebsiteUrl = websiteUrl + return &this +} + +// NewCatalogProductOverviewVendorWithDefaults instantiates a new CatalogProductOverviewVendor object +// This 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 NewCatalogProductOverviewVendorWithDefaults() *CatalogProductOverviewVendor { + this := CatalogProductOverviewVendor{} + return &this +} + +// GetName returns the Name field value +func (o *CatalogProductOverviewVendor) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductOverviewVendor) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CatalogProductOverviewVendor) SetName(v *string) { + o.Name = v +} + +// GetVendorId returns the VendorId field value +func (o *CatalogProductOverviewVendor) GetVendorId() *string { + if o == nil || IsNil(o.VendorId) { + var ret *string + return ret + } + + return o.VendorId +} + +// GetVendorIdOk returns a tuple with the VendorId field value +// and a boolean to check if the value has been set. +func (o *CatalogProductOverviewVendor) GetVendorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VendorId, true +} + +// SetVendorId sets field value +func (o *CatalogProductOverviewVendor) SetVendorId(v *string) { + o.VendorId = v +} + +// GetWebsiteUrl returns the WebsiteUrl field value +func (o *CatalogProductOverviewVendor) GetWebsiteUrl() *string { + if o == nil || IsNil(o.WebsiteUrl) { + var ret *string + return ret + } + + return o.WebsiteUrl +} + +// GetWebsiteUrlOk returns a tuple with the WebsiteUrl field value +// and a boolean to check if the value has been set. +func (o *CatalogProductOverviewVendor) GetWebsiteUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebsiteUrl, true +} + +// SetWebsiteUrl sets field value +func (o *CatalogProductOverviewVendor) SetWebsiteUrl(v *string) { + o.WebsiteUrl = v +} + +func (o CatalogProductOverviewVendor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["vendorId"] = o.VendorId + toSerialize["websiteUrl"] = o.WebsiteUrl + return toSerialize, nil +} + +type NullableCatalogProductOverviewVendor struct { + value *CatalogProductOverviewVendor + isSet bool +} + +func (v NullableCatalogProductOverviewVendor) Get() *CatalogProductOverviewVendor { + return v.value +} + +func (v *NullableCatalogProductOverviewVendor) Set(val *CatalogProductOverviewVendor) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogProductOverviewVendor) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogProductOverviewVendor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogProductOverviewVendor(val *CatalogProductOverviewVendor) *NullableCatalogProductOverviewVendor { + return &NullableCatalogProductOverviewVendor{value: val, isSet: true} +} + +func (v NullableCatalogProductOverviewVendor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogProductOverviewVendor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_catalog_product_pricing_option.go b/services/stackitmarketplace/model_catalog_product_pricing_option.go new file mode 100644 index 000000000..86487579c --- /dev/null +++ b/services/stackitmarketplace/model_catalog_product_pricing_option.go @@ -0,0 +1,404 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogProductPricingOption type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogProductPricingOption{} + +// CatalogProductPricingOption struct for CatalogProductPricingOption +type CatalogProductPricingOption struct { + // The pricing option description. + // REQUIRED + Description *string `json:"description"` + // The list of highlights. + // REQUIRED + Highlights *[]CatalogPricingOptionHighlight `json:"highlights"` + // The pricing option name. + // REQUIRED + Name *string `json:"name"` + // The price type / pricing model. + PriceType *string `json:"priceType,omitempty"` + // Additional price type information. + PricingPlan *string `json:"pricingPlan,omitempty"` + // The price of the product (per unit). + Rate *string `json:"rate,omitempty"` + // The concrete variant of the product. + // REQUIRED + Sku *string `json:"sku"` + // Short description of this offering. + // REQUIRED + SkuInfo *string `json:"skuInfo"` + // More details about what this offering entails. + // REQUIRED + SkuInfoDetails *string `json:"skuInfoDetails"` + // The interval to which the rate applies. + Unit *string `json:"unit,omitempty"` +} + +type _CatalogProductPricingOption CatalogProductPricingOption + +// NewCatalogProductPricingOption instantiates a new CatalogProductPricingOption object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogProductPricingOption(description *string, highlights *[]CatalogPricingOptionHighlight, name *string, sku *string, skuInfo *string, skuInfoDetails *string) *CatalogProductPricingOption { + this := CatalogProductPricingOption{} + this.Description = description + this.Highlights = highlights + this.Name = name + this.Sku = sku + this.SkuInfo = skuInfo + this.SkuInfoDetails = skuInfoDetails + return &this +} + +// NewCatalogProductPricingOptionWithDefaults instantiates a new CatalogProductPricingOption object +// This 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 NewCatalogProductPricingOptionWithDefaults() *CatalogProductPricingOption { + this := CatalogProductPricingOption{} + return &this +} + +// GetDescription returns the Description field value +func (o *CatalogProductPricingOption) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description, true +} + +// SetDescription sets field value +func (o *CatalogProductPricingOption) SetDescription(v *string) { + o.Description = v +} + +// GetHighlights returns the Highlights field value +func (o *CatalogProductPricingOption) GetHighlights() *[]CatalogPricingOptionHighlight { + if o == nil || IsNil(o.Highlights) { + var ret *[]CatalogPricingOptionHighlight + return ret + } + + return o.Highlights +} + +// GetHighlightsOk returns a tuple with the Highlights field value +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetHighlightsOk() (*[]CatalogPricingOptionHighlight, bool) { + if o == nil { + return nil, false + } + return o.Highlights, true +} + +// SetHighlights sets field value +func (o *CatalogProductPricingOption) SetHighlights(v *[]CatalogPricingOptionHighlight) { + o.Highlights = v +} + +// GetName returns the Name field value +func (o *CatalogProductPricingOption) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CatalogProductPricingOption) SetName(v *string) { + o.Name = v +} + +// GetPriceType returns the PriceType field value if set, zero value otherwise. +func (o *CatalogProductPricingOption) GetPriceType() *string { + if o == nil || IsNil(o.PriceType) { + var ret *string + return ret + } + return o.PriceType +} + +// GetPriceTypeOk returns a tuple with the PriceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetPriceTypeOk() (*string, bool) { + if o == nil || IsNil(o.PriceType) { + return nil, false + } + return o.PriceType, true +} + +// HasPriceType returns a boolean if a field has been set. +func (o *CatalogProductPricingOption) HasPriceType() bool { + if o != nil && !IsNil(o.PriceType) { + return true + } + + return false +} + +// SetPriceType gets a reference to the given string and assigns it to the PriceType field. +func (o *CatalogProductPricingOption) SetPriceType(v *string) { + o.PriceType = v +} + +// GetPricingPlan returns the PricingPlan field value if set, zero value otherwise. +func (o *CatalogProductPricingOption) GetPricingPlan() *string { + if o == nil || IsNil(o.PricingPlan) { + var ret *string + return ret + } + return o.PricingPlan +} + +// GetPricingPlanOk returns a tuple with the PricingPlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetPricingPlanOk() (*string, bool) { + if o == nil || IsNil(o.PricingPlan) { + return nil, false + } + return o.PricingPlan, true +} + +// HasPricingPlan returns a boolean if a field has been set. +func (o *CatalogProductPricingOption) HasPricingPlan() bool { + if o != nil && !IsNil(o.PricingPlan) { + return true + } + + return false +} + +// SetPricingPlan gets a reference to the given string and assigns it to the PricingPlan field. +func (o *CatalogProductPricingOption) SetPricingPlan(v *string) { + o.PricingPlan = v +} + +// GetRate returns the Rate field value if set, zero value otherwise. +func (o *CatalogProductPricingOption) GetRate() *string { + if o == nil || IsNil(o.Rate) { + var ret *string + return ret + } + return o.Rate +} + +// GetRateOk returns a tuple with the Rate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetRateOk() (*string, bool) { + if o == nil || IsNil(o.Rate) { + return nil, false + } + return o.Rate, true +} + +// HasRate returns a boolean if a field has been set. +func (o *CatalogProductPricingOption) HasRate() bool { + if o != nil && !IsNil(o.Rate) { + return true + } + + return false +} + +// SetRate gets a reference to the given string and assigns it to the Rate field. +func (o *CatalogProductPricingOption) SetRate(v *string) { + o.Rate = v +} + +// GetSku returns the Sku field value +func (o *CatalogProductPricingOption) GetSku() *string { + if o == nil || IsNil(o.Sku) { + var ret *string + return ret + } + + return o.Sku +} + +// GetSkuOk returns a tuple with the Sku field value +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetSkuOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Sku, true +} + +// SetSku sets field value +func (o *CatalogProductPricingOption) SetSku(v *string) { + o.Sku = v +} + +// GetSkuInfo returns the SkuInfo field value +func (o *CatalogProductPricingOption) GetSkuInfo() *string { + if o == nil || IsNil(o.SkuInfo) { + var ret *string + return ret + } + + return o.SkuInfo +} + +// GetSkuInfoOk returns a tuple with the SkuInfo field value +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetSkuInfoOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SkuInfo, true +} + +// SetSkuInfo sets field value +func (o *CatalogProductPricingOption) SetSkuInfo(v *string) { + o.SkuInfo = v +} + +// GetSkuInfoDetails returns the SkuInfoDetails field value +func (o *CatalogProductPricingOption) GetSkuInfoDetails() *string { + if o == nil || IsNil(o.SkuInfoDetails) { + var ret *string + return ret + } + + return o.SkuInfoDetails +} + +// GetSkuInfoDetailsOk returns a tuple with the SkuInfoDetails field value +// and a boolean to check if the value has been set. +func (o *CatalogProductPricingOption) GetSkuInfoDetailsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SkuInfoDetails, true +} + +// SetSkuInfoDetails sets field value +func (o *CatalogProductPricingOption) SetSkuInfoDetails(v *string) { + o.SkuInfoDetails = v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *CatalogProductPricingOption) 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 *CatalogProductPricingOption) 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 *CatalogProductPricingOption) 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 *CatalogProductPricingOption) SetUnit(v *string) { + o.Unit = v +} + +func (o CatalogProductPricingOption) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["highlights"] = o.Highlights + toSerialize["name"] = o.Name + if !IsNil(o.PriceType) { + toSerialize["priceType"] = o.PriceType + } + if !IsNil(o.PricingPlan) { + toSerialize["pricingPlan"] = o.PricingPlan + } + if !IsNil(o.Rate) { + toSerialize["rate"] = o.Rate + } + toSerialize["sku"] = o.Sku + toSerialize["skuInfo"] = o.SkuInfo + toSerialize["skuInfoDetails"] = o.SkuInfoDetails + if !IsNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + return toSerialize, nil +} + +type NullableCatalogProductPricingOption struct { + value *CatalogProductPricingOption + isSet bool +} + +func (v NullableCatalogProductPricingOption) Get() *CatalogProductPricingOption { + return v.value +} + +func (v *NullableCatalogProductPricingOption) Set(val *CatalogProductPricingOption) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogProductPricingOption) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogProductPricingOption) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogProductPricingOption(val *CatalogProductPricingOption) *NullableCatalogProductPricingOption { + return &NullableCatalogProductPricingOption{value: val, isSet: true} +} + +func (v NullableCatalogProductPricingOption) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogProductPricingOption) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_catalog_product_support_resource.go b/services/stackitmarketplace/model_catalog_product_support_resource.go new file mode 100644 index 000000000..69fb7478b --- /dev/null +++ b/services/stackitmarketplace/model_catalog_product_support_resource.go @@ -0,0 +1,154 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogProductSupportResource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogProductSupportResource{} + +// CatalogProductSupportResource struct for CatalogProductSupportResource +type CatalogProductSupportResource struct { + // The support resource link. + SupportLink *string `json:"supportLink,omitempty"` + // The support resource link title. + SupportLinkTitle *string `json:"supportLinkTitle,omitempty"` +} + +// NewCatalogProductSupportResource instantiates a new CatalogProductSupportResource object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogProductSupportResource() *CatalogProductSupportResource { + this := CatalogProductSupportResource{} + return &this +} + +// NewCatalogProductSupportResourceWithDefaults instantiates a new CatalogProductSupportResource object +// This 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 NewCatalogProductSupportResourceWithDefaults() *CatalogProductSupportResource { + this := CatalogProductSupportResource{} + return &this +} + +// GetSupportLink returns the SupportLink field value if set, zero value otherwise. +func (o *CatalogProductSupportResource) GetSupportLink() *string { + if o == nil || IsNil(o.SupportLink) { + var ret *string + return ret + } + return o.SupportLink +} + +// GetSupportLinkOk returns a tuple with the SupportLink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductSupportResource) GetSupportLinkOk() (*string, bool) { + if o == nil || IsNil(o.SupportLink) { + return nil, false + } + return o.SupportLink, true +} + +// HasSupportLink returns a boolean if a field has been set. +func (o *CatalogProductSupportResource) HasSupportLink() bool { + if o != nil && !IsNil(o.SupportLink) { + return true + } + + return false +} + +// SetSupportLink gets a reference to the given string and assigns it to the SupportLink field. +func (o *CatalogProductSupportResource) SetSupportLink(v *string) { + o.SupportLink = v +} + +// GetSupportLinkTitle returns the SupportLinkTitle field value if set, zero value otherwise. +func (o *CatalogProductSupportResource) GetSupportLinkTitle() *string { + if o == nil || IsNil(o.SupportLinkTitle) { + var ret *string + return ret + } + return o.SupportLinkTitle +} + +// GetSupportLinkTitleOk returns a tuple with the SupportLinkTitle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatalogProductSupportResource) GetSupportLinkTitleOk() (*string, bool) { + if o == nil || IsNil(o.SupportLinkTitle) { + return nil, false + } + return o.SupportLinkTitle, true +} + +// HasSupportLinkTitle returns a boolean if a field has been set. +func (o *CatalogProductSupportResource) HasSupportLinkTitle() bool { + if o != nil && !IsNil(o.SupportLinkTitle) { + return true + } + + return false +} + +// SetSupportLinkTitle gets a reference to the given string and assigns it to the SupportLinkTitle field. +func (o *CatalogProductSupportResource) SetSupportLinkTitle(v *string) { + o.SupportLinkTitle = v +} + +func (o CatalogProductSupportResource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SupportLink) { + toSerialize["supportLink"] = o.SupportLink + } + if !IsNil(o.SupportLinkTitle) { + toSerialize["supportLinkTitle"] = o.SupportLinkTitle + } + return toSerialize, nil +} + +type NullableCatalogProductSupportResource struct { + value *CatalogProductSupportResource + isSet bool +} + +func (v NullableCatalogProductSupportResource) Get() *CatalogProductSupportResource { + return v.value +} + +func (v *NullableCatalogProductSupportResource) Set(val *CatalogProductSupportResource) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogProductSupportResource) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogProductSupportResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogProductSupportResource(val *CatalogProductSupportResource) *NullableCatalogProductSupportResource { + return &NullableCatalogProductSupportResource{value: val, isSet: true} +} + +func (v NullableCatalogProductSupportResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogProductSupportResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_catalog_product_vendor_terms.go b/services/stackitmarketplace/model_catalog_product_vendor_terms.go new file mode 100644 index 000000000..8075635d9 --- /dev/null +++ b/services/stackitmarketplace/model_catalog_product_vendor_terms.go @@ -0,0 +1,169 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CatalogProductVendorTerms type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CatalogProductVendorTerms{} + +// CatalogProductVendorTerms struct for CatalogProductVendorTerms +type CatalogProductVendorTerms struct { + // The terms of use description. + // REQUIRED + Description *string `json:"description"` + // The terms of use title. + // REQUIRED + Title *string `json:"title"` + // The terms of use url. + // REQUIRED + Url *string `json:"url"` +} + +type _CatalogProductVendorTerms CatalogProductVendorTerms + +// NewCatalogProductVendorTerms instantiates a new CatalogProductVendorTerms object +// This constructor will assign default values to properties that have it defined, +// 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 NewCatalogProductVendorTerms(description *string, title *string, url *string) *CatalogProductVendorTerms { + this := CatalogProductVendorTerms{} + this.Description = description + this.Title = title + this.Url = url + return &this +} + +// NewCatalogProductVendorTermsWithDefaults instantiates a new CatalogProductVendorTerms object +// This 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 NewCatalogProductVendorTermsWithDefaults() *CatalogProductVendorTerms { + this := CatalogProductVendorTerms{} + return &this +} + +// GetDescription returns the Description field value +func (o *CatalogProductVendorTerms) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductVendorTerms) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description, true +} + +// SetDescription sets field value +func (o *CatalogProductVendorTerms) SetDescription(v *string) { + o.Description = v +} + +// GetTitle returns the Title field value +func (o *CatalogProductVendorTerms) 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 +// and a boolean to check if the value has been set. +func (o *CatalogProductVendorTerms) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title, true +} + +// SetTitle sets field value +func (o *CatalogProductVendorTerms) SetTitle(v *string) { + o.Title = v +} + +// GetUrl returns the Url field value +func (o *CatalogProductVendorTerms) GetUrl() *string { + if o == nil || IsNil(o.Url) { + var ret *string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CatalogProductVendorTerms) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Url, true +} + +// SetUrl sets field value +func (o *CatalogProductVendorTerms) SetUrl(v *string) { + o.Url = v +} + +func (o CatalogProductVendorTerms) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["title"] = o.Title + toSerialize["url"] = o.Url + return toSerialize, nil +} + +type NullableCatalogProductVendorTerms struct { + value *CatalogProductVendorTerms + isSet bool +} + +func (v NullableCatalogProductVendorTerms) Get() *CatalogProductVendorTerms { + return v.value +} + +func (v *NullableCatalogProductVendorTerms) Set(val *CatalogProductVendorTerms) { + v.value = val + v.isSet = true +} + +func (v NullableCatalogProductVendorTerms) IsSet() bool { + return v.isSet +} + +func (v *NullableCatalogProductVendorTerms) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatalogProductVendorTerms(val *CatalogProductVendorTerms) *NullableCatalogProductVendorTerms { + return &NullableCatalogProductVendorTerms{value: val, isSet: true} +} + +func (v NullableCatalogProductVendorTerms) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatalogProductVendorTerms) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_current_subscription_state_response.go b/services/stackitmarketplace/model_current_subscription_state_response.go new file mode 100644 index 000000000..14d00e5e5 --- /dev/null +++ b/services/stackitmarketplace/model_current_subscription_state_response.go @@ -0,0 +1,140 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the CurrentSubscriptionStateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CurrentSubscriptionStateResponse{} + +// CurrentSubscriptionStateResponse struct for CurrentSubscriptionStateResponse +type CurrentSubscriptionStateResponse struct { + // Lifecycle state of the subscription. + // REQUIRED + LifecycleState *string `json:"lifecycleState"` + // The subscription ID. + // REQUIRED + SubscriptionId *string `json:"subscriptionId"` +} + +type _CurrentSubscriptionStateResponse CurrentSubscriptionStateResponse + +// NewCurrentSubscriptionStateResponse instantiates a new CurrentSubscriptionStateResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewCurrentSubscriptionStateResponse(lifecycleState *string, subscriptionId *string) *CurrentSubscriptionStateResponse { + this := CurrentSubscriptionStateResponse{} + this.LifecycleState = lifecycleState + this.SubscriptionId = subscriptionId + return &this +} + +// NewCurrentSubscriptionStateResponseWithDefaults instantiates a new CurrentSubscriptionStateResponse object +// This 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 NewCurrentSubscriptionStateResponseWithDefaults() *CurrentSubscriptionStateResponse { + this := CurrentSubscriptionStateResponse{} + return &this +} + +// GetLifecycleState returns the LifecycleState field value +func (o *CurrentSubscriptionStateResponse) GetLifecycleState() *string { + if o == nil || IsNil(o.LifecycleState) { + var ret *string + return ret + } + + return o.LifecycleState +} + +// GetLifecycleStateOk returns a tuple with the LifecycleState field value +// and a boolean to check if the value has been set. +func (o *CurrentSubscriptionStateResponse) GetLifecycleStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LifecycleState, true +} + +// SetLifecycleState sets field value +func (o *CurrentSubscriptionStateResponse) SetLifecycleState(v *string) { + o.LifecycleState = v +} + +// GetSubscriptionId returns the SubscriptionId field value +func (o *CurrentSubscriptionStateResponse) GetSubscriptionId() *string { + if o == nil || IsNil(o.SubscriptionId) { + var ret *string + return ret + } + + return o.SubscriptionId +} + +// GetSubscriptionIdOk returns a tuple with the SubscriptionId field value +// and a boolean to check if the value has been set. +func (o *CurrentSubscriptionStateResponse) GetSubscriptionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SubscriptionId, true +} + +// SetSubscriptionId sets field value +func (o *CurrentSubscriptionStateResponse) SetSubscriptionId(v *string) { + o.SubscriptionId = v +} + +func (o CurrentSubscriptionStateResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lifecycleState"] = o.LifecycleState + toSerialize["subscriptionId"] = o.SubscriptionId + return toSerialize, nil +} + +type NullableCurrentSubscriptionStateResponse struct { + value *CurrentSubscriptionStateResponse + isSet bool +} + +func (v NullableCurrentSubscriptionStateResponse) Get() *CurrentSubscriptionStateResponse { + return v.value +} + +func (v *NullableCurrentSubscriptionStateResponse) Set(val *CurrentSubscriptionStateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCurrentSubscriptionStateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCurrentSubscriptionStateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCurrentSubscriptionStateResponse(val *CurrentSubscriptionStateResponse) *NullableCurrentSubscriptionStateResponse { + return &NullableCurrentSubscriptionStateResponse{value: val, isSet: true} +} + +func (v NullableCurrentSubscriptionStateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCurrentSubscriptionStateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_error_response.go b/services/stackitmarketplace/model_error_response.go new file mode 100644 index 000000000..edf67053e --- /dev/null +++ b/services/stackitmarketplace/model_error_response.go @@ -0,0 +1,229 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" + "time" +) + +// checks if the ErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorResponse{} + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + // Reason phrase of the status code. + // REQUIRED + Error *string `json:"error"` + // Description of the error. + // REQUIRED + Message *string `json:"message"` + // Path which was called. + // REQUIRED + Path *string `json:"path"` + // HTTP response status code. + // Can be cast to int32 without loss of precision. + // REQUIRED + Status *int64 `json:"status"` + // Timestamp at which the error occurred. + // REQUIRED + TimeStamp *time.Time `json:"timeStamp"` +} + +type _ErrorResponse ErrorResponse + +// NewErrorResponse instantiates a new ErrorResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewErrorResponse(error_ *string, message *string, path *string, status *int64, timeStamp *time.Time) *ErrorResponse { + this := ErrorResponse{} + this.Error = error_ + this.Message = message + this.Path = path + this.Status = status + this.TimeStamp = timeStamp + return &this +} + +// NewErrorResponseWithDefaults instantiates a new ErrorResponse object +// This 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 NewErrorResponseWithDefaults() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// GetError returns the Error field value +func (o *ErrorResponse) 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 +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Error, true +} + +// SetError sets field value +func (o *ErrorResponse) SetError(v *string) { + o.Error = v +} + +// GetMessage returns the Message field value +func (o *ErrorResponse) 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 +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Message, true +} + +// SetMessage sets field value +func (o *ErrorResponse) SetMessage(v *string) { + o.Message = v +} + +// GetPath returns the Path field value +func (o *ErrorResponse) GetPath() *string { + if o == nil || IsNil(o.Path) { + var ret *string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Path, true +} + +// SetPath sets field value +func (o *ErrorResponse) SetPath(v *string) { + o.Path = v +} + +// GetStatus returns the Status field value +func (o *ErrorResponse) GetStatus() *int64 { + if o == nil || IsNil(o.Status) { + var ret *int64 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetStatusOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Status, true +} + +// SetStatus sets field value +func (o *ErrorResponse) SetStatus(v *int64) { + o.Status = v +} + +// GetTimeStamp returns the TimeStamp field value +func (o *ErrorResponse) GetTimeStamp() *time.Time { + if o == nil || IsNil(o.TimeStamp) { + var ret *time.Time + return ret + } + + return o.TimeStamp +} + +// GetTimeStampOk returns a tuple with the TimeStamp field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetTimeStampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.TimeStamp, true +} + +// SetTimeStamp sets field value +func (o *ErrorResponse) SetTimeStamp(v *time.Time) { + o.TimeStamp = v +} + +func (o ErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error"] = o.Error + toSerialize["message"] = o.Message + toSerialize["path"] = o.Path + toSerialize["status"] = o.Status + toSerialize["timeStamp"] = o.TimeStamp + return toSerialize, nil +} + +type NullableErrorResponse struct { + value *ErrorResponse + isSet bool +} + +func (v NullableErrorResponse) Get() *ErrorResponse { + return v.value +} + +func (v *NullableErrorResponse) Set(val *ErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { + return &NullableErrorResponse{value: val, isSet: true} +} + +func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_list_catalog_products_response.go b/services/stackitmarketplace/model_list_catalog_products_response.go new file mode 100644 index 000000000..20617fa15 --- /dev/null +++ b/services/stackitmarketplace/model_list_catalog_products_response.go @@ -0,0 +1,171 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the ListCatalogProductsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCatalogProductsResponse{} + +// ListCatalogProductsResponse struct for ListCatalogProductsResponse +type ListCatalogProductsResponse struct { + // A pagination cursor that represents a position in the dataset. Use it in subsequent requests to continue retrieving data from this position. If `null`, there are no more results to retrieve. + // REQUIRED + Cursor *string `json:"cursor"` + // REQUIRED + Items *[]CatalogProductOverview `json:"items"` + // The maximum number of items to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. + // Can be cast to int32 without loss of precision. + // REQUIRED + Limit *int64 `json:"limit"` +} + +type _ListCatalogProductsResponse ListCatalogProductsResponse + +// NewListCatalogProductsResponse instantiates a new ListCatalogProductsResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewListCatalogProductsResponse(cursor *string, items *[]CatalogProductOverview, limit *int64) *ListCatalogProductsResponse { + this := ListCatalogProductsResponse{} + this.Cursor = cursor + this.Items = items + this.Limit = limit + return &this +} + +// NewListCatalogProductsResponseWithDefaults instantiates a new ListCatalogProductsResponse object +// This 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 NewListCatalogProductsResponseWithDefaults() *ListCatalogProductsResponse { + this := ListCatalogProductsResponse{} + var limit int64 = 50 + this.Limit = &limit + return &this +} + +// GetCursor returns the Cursor field value +func (o *ListCatalogProductsResponse) GetCursor() *string { + if o == nil || IsNil(o.Cursor) { + var ret *string + return ret + } + + return o.Cursor +} + +// GetCursorOk returns a tuple with the Cursor field value +// and a boolean to check if the value has been set. +func (o *ListCatalogProductsResponse) GetCursorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Cursor, true +} + +// SetCursor sets field value +func (o *ListCatalogProductsResponse) SetCursor(v *string) { + o.Cursor = v +} + +// GetItems returns the Items field value +func (o *ListCatalogProductsResponse) GetItems() *[]CatalogProductOverview { + if o == nil || IsNil(o.Items) { + var ret *[]CatalogProductOverview + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListCatalogProductsResponse) GetItemsOk() (*[]CatalogProductOverview, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListCatalogProductsResponse) SetItems(v *[]CatalogProductOverview) { + o.Items = v +} + +// GetLimit returns the Limit field value +func (o *ListCatalogProductsResponse) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListCatalogProductsResponse) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *ListCatalogProductsResponse) SetLimit(v *int64) { + o.Limit = v +} + +func (o ListCatalogProductsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cursor"] = o.Cursor + toSerialize["items"] = o.Items + toSerialize["limit"] = o.Limit + return toSerialize, nil +} + +type NullableListCatalogProductsResponse struct { + value *ListCatalogProductsResponse + isSet bool +} + +func (v NullableListCatalogProductsResponse) Get() *ListCatalogProductsResponse { + return v.value +} + +func (v *NullableListCatalogProductsResponse) Set(val *ListCatalogProductsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCatalogProductsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCatalogProductsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCatalogProductsResponse(val *ListCatalogProductsResponse) *NullableListCatalogProductsResponse { + return &NullableListCatalogProductsResponse{value: val, isSet: true} +} + +func (v NullableListCatalogProductsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCatalogProductsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_list_vendor_subscriptions_response.go b/services/stackitmarketplace/model_list_vendor_subscriptions_response.go new file mode 100644 index 000000000..bfebaab30 --- /dev/null +++ b/services/stackitmarketplace/model_list_vendor_subscriptions_response.go @@ -0,0 +1,172 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the ListVendorSubscriptionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListVendorSubscriptionsResponse{} + +// ListVendorSubscriptionsResponse struct for ListVendorSubscriptionsResponse +type ListVendorSubscriptionsResponse struct { + // A pagination cursor that represents a position in the dataset. Use it in subsequent requests to continue retrieving data from this position. If `null`, there are no more results to retrieve. + // REQUIRED + Cursor *string `json:"cursor"` + // List of subscriptions. + // REQUIRED + Items *[]VendorSubscription `json:"items"` + // Number of subscriptions returned for a single request. + // Can be cast to int32 without loss of precision. + // REQUIRED + Limit *int64 `json:"limit"` +} + +type _ListVendorSubscriptionsResponse ListVendorSubscriptionsResponse + +// NewListVendorSubscriptionsResponse instantiates a new ListVendorSubscriptionsResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewListVendorSubscriptionsResponse(cursor *string, items *[]VendorSubscription, limit *int64) *ListVendorSubscriptionsResponse { + this := ListVendorSubscriptionsResponse{} + this.Cursor = cursor + this.Items = items + this.Limit = limit + return &this +} + +// NewListVendorSubscriptionsResponseWithDefaults instantiates a new ListVendorSubscriptionsResponse object +// This 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 NewListVendorSubscriptionsResponseWithDefaults() *ListVendorSubscriptionsResponse { + this := ListVendorSubscriptionsResponse{} + var limit int64 = 50 + this.Limit = &limit + return &this +} + +// GetCursor returns the Cursor field value +func (o *ListVendorSubscriptionsResponse) GetCursor() *string { + if o == nil || IsNil(o.Cursor) { + var ret *string + return ret + } + + return o.Cursor +} + +// GetCursorOk returns a tuple with the Cursor field value +// and a boolean to check if the value has been set. +func (o *ListVendorSubscriptionsResponse) GetCursorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Cursor, true +} + +// SetCursor sets field value +func (o *ListVendorSubscriptionsResponse) SetCursor(v *string) { + o.Cursor = v +} + +// GetItems returns the Items field value +func (o *ListVendorSubscriptionsResponse) GetItems() *[]VendorSubscription { + if o == nil || IsNil(o.Items) { + var ret *[]VendorSubscription + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListVendorSubscriptionsResponse) GetItemsOk() (*[]VendorSubscription, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListVendorSubscriptionsResponse) SetItems(v *[]VendorSubscription) { + o.Items = v +} + +// GetLimit returns the Limit field value +func (o *ListVendorSubscriptionsResponse) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListVendorSubscriptionsResponse) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *ListVendorSubscriptionsResponse) SetLimit(v *int64) { + o.Limit = v +} + +func (o ListVendorSubscriptionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cursor"] = o.Cursor + toSerialize["items"] = o.Items + toSerialize["limit"] = o.Limit + return toSerialize, nil +} + +type NullableListVendorSubscriptionsResponse struct { + value *ListVendorSubscriptionsResponse + isSet bool +} + +func (v NullableListVendorSubscriptionsResponse) Get() *ListVendorSubscriptionsResponse { + return v.value +} + +func (v *NullableListVendorSubscriptionsResponse) Set(val *ListVendorSubscriptionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListVendorSubscriptionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListVendorSubscriptionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListVendorSubscriptionsResponse(val *ListVendorSubscriptionsResponse) *NullableListVendorSubscriptionsResponse { + return &NullableListVendorSubscriptionsResponse{value: val, isSet: true} +} + +func (v NullableListVendorSubscriptionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListVendorSubscriptionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_requested_subscription_state_response.go b/services/stackitmarketplace/model_requested_subscription_state_response.go new file mode 100644 index 000000000..f6ed66fa4 --- /dev/null +++ b/services/stackitmarketplace/model_requested_subscription_state_response.go @@ -0,0 +1,140 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the RequestedSubscriptionStateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestedSubscriptionStateResponse{} + +// RequestedSubscriptionStateResponse struct for RequestedSubscriptionStateResponse +type RequestedSubscriptionStateResponse struct { + // Lifecycle state of the subscription. + // REQUIRED + LifecycleState *string `json:"lifecycleState"` + // The subscription ID. + // REQUIRED + SubscriptionId *string `json:"subscriptionId"` +} + +type _RequestedSubscriptionStateResponse RequestedSubscriptionStateResponse + +// NewRequestedSubscriptionStateResponse instantiates a new RequestedSubscriptionStateResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewRequestedSubscriptionStateResponse(lifecycleState *string, subscriptionId *string) *RequestedSubscriptionStateResponse { + this := RequestedSubscriptionStateResponse{} + this.LifecycleState = lifecycleState + this.SubscriptionId = subscriptionId + return &this +} + +// NewRequestedSubscriptionStateResponseWithDefaults instantiates a new RequestedSubscriptionStateResponse object +// This 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 NewRequestedSubscriptionStateResponseWithDefaults() *RequestedSubscriptionStateResponse { + this := RequestedSubscriptionStateResponse{} + return &this +} + +// GetLifecycleState returns the LifecycleState field value +func (o *RequestedSubscriptionStateResponse) GetLifecycleState() *string { + if o == nil || IsNil(o.LifecycleState) { + var ret *string + return ret + } + + return o.LifecycleState +} + +// GetLifecycleStateOk returns a tuple with the LifecycleState field value +// and a boolean to check if the value has been set. +func (o *RequestedSubscriptionStateResponse) GetLifecycleStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LifecycleState, true +} + +// SetLifecycleState sets field value +func (o *RequestedSubscriptionStateResponse) SetLifecycleState(v *string) { + o.LifecycleState = v +} + +// GetSubscriptionId returns the SubscriptionId field value +func (o *RequestedSubscriptionStateResponse) GetSubscriptionId() *string { + if o == nil || IsNil(o.SubscriptionId) { + var ret *string + return ret + } + + return o.SubscriptionId +} + +// GetSubscriptionIdOk returns a tuple with the SubscriptionId field value +// and a boolean to check if the value has been set. +func (o *RequestedSubscriptionStateResponse) GetSubscriptionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SubscriptionId, true +} + +// SetSubscriptionId sets field value +func (o *RequestedSubscriptionStateResponse) SetSubscriptionId(v *string) { + o.SubscriptionId = v +} + +func (o RequestedSubscriptionStateResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lifecycleState"] = o.LifecycleState + toSerialize["subscriptionId"] = o.SubscriptionId + return toSerialize, nil +} + +type NullableRequestedSubscriptionStateResponse struct { + value *RequestedSubscriptionStateResponse + isSet bool +} + +func (v NullableRequestedSubscriptionStateResponse) Get() *RequestedSubscriptionStateResponse { + return v.value +} + +func (v *NullableRequestedSubscriptionStateResponse) Set(val *RequestedSubscriptionStateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRequestedSubscriptionStateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestedSubscriptionStateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestedSubscriptionStateResponse(val *RequestedSubscriptionStateResponse) *NullableRequestedSubscriptionStateResponse { + return &NullableRequestedSubscriptionStateResponse{value: val, isSet: true} +} + +func (v NullableRequestedSubscriptionStateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestedSubscriptionStateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_resolve_customer_payload.go b/services/stackitmarketplace/model_resolve_customer_payload.go new file mode 100644 index 000000000..5c595d9da --- /dev/null +++ b/services/stackitmarketplace/model_resolve_customer_payload.go @@ -0,0 +1,111 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the ResolveCustomerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResolveCustomerPayload{} + +// ResolveCustomerPayload struct for ResolveCustomerPayload +type ResolveCustomerPayload struct { + // Opaque token exchangeable for subscription details. + // REQUIRED + Token *string `json:"token"` +} + +type _ResolveCustomerPayload ResolveCustomerPayload + +// NewResolveCustomerPayload instantiates a new ResolveCustomerPayload object +// This constructor will assign default values to properties that have it defined, +// 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 NewResolveCustomerPayload(token *string) *ResolveCustomerPayload { + this := ResolveCustomerPayload{} + this.Token = token + return &this +} + +// NewResolveCustomerPayloadWithDefaults instantiates a new ResolveCustomerPayload object +// This 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 NewResolveCustomerPayloadWithDefaults() *ResolveCustomerPayload { + this := ResolveCustomerPayload{} + return &this +} + +// GetToken returns the Token field value +func (o *ResolveCustomerPayload) 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 +// and a boolean to check if the value has been set. +func (o *ResolveCustomerPayload) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Token, true +} + +// SetToken sets field value +func (o *ResolveCustomerPayload) SetToken(v *string) { + o.Token = v +} + +func (o ResolveCustomerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["token"] = o.Token + return toSerialize, nil +} + +type NullableResolveCustomerPayload struct { + value *ResolveCustomerPayload + isSet bool +} + +func (v NullableResolveCustomerPayload) Get() *ResolveCustomerPayload { + return v.value +} + +func (v *NullableResolveCustomerPayload) Set(val *ResolveCustomerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableResolveCustomerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableResolveCustomerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResolveCustomerPayload(val *ResolveCustomerPayload) *NullableResolveCustomerPayload { + return &NullableResolveCustomerPayload{value: val, isSet: true} +} + +func (v NullableResolveCustomerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResolveCustomerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_subscription_cancel_response.go b/services/stackitmarketplace/model_subscription_cancel_response.go new file mode 100644 index 000000000..e9a644eba --- /dev/null +++ b/services/stackitmarketplace/model_subscription_cancel_response.go @@ -0,0 +1,138 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the SubscriptionCancelResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SubscriptionCancelResponse{} + +// SubscriptionCancelResponse struct for SubscriptionCancelResponse +type SubscriptionCancelResponse struct { + // REQUIRED + CurrentSubscription *CurrentSubscriptionStateResponse `json:"currentSubscription"` + // REQUIRED + RequestedSubscription *RequestedSubscriptionStateResponse `json:"requestedSubscription"` +} + +type _SubscriptionCancelResponse SubscriptionCancelResponse + +// NewSubscriptionCancelResponse instantiates a new SubscriptionCancelResponse object +// This constructor will assign default values to properties that have it defined, +// 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 NewSubscriptionCancelResponse(currentSubscription *CurrentSubscriptionStateResponse, requestedSubscription *RequestedSubscriptionStateResponse) *SubscriptionCancelResponse { + this := SubscriptionCancelResponse{} + this.CurrentSubscription = currentSubscription + this.RequestedSubscription = requestedSubscription + return &this +} + +// NewSubscriptionCancelResponseWithDefaults instantiates a new SubscriptionCancelResponse object +// This 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 NewSubscriptionCancelResponseWithDefaults() *SubscriptionCancelResponse { + this := SubscriptionCancelResponse{} + return &this +} + +// GetCurrentSubscription returns the CurrentSubscription field value +func (o *SubscriptionCancelResponse) GetCurrentSubscription() *CurrentSubscriptionStateResponse { + if o == nil || IsNil(o.CurrentSubscription) { + var ret *CurrentSubscriptionStateResponse + return ret + } + + return o.CurrentSubscription +} + +// GetCurrentSubscriptionOk returns a tuple with the CurrentSubscription field value +// and a boolean to check if the value has been set. +func (o *SubscriptionCancelResponse) GetCurrentSubscriptionOk() (*CurrentSubscriptionStateResponse, bool) { + if o == nil { + return nil, false + } + return o.CurrentSubscription, true +} + +// SetCurrentSubscription sets field value +func (o *SubscriptionCancelResponse) SetCurrentSubscription(v *CurrentSubscriptionStateResponse) { + o.CurrentSubscription = v +} + +// GetRequestedSubscription returns the RequestedSubscription field value +func (o *SubscriptionCancelResponse) GetRequestedSubscription() *RequestedSubscriptionStateResponse { + if o == nil || IsNil(o.RequestedSubscription) { + var ret *RequestedSubscriptionStateResponse + return ret + } + + return o.RequestedSubscription +} + +// GetRequestedSubscriptionOk returns a tuple with the RequestedSubscription field value +// and a boolean to check if the value has been set. +func (o *SubscriptionCancelResponse) GetRequestedSubscriptionOk() (*RequestedSubscriptionStateResponse, bool) { + if o == nil { + return nil, false + } + return o.RequestedSubscription, true +} + +// SetRequestedSubscription sets field value +func (o *SubscriptionCancelResponse) SetRequestedSubscription(v *RequestedSubscriptionStateResponse) { + o.RequestedSubscription = v +} + +func (o SubscriptionCancelResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["currentSubscription"] = o.CurrentSubscription + toSerialize["requestedSubscription"] = o.RequestedSubscription + return toSerialize, nil +} + +type NullableSubscriptionCancelResponse struct { + value *SubscriptionCancelResponse + isSet bool +} + +func (v NullableSubscriptionCancelResponse) Get() *SubscriptionCancelResponse { + return v.value +} + +func (v *NullableSubscriptionCancelResponse) Set(val *SubscriptionCancelResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSubscriptionCancelResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSubscriptionCancelResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubscriptionCancelResponse(val *SubscriptionCancelResponse) *NullableSubscriptionCancelResponse { + return &NullableSubscriptionCancelResponse{value: val, isSet: true} +} + +func (v NullableSubscriptionCancelResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubscriptionCancelResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_subscription_product.go b/services/stackitmarketplace/model_subscription_product.go new file mode 100644 index 000000000..2d0b43ff4 --- /dev/null +++ b/services/stackitmarketplace/model_subscription_product.go @@ -0,0 +1,314 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the SubscriptionProduct type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SubscriptionProduct{} + +// SubscriptionProduct struct for SubscriptionProduct +type SubscriptionProduct struct { + // The product's delivery method. + // REQUIRED + DeliveryMethod *string `json:"deliveryMethod"` + // The lifecycle state of the product. + // REQUIRED + LifecycleState *string `json:"lifecycleState"` + // The product's price type. + // REQUIRED + PriceType *string `json:"priceType"` + // The product's pricing plan. + // REQUIRED + PricingPlan *string `json:"pricingPlan"` + // The product ID. + // REQUIRED + ProductId *string `json:"productId"` + // The name of the product. + // REQUIRED + ProductName *string `json:"productName"` + // The product's vendor name. + // REQUIRED + VendorName *string `json:"vendorName"` + // The vendor's website. + // REQUIRED + VendorWebsiteUrl *string `json:"vendorWebsiteUrl"` +} + +type _SubscriptionProduct SubscriptionProduct + +// NewSubscriptionProduct instantiates a new SubscriptionProduct object +// This constructor will assign default values to properties that have it defined, +// 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 NewSubscriptionProduct(deliveryMethod *string, lifecycleState *string, priceType *string, pricingPlan *string, productId *string, productName *string, vendorName *string, vendorWebsiteUrl *string) *SubscriptionProduct { + this := SubscriptionProduct{} + this.DeliveryMethod = deliveryMethod + this.LifecycleState = lifecycleState + this.PriceType = priceType + this.PricingPlan = pricingPlan + this.ProductId = productId + this.ProductName = productName + this.VendorName = vendorName + this.VendorWebsiteUrl = vendorWebsiteUrl + return &this +} + +// NewSubscriptionProductWithDefaults instantiates a new SubscriptionProduct object +// This 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 NewSubscriptionProductWithDefaults() *SubscriptionProduct { + this := SubscriptionProduct{} + return &this +} + +// GetDeliveryMethod returns the DeliveryMethod field value +func (o *SubscriptionProduct) GetDeliveryMethod() *string { + if o == nil || IsNil(o.DeliveryMethod) { + var ret *string + return ret + } + + return o.DeliveryMethod +} + +// GetDeliveryMethodOk returns a tuple with the DeliveryMethod field value +// and a boolean to check if the value has been set. +func (o *SubscriptionProduct) GetDeliveryMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DeliveryMethod, true +} + +// SetDeliveryMethod sets field value +func (o *SubscriptionProduct) SetDeliveryMethod(v *string) { + o.DeliveryMethod = v +} + +// GetLifecycleState returns the LifecycleState field value +func (o *SubscriptionProduct) GetLifecycleState() *string { + if o == nil || IsNil(o.LifecycleState) { + var ret *string + return ret + } + + return o.LifecycleState +} + +// GetLifecycleStateOk returns a tuple with the LifecycleState field value +// and a boolean to check if the value has been set. +func (o *SubscriptionProduct) GetLifecycleStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LifecycleState, true +} + +// SetLifecycleState sets field value +func (o *SubscriptionProduct) SetLifecycleState(v *string) { + o.LifecycleState = v +} + +// GetPriceType returns the PriceType field value +func (o *SubscriptionProduct) GetPriceType() *string { + if o == nil || IsNil(o.PriceType) { + var ret *string + return ret + } + + return o.PriceType +} + +// GetPriceTypeOk returns a tuple with the PriceType field value +// and a boolean to check if the value has been set. +func (o *SubscriptionProduct) GetPriceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PriceType, true +} + +// SetPriceType sets field value +func (o *SubscriptionProduct) SetPriceType(v *string) { + o.PriceType = v +} + +// GetPricingPlan returns the PricingPlan field value +func (o *SubscriptionProduct) GetPricingPlan() *string { + if o == nil || IsNil(o.PricingPlan) { + var ret *string + return ret + } + + return o.PricingPlan +} + +// GetPricingPlanOk returns a tuple with the PricingPlan field value +// and a boolean to check if the value has been set. +func (o *SubscriptionProduct) GetPricingPlanOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PricingPlan, true +} + +// SetPricingPlan sets field value +func (o *SubscriptionProduct) SetPricingPlan(v *string) { + o.PricingPlan = v +} + +// GetProductId returns the ProductId field value +func (o *SubscriptionProduct) GetProductId() *string { + if o == nil || IsNil(o.ProductId) { + var ret *string + return ret + } + + return o.ProductId +} + +// GetProductIdOk returns a tuple with the ProductId field value +// and a boolean to check if the value has been set. +func (o *SubscriptionProduct) GetProductIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProductId, true +} + +// SetProductId sets field value +func (o *SubscriptionProduct) SetProductId(v *string) { + o.ProductId = v +} + +// GetProductName returns the ProductName field value +func (o *SubscriptionProduct) GetProductName() *string { + if o == nil || IsNil(o.ProductName) { + var ret *string + return ret + } + + return o.ProductName +} + +// GetProductNameOk returns a tuple with the ProductName field value +// and a boolean to check if the value has been set. +func (o *SubscriptionProduct) GetProductNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProductName, true +} + +// SetProductName sets field value +func (o *SubscriptionProduct) SetProductName(v *string) { + o.ProductName = v +} + +// GetVendorName returns the VendorName field value +func (o *SubscriptionProduct) GetVendorName() *string { + if o == nil || IsNil(o.VendorName) { + var ret *string + return ret + } + + return o.VendorName +} + +// GetVendorNameOk returns a tuple with the VendorName field value +// and a boolean to check if the value has been set. +func (o *SubscriptionProduct) GetVendorNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VendorName, true +} + +// SetVendorName sets field value +func (o *SubscriptionProduct) SetVendorName(v *string) { + o.VendorName = v +} + +// GetVendorWebsiteUrl returns the VendorWebsiteUrl field value +func (o *SubscriptionProduct) GetVendorWebsiteUrl() *string { + if o == nil || IsNil(o.VendorWebsiteUrl) { + var ret *string + return ret + } + + return o.VendorWebsiteUrl +} + +// GetVendorWebsiteUrlOk returns a tuple with the VendorWebsiteUrl field value +// and a boolean to check if the value has been set. +func (o *SubscriptionProduct) GetVendorWebsiteUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VendorWebsiteUrl, true +} + +// SetVendorWebsiteUrl sets field value +func (o *SubscriptionProduct) SetVendorWebsiteUrl(v *string) { + o.VendorWebsiteUrl = v +} + +func (o SubscriptionProduct) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["deliveryMethod"] = o.DeliveryMethod + toSerialize["lifecycleState"] = o.LifecycleState + toSerialize["priceType"] = o.PriceType + toSerialize["pricingPlan"] = o.PricingPlan + toSerialize["productId"] = o.ProductId + toSerialize["productName"] = o.ProductName + toSerialize["vendorName"] = o.VendorName + toSerialize["vendorWebsiteUrl"] = o.VendorWebsiteUrl + return toSerialize, nil +} + +type NullableSubscriptionProduct struct { + value *SubscriptionProduct + isSet bool +} + +func (v NullableSubscriptionProduct) Get() *SubscriptionProduct { + return v.value +} + +func (v *NullableSubscriptionProduct) Set(val *SubscriptionProduct) { + v.value = val + v.isSet = true +} + +func (v NullableSubscriptionProduct) IsSet() bool { + return v.isSet +} + +func (v *NullableSubscriptionProduct) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubscriptionProduct(val *SubscriptionProduct) *NullableSubscriptionProduct { + return &NullableSubscriptionProduct{value: val, isSet: true} +} + +func (v NullableSubscriptionProduct) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubscriptionProduct) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_vendor_subscription.go b/services/stackitmarketplace/model_vendor_subscription.go new file mode 100644 index 000000000..273968682 --- /dev/null +++ b/services/stackitmarketplace/model_vendor_subscription.go @@ -0,0 +1,197 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the VendorSubscription type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VendorSubscription{} + +// VendorSubscription struct for VendorSubscription +type VendorSubscription struct { + // Lifecycle state of the subscription. + // REQUIRED + LifecycleState *string `json:"lifecycleState"` + // REQUIRED + Product *SubscriptionProduct `json:"product"` + // The associated consumer project ID. + // REQUIRED + ProjectId *string `json:"projectId"` + // The subscription ID. + // REQUIRED + SubscriptionId *string `json:"subscriptionId"` +} + +type _VendorSubscription VendorSubscription + +// NewVendorSubscription instantiates a new VendorSubscription object +// This constructor will assign default values to properties that have it defined, +// 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 NewVendorSubscription(lifecycleState *string, product *SubscriptionProduct, projectId *string, subscriptionId *string) *VendorSubscription { + this := VendorSubscription{} + this.LifecycleState = lifecycleState + this.Product = product + this.ProjectId = projectId + this.SubscriptionId = subscriptionId + return &this +} + +// NewVendorSubscriptionWithDefaults instantiates a new VendorSubscription object +// This 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 NewVendorSubscriptionWithDefaults() *VendorSubscription { + this := VendorSubscription{} + return &this +} + +// GetLifecycleState returns the LifecycleState field value +func (o *VendorSubscription) GetLifecycleState() *string { + if o == nil || IsNil(o.LifecycleState) { + var ret *string + return ret + } + + return o.LifecycleState +} + +// GetLifecycleStateOk returns a tuple with the LifecycleState field value +// and a boolean to check if the value has been set. +func (o *VendorSubscription) GetLifecycleStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LifecycleState, true +} + +// SetLifecycleState sets field value +func (o *VendorSubscription) SetLifecycleState(v *string) { + o.LifecycleState = v +} + +// GetProduct returns the Product field value +func (o *VendorSubscription) GetProduct() *SubscriptionProduct { + if o == nil || IsNil(o.Product) { + var ret *SubscriptionProduct + return ret + } + + return o.Product +} + +// GetProductOk returns a tuple with the Product field value +// and a boolean to check if the value has been set. +func (o *VendorSubscription) GetProductOk() (*SubscriptionProduct, bool) { + if o == nil { + return nil, false + } + return o.Product, true +} + +// SetProduct sets field value +func (o *VendorSubscription) SetProduct(v *SubscriptionProduct) { + o.Product = v +} + +// GetProjectId returns the ProjectId field value +func (o *VendorSubscription) 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 +// and a boolean to check if the value has been set. +func (o *VendorSubscription) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProjectId, true +} + +// SetProjectId sets field value +func (o *VendorSubscription) SetProjectId(v *string) { + o.ProjectId = v +} + +// GetSubscriptionId returns the SubscriptionId field value +func (o *VendorSubscription) GetSubscriptionId() *string { + if o == nil || IsNil(o.SubscriptionId) { + var ret *string + return ret + } + + return o.SubscriptionId +} + +// GetSubscriptionIdOk returns a tuple with the SubscriptionId field value +// and a boolean to check if the value has been set. +func (o *VendorSubscription) GetSubscriptionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SubscriptionId, true +} + +// SetSubscriptionId sets field value +func (o *VendorSubscription) SetSubscriptionId(v *string) { + o.SubscriptionId = v +} + +func (o VendorSubscription) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lifecycleState"] = o.LifecycleState + toSerialize["product"] = o.Product + toSerialize["projectId"] = o.ProjectId + toSerialize["subscriptionId"] = o.SubscriptionId + return toSerialize, nil +} + +type NullableVendorSubscription struct { + value *VendorSubscription + isSet bool +} + +func (v NullableVendorSubscription) Get() *VendorSubscription { + return v.value +} + +func (v *NullableVendorSubscription) Set(val *VendorSubscription) { + v.value = val + v.isSet = true +} + +func (v NullableVendorSubscription) IsSet() bool { + return v.isSet +} + +func (v *NullableVendorSubscription) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVendorSubscription(val *VendorSubscription) *NullableVendorSubscription { + return &NullableVendorSubscription{value: val, isSet: true} +} + +func (v NullableVendorSubscription) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVendorSubscription) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/utils.go b/services/stackitmarketplace/utils.go new file mode 100644 index 000000000..089879e2d --- /dev/null +++ b/services/stackitmarketplace/utils.go @@ -0,0 +1,347 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +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) +}