diff --git a/CHANGELOG.md b/CHANGELOG.md index 46a10064e..55863519b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## Release (2025-XX-YY) +- `sfs`: [v0.1.0](services/sfs/CHANGELOG.md#v010) + - **New**: STACKIT File Storage (SFS) service - `scf`: - [v0.4.0](services/scf/CHANGELOG.md#v040) - **Feature:** Add new model structs `SpaceWithIsolationSegment` and `SpaceWithIsolationSegmentAllOf` diff --git a/go.work b/go.work index f661cc459..159a66756 100644 --- a/go.work +++ b/go.work @@ -65,6 +65,7 @@ use ( ./services/serverupdate ./services/serviceaccount ./services/serviceenablement + ./services/sfs ./services/ske ./services/sqlserverflex ./services/stackitmarketplace diff --git a/services/sfs/.openapi-generator/VERSION b/services/sfs/.openapi-generator/VERSION new file mode 100644 index 000000000..cd802a1ec --- /dev/null +++ b/services/sfs/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/services/sfs/CHANGELOG.md b/services/sfs/CHANGELOG.md new file mode 100644 index 000000000..c6ee36255 --- /dev/null +++ b/services/sfs/CHANGELOG.md @@ -0,0 +1,2 @@ +## v0.1.0 +- **New**: STACKIT File Storage (SFS) service diff --git a/services/sfs/LICENSE.md b/services/sfs/LICENSE.md new file mode 100644 index 000000000..7e2f06484 --- /dev/null +++ b/services/sfs/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/sfs/NOTICE.txt b/services/sfs/NOTICE.txt new file mode 100644 index 000000000..d62811aee --- /dev/null +++ b/services/sfs/NOTICE.txt @@ -0,0 +1,2 @@ +STACKIT File Storage (SFS) SDK for Go +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/sfs/VERSION b/services/sfs/VERSION new file mode 100644 index 000000000..9ff151c5b --- /dev/null +++ b/services/sfs/VERSION @@ -0,0 +1 @@ +v0.1.0 \ No newline at end of file diff --git a/services/sfs/api_default.go b/services/sfs/api_default.go new file mode 100644 index 000000000..d416d8812 --- /dev/null +++ b/services/sfs/api_default.go @@ -0,0 +1,4055 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +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" +) + +type DefaultApi interface { + /* + CreateResourcePool Create Resource Pool + Create a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateResourcePoolRequest + */ + CreateResourcePool(ctx context.Context, projectId string, region string) ApiCreateResourcePoolRequest + /* + CreateResourcePoolExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return CreateResourcePoolResponse + + */ + CreateResourcePoolExecute(ctx context.Context, projectId string, region string) (*CreateResourcePoolResponse, error) + /* + CreateResourcePoolSnapshot Create Resource Pool Snapshot + Creates a Snapshot of a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiCreateResourcePoolSnapshotRequest + */ + CreateResourcePoolSnapshot(ctx context.Context, projectId string, region string, resourcePoolId string) ApiCreateResourcePoolSnapshotRequest + /* + CreateResourcePoolSnapshotExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return CreateResourcePoolSnapshotResponse + + */ + CreateResourcePoolSnapshotExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*CreateResourcePoolSnapshotResponse, error) + /* + CreateShare Create Share + Creates a Share in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiCreateShareRequest + */ + CreateShare(ctx context.Context, projectId string, region string, resourcePoolId string) ApiCreateShareRequest + /* + CreateShareExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return CreateShareResponse + + */ + CreateShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*CreateShareResponse, error) + /* + CreateShareExportPolicy Create Share Export Policy + Creates a ShareExportPolicy in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateShareExportPolicyRequest + */ + CreateShareExportPolicy(ctx context.Context, projectId string, region string) ApiCreateShareExportPolicyRequest + /* + CreateShareExportPolicyExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return CreateShareExportPolicyResponse + + */ + CreateShareExportPolicyExecute(ctx context.Context, projectId string, region string) (*CreateShareExportPolicyResponse, error) + /* + DeleteResourcePool Delete Resource Pool + Deletes a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiDeleteResourcePoolRequest + */ + DeleteResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiDeleteResourcePoolRequest + /* + DeleteResourcePoolExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return map[string]interface{} + + */ + DeleteResourcePoolExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (map[string]interface{}, error) + /* + DeleteResourcePoolSnapshot Delete Resource Pool Snapshot + Deletes a Snapshot from a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param snapshotName + @return ApiDeleteResourcePoolSnapshotRequest + */ + DeleteResourcePoolSnapshot(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) ApiDeleteResourcePoolSnapshotRequest + /* + DeleteResourcePoolSnapshotExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param snapshotName + @return map[string]interface{} + + */ + DeleteResourcePoolSnapshotExecute(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) (map[string]interface{}, error) + /* + DeleteShare Delete Share + Deletes a Shares in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return ApiDeleteShareRequest + */ + DeleteShare(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) ApiDeleteShareRequest + /* + DeleteShareExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return map[string]interface{} + + */ + DeleteShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) (map[string]interface{}, error) + /* + DeleteShareExportPolicy Delete Share Export Policy + Deletes a ShareExportPolicies in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return ApiDeleteShareExportPolicyRequest + */ + DeleteShareExportPolicy(ctx context.Context, projectId string, region string, policyId string) ApiDeleteShareExportPolicyRequest + /* + DeleteShareExportPolicyExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return map[string]interface{} + + */ + DeleteShareExportPolicyExecute(ctx context.Context, projectId string, region string, policyId string) (map[string]interface{}, error) + /* + GetResourcePool Get Resource Pool + Retrieves a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiGetResourcePoolRequest + */ + GetResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiGetResourcePoolRequest + /* + GetResourcePoolExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return GetResourcePoolResponse + + */ + GetResourcePoolExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*GetResourcePoolResponse, error) + /* + GetResourcePoolSnapshot Get Resource Pool Snapshot + Retrieves a Snapshot from a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param snapshotName + @return ApiGetResourcePoolSnapshotRequest + */ + GetResourcePoolSnapshot(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) ApiGetResourcePoolSnapshotRequest + /* + GetResourcePoolSnapshotExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param snapshotName + @return GetResourcePoolSnapshotResponse + + */ + GetResourcePoolSnapshotExecute(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) (*GetResourcePoolSnapshotResponse, error) + /* + GetShare Get Share + Retrieves a Shares in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return ApiGetShareRequest + */ + GetShare(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) ApiGetShareRequest + /* + GetShareExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return GetShareResponse + + */ + GetShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) (*GetShareResponse, error) + /* + GetShareExportPolicy Get Share Export Policy + Retrieves a ShareExportPolicies in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return ApiGetShareExportPolicyRequest + */ + GetShareExportPolicy(ctx context.Context, projectId string, region string, policyId string) ApiGetShareExportPolicyRequest + /* + GetShareExportPolicyExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return GetShareExportPolicyResponse + + */ + GetShareExportPolicyExecute(ctx context.Context, projectId string, region string, policyId string) (*GetShareExportPolicyResponse, error) + /* + ListPerformanceClasses List Resource Performance Classes + Lists all performances classes available + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPerformanceClassesRequest + */ + ListPerformanceClasses(ctx context.Context) ApiListPerformanceClassesRequest + /* + ListPerformanceClassesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ListPerformanceClassesResponse + + */ + ListPerformanceClassesExecute(ctx context.Context) (*ListPerformanceClassesResponse, error) + /* + ListResourcePoolSnapshots List Resource Pool Snapshots + Lists the Snapshots of a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiListResourcePoolSnapshotsRequest + */ + ListResourcePoolSnapshots(ctx context.Context, projectId string, region string, resourcePoolId string) ApiListResourcePoolSnapshotsRequest + /* + ListResourcePoolSnapshotsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ListResourcePoolSnapshotsResponse + + */ + ListResourcePoolSnapshotsExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*ListResourcePoolSnapshotsResponse, error) + /* + ListResourcePools List Resource Pools + Lists Resource Pools in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListResourcePoolsRequest + */ + ListResourcePools(ctx context.Context, projectId string, region string) ApiListResourcePoolsRequest + /* + ListResourcePoolsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ListResourcePoolsResponse + + */ + ListResourcePoolsExecute(ctx context.Context, projectId string, region string) (*ListResourcePoolsResponse, error) + /* + ListShareExportPolicies List Share Export Policies + Lists ShareExportPolicies in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListShareExportPoliciesRequest + */ + ListShareExportPolicies(ctx context.Context, projectId string, region string) ApiListShareExportPoliciesRequest + /* + ListShareExportPoliciesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ListShareExportPoliciesResponse + + */ + ListShareExportPoliciesExecute(ctx context.Context, projectId string, region string) (*ListShareExportPoliciesResponse, error) + /* + ListShares List Shares + Lists Shares in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiListSharesRequest + */ + ListShares(ctx context.Context, projectId string, region string, resourcePoolId string) ApiListSharesRequest + /* + ListSharesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ListSharesResponse + + */ + ListSharesExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*ListSharesResponse, error) + /* + ListSnapshotSchedules List Snapshot Schedules + Lists snapshot schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListSnapshotSchedulesRequest + */ + ListSnapshotSchedules(ctx context.Context, projectId string) ApiListSnapshotSchedulesRequest + /* + ListSnapshotSchedulesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ListSnapshotSchedulesResponse + + */ + ListSnapshotSchedulesExecute(ctx context.Context, projectId string) (*ListSnapshotSchedulesResponse, error) + /* + UpdateResourcePool Update Resource Pool + Updates a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiUpdateResourcePoolRequest + */ + UpdateResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiUpdateResourcePoolRequest + /* + UpdateResourcePoolExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return UpdateResourcePoolResponse + + */ + UpdateResourcePoolExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*UpdateResourcePoolResponse, error) + /* + UpdateShare Update Share + Updates a Shares in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return ApiUpdateShareRequest + */ + UpdateShare(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) ApiUpdateShareRequest + /* + UpdateShareExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return UpdateShareResponse + + */ + UpdateShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) (*UpdateShareResponse, error) + /* + UpdateShareExportPolicy Update Share Export Policy + Updates a ShareExportPolicies in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return ApiUpdateShareExportPolicyRequest + */ + UpdateShareExportPolicy(ctx context.Context, projectId string, region string, policyId string) ApiUpdateShareExportPolicyRequest + /* + UpdateShareExportPolicyExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return UpdateShareExportPolicyResponse + + */ + UpdateShareExportPolicyExecute(ctx context.Context, projectId string, region string, policyId string) (*UpdateShareExportPolicyResponse, error) +} + +type ApiCreateResourcePoolRequest interface { + CreateResourcePoolPayload(createResourcePoolPayload CreateResourcePoolPayload) ApiCreateResourcePoolRequest + Execute() (*CreateResourcePoolResponse, error) +} + +type ApiCreateResourcePoolSnapshotRequest interface { + CreateResourcePoolSnapshotPayload(createResourcePoolSnapshotPayload CreateResourcePoolSnapshotPayload) ApiCreateResourcePoolSnapshotRequest + Execute() (*CreateResourcePoolSnapshotResponse, error) +} + +type ApiCreateShareRequest interface { + CreateSharePayload(createSharePayload CreateSharePayload) ApiCreateShareRequest + Execute() (*CreateShareResponse, error) +} + +type ApiCreateShareExportPolicyRequest interface { + CreateShareExportPolicyPayload(createShareExportPolicyPayload CreateShareExportPolicyPayload) ApiCreateShareExportPolicyRequest + Execute() (*CreateShareExportPolicyResponse, error) +} + +type ApiDeleteResourcePoolRequest interface { + Execute() (map[string]interface{}, error) +} + +type ApiDeleteResourcePoolSnapshotRequest interface { + Execute() (map[string]interface{}, error) +} + +type ApiDeleteShareRequest interface { + Execute() (map[string]interface{}, error) +} + +type ApiDeleteShareExportPolicyRequest interface { + Execute() (map[string]interface{}, error) +} + +type ApiGetResourcePoolRequest interface { + Execute() (*GetResourcePoolResponse, error) +} + +type ApiGetResourcePoolSnapshotRequest interface { + Execute() (*GetResourcePoolSnapshotResponse, error) +} + +type ApiGetShareRequest interface { + Execute() (*GetShareResponse, error) +} + +type ApiGetShareExportPolicyRequest interface { + Execute() (*GetShareExportPolicyResponse, error) +} + +type ApiListPerformanceClassesRequest interface { + Execute() (*ListPerformanceClassesResponse, error) +} + +type ApiListResourcePoolSnapshotsRequest interface { + Execute() (*ListResourcePoolSnapshotsResponse, error) +} + +type ApiListResourcePoolsRequest interface { + Execute() (*ListResourcePoolsResponse, error) +} + +type ApiListShareExportPoliciesRequest interface { + Execute() (*ListShareExportPoliciesResponse, error) +} + +type ApiListSharesRequest interface { + Execute() (*ListSharesResponse, error) +} + +type ApiListSnapshotSchedulesRequest interface { + Execute() (*ListSnapshotSchedulesResponse, error) +} + +type ApiUpdateResourcePoolRequest interface { + UpdateResourcePoolPayload(updateResourcePoolPayload UpdateResourcePoolPayload) ApiUpdateResourcePoolRequest + Execute() (*UpdateResourcePoolResponse, error) +} + +type ApiUpdateShareRequest interface { + UpdateSharePayload(updateSharePayload UpdateSharePayload) ApiUpdateShareRequest + Execute() (*UpdateShareResponse, error) +} + +type ApiUpdateShareExportPolicyRequest interface { + UpdateShareExportPolicyPayload(updateShareExportPolicyPayload UpdateShareExportPolicyPayload) ApiUpdateShareExportPolicyRequest + Execute() (*UpdateShareExportPolicyResponse, error) +} + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type CreateResourcePoolRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createResourcePoolPayload *CreateResourcePoolPayload +} + +func (r CreateResourcePoolRequest) CreateResourcePoolPayload(createResourcePoolPayload CreateResourcePoolPayload) ApiCreateResourcePoolRequest { + r.createResourcePoolPayload = &createResourcePoolPayload + return r +} + +func (r CreateResourcePoolRequest) Execute() (*CreateResourcePoolResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateResourcePoolResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateResourcePool") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools" + 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{} + localVarFormParams := url.Values{} + if r.createResourcePoolPayload == nil { + return localVarReturnValue, fmt.Errorf("createResourcePoolPayload 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createResourcePoolPayload + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +CreateResourcePool: Create Resource Pool + +Create a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateResourcePoolRequest +*/ +func (a *APIClient) CreateResourcePool(ctx context.Context, projectId string, region string) ApiCreateResourcePoolRequest { + return CreateResourcePoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +func (a *APIClient) CreateResourcePoolExecute(ctx context.Context, projectId string, region string) (*CreateResourcePoolResponse, error) { + r := CreateResourcePoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } + return r.Execute() +} + +type CreateResourcePoolSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string + createResourcePoolSnapshotPayload *CreateResourcePoolSnapshotPayload +} + +func (r CreateResourcePoolSnapshotRequest) CreateResourcePoolSnapshotPayload(createResourcePoolSnapshotPayload CreateResourcePoolSnapshotPayload) ApiCreateResourcePoolSnapshotRequest { + r.createResourcePoolSnapshotPayload = &createResourcePoolSnapshotPayload + return r +} + +func (r CreateResourcePoolSnapshotRequest) Execute() (*CreateResourcePoolSnapshotResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateResourcePoolSnapshotResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateResourcePoolSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createResourcePoolSnapshotPayload == nil { + return localVarReturnValue, fmt.Errorf("createResourcePoolSnapshotPayload 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createResourcePoolSnapshotPayload + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +CreateResourcePoolSnapshot: Create Resource Pool Snapshot + +Creates a Snapshot of a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiCreateResourcePoolSnapshotRequest +*/ +func (a *APIClient) CreateResourcePoolSnapshot(ctx context.Context, projectId string, region string, resourcePoolId string) ApiCreateResourcePoolSnapshotRequest { + return CreateResourcePoolSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } +} + +func (a *APIClient) CreateResourcePoolSnapshotExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*CreateResourcePoolSnapshotResponse, error) { + r := CreateResourcePoolSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } + return r.Execute() +} + +type CreateShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string + createSharePayload *CreateSharePayload +} + +func (r CreateShareRequest) CreateSharePayload(createSharePayload CreateSharePayload) ApiCreateShareRequest { + r.createSharePayload = &createSharePayload + return r +} + +func (r CreateShareRequest) Execute() (*CreateShareResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateShareResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createSharePayload == nil { + return localVarReturnValue, fmt.Errorf("createSharePayload 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSharePayload + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +CreateShare: Create Share + +Creates a Share in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiCreateShareRequest +*/ +func (a *APIClient) CreateShare(ctx context.Context, projectId string, region string, resourcePoolId string) ApiCreateShareRequest { + return CreateShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } +} + +func (a *APIClient) CreateShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*CreateShareResponse, error) { + r := CreateShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } + return r.Execute() +} + +type CreateShareExportPolicyRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createShareExportPolicyPayload *CreateShareExportPolicyPayload +} + +func (r CreateShareExportPolicyRequest) CreateShareExportPolicyPayload(createShareExportPolicyPayload CreateShareExportPolicyPayload) ApiCreateShareExportPolicyRequest { + r.createShareExportPolicyPayload = &createShareExportPolicyPayload + return r +} + +func (r CreateShareExportPolicyRequest) Execute() (*CreateShareExportPolicyResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateShareExportPolicyResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateShareExportPolicy") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies" + 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{} + localVarFormParams := url.Values{} + if r.createShareExportPolicyPayload == nil { + return localVarReturnValue, fmt.Errorf("createShareExportPolicyPayload 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createShareExportPolicyPayload + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +CreateShareExportPolicy: Create Share Export Policy + +Creates a ShareExportPolicy in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateShareExportPolicyRequest +*/ +func (a *APIClient) CreateShareExportPolicy(ctx context.Context, projectId string, region string) ApiCreateShareExportPolicyRequest { + return CreateShareExportPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +func (a *APIClient) CreateShareExportPolicyExecute(ctx context.Context, projectId string, region string) (*CreateShareExportPolicyResponse, error) { + r := CreateShareExportPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } + return r.Execute() +} + +type DeleteResourcePoolRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string +} + +func (r DeleteResourcePoolRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteResourcePool") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +DeleteResourcePool: Delete Resource Pool + +Deletes a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiDeleteResourcePoolRequest +*/ +func (a *APIClient) DeleteResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiDeleteResourcePoolRequest { + return DeleteResourcePoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } +} + +func (a *APIClient) DeleteResourcePoolExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (map[string]interface{}, error) { + r := DeleteResourcePoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } + return r.Execute() +} + +type DeleteResourcePoolSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string + snapshotName string +} + +func (r DeleteResourcePoolSnapshotRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteResourcePoolSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotName"+"}", url.PathEscape(ParameterValueToString(r.snapshotName, "snapshotName")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +DeleteResourcePoolSnapshot: Delete Resource Pool Snapshot + +Deletes a Snapshot from a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param snapshotName + @return ApiDeleteResourcePoolSnapshotRequest +*/ +func (a *APIClient) DeleteResourcePoolSnapshot(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) ApiDeleteResourcePoolSnapshotRequest { + return DeleteResourcePoolSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + snapshotName: snapshotName, + } +} + +func (a *APIClient) DeleteResourcePoolSnapshotExecute(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) (map[string]interface{}, error) { + r := DeleteResourcePoolSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + snapshotName: snapshotName, + } + return r.Execute() +} + +type DeleteShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string + shareId string +} + +func (r DeleteShareRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares/{shareId}" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"shareId"+"}", url.PathEscape(ParameterValueToString(r.shareId, "shareId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +DeleteShare: Delete Share + +Deletes a Shares in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return ApiDeleteShareRequest +*/ +func (a *APIClient) DeleteShare(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) ApiDeleteShareRequest { + return DeleteShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + shareId: shareId, + } +} + +func (a *APIClient) DeleteShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) (map[string]interface{}, error) { + r := DeleteShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + shareId: shareId, + } + return r.Execute() +} + +type DeleteShareExportPolicyRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + policyId string +} + +func (r DeleteShareExportPolicyRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteShareExportPolicy") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}" + 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, "{"+"policyId"+"}", url.PathEscape(ParameterValueToString(r.policyId, "policyId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +DeleteShareExportPolicy: Delete Share Export Policy + +Deletes a ShareExportPolicies in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return ApiDeleteShareExportPolicyRequest +*/ +func (a *APIClient) DeleteShareExportPolicy(ctx context.Context, projectId string, region string, policyId string) ApiDeleteShareExportPolicyRequest { + return DeleteShareExportPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + policyId: policyId, + } +} + +func (a *APIClient) DeleteShareExportPolicyExecute(ctx context.Context, projectId string, region string, policyId string) (map[string]interface{}, error) { + r := DeleteShareExportPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + policyId: policyId, + } + return r.Execute() +} + +type GetResourcePoolRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string +} + +func (r GetResourcePoolRequest) Execute() (*GetResourcePoolResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetResourcePoolResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetResourcePool") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +GetResourcePool: Get Resource Pool + +Retrieves a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiGetResourcePoolRequest +*/ +func (a *APIClient) GetResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiGetResourcePoolRequest { + return GetResourcePoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } +} + +func (a *APIClient) GetResourcePoolExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*GetResourcePoolResponse, error) { + r := GetResourcePoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } + return r.Execute() +} + +type GetResourcePoolSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string + snapshotName string +} + +func (r GetResourcePoolSnapshotRequest) Execute() (*GetResourcePoolSnapshotResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetResourcePoolSnapshotResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetResourcePoolSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotName"+"}", url.PathEscape(ParameterValueToString(r.snapshotName, "snapshotName")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +GetResourcePoolSnapshot: Get Resource Pool Snapshot + +Retrieves a Snapshot from a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param snapshotName + @return ApiGetResourcePoolSnapshotRequest +*/ +func (a *APIClient) GetResourcePoolSnapshot(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) ApiGetResourcePoolSnapshotRequest { + return GetResourcePoolSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + snapshotName: snapshotName, + } +} + +func (a *APIClient) GetResourcePoolSnapshotExecute(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) (*GetResourcePoolSnapshotResponse, error) { + r := GetResourcePoolSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + snapshotName: snapshotName, + } + return r.Execute() +} + +type GetShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string + shareId string +} + +func (r GetShareRequest) Execute() (*GetShareResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetShareResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares/{shareId}" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"shareId"+"}", url.PathEscape(ParameterValueToString(r.shareId, "shareId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +GetShare: Get Share + +Retrieves a Shares in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return ApiGetShareRequest +*/ +func (a *APIClient) GetShare(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) ApiGetShareRequest { + return GetShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + shareId: shareId, + } +} + +func (a *APIClient) GetShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) (*GetShareResponse, error) { + r := GetShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + shareId: shareId, + } + return r.Execute() +} + +type GetShareExportPolicyRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + policyId string +} + +func (r GetShareExportPolicyRequest) Execute() (*GetShareExportPolicyResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetShareExportPolicyResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetShareExportPolicy") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}" + 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, "{"+"policyId"+"}", url.PathEscape(ParameterValueToString(r.policyId, "policyId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +GetShareExportPolicy: Get Share Export Policy + +Retrieves a ShareExportPolicies in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return ApiGetShareExportPolicyRequest +*/ +func (a *APIClient) GetShareExportPolicy(ctx context.Context, projectId string, region string, policyId string) ApiGetShareExportPolicyRequest { + return GetShareExportPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + policyId: policyId, + } +} + +func (a *APIClient) GetShareExportPolicyExecute(ctx context.Context, projectId string, region string, policyId string) (*GetShareExportPolicyResponse, error) { + r := GetShareExportPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + policyId: policyId, + } + return r.Execute() +} + +type ListPerformanceClassesRequest struct { + ctx context.Context + apiService *DefaultApiService +} + +func (r ListPerformanceClassesRequest) Execute() (*ListPerformanceClassesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListPerformanceClassesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPerformanceClasses") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/resourcePoolPerformanceClasses" + + 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +ListPerformanceClasses: List Resource Performance Classes + +Lists all performances classes available + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPerformanceClassesRequest +*/ +func (a *APIClient) ListPerformanceClasses(ctx context.Context) ApiListPerformanceClassesRequest { + return ListPerformanceClassesRequest{ + apiService: a.defaultApi, + ctx: ctx, + } +} + +func (a *APIClient) ListPerformanceClassesExecute(ctx context.Context) (*ListPerformanceClassesResponse, error) { + r := ListPerformanceClassesRequest{ + apiService: a.defaultApi, + ctx: ctx, + } + return r.Execute() +} + +type ListResourcePoolSnapshotsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string +} + +func (r ListResourcePoolSnapshotsRequest) Execute() (*ListResourcePoolSnapshotsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListResourcePoolSnapshotsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListResourcePoolSnapshots") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +ListResourcePoolSnapshots: List Resource Pool Snapshots + +Lists the Snapshots of a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiListResourcePoolSnapshotsRequest +*/ +func (a *APIClient) ListResourcePoolSnapshots(ctx context.Context, projectId string, region string, resourcePoolId string) ApiListResourcePoolSnapshotsRequest { + return ListResourcePoolSnapshotsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } +} + +func (a *APIClient) ListResourcePoolSnapshotsExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*ListResourcePoolSnapshotsResponse, error) { + r := ListResourcePoolSnapshotsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } + return r.Execute() +} + +type ListResourcePoolsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string +} + +func (r ListResourcePoolsRequest) Execute() (*ListResourcePoolsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListResourcePoolsResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListResourcePools") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools" + 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{} + 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +ListResourcePools: List Resource Pools + +Lists Resource Pools in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListResourcePoolsRequest +*/ +func (a *APIClient) ListResourcePools(ctx context.Context, projectId string, region string) ApiListResourcePoolsRequest { + return ListResourcePoolsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +func (a *APIClient) ListResourcePoolsExecute(ctx context.Context, projectId string, region string) (*ListResourcePoolsResponse, error) { + r := ListResourcePoolsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } + return r.Execute() +} + +type ListShareExportPoliciesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string +} + +func (r ListShareExportPoliciesRequest) Execute() (*ListShareExportPoliciesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListShareExportPoliciesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListShareExportPolicies") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies" + 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{} + 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +ListShareExportPolicies: List Share Export Policies + +Lists ShareExportPolicies in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListShareExportPoliciesRequest +*/ +func (a *APIClient) ListShareExportPolicies(ctx context.Context, projectId string, region string) ApiListShareExportPoliciesRequest { + return ListShareExportPoliciesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +func (a *APIClient) ListShareExportPoliciesExecute(ctx context.Context, projectId string, region string) (*ListShareExportPoliciesResponse, error) { + r := ListShareExportPoliciesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } + return r.Execute() +} + +type ListSharesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string +} + +func (r ListSharesRequest) Execute() (*ListSharesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListSharesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListShares") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +ListShares: List Shares + +Lists Shares in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiListSharesRequest +*/ +func (a *APIClient) ListShares(ctx context.Context, projectId string, region string, resourcePoolId string) ApiListSharesRequest { + return ListSharesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } +} + +func (a *APIClient) ListSharesExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*ListSharesResponse, error) { + r := ListSharesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } + return r.Execute() +} + +type ListSnapshotSchedulesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ListSnapshotSchedulesRequest) Execute() (*ListSnapshotSchedulesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListSnapshotSchedulesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSnapshotSchedules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/snapshotSchedules" + 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +ListSnapshotSchedules: List Snapshot Schedules + +Lists snapshot schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListSnapshotSchedulesRequest +*/ +func (a *APIClient) ListSnapshotSchedules(ctx context.Context, projectId string) ApiListSnapshotSchedulesRequest { + return ListSnapshotSchedulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) ListSnapshotSchedulesExecute(ctx context.Context, projectId string) (*ListSnapshotSchedulesResponse, error) { + r := ListSnapshotSchedulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type UpdateResourcePoolRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string + updateResourcePoolPayload *UpdateResourcePoolPayload +} + +func (r UpdateResourcePoolRequest) UpdateResourcePoolPayload(updateResourcePoolPayload UpdateResourcePoolPayload) ApiUpdateResourcePoolRequest { + r.updateResourcePoolPayload = &updateResourcePoolPayload + return r +} + +func (r UpdateResourcePoolRequest) Execute() (*UpdateResourcePoolResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateResourcePoolResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateResourcePool") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateResourcePoolPayload == nil { + return localVarReturnValue, fmt.Errorf("updateResourcePoolPayload 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateResourcePoolPayload + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +UpdateResourcePool: Update Resource Pool + +Updates a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @return ApiUpdateResourcePoolRequest +*/ +func (a *APIClient) UpdateResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiUpdateResourcePoolRequest { + return UpdateResourcePoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } +} + +func (a *APIClient) UpdateResourcePoolExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*UpdateResourcePoolResponse, error) { + r := UpdateResourcePoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + } + return r.Execute() +} + +type UpdateShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string + shareId string + updateSharePayload *UpdateSharePayload +} + +func (r UpdateShareRequest) UpdateSharePayload(updateSharePayload UpdateSharePayload) ApiUpdateShareRequest { + r.updateSharePayload = &updateSharePayload + return r +} + +func (r UpdateShareRequest) Execute() (*UpdateShareResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateShareResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares/{shareId}" + 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, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"shareId"+"}", url.PathEscape(ParameterValueToString(r.shareId, "shareId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateSharePayload == nil { + return localVarReturnValue, fmt.Errorf("updateSharePayload 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateSharePayload + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +UpdateShare: Update Share + +Updates a Shares in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param shareId + @return ApiUpdateShareRequest +*/ +func (a *APIClient) UpdateShare(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) ApiUpdateShareRequest { + return UpdateShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + shareId: shareId, + } +} + +func (a *APIClient) UpdateShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) (*UpdateShareResponse, error) { + r := UpdateShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + shareId: shareId, + } + return r.Execute() +} + +type UpdateShareExportPolicyRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + policyId string + updateShareExportPolicyPayload *UpdateShareExportPolicyPayload +} + +func (r UpdateShareExportPolicyRequest) UpdateShareExportPolicyPayload(updateShareExportPolicyPayload UpdateShareExportPolicyPayload) ApiUpdateShareExportPolicyRequest { + r.updateShareExportPolicyPayload = &updateShareExportPolicyPayload + return r +} + +func (r UpdateShareExportPolicyRequest) Execute() (*UpdateShareExportPolicyResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateShareExportPolicyResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateShareExportPolicy") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}" + 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, "{"+"policyId"+"}", url.PathEscape(ParameterValueToString(r.policyId, "policyId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateShareExportPolicyPayload == nil { + return localVarReturnValue, fmt.Errorf("updateShareExportPolicyPayload 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateShareExportPolicyPayload + req, err := 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 := 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 ValidationError + err = 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 string + err = 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 == 500 { + var v Error + err = 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 = 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 +} + +/* +UpdateShareExportPolicy: Update Share Export Policy + +Updates a ShareExportPolicies in a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param policyId + @return ApiUpdateShareExportPolicyRequest +*/ +func (a *APIClient) UpdateShareExportPolicy(ctx context.Context, projectId string, region string, policyId string) ApiUpdateShareExportPolicyRequest { + return UpdateShareExportPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + policyId: policyId, + } +} + +func (a *APIClient) UpdateShareExportPolicyExecute(ctx context.Context, projectId string, region string, policyId string) (*UpdateShareExportPolicyResponse, error) { + r := UpdateShareExportPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + policyId: policyId, + } + return r.Execute() +} diff --git a/services/sfs/api_default_test.go b/services/sfs/api_default_test.go new file mode 100644 index 000000000..301404d24 --- /dev/null +++ b/services/sfs/api_default_test.go @@ -0,0 +1,1238 @@ +/* +STACKIT File Storage (SFS) + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package sfs + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +func Test_sfs_DefaultApiService(t *testing.T) { + + t.Run("Test DefaultApiService CreateResourcePool", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := CreateResourcePoolResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + createResourcePoolPayload := CreateResourcePoolPayload{} + + resp, reqErr := apiClient.CreateResourcePool(context.Background(), projectId, region).CreateResourcePoolPayload(createResourcePoolPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService CreateResourcePoolSnapshot", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := CreateResourcePoolSnapshotResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + createResourcePoolSnapshotPayload := CreateResourcePoolSnapshotPayload{} + + resp, reqErr := apiClient.CreateResourcePoolSnapshot(context.Background(), projectId, region, resourcePoolId).CreateResourcePoolSnapshotPayload(createResourcePoolSnapshotPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService CreateShare", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := CreateShareResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + createSharePayload := CreateSharePayload{} + + resp, reqErr := apiClient.CreateShare(context.Background(), projectId, region, resourcePoolId).CreateSharePayload(createSharePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService CreateShareExportPolicy", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := CreateShareExportPolicyResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + createShareExportPolicyPayload := CreateShareExportPolicyPayload{} + + resp, reqErr := apiClient.CreateShareExportPolicy(context.Background(), projectId, region).CreateShareExportPolicyPayload(createShareExportPolicyPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteResourcePool", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + + resp, reqErr := apiClient.DeleteResourcePool(context.Background(), projectId, region, resourcePoolId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteResourcePoolSnapshot", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + snapshotNameValue := "snapshotName-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotName"+"}", url.PathEscape(ParameterValueToString(snapshotNameValue, "snapshotName")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + snapshotName := snapshotNameValue + + resp, reqErr := apiClient.DeleteResourcePoolSnapshot(context.Background(), projectId, region, resourcePoolId, snapshotName).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteShare", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares/{shareId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + shareIdValue := "shareId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"shareId"+"}", url.PathEscape(ParameterValueToString(shareIdValue, "shareId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + shareId := shareIdValue + + resp, reqErr := apiClient.DeleteShare(context.Background(), projectId, region, resourcePoolId, shareId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteShareExportPolicy", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + policyIdValue := "policyId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"policyId"+"}", url.PathEscape(ParameterValueToString(policyIdValue, "policyId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, 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 sfs_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 := projectIdValue + region := regionValue + policyId := policyIdValue + + resp, reqErr := apiClient.DeleteShareExportPolicy(context.Background(), projectId, region, policyId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetResourcePool", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := GetResourcePoolResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + + resp, reqErr := apiClient.GetResourcePool(context.Background(), projectId, region, resourcePoolId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetResourcePoolSnapshot", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + snapshotNameValue := "snapshotName-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotName"+"}", url.PathEscape(ParameterValueToString(snapshotNameValue, "snapshotName")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := GetResourcePoolSnapshotResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + snapshotName := snapshotNameValue + + resp, reqErr := apiClient.GetResourcePoolSnapshot(context.Background(), projectId, region, resourcePoolId, snapshotName).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetShare", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares/{shareId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + shareIdValue := "shareId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"shareId"+"}", url.PathEscape(ParameterValueToString(shareIdValue, "shareId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := GetShareResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + shareId := shareIdValue + + resp, reqErr := apiClient.GetShare(context.Background(), projectId, region, resourcePoolId, shareId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetShareExportPolicy", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + policyIdValue := "policyId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"policyId"+"}", url.PathEscape(ParameterValueToString(policyIdValue, "policyId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := GetShareExportPolicyResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + policyId := policyIdValue + + resp, reqErr := apiClient.GetShareExportPolicy(context.Background(), projectId, region, policyId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListPerformanceClasses", func(t *testing.T) { + _apiUrlPath := "/v1beta/resourcePoolPerformanceClasses" + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListPerformanceClassesResponse{} + 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 sfs_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.ListPerformanceClasses(context.Background()).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListResourcePoolSnapshots", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListResourcePoolSnapshotsResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + + resp, reqErr := apiClient.ListResourcePoolSnapshots(context.Background(), projectId, region, resourcePoolId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListResourcePools", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListResourcePoolsResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + + resp, reqErr := apiClient.ListResourcePools(context.Background(), projectId, region).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListShareExportPolicies", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListShareExportPoliciesResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + + resp, reqErr := apiClient.ListShareExportPolicies(context.Background(), projectId, region).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListShares", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListSharesResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + + resp, reqErr := apiClient.ListShares(context.Background(), projectId, region, resourcePoolId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListSnapshotSchedules", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/snapshotSchedules" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ListSnapshotSchedulesResponse{} + 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 sfs_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 := projectIdValue + + resp, reqErr := apiClient.ListSnapshotSchedules(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateResourcePool", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := UpdateResourcePoolResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + updateResourcePoolPayload := UpdateResourcePoolPayload{} + + resp, reqErr := apiClient.UpdateResourcePool(context.Background(), projectId, region, resourcePoolId).UpdateResourcePoolPayload(updateResourcePoolPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateShare", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares/{shareId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + resourcePoolIdValue := "resourcePoolId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(resourcePoolIdValue, "resourcePoolId")), -1) + shareIdValue := "shareId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"shareId"+"}", url.PathEscape(ParameterValueToString(shareIdValue, "shareId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := UpdateShareResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + resourcePoolId := resourcePoolIdValue + shareId := shareIdValue + updateSharePayload := UpdateSharePayload{} + + resp, reqErr := apiClient.UpdateShare(context.Background(), projectId, region, resourcePoolId, shareId).UpdateSharePayload(updateSharePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateShareExportPolicy", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + policyIdValue := "policyId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"policyId"+"}", url.PathEscape(ParameterValueToString(policyIdValue, "policyId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := UpdateShareExportPolicyResponse{} + 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 sfs_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 := projectIdValue + region := regionValue + policyId := policyIdValue + updateShareExportPolicyPayload := UpdateShareExportPolicyPayload{} + + resp, reqErr := apiClient.UpdateShareExportPolicy(context.Background(), projectId, region, policyId).UpdateShareExportPolicyPayload(updateShareExportPolicyPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + +} diff --git a/services/sfs/client.go b/services/sfs/client.go new file mode 100644 index 000000000..9725c9658 --- /dev/null +++ b/services/sfs/client.go @@ -0,0 +1,631 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +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 File Storage (SFS) 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 DefaultApi +} + +// 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 !IsNil(postBody) { + 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/sfs/configuration.go b/services/sfs/configuration.go new file mode 100644 index 000000000..eb65cb89d --- /dev/null +++ b/services/sfs/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +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: "stackit-sdk-go/sfs", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://sfs.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/sfs/go.mod b/services/sfs/go.mod new file mode 100644 index 000000000..024a2a432 --- /dev/null +++ b/services/sfs/go.mod @@ -0,0 +1,10 @@ +module github.com/stackitcloud/stackit-sdk-go/services/sfs + +go 1.21 + +require github.com/stackitcloud/stackit-sdk-go/core v0.20.1 + +require ( + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect +) diff --git a/services/sfs/go.sum b/services/sfs/go.sum new file mode 100644 index 000000000..6eca79590 --- /dev/null +++ b/services/sfs/go.sum @@ -0,0 +1,8 @@ +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +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.20.1 h1:odiuhhRXmxvEvnVTeZSN9u98edvw2Cd3DcnkepncP3M= +github.com/stackitcloud/stackit-sdk-go/core v0.20.1/go.mod h1:fqto7M82ynGhEnpZU6VkQKYWYoFG5goC076JWXTUPRQ= diff --git a/services/sfs/model_create_resource_pool_payload.go b/services/sfs/model_create_resource_pool_payload.go new file mode 100644 index 000000000..165f54d23 --- /dev/null +++ b/services/sfs/model_create_resource_pool_payload.go @@ -0,0 +1,469 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateResourcePoolPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateResourcePoolPayload{} + +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type CreateResourcePoolPayloadGetAvailabilityZoneAttributeType = *string + +func getCreateResourcePoolPayloadGetAvailabilityZoneAttributeTypeOk(arg CreateResourcePoolPayloadGetAvailabilityZoneAttributeType) (ret CreateResourcePoolPayloadGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolPayloadGetAvailabilityZoneAttributeType(arg *CreateResourcePoolPayloadGetAvailabilityZoneAttributeType, val CreateResourcePoolPayloadGetAvailabilityZoneRetType) { + *arg = &val +} + +type CreateResourcePoolPayloadGetAvailabilityZoneArgType = string +type CreateResourcePoolPayloadGetAvailabilityZoneRetType = string + +/* + types and functions for ipAcl +*/ + +// isArray +type CreateResourcePoolPayloadGetIpAclAttributeType = *[]string +type CreateResourcePoolPayloadGetIpAclArgType = []string +type CreateResourcePoolPayloadGetIpAclRetType = []string + +func getCreateResourcePoolPayloadGetIpAclAttributeTypeOk(arg CreateResourcePoolPayloadGetIpAclAttributeType) (ret CreateResourcePoolPayloadGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolPayloadGetIpAclAttributeType(arg *CreateResourcePoolPayloadGetIpAclAttributeType, val CreateResourcePoolPayloadGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type CreateResourcePoolPayloadGetLabelsAttributeType = *map[string]string +type CreateResourcePoolPayloadGetLabelsArgType = map[string]string +type CreateResourcePoolPayloadGetLabelsRetType = map[string]string + +func getCreateResourcePoolPayloadGetLabelsAttributeTypeOk(arg CreateResourcePoolPayloadGetLabelsAttributeType) (ret CreateResourcePoolPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolPayloadGetLabelsAttributeType(arg *CreateResourcePoolPayloadGetLabelsAttributeType, val CreateResourcePoolPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateResourcePoolPayloadGetNameAttributeType = *string + +func getCreateResourcePoolPayloadGetNameAttributeTypeOk(arg CreateResourcePoolPayloadGetNameAttributeType) (ret CreateResourcePoolPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolPayloadGetNameAttributeType(arg *CreateResourcePoolPayloadGetNameAttributeType, val CreateResourcePoolPayloadGetNameRetType) { + *arg = &val +} + +type CreateResourcePoolPayloadGetNameArgType = string +type CreateResourcePoolPayloadGetNameRetType = string + +/* + types and functions for performanceClass +*/ + +// isNotNullableString +type CreateResourcePoolPayloadGetPerformanceClassAttributeType = *string + +func getCreateResourcePoolPayloadGetPerformanceClassAttributeTypeOk(arg CreateResourcePoolPayloadGetPerformanceClassAttributeType) (ret CreateResourcePoolPayloadGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolPayloadGetPerformanceClassAttributeType(arg *CreateResourcePoolPayloadGetPerformanceClassAttributeType, val CreateResourcePoolPayloadGetPerformanceClassRetType) { + *arg = &val +} + +type CreateResourcePoolPayloadGetPerformanceClassArgType = string +type CreateResourcePoolPayloadGetPerformanceClassRetType = string + +/* + types and functions for sizeGigabytes +*/ + +// isInteger +type CreateResourcePoolPayloadGetSizeGigabytesAttributeType = *int64 +type CreateResourcePoolPayloadGetSizeGigabytesArgType = int64 +type CreateResourcePoolPayloadGetSizeGigabytesRetType = int64 + +func getCreateResourcePoolPayloadGetSizeGigabytesAttributeTypeOk(arg CreateResourcePoolPayloadGetSizeGigabytesAttributeType) (ret CreateResourcePoolPayloadGetSizeGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolPayloadGetSizeGigabytesAttributeType(arg *CreateResourcePoolPayloadGetSizeGigabytesAttributeType, val CreateResourcePoolPayloadGetSizeGigabytesRetType) { + *arg = &val +} + +/* + types and functions for snapshotScheduleName +*/ + +// isNotNullableString +type CreateResourcePoolPayloadGetSnapshotScheduleNameAttributeType = *string + +func getCreateResourcePoolPayloadGetSnapshotScheduleNameAttributeTypeOk(arg CreateResourcePoolPayloadGetSnapshotScheduleNameAttributeType) (ret CreateResourcePoolPayloadGetSnapshotScheduleNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolPayloadGetSnapshotScheduleNameAttributeType(arg *CreateResourcePoolPayloadGetSnapshotScheduleNameAttributeType, val CreateResourcePoolPayloadGetSnapshotScheduleNameRetType) { + *arg = &val +} + +type CreateResourcePoolPayloadGetSnapshotScheduleNameArgType = string +type CreateResourcePoolPayloadGetSnapshotScheduleNameRetType = string + +/* + types and functions for snapshotsAreVisible +*/ + +// isBoolean +type CreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType = *bool +type CreateResourcePoolPayloadgetSnapshotsAreVisibleArgType = bool +type CreateResourcePoolPayloadgetSnapshotsAreVisibleRetType = bool + +func getCreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeTypeOk(arg CreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType) (ret CreateResourcePoolPayloadgetSnapshotsAreVisibleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType(arg *CreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType, val CreateResourcePoolPayloadgetSnapshotsAreVisibleRetType) { + *arg = &val +} + +// CreateResourcePoolPayload struct for CreateResourcePoolPayload +type CreateResourcePoolPayload struct { + // Availability zone + AvailabilityZone CreateResourcePoolPayloadGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` + // List of IPs that can mount the Resource Pool in read-only; IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.250/32\" for a specific IP) + IpAcl CreateResourcePoolPayloadGetIpAclAttributeType `json:"ipAcl,omitempty"` + // An optional object that represents the labels associated with the resource pool keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels CreateResourcePoolPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // Name of the Resource Pool + Name CreateResourcePoolPayloadGetNameAttributeType `json:"name,omitempty"` + // Name of the performance class + PerformanceClass CreateResourcePoolPayloadGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` + // Size of the Resource Pool (unit: gibibytes) + // Can be cast to int32 without loss of precision. + SizeGigabytes CreateResourcePoolPayloadGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // (optional) Name of the Snapshot Schedule to use + SnapshotScheduleName CreateResourcePoolPayloadGetSnapshotScheduleNameAttributeType `json:"snapshotScheduleName,omitempty"` + // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. + SnapshotsAreVisible CreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` +} + +// NewCreateResourcePoolPayload instantiates a new CreateResourcePoolPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateResourcePoolPayload() *CreateResourcePoolPayload { + this := CreateResourcePoolPayload{} + return &this +} + +// NewCreateResourcePoolPayloadWithDefaults instantiates a new CreateResourcePoolPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateResourcePoolPayloadWithDefaults() *CreateResourcePoolPayload { + this := CreateResourcePoolPayload{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetAvailabilityZone() (res CreateResourcePoolPayloadGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolPayload) GetAvailabilityZoneOk() (ret CreateResourcePoolPayloadGetAvailabilityZoneRetType, ok bool) { + return getCreateResourcePoolPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasAvailabilityZone() bool { + _, ok := o.GetAvailabilityZoneOk() + return ok +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *CreateResourcePoolPayload) SetAvailabilityZone(v CreateResourcePoolPayloadGetAvailabilityZoneRetType) { + setCreateResourcePoolPayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetIpAcl() (res CreateResourcePoolPayloadGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolPayload) GetIpAclOk() (ret CreateResourcePoolPayloadGetIpAclRetType, ok bool) { + return getCreateResourcePoolPayloadGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *CreateResourcePoolPayload) SetIpAcl(v CreateResourcePoolPayloadGetIpAclRetType) { + setCreateResourcePoolPayloadGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetLabels() (res CreateResourcePoolPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *CreateResourcePoolPayload) GetLabelsOk() (ret CreateResourcePoolPayloadGetLabelsRetType, ok bool) { + return getCreateResourcePoolPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateResourcePoolPayload) SetLabels(v CreateResourcePoolPayloadGetLabelsRetType) { + setCreateResourcePoolPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetName() (res CreateResourcePoolPayloadGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *CreateResourcePoolPayload) GetNameOk() (ret CreateResourcePoolPayloadGetNameRetType, ok bool) { + return getCreateResourcePoolPayloadGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateResourcePoolPayload) SetName(v CreateResourcePoolPayloadGetNameRetType) { + setCreateResourcePoolPayloadGetNameAttributeType(&o.Name, v) +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetPerformanceClass() (res CreateResourcePoolPayloadGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolPayload) GetPerformanceClassOk() (ret CreateResourcePoolPayloadGetPerformanceClassRetType, ok bool) { + return getCreateResourcePoolPayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass) +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasPerformanceClass() bool { + _, ok := o.GetPerformanceClassOk() + return ok +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *CreateResourcePoolPayload) SetPerformanceClass(v CreateResourcePoolPayloadGetPerformanceClassRetType) { + setCreateResourcePoolPayloadGetPerformanceClassAttributeType(&o.PerformanceClass, v) +} + +// GetSizeGigabytes returns the SizeGigabytes field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetSizeGigabytes() (res CreateResourcePoolPayloadGetSizeGigabytesRetType) { + res, _ = o.GetSizeGigabytesOk() + return +} + +// GetSizeGigabytesOk returns a tuple with the SizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolPayload) GetSizeGigabytesOk() (ret CreateResourcePoolPayloadGetSizeGigabytesRetType, ok bool) { + return getCreateResourcePoolPayloadGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes) +} + +// HasSizeGigabytes returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasSizeGigabytes() bool { + _, ok := o.GetSizeGigabytesOk() + return ok +} + +// SetSizeGigabytes gets a reference to the given int64 and assigns it to the SizeGigabytes field. +func (o *CreateResourcePoolPayload) SetSizeGigabytes(v CreateResourcePoolPayloadGetSizeGigabytesRetType) { + setCreateResourcePoolPayloadGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) +} + +// GetSnapshotScheduleName returns the SnapshotScheduleName field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetSnapshotScheduleName() (res CreateResourcePoolPayloadGetSnapshotScheduleNameRetType) { + res, _ = o.GetSnapshotScheduleNameOk() + return +} + +// GetSnapshotScheduleNameOk returns a tuple with the SnapshotScheduleName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolPayload) GetSnapshotScheduleNameOk() (ret CreateResourcePoolPayloadGetSnapshotScheduleNameRetType, ok bool) { + return getCreateResourcePoolPayloadGetSnapshotScheduleNameAttributeTypeOk(o.SnapshotScheduleName) +} + +// HasSnapshotScheduleName returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasSnapshotScheduleName() bool { + _, ok := o.GetSnapshotScheduleNameOk() + return ok +} + +// SetSnapshotScheduleName gets a reference to the given string and assigns it to the SnapshotScheduleName field. +func (o *CreateResourcePoolPayload) SetSnapshotScheduleName(v CreateResourcePoolPayloadGetSnapshotScheduleNameRetType) { + setCreateResourcePoolPayloadGetSnapshotScheduleNameAttributeType(&o.SnapshotScheduleName, v) +} + +// GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetSnapshotsAreVisible() (res CreateResourcePoolPayloadgetSnapshotsAreVisibleRetType) { + res, _ = o.GetSnapshotsAreVisibleOk() + return +} + +// GetSnapshotsAreVisibleOk returns a tuple with the SnapshotsAreVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolPayload) GetSnapshotsAreVisibleOk() (ret CreateResourcePoolPayloadgetSnapshotsAreVisibleRetType, ok bool) { + return getCreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible) +} + +// HasSnapshotsAreVisible returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasSnapshotsAreVisible() bool { + _, ok := o.GetSnapshotsAreVisibleOk() + return ok +} + +// SetSnapshotsAreVisible gets a reference to the given bool and assigns it to the SnapshotsAreVisible field. +func (o *CreateResourcePoolPayload) SetSnapshotsAreVisible(v CreateResourcePoolPayloadgetSnapshotsAreVisibleRetType) { + setCreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType(&o.SnapshotsAreVisible, v) +} + +func (o CreateResourcePoolPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateResourcePoolPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getCreateResourcePoolPayloadGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getCreateResourcePoolPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateResourcePoolPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateResourcePoolPayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val + } + if val, ok := getCreateResourcePoolPayloadGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { + toSerialize["SizeGigabytes"] = val + } + if val, ok := getCreateResourcePoolPayloadGetSnapshotScheduleNameAttributeTypeOk(o.SnapshotScheduleName); ok { + toSerialize["SnapshotScheduleName"] = val + } + if val, ok := getCreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { + toSerialize["SnapshotsAreVisible"] = val + } + return toSerialize, nil +} + +type NullableCreateResourcePoolPayload struct { + value *CreateResourcePoolPayload + isSet bool +} + +func (v NullableCreateResourcePoolPayload) Get() *CreateResourcePoolPayload { + return v.value +} + +func (v *NullableCreateResourcePoolPayload) Set(val *CreateResourcePoolPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateResourcePoolPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateResourcePoolPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateResourcePoolPayload(val *CreateResourcePoolPayload) *NullableCreateResourcePoolPayload { + return &NullableCreateResourcePoolPayload{value: val, isSet: true} +} + +func (v NullableCreateResourcePoolPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateResourcePoolPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_resource_pool_payload_test.go b/services/sfs/model_create_resource_pool_payload_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_resource_pool_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_resource_pool_response.go b/services/sfs/model_create_resource_pool_response.go new file mode 100644 index 000000000..67746b7b3 --- /dev/null +++ b/services/sfs/model_create_resource_pool_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateResourcePoolResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateResourcePoolResponse{} + +/* + types and functions for resourcePool +*/ + +// isModel +type CreateResourcePoolResponseGetResourcePoolAttributeType = *CreateResourcePoolResponseResourcePool +type CreateResourcePoolResponseGetResourcePoolArgType = CreateResourcePoolResponseResourcePool +type CreateResourcePoolResponseGetResourcePoolRetType = CreateResourcePoolResponseResourcePool + +func getCreateResourcePoolResponseGetResourcePoolAttributeTypeOk(arg CreateResourcePoolResponseGetResourcePoolAttributeType) (ret CreateResourcePoolResponseGetResourcePoolRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseGetResourcePoolAttributeType(arg *CreateResourcePoolResponseGetResourcePoolAttributeType, val CreateResourcePoolResponseGetResourcePoolRetType) { + *arg = &val +} + +// CreateResourcePoolResponse struct for CreateResourcePoolResponse +type CreateResourcePoolResponse struct { + ResourcePool CreateResourcePoolResponseGetResourcePoolAttributeType `json:"resourcePool,omitempty"` +} + +// NewCreateResourcePoolResponse instantiates a new CreateResourcePoolResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateResourcePoolResponse() *CreateResourcePoolResponse { + this := CreateResourcePoolResponse{} + return &this +} + +// NewCreateResourcePoolResponseWithDefaults instantiates a new CreateResourcePoolResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateResourcePoolResponseWithDefaults() *CreateResourcePoolResponse { + this := CreateResourcePoolResponse{} + return &this +} + +// GetResourcePool returns the ResourcePool field value if set, zero value otherwise. +func (o *CreateResourcePoolResponse) GetResourcePool() (res CreateResourcePoolResponseGetResourcePoolRetType) { + res, _ = o.GetResourcePoolOk() + return +} + +// GetResourcePoolOk returns a tuple with the ResourcePool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponse) GetResourcePoolOk() (ret CreateResourcePoolResponseGetResourcePoolRetType, ok bool) { + return getCreateResourcePoolResponseGetResourcePoolAttributeTypeOk(o.ResourcePool) +} + +// HasResourcePool returns a boolean if a field has been set. +func (o *CreateResourcePoolResponse) HasResourcePool() bool { + _, ok := o.GetResourcePoolOk() + return ok +} + +// SetResourcePool gets a reference to the given CreateResourcePoolResponseResourcePool and assigns it to the ResourcePool field. +func (o *CreateResourcePoolResponse) SetResourcePool(v CreateResourcePoolResponseGetResourcePoolRetType) { + setCreateResourcePoolResponseGetResourcePoolAttributeType(&o.ResourcePool, v) +} + +func (o CreateResourcePoolResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateResourcePoolResponseGetResourcePoolAttributeTypeOk(o.ResourcePool); ok { + toSerialize["ResourcePool"] = val + } + return toSerialize, nil +} + +type NullableCreateResourcePoolResponse struct { + value *CreateResourcePoolResponse + isSet bool +} + +func (v NullableCreateResourcePoolResponse) Get() *CreateResourcePoolResponse { + return v.value +} + +func (v *NullableCreateResourcePoolResponse) Set(val *CreateResourcePoolResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateResourcePoolResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateResourcePoolResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateResourcePoolResponse(val *CreateResourcePoolResponse) *NullableCreateResourcePoolResponse { + return &NullableCreateResourcePoolResponse{value: val, isSet: true} +} + +func (v NullableCreateResourcePoolResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateResourcePoolResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_resource_pool_response_resource_pool.go b/services/sfs/model_create_resource_pool_response_resource_pool.go new file mode 100644 index 000000000..00419b2cd --- /dev/null +++ b/services/sfs/model_create_resource_pool_response_resource_pool.go @@ -0,0 +1,802 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the CreateResourcePoolResponseResourcePool type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateResourcePoolResponseResourcePool{} + +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type CreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType = *string + +func getCreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType) (ret CreateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType(arg *CreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType, val CreateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + *arg = &val +} + +type CreateResourcePoolResponseResourcePoolGetAvailabilityZoneArgType = string +type CreateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType = string + +/* + types and functions for countShares +*/ + +// isInteger +type CreateResourcePoolResponseResourcePoolGetCountSharesAttributeType = *int64 +type CreateResourcePoolResponseResourcePoolGetCountSharesArgType = int64 +type CreateResourcePoolResponseResourcePoolGetCountSharesRetType = int64 + +func getCreateResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetCountSharesAttributeType) (ret CreateResourcePoolResponseResourcePoolGetCountSharesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetCountSharesAttributeType(arg *CreateResourcePoolResponseResourcePoolGetCountSharesAttributeType, val CreateResourcePoolResponseResourcePoolGetCountSharesRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateResourcePoolResponseResourcePoolGetCreatedAtAttributeType = *time.Time +type CreateResourcePoolResponseResourcePoolGetCreatedAtArgType = time.Time +type CreateResourcePoolResponseResourcePoolGetCreatedAtRetType = time.Time + +func getCreateResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetCreatedAtAttributeType) (ret CreateResourcePoolResponseResourcePoolGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetCreatedAtAttributeType(arg *CreateResourcePoolResponseResourcePoolGetCreatedAtAttributeType, val CreateResourcePoolResponseResourcePoolGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateResourcePoolResponseResourcePoolGetIdAttributeType = *string + +func getCreateResourcePoolResponseResourcePoolGetIdAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetIdAttributeType) (ret CreateResourcePoolResponseResourcePoolGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetIdAttributeType(arg *CreateResourcePoolResponseResourcePoolGetIdAttributeType, val CreateResourcePoolResponseResourcePoolGetIdRetType) { + *arg = &val +} + +type CreateResourcePoolResponseResourcePoolGetIdArgType = string +type CreateResourcePoolResponseResourcePoolGetIdRetType = string + +/* + types and functions for ipAcl +*/ + +// isArray +type CreateResourcePoolResponseResourcePoolGetIpAclAttributeType = *[]string +type CreateResourcePoolResponseResourcePoolGetIpAclArgType = []string +type CreateResourcePoolResponseResourcePoolGetIpAclRetType = []string + +func getCreateResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetIpAclAttributeType) (ret CreateResourcePoolResponseResourcePoolGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetIpAclAttributeType(arg *CreateResourcePoolResponseResourcePoolGetIpAclAttributeType, val CreateResourcePoolResponseResourcePoolGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type CreateResourcePoolResponseResourcePoolGetLabelsAttributeType = *map[string]string +type CreateResourcePoolResponseResourcePoolGetLabelsArgType = map[string]string +type CreateResourcePoolResponseResourcePoolGetLabelsRetType = map[string]string + +func getCreateResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetLabelsAttributeType) (ret CreateResourcePoolResponseResourcePoolGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetLabelsAttributeType(arg *CreateResourcePoolResponseResourcePoolGetLabelsAttributeType, val CreateResourcePoolResponseResourcePoolGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mountPath +*/ + +// isNotNullableString +type CreateResourcePoolResponseResourcePoolGetMountPathAttributeType = *string + +func getCreateResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetMountPathAttributeType) (ret CreateResourcePoolResponseResourcePoolGetMountPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetMountPathAttributeType(arg *CreateResourcePoolResponseResourcePoolGetMountPathAttributeType, val CreateResourcePoolResponseResourcePoolGetMountPathRetType) { + *arg = &val +} + +type CreateResourcePoolResponseResourcePoolGetMountPathArgType = string +type CreateResourcePoolResponseResourcePoolGetMountPathRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateResourcePoolResponseResourcePoolGetNameAttributeType = *string + +func getCreateResourcePoolResponseResourcePoolGetNameAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetNameAttributeType) (ret CreateResourcePoolResponseResourcePoolGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetNameAttributeType(arg *CreateResourcePoolResponseResourcePoolGetNameAttributeType, val CreateResourcePoolResponseResourcePoolGetNameRetType) { + *arg = &val +} + +type CreateResourcePoolResponseResourcePoolGetNameArgType = string +type CreateResourcePoolResponseResourcePoolGetNameRetType = string + +/* + types and functions for performanceClass +*/ + +// isModel +type CreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType = *ResourcePoolPerformanceClass +type CreateResourcePoolResponseResourcePoolGetPerformanceClassArgType = ResourcePoolPerformanceClass +type CreateResourcePoolResponseResourcePoolGetPerformanceClassRetType = ResourcePoolPerformanceClass + +func getCreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType) (ret CreateResourcePoolResponseResourcePoolGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType(arg *CreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType, val CreateResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + *arg = &val +} + +/* + types and functions for performanceClassDowngradableAt +*/ + +// isDateTime +type CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType = *time.Time +type CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtArgType = time.Time +type CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType = time.Time + +func getCreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType) (ret CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType(arg *CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType, val CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + *arg = &val +} + +/* + types and functions for sizeReducibleAt +*/ + +// isDateTime +type CreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType = *time.Time +type CreateResourcePoolResponseResourcePoolGetSizeReducibleAtArgType = time.Time +type CreateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType = time.Time + +func getCreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType) (ret CreateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(arg *CreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType, val CreateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + *arg = &val +} + +/* + types and functions for snapshotSchedule +*/ + +// isModel +type CreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType = *SnapshotSchedule +type CreateResourcePoolResponseResourcePoolGetSnapshotScheduleArgType = SnapshotSchedule +type CreateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType = SnapshotSchedule + +func getCreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType) (ret CreateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType(arg *CreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType, val CreateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + *arg = &val +} + +/* + types and functions for snapshotsAreVisible +*/ + +// isBoolean +type CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType = *bool +type CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleArgType = bool +type CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType = bool + +func getCreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType) (ret CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType(arg *CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType, val CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + *arg = &val +} + +/* + types and functions for space +*/ + +// isModel +type CreateResourcePoolResponseResourcePoolGetSpaceAttributeType = *ResourcePoolSpace +type CreateResourcePoolResponseResourcePoolGetSpaceArgType = ResourcePoolSpace +type CreateResourcePoolResponseResourcePoolGetSpaceRetType = ResourcePoolSpace + +func getCreateResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetSpaceAttributeType) (ret CreateResourcePoolResponseResourcePoolGetSpaceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetSpaceAttributeType(arg *CreateResourcePoolResponseResourcePoolGetSpaceAttributeType, val CreateResourcePoolResponseResourcePoolGetSpaceRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type CreateResourcePoolResponseResourcePoolGetStateAttributeType = *string + +func getCreateResourcePoolResponseResourcePoolGetStateAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetStateAttributeType) (ret CreateResourcePoolResponseResourcePoolGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolResponseResourcePoolGetStateAttributeType(arg *CreateResourcePoolResponseResourcePoolGetStateAttributeType, val CreateResourcePoolResponseResourcePoolGetStateRetType) { + *arg = &val +} + +type CreateResourcePoolResponseResourcePoolGetStateArgType = string +type CreateResourcePoolResponseResourcePoolGetStateRetType = string + +// CreateResourcePoolResponseResourcePool Created Resource Pool +type CreateResourcePoolResponseResourcePool struct { + // Name of the respective availability zone + AvailabilityZone CreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` + // Number of Shares in the Resource Pool + // Can be cast to int32 without loss of precision. + CountShares CreateResourcePoolResponseResourcePoolGetCountSharesAttributeType `json:"countShares,omitempty"` + CreatedAt CreateResourcePoolResponseResourcePoolGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Resource Pool + Id CreateResourcePoolResponseResourcePoolGetIdAttributeType `json:"id,omitempty"` + // List of IPs that can mount the Resource Pool in read-only; IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.250/32\" for a specific IP) + IpAcl CreateResourcePoolResponseResourcePoolGetIpAclAttributeType `json:"ipAcl,omitempty"` + Labels CreateResourcePoolResponseResourcePoolGetLabelsAttributeType `json:"labels,omitempty"` + // Mount path of the Resource Pool, used to mount the Resource Pool Note that a Resource Pool can only be mounted in read-only + MountPath CreateResourcePoolResponseResourcePoolGetMountPathAttributeType `json:"mountPath,omitempty"` + // Name of the Resource Pool + Name CreateResourcePoolResponseResourcePoolGetNameAttributeType `json:"name,omitempty"` + PerformanceClass CreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` + // Time when the performance class can be downgraded again. + PerformanceClassDowngradableAt CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType `json:"performanceClassDowngradableAt,omitempty"` + // Time when the size can be reduced again. + SizeReducibleAt CreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType `json:"sizeReducibleAt,omitempty"` + SnapshotSchedule CreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType `json:"snapshotSchedule,omitempty"` + // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. + SnapshotsAreVisible CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` + Space CreateResourcePoolResponseResourcePoolGetSpaceAttributeType `json:"space,omitempty"` + // State of the Resource Pool (possible values: [\"pending\", \"creating\", \"created\", \"updating\", \"error\", \"deleting\"]) + State CreateResourcePoolResponseResourcePoolGetStateAttributeType `json:"state,omitempty"` +} + +// NewCreateResourcePoolResponseResourcePool instantiates a new CreateResourcePoolResponseResourcePool object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateResourcePoolResponseResourcePool() *CreateResourcePoolResponseResourcePool { + this := CreateResourcePoolResponseResourcePool{} + return &this +} + +// NewCreateResourcePoolResponseResourcePoolWithDefaults instantiates a new CreateResourcePoolResponseResourcePool object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateResourcePoolResponseResourcePoolWithDefaults() *CreateResourcePoolResponseResourcePool { + this := CreateResourcePoolResponseResourcePool{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetAvailabilityZone() (res CreateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetAvailabilityZoneOk() (ret CreateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasAvailabilityZone() bool { + _, ok := o.GetAvailabilityZoneOk() + return ok +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *CreateResourcePoolResponseResourcePool) SetAvailabilityZone(v CreateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + setCreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) +} + +// GetCountShares returns the CountShares field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetCountShares() (res CreateResourcePoolResponseResourcePoolGetCountSharesRetType) { + res, _ = o.GetCountSharesOk() + return +} + +// GetCountSharesOk returns a tuple with the CountShares field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetCountSharesOk() (ret CreateResourcePoolResponseResourcePoolGetCountSharesRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(o.CountShares) +} + +// HasCountShares returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasCountShares() bool { + _, ok := o.GetCountSharesOk() + return ok +} + +// SetCountShares gets a reference to the given int64 and assigns it to the CountShares field. +func (o *CreateResourcePoolResponseResourcePool) SetCountShares(v CreateResourcePoolResponseResourcePoolGetCountSharesRetType) { + setCreateResourcePoolResponseResourcePoolGetCountSharesAttributeType(&o.CountShares, v) +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetCreatedAt() (res CreateResourcePoolResponseResourcePoolGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetCreatedAtOk() (ret CreateResourcePoolResponseResourcePoolGetCreatedAtRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateResourcePoolResponseResourcePool) SetCreatedAt(v CreateResourcePoolResponseResourcePoolGetCreatedAtRetType) { + setCreateResourcePoolResponseResourcePoolGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetId() (res CreateResourcePoolResponseResourcePoolGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *CreateResourcePoolResponseResourcePool) GetIdOk() (ret CreateResourcePoolResponseResourcePoolGetIdRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateResourcePoolResponseResourcePool) SetId(v CreateResourcePoolResponseResourcePoolGetIdRetType) { + setCreateResourcePoolResponseResourcePoolGetIdAttributeType(&o.Id, v) +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetIpAcl() (res CreateResourcePoolResponseResourcePoolGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetIpAclOk() (ret CreateResourcePoolResponseResourcePoolGetIpAclRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *CreateResourcePoolResponseResourcePool) SetIpAcl(v CreateResourcePoolResponseResourcePoolGetIpAclRetType) { + setCreateResourcePoolResponseResourcePoolGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetLabels() (res CreateResourcePoolResponseResourcePoolGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *CreateResourcePoolResponseResourcePool) GetLabelsOk() (ret CreateResourcePoolResponseResourcePoolGetLabelsRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateResourcePoolResponseResourcePool) SetLabels(v CreateResourcePoolResponseResourcePoolGetLabelsRetType) { + setCreateResourcePoolResponseResourcePoolGetLabelsAttributeType(&o.Labels, v) +} + +// GetMountPath returns the MountPath field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetMountPath() (res CreateResourcePoolResponseResourcePoolGetMountPathRetType) { + res, _ = o.GetMountPathOk() + return +} + +// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetMountPathOk() (ret CreateResourcePoolResponseResourcePoolGetMountPathRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(o.MountPath) +} + +// HasMountPath returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasMountPath() bool { + _, ok := o.GetMountPathOk() + return ok +} + +// SetMountPath gets a reference to the given string and assigns it to the MountPath field. +func (o *CreateResourcePoolResponseResourcePool) SetMountPath(v CreateResourcePoolResponseResourcePoolGetMountPathRetType) { + setCreateResourcePoolResponseResourcePoolGetMountPathAttributeType(&o.MountPath, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetName() (res CreateResourcePoolResponseResourcePoolGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *CreateResourcePoolResponseResourcePool) GetNameOk() (ret CreateResourcePoolResponseResourcePoolGetNameRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateResourcePoolResponseResourcePool) SetName(v CreateResourcePoolResponseResourcePoolGetNameRetType) { + setCreateResourcePoolResponseResourcePoolGetNameAttributeType(&o.Name, v) +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetPerformanceClass() (res CreateResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetPerformanceClassOk() (ret CreateResourcePoolResponseResourcePoolGetPerformanceClassRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(o.PerformanceClass) +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasPerformanceClass() bool { + _, ok := o.GetPerformanceClassOk() + return ok +} + +// SetPerformanceClass gets a reference to the given ResourcePoolPerformanceClass and assigns it to the PerformanceClass field. +func (o *CreateResourcePoolResponseResourcePool) SetPerformanceClass(v CreateResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + setCreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType(&o.PerformanceClass, v) +} + +// GetPerformanceClassDowngradableAt returns the PerformanceClassDowngradableAt field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetPerformanceClassDowngradableAt() (res CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + res, _ = o.GetPerformanceClassDowngradableAtOk() + return +} + +// GetPerformanceClassDowngradableAtOk returns a tuple with the PerformanceClassDowngradableAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetPerformanceClassDowngradableAtOk() (ret CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(o.PerformanceClassDowngradableAt) +} + +// HasPerformanceClassDowngradableAt returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasPerformanceClassDowngradableAt() bool { + _, ok := o.GetPerformanceClassDowngradableAtOk() + return ok +} + +// SetPerformanceClassDowngradableAt gets a reference to the given time.Time and assigns it to the PerformanceClassDowngradableAt field. +func (o *CreateResourcePoolResponseResourcePool) SetPerformanceClassDowngradableAt(v CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + setCreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType(&o.PerformanceClassDowngradableAt, v) +} + +// GetSizeReducibleAt returns the SizeReducibleAt field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetSizeReducibleAt() (res CreateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + res, _ = o.GetSizeReducibleAtOk() + return +} + +// GetSizeReducibleAtOk returns a tuple with the SizeReducibleAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetSizeReducibleAtOk() (ret CreateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt) +} + +// HasSizeReducibleAt returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasSizeReducibleAt() bool { + _, ok := o.GetSizeReducibleAtOk() + return ok +} + +// SetSizeReducibleAt gets a reference to the given time.Time and assigns it to the SizeReducibleAt field. +func (o *CreateResourcePoolResponseResourcePool) SetSizeReducibleAt(v CreateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + setCreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(&o.SizeReducibleAt, v) +} + +// GetSnapshotSchedule returns the SnapshotSchedule field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetSnapshotSchedule() (res CreateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + res, _ = o.GetSnapshotScheduleOk() + return +} + +// GetSnapshotScheduleOk returns a tuple with the SnapshotSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetSnapshotScheduleOk() (ret CreateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(o.SnapshotSchedule) +} + +// HasSnapshotSchedule returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasSnapshotSchedule() bool { + _, ok := o.GetSnapshotScheduleOk() + return ok +} + +// SetSnapshotSchedule gets a reference to the given SnapshotSchedule and assigns it to the SnapshotSchedule field. +func (o *CreateResourcePoolResponseResourcePool) SetSnapshotSchedule(v CreateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + setCreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType(&o.SnapshotSchedule, v) +} + +// GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetSnapshotsAreVisible() (res CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + res, _ = o.GetSnapshotsAreVisibleOk() + return +} + +// GetSnapshotsAreVisibleOk returns a tuple with the SnapshotsAreVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetSnapshotsAreVisibleOk() (ret CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible) +} + +// HasSnapshotsAreVisible returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasSnapshotsAreVisible() bool { + _, ok := o.GetSnapshotsAreVisibleOk() + return ok +} + +// SetSnapshotsAreVisible gets a reference to the given bool and assigns it to the SnapshotsAreVisible field. +func (o *CreateResourcePoolResponseResourcePool) SetSnapshotsAreVisible(v CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + setCreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType(&o.SnapshotsAreVisible, v) +} + +// GetSpace returns the Space field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetSpace() (res CreateResourcePoolResponseResourcePoolGetSpaceRetType) { + res, _ = o.GetSpaceOk() + return +} + +// GetSpaceOk returns a tuple with the Space field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolResponseResourcePool) GetSpaceOk() (ret CreateResourcePoolResponseResourcePoolGetSpaceRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(o.Space) +} + +// HasSpace returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasSpace() bool { + _, ok := o.GetSpaceOk() + return ok +} + +// SetSpace gets a reference to the given ResourcePoolSpace and assigns it to the Space field. +func (o *CreateResourcePoolResponseResourcePool) SetSpace(v CreateResourcePoolResponseResourcePoolGetSpaceRetType) { + setCreateResourcePoolResponseResourcePoolGetSpaceAttributeType(&o.Space, v) +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *CreateResourcePoolResponseResourcePool) GetState() (res CreateResourcePoolResponseResourcePoolGetStateRetType) { + res, _ = o.GetStateOk() + return +} + +// 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 *CreateResourcePoolResponseResourcePool) GetStateOk() (ret CreateResourcePoolResponseResourcePoolGetStateRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetStateAttributeTypeOk(o.State) +} + +// HasState returns a boolean if a field has been set. +func (o *CreateResourcePoolResponseResourcePool) HasState() bool { + _, ok := o.GetStateOk() + return ok +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *CreateResourcePoolResponseResourcePool) SetState(v CreateResourcePoolResponseResourcePoolGetStateRetType) { + setCreateResourcePoolResponseResourcePoolGetStateAttributeType(&o.State, v) +} + +func (o CreateResourcePoolResponseResourcePool) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(o.CountShares); ok { + toSerialize["CountShares"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(o.MountPath); ok { + toSerialize["MountPath"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(o.PerformanceClassDowngradableAt); ok { + toSerialize["PerformanceClassDowngradableAt"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt); ok { + toSerialize["SizeReducibleAt"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(o.SnapshotSchedule); ok { + toSerialize["SnapshotSchedule"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { + toSerialize["SnapshotsAreVisible"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(o.Space); ok { + toSerialize["Space"] = val + } + if val, ok := getCreateResourcePoolResponseResourcePoolGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +type NullableCreateResourcePoolResponseResourcePool struct { + value *CreateResourcePoolResponseResourcePool + isSet bool +} + +func (v NullableCreateResourcePoolResponseResourcePool) Get() *CreateResourcePoolResponseResourcePool { + return v.value +} + +func (v *NullableCreateResourcePoolResponseResourcePool) Set(val *CreateResourcePoolResponseResourcePool) { + v.value = val + v.isSet = true +} + +func (v NullableCreateResourcePoolResponseResourcePool) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateResourcePoolResponseResourcePool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateResourcePoolResponseResourcePool(val *CreateResourcePoolResponseResourcePool) *NullableCreateResourcePoolResponseResourcePool { + return &NullableCreateResourcePoolResponseResourcePool{value: val, isSet: true} +} + +func (v NullableCreateResourcePoolResponseResourcePool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateResourcePoolResponseResourcePool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_resource_pool_response_resource_pool_test.go b/services/sfs/model_create_resource_pool_response_resource_pool_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_resource_pool_response_resource_pool_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_resource_pool_response_test.go b/services/sfs/model_create_resource_pool_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_resource_pool_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_resource_pool_snapshot_payload.go b/services/sfs/model_create_resource_pool_snapshot_payload.go new file mode 100644 index 000000000..8d1891c0d --- /dev/null +++ b/services/sfs/model_create_resource_pool_snapshot_payload.go @@ -0,0 +1,193 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateResourcePoolSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateResourcePoolSnapshotPayload{} + +/* + types and functions for comment +*/ + +// isNullableString +type CreateResourcePoolSnapshotPayloadGetCommentAttributeType = *NullableString + +func getCreateResourcePoolSnapshotPayloadGetCommentAttributeTypeOk(arg CreateResourcePoolSnapshotPayloadGetCommentAttributeType) (ret CreateResourcePoolSnapshotPayloadGetCommentRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreateResourcePoolSnapshotPayloadGetCommentAttributeType(arg *CreateResourcePoolSnapshotPayloadGetCommentAttributeType, val CreateResourcePoolSnapshotPayloadGetCommentRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreateResourcePoolSnapshotPayloadGetCommentArgType = *string +type CreateResourcePoolSnapshotPayloadGetCommentRetType = *string + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateResourcePoolSnapshotPayloadGetNameAttributeType = *string + +func getCreateResourcePoolSnapshotPayloadGetNameAttributeTypeOk(arg CreateResourcePoolSnapshotPayloadGetNameAttributeType) (ret CreateResourcePoolSnapshotPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolSnapshotPayloadGetNameAttributeType(arg *CreateResourcePoolSnapshotPayloadGetNameAttributeType, val CreateResourcePoolSnapshotPayloadGetNameRetType) { + *arg = &val +} + +type CreateResourcePoolSnapshotPayloadGetNameArgType = string +type CreateResourcePoolSnapshotPayloadGetNameRetType = string + +// CreateResourcePoolSnapshotPayload struct for CreateResourcePoolSnapshotPayload +type CreateResourcePoolSnapshotPayload struct { + // (optional) A comment to add more information about a snapshot + Comment CreateResourcePoolSnapshotPayloadGetCommentAttributeType `json:"comment,omitempty"` + // Name of the Resource Pool Snapshot + Name CreateResourcePoolSnapshotPayloadGetNameAttributeType `json:"name,omitempty"` +} + +// NewCreateResourcePoolSnapshotPayload instantiates a new CreateResourcePoolSnapshotPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateResourcePoolSnapshotPayload() *CreateResourcePoolSnapshotPayload { + this := CreateResourcePoolSnapshotPayload{} + return &this +} + +// NewCreateResourcePoolSnapshotPayloadWithDefaults instantiates a new CreateResourcePoolSnapshotPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateResourcePoolSnapshotPayloadWithDefaults() *CreateResourcePoolSnapshotPayload { + this := CreateResourcePoolSnapshotPayload{} + return &this +} + +// GetComment returns the Comment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateResourcePoolSnapshotPayload) GetComment() (res CreateResourcePoolSnapshotPayloadGetCommentRetType) { + res, _ = o.GetCommentOk() + return +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateResourcePoolSnapshotPayload) GetCommentOk() (ret CreateResourcePoolSnapshotPayloadGetCommentRetType, ok bool) { + return getCreateResourcePoolSnapshotPayloadGetCommentAttributeTypeOk(o.Comment) +} + +// HasComment returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotPayload) HasComment() bool { + _, ok := o.GetCommentOk() + return ok +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *CreateResourcePoolSnapshotPayload) SetComment(v CreateResourcePoolSnapshotPayloadGetCommentRetType) { + setCreateResourcePoolSnapshotPayloadGetCommentAttributeType(&o.Comment, v) +} + +// SetCommentNil sets the value for Comment to be an explicit nil +func (o *CreateResourcePoolSnapshotPayload) SetCommentNil() { + o.Comment = nil +} + +// UnsetComment ensures that no value is present for Comment, not even an explicit nil +func (o *CreateResourcePoolSnapshotPayload) UnsetComment() { + o.Comment = nil +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateResourcePoolSnapshotPayload) GetName() (res CreateResourcePoolSnapshotPayloadGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *CreateResourcePoolSnapshotPayload) GetNameOk() (ret CreateResourcePoolSnapshotPayloadGetNameRetType, ok bool) { + return getCreateResourcePoolSnapshotPayloadGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotPayload) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateResourcePoolSnapshotPayload) SetName(v CreateResourcePoolSnapshotPayloadGetNameRetType) { + setCreateResourcePoolSnapshotPayloadGetNameAttributeType(&o.Name, v) +} + +func (o CreateResourcePoolSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateResourcePoolSnapshotPayloadGetCommentAttributeTypeOk(o.Comment); ok { + toSerialize["Comment"] = val + } + if val, ok := getCreateResourcePoolSnapshotPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + return toSerialize, nil +} + +type NullableCreateResourcePoolSnapshotPayload struct { + value *CreateResourcePoolSnapshotPayload + isSet bool +} + +func (v NullableCreateResourcePoolSnapshotPayload) Get() *CreateResourcePoolSnapshotPayload { + return v.value +} + +func (v *NullableCreateResourcePoolSnapshotPayload) Set(val *CreateResourcePoolSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateResourcePoolSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateResourcePoolSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateResourcePoolSnapshotPayload(val *CreateResourcePoolSnapshotPayload) *NullableCreateResourcePoolSnapshotPayload { + return &NullableCreateResourcePoolSnapshotPayload{value: val, isSet: true} +} + +func (v NullableCreateResourcePoolSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateResourcePoolSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_resource_pool_snapshot_payload_test.go b/services/sfs/model_create_resource_pool_snapshot_payload_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_resource_pool_snapshot_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_resource_pool_snapshot_response.go b/services/sfs/model_create_resource_pool_snapshot_response.go new file mode 100644 index 000000000..76bd724dd --- /dev/null +++ b/services/sfs/model_create_resource_pool_snapshot_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateResourcePoolSnapshotResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateResourcePoolSnapshotResponse{} + +/* + types and functions for resourcePoolSnapshot +*/ + +// isModel +type CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType = *CreateResourcePoolSnapshotResponseResourcePoolSnapshot +type CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotArgType = CreateResourcePoolSnapshotResponseResourcePoolSnapshot +type CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType = CreateResourcePoolSnapshotResponseResourcePoolSnapshot + +func getCreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeTypeOk(arg CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType) (ret CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType(arg *CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType, val CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType) { + *arg = &val +} + +// CreateResourcePoolSnapshotResponse struct for CreateResourcePoolSnapshotResponse +type CreateResourcePoolSnapshotResponse struct { + ResourcePoolSnapshot CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType `json:"resourcePoolSnapshot,omitempty"` +} + +// NewCreateResourcePoolSnapshotResponse instantiates a new CreateResourcePoolSnapshotResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateResourcePoolSnapshotResponse() *CreateResourcePoolSnapshotResponse { + this := CreateResourcePoolSnapshotResponse{} + return &this +} + +// NewCreateResourcePoolSnapshotResponseWithDefaults instantiates a new CreateResourcePoolSnapshotResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateResourcePoolSnapshotResponseWithDefaults() *CreateResourcePoolSnapshotResponse { + this := CreateResourcePoolSnapshotResponse{} + return &this +} + +// GetResourcePoolSnapshot returns the ResourcePoolSnapshot field value if set, zero value otherwise. +func (o *CreateResourcePoolSnapshotResponse) GetResourcePoolSnapshot() (res CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType) { + res, _ = o.GetResourcePoolSnapshotOk() + return +} + +// GetResourcePoolSnapshotOk returns a tuple with the ResourcePoolSnapshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolSnapshotResponse) GetResourcePoolSnapshotOk() (ret CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType, ok bool) { + return getCreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeTypeOk(o.ResourcePoolSnapshot) +} + +// HasResourcePoolSnapshot returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotResponse) HasResourcePoolSnapshot() bool { + _, ok := o.GetResourcePoolSnapshotOk() + return ok +} + +// SetResourcePoolSnapshot gets a reference to the given CreateResourcePoolSnapshotResponseResourcePoolSnapshot and assigns it to the ResourcePoolSnapshot field. +func (o *CreateResourcePoolSnapshotResponse) SetResourcePoolSnapshot(v CreateResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType) { + setCreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType(&o.ResourcePoolSnapshot, v) +} + +func (o CreateResourcePoolSnapshotResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeTypeOk(o.ResourcePoolSnapshot); ok { + toSerialize["ResourcePoolSnapshot"] = val + } + return toSerialize, nil +} + +type NullableCreateResourcePoolSnapshotResponse struct { + value *CreateResourcePoolSnapshotResponse + isSet bool +} + +func (v NullableCreateResourcePoolSnapshotResponse) Get() *CreateResourcePoolSnapshotResponse { + return v.value +} + +func (v *NullableCreateResourcePoolSnapshotResponse) Set(val *CreateResourcePoolSnapshotResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateResourcePoolSnapshotResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateResourcePoolSnapshotResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateResourcePoolSnapshotResponse(val *CreateResourcePoolSnapshotResponse) *NullableCreateResourcePoolSnapshotResponse { + return &NullableCreateResourcePoolSnapshotResponse{value: val, isSet: true} +} + +func (v NullableCreateResourcePoolSnapshotResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateResourcePoolSnapshotResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot.go b/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot.go new file mode 100644 index 000000000..d1e16f475 --- /dev/null +++ b/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot.go @@ -0,0 +1,388 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the CreateResourcePoolSnapshotResponseResourcePoolSnapshot type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateResourcePoolSnapshotResponseResourcePoolSnapshot{} + +/* + types and functions for comment +*/ + +// isNullableString +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType = *NullableString + +func getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeTypeOk(arg CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType) (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType(arg *CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType, val CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentArgType = *string +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType = *string + +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType = *time.Time +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtArgType = time.Time +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType = time.Time + +func getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeTypeOk(arg CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType) (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType(arg *CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType, val CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for logicalSizeGigabytes +*/ + +// isInteger +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType = *int64 +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesArgType = int64 +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType = int64 + +func getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(arg CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType) (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType(arg *CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType, val CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + *arg = &val +} + +/* + types and functions for resourcePoolId +*/ + +// isNotNullableString +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType = *string + +func getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(arg CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType) (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType(arg *CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType, val CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType) { + *arg = &val +} + +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdArgType = string +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType = string + +/* + types and functions for sizeGigabytes +*/ + +// isInteger +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType = *int64 +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesArgType = int64 +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType = int64 + +func getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(arg CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType) (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType(arg *CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType, val CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType) { + *arg = &val +} + +/* + types and functions for snapshotName +*/ + +// isNotNullableString +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType = *string + +func getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(arg CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType) (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType(arg *CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType, val CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType) { + *arg = &val +} + +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameArgType = string +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType = string + +// CreateResourcePoolSnapshotResponseResourcePoolSnapshot Created Resource Pool Snapshot +type CreateResourcePoolSnapshotResponseResourcePoolSnapshot struct { + // (optional) A comment to add more information about a snapshot + Comment CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType `json:"comment,omitempty"` + CreatedAt CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // Represents the user-visible data size at the time of the snapshot in Gibibytes (e.g. what’s in the snapshot) + // Can be cast to int32 without loss of precision. + LogicalSizeGigabytes CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType `json:"logicalSizeGigabytes,omitempty"` + // ID of the Resource Pool of the Snapshot + ResourcePoolId CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType `json:"resourcePoolId,omitempty"` + // Reflects the actual storage footprint in the backend at snapshot time in Gibibytes (e.g. how much storage from the Resource Pool does it use). + // Can be cast to int32 without loss of precision. + SizeGigabytes CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // Name of the Resource Pool Snapshot + SnapshotName CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType `json:"snapshotName,omitempty"` +} + +// NewCreateResourcePoolSnapshotResponseResourcePoolSnapshot instantiates a new CreateResourcePoolSnapshotResponseResourcePoolSnapshot object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateResourcePoolSnapshotResponseResourcePoolSnapshot() *CreateResourcePoolSnapshotResponseResourcePoolSnapshot { + this := CreateResourcePoolSnapshotResponseResourcePoolSnapshot{} + return &this +} + +// NewCreateResourcePoolSnapshotResponseResourcePoolSnapshotWithDefaults instantiates a new CreateResourcePoolSnapshotResponseResourcePoolSnapshot object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateResourcePoolSnapshotResponseResourcePoolSnapshotWithDefaults() *CreateResourcePoolSnapshotResponseResourcePoolSnapshot { + this := CreateResourcePoolSnapshotResponseResourcePoolSnapshot{} + return &this +} + +// GetComment returns the Comment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetComment() (res CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType) { + res, _ = o.GetCommentOk() + return +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetCommentOk() (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType, ok bool) { + return getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeTypeOk(o.Comment) +} + +// HasComment returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) HasComment() bool { + _, ok := o.GetCommentOk() + return ok +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetComment(v CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType) { + setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType(&o.Comment, v) +} + +// SetCommentNil sets the value for Comment to be an explicit nil +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetCommentNil() { + o.Comment = nil +} + +// UnsetComment ensures that no value is present for Comment, not even an explicit nil +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) UnsetComment() { + o.Comment = nil +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetCreatedAt() (res CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetCreatedAtOk() (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType, ok bool) { + return getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetCreatedAt(v CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType) { + setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetLogicalSizeGigabytes returns the LogicalSizeGigabytes field value if set, zero value otherwise. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetLogicalSizeGigabytes() (res CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + res, _ = o.GetLogicalSizeGigabytesOk() + return +} + +// GetLogicalSizeGigabytesOk returns a tuple with the LogicalSizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetLogicalSizeGigabytesOk() (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType, ok bool) { + return getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(o.LogicalSizeGigabytes) +} + +// HasLogicalSizeGigabytes returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) HasLogicalSizeGigabytes() bool { + _, ok := o.GetLogicalSizeGigabytesOk() + return ok +} + +// SetLogicalSizeGigabytes gets a reference to the given int64 and assigns it to the LogicalSizeGigabytes field. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetLogicalSizeGigabytes(v CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType(&o.LogicalSizeGigabytes, v) +} + +// GetResourcePoolId returns the ResourcePoolId field value if set, zero value otherwise. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetResourcePoolId() (res CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType) { + res, _ = o.GetResourcePoolIdOk() + return +} + +// GetResourcePoolIdOk returns a tuple with the ResourcePoolId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetResourcePoolIdOk() (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType, ok bool) { + return getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(o.ResourcePoolId) +} + +// HasResourcePoolId returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) HasResourcePoolId() bool { + _, ok := o.GetResourcePoolIdOk() + return ok +} + +// SetResourcePoolId gets a reference to the given string and assigns it to the ResourcePoolId field. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetResourcePoolId(v CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType) { + setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType(&o.ResourcePoolId, v) +} + +// GetSizeGigabytes returns the SizeGigabytes field value if set, zero value otherwise. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetSizeGigabytes() (res CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType) { + res, _ = o.GetSizeGigabytesOk() + return +} + +// GetSizeGigabytesOk returns a tuple with the SizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetSizeGigabytesOk() (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType, ok bool) { + return getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes) +} + +// HasSizeGigabytes returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) HasSizeGigabytes() bool { + _, ok := o.GetSizeGigabytesOk() + return ok +} + +// SetSizeGigabytes gets a reference to the given int64 and assigns it to the SizeGigabytes field. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetSizeGigabytes(v CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType) { + setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) +} + +// GetSnapshotName returns the SnapshotName field value if set, zero value otherwise. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnapshotName() (res CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType) { + res, _ = o.GetSnapshotNameOk() + return +} + +// GetSnapshotNameOk returns a tuple with the SnapshotName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnapshotNameOk() (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType, ok bool) { + return getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName) +} + +// HasSnapshotName returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) HasSnapshotName() bool { + _, ok := o.GetSnapshotNameOk() + return ok +} + +// SetSnapshotName gets a reference to the given string and assigns it to the SnapshotName field. +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetSnapshotName(v CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType) { + setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType(&o.SnapshotName, v) +} + +func (o CreateResourcePoolSnapshotResponseResourcePoolSnapshot) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeTypeOk(o.Comment); ok { + toSerialize["Comment"] = val + } + if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(o.LogicalSizeGigabytes); ok { + toSerialize["LogicalSizeGigabytes"] = val + } + if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(o.ResourcePoolId); ok { + toSerialize["ResourcePoolId"] = val + } + if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { + toSerialize["SizeGigabytes"] = val + } + if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName); ok { + toSerialize["SnapshotName"] = val + } + return toSerialize, nil +} + +type NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot struct { + value *CreateResourcePoolSnapshotResponseResourcePoolSnapshot + isSet bool +} + +func (v NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot) Get() *CreateResourcePoolSnapshotResponseResourcePoolSnapshot { + return v.value +} + +func (v *NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot) Set(val *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) { + v.value = val + v.isSet = true +} + +func (v NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot(val *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) *NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot { + return &NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot{value: val, isSet: true} +} + +func (v NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateResourcePoolSnapshotResponseResourcePoolSnapshot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot_test.go b/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_resource_pool_snapshot_response_test.go b/services/sfs/model_create_resource_pool_snapshot_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_resource_pool_snapshot_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_share_export_policy_payload.go b/services/sfs/model_create_share_export_policy_payload.go new file mode 100644 index 000000000..a56d58276 --- /dev/null +++ b/services/sfs/model_create_share_export_policy_payload.go @@ -0,0 +1,225 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateShareExportPolicyPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateShareExportPolicyPayload{} + +/* + types and functions for labels +*/ + +// isContainer +type CreateShareExportPolicyPayloadGetLabelsAttributeType = *map[string]string +type CreateShareExportPolicyPayloadGetLabelsArgType = map[string]string +type CreateShareExportPolicyPayloadGetLabelsRetType = map[string]string + +func getCreateShareExportPolicyPayloadGetLabelsAttributeTypeOk(arg CreateShareExportPolicyPayloadGetLabelsAttributeType) (ret CreateShareExportPolicyPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyPayloadGetLabelsAttributeType(arg *CreateShareExportPolicyPayloadGetLabelsAttributeType, val CreateShareExportPolicyPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateShareExportPolicyPayloadGetNameAttributeType = *string + +func getCreateShareExportPolicyPayloadGetNameAttributeTypeOk(arg CreateShareExportPolicyPayloadGetNameAttributeType) (ret CreateShareExportPolicyPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyPayloadGetNameAttributeType(arg *CreateShareExportPolicyPayloadGetNameAttributeType, val CreateShareExportPolicyPayloadGetNameRetType) { + *arg = &val +} + +type CreateShareExportPolicyPayloadGetNameArgType = string +type CreateShareExportPolicyPayloadGetNameRetType = string + +/* + types and functions for rules +*/ + +// isArray +type CreateShareExportPolicyPayloadGetRulesAttributeType = *[]CreateShareExportPolicyRequestRule +type CreateShareExportPolicyPayloadGetRulesArgType = []CreateShareExportPolicyRequestRule +type CreateShareExportPolicyPayloadGetRulesRetType = []CreateShareExportPolicyRequestRule + +func getCreateShareExportPolicyPayloadGetRulesAttributeTypeOk(arg CreateShareExportPolicyPayloadGetRulesAttributeType) (ret CreateShareExportPolicyPayloadGetRulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyPayloadGetRulesAttributeType(arg *CreateShareExportPolicyPayloadGetRulesAttributeType, val CreateShareExportPolicyPayloadGetRulesRetType) { + *arg = &val +} + +// CreateShareExportPolicyPayload struct for CreateShareExportPolicyPayload +type CreateShareExportPolicyPayload struct { + // An optional object that represents the labels associated with the share export policy keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels CreateShareExportPolicyPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // Name of the Share Export Policy + Name CreateShareExportPolicyPayloadGetNameAttributeType `json:"name,omitempty"` + // List of rules of the Share Export Policy. The order of the rules within the array does not matter - what matters is the field \"order\" within each rule + Rules CreateShareExportPolicyPayloadGetRulesAttributeType `json:"rules,omitempty"` +} + +// NewCreateShareExportPolicyPayload instantiates a new CreateShareExportPolicyPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateShareExportPolicyPayload() *CreateShareExportPolicyPayload { + this := CreateShareExportPolicyPayload{} + return &this +} + +// NewCreateShareExportPolicyPayloadWithDefaults instantiates a new CreateShareExportPolicyPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateShareExportPolicyPayloadWithDefaults() *CreateShareExportPolicyPayload { + this := CreateShareExportPolicyPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateShareExportPolicyPayload) GetLabels() (res CreateShareExportPolicyPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *CreateShareExportPolicyPayload) GetLabelsOk() (ret CreateShareExportPolicyPayloadGetLabelsRetType, ok bool) { + return getCreateShareExportPolicyPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateShareExportPolicyPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateShareExportPolicyPayload) SetLabels(v CreateShareExportPolicyPayloadGetLabelsRetType) { + setCreateShareExportPolicyPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateShareExportPolicyPayload) GetName() (res CreateShareExportPolicyPayloadGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *CreateShareExportPolicyPayload) GetNameOk() (ret CreateShareExportPolicyPayloadGetNameRetType, ok bool) { + return getCreateShareExportPolicyPayloadGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *CreateShareExportPolicyPayload) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateShareExportPolicyPayload) SetName(v CreateShareExportPolicyPayloadGetNameRetType) { + setCreateShareExportPolicyPayloadGetNameAttributeType(&o.Name, v) +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *CreateShareExportPolicyPayload) GetRules() (res CreateShareExportPolicyPayloadGetRulesRetType) { + res, _ = o.GetRulesOk() + return +} + +// 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 *CreateShareExportPolicyPayload) GetRulesOk() (ret CreateShareExportPolicyPayloadGetRulesRetType, ok bool) { + return getCreateShareExportPolicyPayloadGetRulesAttributeTypeOk(o.Rules) +} + +// HasRules returns a boolean if a field has been set. +func (o *CreateShareExportPolicyPayload) HasRules() bool { + _, ok := o.GetRulesOk() + return ok +} + +// SetRules gets a reference to the given []CreateShareExportPolicyRequestRule and assigns it to the Rules field. +func (o *CreateShareExportPolicyPayload) SetRules(v CreateShareExportPolicyPayloadGetRulesRetType) { + setCreateShareExportPolicyPayloadGetRulesAttributeType(&o.Rules, v) +} + +func (o CreateShareExportPolicyPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateShareExportPolicyPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateShareExportPolicyPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateShareExportPolicyPayloadGetRulesAttributeTypeOk(o.Rules); ok { + toSerialize["Rules"] = val + } + return toSerialize, nil +} + +type NullableCreateShareExportPolicyPayload struct { + value *CreateShareExportPolicyPayload + isSet bool +} + +func (v NullableCreateShareExportPolicyPayload) Get() *CreateShareExportPolicyPayload { + return v.value +} + +func (v *NullableCreateShareExportPolicyPayload) Set(val *CreateShareExportPolicyPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateShareExportPolicyPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateShareExportPolicyPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateShareExportPolicyPayload(val *CreateShareExportPolicyPayload) *NullableCreateShareExportPolicyPayload { + return &NullableCreateShareExportPolicyPayload{value: val, isSet: true} +} + +func (v NullableCreateShareExportPolicyPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateShareExportPolicyPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_share_export_policy_payload_test.go b/services/sfs/model_create_share_export_policy_payload_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_share_export_policy_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_share_export_policy_request_rule.go b/services/sfs/model_create_share_export_policy_request_rule.go new file mode 100644 index 000000000..2e06972dd --- /dev/null +++ b/services/sfs/model_create_share_export_policy_request_rule.go @@ -0,0 +1,391 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateShareExportPolicyRequestRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateShareExportPolicyRequestRule{} + +/* + types and functions for description +*/ + +// isNullableString +type CreateShareExportPolicyRequestRuleGetDescriptionAttributeType = *NullableString + +func getCreateShareExportPolicyRequestRuleGetDescriptionAttributeTypeOk(arg CreateShareExportPolicyRequestRuleGetDescriptionAttributeType) (ret CreateShareExportPolicyRequestRuleGetDescriptionRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreateShareExportPolicyRequestRuleGetDescriptionAttributeType(arg *CreateShareExportPolicyRequestRuleGetDescriptionAttributeType, val CreateShareExportPolicyRequestRuleGetDescriptionRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreateShareExportPolicyRequestRuleGetDescriptionArgType = *string +type CreateShareExportPolicyRequestRuleGetDescriptionRetType = *string + +/* + types and functions for ipAcl +*/ + +// isArray +type CreateShareExportPolicyRequestRuleGetIpAclAttributeType = *[]string +type CreateShareExportPolicyRequestRuleGetIpAclArgType = []string +type CreateShareExportPolicyRequestRuleGetIpAclRetType = []string + +func getCreateShareExportPolicyRequestRuleGetIpAclAttributeTypeOk(arg CreateShareExportPolicyRequestRuleGetIpAclAttributeType) (ret CreateShareExportPolicyRequestRuleGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyRequestRuleGetIpAclAttributeType(arg *CreateShareExportPolicyRequestRuleGetIpAclAttributeType, val CreateShareExportPolicyRequestRuleGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for order +*/ + +// isInteger +type CreateShareExportPolicyRequestRuleGetOrderAttributeType = *int64 +type CreateShareExportPolicyRequestRuleGetOrderArgType = int64 +type CreateShareExportPolicyRequestRuleGetOrderRetType = int64 + +func getCreateShareExportPolicyRequestRuleGetOrderAttributeTypeOk(arg CreateShareExportPolicyRequestRuleGetOrderAttributeType) (ret CreateShareExportPolicyRequestRuleGetOrderRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyRequestRuleGetOrderAttributeType(arg *CreateShareExportPolicyRequestRuleGetOrderAttributeType, val CreateShareExportPolicyRequestRuleGetOrderRetType) { + *arg = &val +} + +/* + types and functions for readOnly +*/ + +// isBoolean +type CreateShareExportPolicyRequestRulegetReadOnlyAttributeType = *bool +type CreateShareExportPolicyRequestRulegetReadOnlyArgType = bool +type CreateShareExportPolicyRequestRulegetReadOnlyRetType = bool + +func getCreateShareExportPolicyRequestRulegetReadOnlyAttributeTypeOk(arg CreateShareExportPolicyRequestRulegetReadOnlyAttributeType) (ret CreateShareExportPolicyRequestRulegetReadOnlyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyRequestRulegetReadOnlyAttributeType(arg *CreateShareExportPolicyRequestRulegetReadOnlyAttributeType, val CreateShareExportPolicyRequestRulegetReadOnlyRetType) { + *arg = &val +} + +/* + types and functions for setUuid +*/ + +// isBoolean +type CreateShareExportPolicyRequestRulegetSetUuidAttributeType = *bool +type CreateShareExportPolicyRequestRulegetSetUuidArgType = bool +type CreateShareExportPolicyRequestRulegetSetUuidRetType = bool + +func getCreateShareExportPolicyRequestRulegetSetUuidAttributeTypeOk(arg CreateShareExportPolicyRequestRulegetSetUuidAttributeType) (ret CreateShareExportPolicyRequestRulegetSetUuidRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyRequestRulegetSetUuidAttributeType(arg *CreateShareExportPolicyRequestRulegetSetUuidAttributeType, val CreateShareExportPolicyRequestRulegetSetUuidRetType) { + *arg = &val +} + +/* + types and functions for superUser +*/ + +// isBoolean +type CreateShareExportPolicyRequestRulegetSuperUserAttributeType = *bool +type CreateShareExportPolicyRequestRulegetSuperUserArgType = bool +type CreateShareExportPolicyRequestRulegetSuperUserRetType = bool + +func getCreateShareExportPolicyRequestRulegetSuperUserAttributeTypeOk(arg CreateShareExportPolicyRequestRulegetSuperUserAttributeType) (ret CreateShareExportPolicyRequestRulegetSuperUserRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyRequestRulegetSuperUserAttributeType(arg *CreateShareExportPolicyRequestRulegetSuperUserAttributeType, val CreateShareExportPolicyRequestRulegetSuperUserRetType) { + *arg = &val +} + +// CreateShareExportPolicyRequestRule struct for CreateShareExportPolicyRequestRule +type CreateShareExportPolicyRequestRule struct { + // Description of the Rule (optional) + Description CreateShareExportPolicyRequestRuleGetDescriptionAttributeType `json:"description,omitempty"` + // IP access control list, where IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.250/32\" for a specific IP) This array cannot be empty + IpAcl CreateShareExportPolicyRequestRuleGetIpAclAttributeType `json:"ipAcl,omitempty"` + // Order of the rule within a Share Export Policy. The order is used so that when a client IP matches multiple rules, the first rule is applied This field must be set + // Can be cast to int32 without loss of precision. + Order CreateShareExportPolicyRequestRuleGetOrderAttributeType `json:"order,omitempty"` + // Flag to indicate if client IPs matching this rule can only mount the share in read only mode Default: false + ReadOnly CreateShareExportPolicyRequestRulegetReadOnlyAttributeType `json:"readOnly,omitempty"` + // Flag to honor set UUID Default: false + SetUuid CreateShareExportPolicyRequestRulegetSetUuidAttributeType `json:"setUuid,omitempty"` + // Flag to indicate if client IPs matching this rule have root access on the Share Default: true + SuperUser CreateShareExportPolicyRequestRulegetSuperUserAttributeType `json:"superUser,omitempty"` +} + +// NewCreateShareExportPolicyRequestRule instantiates a new CreateShareExportPolicyRequestRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateShareExportPolicyRequestRule() *CreateShareExportPolicyRequestRule { + this := CreateShareExportPolicyRequestRule{} + return &this +} + +// NewCreateShareExportPolicyRequestRuleWithDefaults instantiates a new CreateShareExportPolicyRequestRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateShareExportPolicyRequestRuleWithDefaults() *CreateShareExportPolicyRequestRule { + this := CreateShareExportPolicyRequestRule{} + var readOnly bool = false + this.ReadOnly = &readOnly + var setUuid bool = false + this.SetUuid = &setUuid + var superUser bool = true + this.SuperUser = &superUser + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateShareExportPolicyRequestRule) GetDescription() (res CreateShareExportPolicyRequestRuleGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateShareExportPolicyRequestRule) GetDescriptionOk() (ret CreateShareExportPolicyRequestRuleGetDescriptionRetType, ok bool) { + return getCreateShareExportPolicyRequestRuleGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateShareExportPolicyRequestRule) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateShareExportPolicyRequestRule) SetDescription(v CreateShareExportPolicyRequestRuleGetDescriptionRetType) { + setCreateShareExportPolicyRequestRuleGetDescriptionAttributeType(&o.Description, v) +} + +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *CreateShareExportPolicyRequestRule) SetDescriptionNil() { + o.Description = nil +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *CreateShareExportPolicyRequestRule) UnsetDescription() { + o.Description = nil +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *CreateShareExportPolicyRequestRule) GetIpAcl() (res CreateShareExportPolicyRequestRuleGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareExportPolicyRequestRule) GetIpAclOk() (ret CreateShareExportPolicyRequestRuleGetIpAclRetType, ok bool) { + return getCreateShareExportPolicyRequestRuleGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *CreateShareExportPolicyRequestRule) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *CreateShareExportPolicyRequestRule) SetIpAcl(v CreateShareExportPolicyRequestRuleGetIpAclRetType) { + setCreateShareExportPolicyRequestRuleGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *CreateShareExportPolicyRequestRule) GetOrder() (res CreateShareExportPolicyRequestRuleGetOrderRetType) { + res, _ = o.GetOrderOk() + return +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareExportPolicyRequestRule) GetOrderOk() (ret CreateShareExportPolicyRequestRuleGetOrderRetType, ok bool) { + return getCreateShareExportPolicyRequestRuleGetOrderAttributeTypeOk(o.Order) +} + +// HasOrder returns a boolean if a field has been set. +func (o *CreateShareExportPolicyRequestRule) HasOrder() bool { + _, ok := o.GetOrderOk() + return ok +} + +// SetOrder gets a reference to the given int64 and assigns it to the Order field. +func (o *CreateShareExportPolicyRequestRule) SetOrder(v CreateShareExportPolicyRequestRuleGetOrderRetType) { + setCreateShareExportPolicyRequestRuleGetOrderAttributeType(&o.Order, v) +} + +// GetReadOnly returns the ReadOnly field value if set, zero value otherwise. +func (o *CreateShareExportPolicyRequestRule) GetReadOnly() (res CreateShareExportPolicyRequestRulegetReadOnlyRetType) { + res, _ = o.GetReadOnlyOk() + return +} + +// GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareExportPolicyRequestRule) GetReadOnlyOk() (ret CreateShareExportPolicyRequestRulegetReadOnlyRetType, ok bool) { + return getCreateShareExportPolicyRequestRulegetReadOnlyAttributeTypeOk(o.ReadOnly) +} + +// HasReadOnly returns a boolean if a field has been set. +func (o *CreateShareExportPolicyRequestRule) HasReadOnly() bool { + _, ok := o.GetReadOnlyOk() + return ok +} + +// SetReadOnly gets a reference to the given bool and assigns it to the ReadOnly field. +func (o *CreateShareExportPolicyRequestRule) SetReadOnly(v CreateShareExportPolicyRequestRulegetReadOnlyRetType) { + setCreateShareExportPolicyRequestRulegetReadOnlyAttributeType(&o.ReadOnly, v) +} + +// GetSetUuid returns the SetUuid field value if set, zero value otherwise. +func (o *CreateShareExportPolicyRequestRule) GetSetUuid() (res CreateShareExportPolicyRequestRulegetSetUuidRetType) { + res, _ = o.GetSetUuidOk() + return +} + +// GetSetUuidOk returns a tuple with the SetUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareExportPolicyRequestRule) GetSetUuidOk() (ret CreateShareExportPolicyRequestRulegetSetUuidRetType, ok bool) { + return getCreateShareExportPolicyRequestRulegetSetUuidAttributeTypeOk(o.SetUuid) +} + +// HasSetUuid returns a boolean if a field has been set. +func (o *CreateShareExportPolicyRequestRule) HasSetUuid() bool { + _, ok := o.GetSetUuidOk() + return ok +} + +// SetSetUuid gets a reference to the given bool and assigns it to the SetUuid field. +func (o *CreateShareExportPolicyRequestRule) SetSetUuid(v CreateShareExportPolicyRequestRulegetSetUuidRetType) { + setCreateShareExportPolicyRequestRulegetSetUuidAttributeType(&o.SetUuid, v) +} + +// GetSuperUser returns the SuperUser field value if set, zero value otherwise. +func (o *CreateShareExportPolicyRequestRule) GetSuperUser() (res CreateShareExportPolicyRequestRulegetSuperUserRetType) { + res, _ = o.GetSuperUserOk() + return +} + +// GetSuperUserOk returns a tuple with the SuperUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareExportPolicyRequestRule) GetSuperUserOk() (ret CreateShareExportPolicyRequestRulegetSuperUserRetType, ok bool) { + return getCreateShareExportPolicyRequestRulegetSuperUserAttributeTypeOk(o.SuperUser) +} + +// HasSuperUser returns a boolean if a field has been set. +func (o *CreateShareExportPolicyRequestRule) HasSuperUser() bool { + _, ok := o.GetSuperUserOk() + return ok +} + +// SetSuperUser gets a reference to the given bool and assigns it to the SuperUser field. +func (o *CreateShareExportPolicyRequestRule) SetSuperUser(v CreateShareExportPolicyRequestRulegetSuperUserRetType) { + setCreateShareExportPolicyRequestRulegetSuperUserAttributeType(&o.SuperUser, v) +} + +func (o CreateShareExportPolicyRequestRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateShareExportPolicyRequestRuleGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getCreateShareExportPolicyRequestRuleGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getCreateShareExportPolicyRequestRuleGetOrderAttributeTypeOk(o.Order); ok { + toSerialize["Order"] = val + } + if val, ok := getCreateShareExportPolicyRequestRulegetReadOnlyAttributeTypeOk(o.ReadOnly); ok { + toSerialize["ReadOnly"] = val + } + if val, ok := getCreateShareExportPolicyRequestRulegetSetUuidAttributeTypeOk(o.SetUuid); ok { + toSerialize["SetUuid"] = val + } + if val, ok := getCreateShareExportPolicyRequestRulegetSuperUserAttributeTypeOk(o.SuperUser); ok { + toSerialize["SuperUser"] = val + } + return toSerialize, nil +} + +type NullableCreateShareExportPolicyRequestRule struct { + value *CreateShareExportPolicyRequestRule + isSet bool +} + +func (v NullableCreateShareExportPolicyRequestRule) Get() *CreateShareExportPolicyRequestRule { + return v.value +} + +func (v *NullableCreateShareExportPolicyRequestRule) Set(val *CreateShareExportPolicyRequestRule) { + v.value = val + v.isSet = true +} + +func (v NullableCreateShareExportPolicyRequestRule) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateShareExportPolicyRequestRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateShareExportPolicyRequestRule(val *CreateShareExportPolicyRequestRule) *NullableCreateShareExportPolicyRequestRule { + return &NullableCreateShareExportPolicyRequestRule{value: val, isSet: true} +} + +func (v NullableCreateShareExportPolicyRequestRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateShareExportPolicyRequestRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_share_export_policy_request_rule_test.go b/services/sfs/model_create_share_export_policy_request_rule_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_share_export_policy_request_rule_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_share_export_policy_response.go b/services/sfs/model_create_share_export_policy_response.go new file mode 100644 index 000000000..8294cfc58 --- /dev/null +++ b/services/sfs/model_create_share_export_policy_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateShareExportPolicyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateShareExportPolicyResponse{} + +/* + types and functions for shareExportPolicy +*/ + +// isModel +type CreateShareExportPolicyResponseGetShareExportPolicyAttributeType = *CreateShareExportPolicyResponseShareExportPolicy +type CreateShareExportPolicyResponseGetShareExportPolicyArgType = CreateShareExportPolicyResponseShareExportPolicy +type CreateShareExportPolicyResponseGetShareExportPolicyRetType = CreateShareExportPolicyResponseShareExportPolicy + +func getCreateShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(arg CreateShareExportPolicyResponseGetShareExportPolicyAttributeType) (ret CreateShareExportPolicyResponseGetShareExportPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyResponseGetShareExportPolicyAttributeType(arg *CreateShareExportPolicyResponseGetShareExportPolicyAttributeType, val CreateShareExportPolicyResponseGetShareExportPolicyRetType) { + *arg = &val +} + +// CreateShareExportPolicyResponse struct for CreateShareExportPolicyResponse +type CreateShareExportPolicyResponse struct { + ShareExportPolicy CreateShareExportPolicyResponseGetShareExportPolicyAttributeType `json:"shareExportPolicy,omitempty"` +} + +// NewCreateShareExportPolicyResponse instantiates a new CreateShareExportPolicyResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateShareExportPolicyResponse() *CreateShareExportPolicyResponse { + this := CreateShareExportPolicyResponse{} + return &this +} + +// NewCreateShareExportPolicyResponseWithDefaults instantiates a new CreateShareExportPolicyResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateShareExportPolicyResponseWithDefaults() *CreateShareExportPolicyResponse { + this := CreateShareExportPolicyResponse{} + return &this +} + +// GetShareExportPolicy returns the ShareExportPolicy field value if set, zero value otherwise. +func (o *CreateShareExportPolicyResponse) GetShareExportPolicy() (res CreateShareExportPolicyResponseGetShareExportPolicyRetType) { + res, _ = o.GetShareExportPolicyOk() + return +} + +// GetShareExportPolicyOk returns a tuple with the ShareExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareExportPolicyResponse) GetShareExportPolicyOk() (ret CreateShareExportPolicyResponseGetShareExportPolicyRetType, ok bool) { + return getCreateShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(o.ShareExportPolicy) +} + +// HasShareExportPolicy returns a boolean if a field has been set. +func (o *CreateShareExportPolicyResponse) HasShareExportPolicy() bool { + _, ok := o.GetShareExportPolicyOk() + return ok +} + +// SetShareExportPolicy gets a reference to the given CreateShareExportPolicyResponseShareExportPolicy and assigns it to the ShareExportPolicy field. +func (o *CreateShareExportPolicyResponse) SetShareExportPolicy(v CreateShareExportPolicyResponseGetShareExportPolicyRetType) { + setCreateShareExportPolicyResponseGetShareExportPolicyAttributeType(&o.ShareExportPolicy, v) +} + +func (o CreateShareExportPolicyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(o.ShareExportPolicy); ok { + toSerialize["ShareExportPolicy"] = val + } + return toSerialize, nil +} + +type NullableCreateShareExportPolicyResponse struct { + value *CreateShareExportPolicyResponse + isSet bool +} + +func (v NullableCreateShareExportPolicyResponse) Get() *CreateShareExportPolicyResponse { + return v.value +} + +func (v *NullableCreateShareExportPolicyResponse) Set(val *CreateShareExportPolicyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateShareExportPolicyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateShareExportPolicyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateShareExportPolicyResponse(val *CreateShareExportPolicyResponse) *NullableCreateShareExportPolicyResponse { + return &NullableCreateShareExportPolicyResponse{value: val, isSet: true} +} + +func (v NullableCreateShareExportPolicyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateShareExportPolicyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_share_export_policy_response_share_export_policy.go b/services/sfs/model_create_share_export_policy_response_share_export_policy.go new file mode 100644 index 000000000..b81720ceb --- /dev/null +++ b/services/sfs/model_create_share_export_policy_response_share_export_policy.go @@ -0,0 +1,371 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the CreateShareExportPolicyResponseShareExportPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateShareExportPolicyResponseShareExportPolicy{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType = *time.Time +type CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtArgType = time.Time +type CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType = time.Time + +func getCreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeTypeOk(arg CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType) (ret CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType(arg *CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType, val CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateShareExportPolicyResponseShareExportPolicyGetIdAttributeType = *string + +func getCreateShareExportPolicyResponseShareExportPolicyGetIdAttributeTypeOk(arg CreateShareExportPolicyResponseShareExportPolicyGetIdAttributeType) (ret CreateShareExportPolicyResponseShareExportPolicyGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyResponseShareExportPolicyGetIdAttributeType(arg *CreateShareExportPolicyResponseShareExportPolicyGetIdAttributeType, val CreateShareExportPolicyResponseShareExportPolicyGetIdRetType) { + *arg = &val +} + +type CreateShareExportPolicyResponseShareExportPolicyGetIdArgType = string +type CreateShareExportPolicyResponseShareExportPolicyGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type CreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType = *map[string]string +type CreateShareExportPolicyResponseShareExportPolicyGetLabelsArgType = map[string]string +type CreateShareExportPolicyResponseShareExportPolicyGetLabelsRetType = map[string]string + +func getCreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeTypeOk(arg CreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType) (ret CreateShareExportPolicyResponseShareExportPolicyGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType(arg *CreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType, val CreateShareExportPolicyResponseShareExportPolicyGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateShareExportPolicyResponseShareExportPolicyGetNameAttributeType = *string + +func getCreateShareExportPolicyResponseShareExportPolicyGetNameAttributeTypeOk(arg CreateShareExportPolicyResponseShareExportPolicyGetNameAttributeType) (ret CreateShareExportPolicyResponseShareExportPolicyGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyResponseShareExportPolicyGetNameAttributeType(arg *CreateShareExportPolicyResponseShareExportPolicyGetNameAttributeType, val CreateShareExportPolicyResponseShareExportPolicyGetNameRetType) { + *arg = &val +} + +type CreateShareExportPolicyResponseShareExportPolicyGetNameArgType = string +type CreateShareExportPolicyResponseShareExportPolicyGetNameRetType = string + +/* + types and functions for rules +*/ + +// isArray +type CreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeType = *[]ShareExportPolicyRule +type CreateShareExportPolicyResponseShareExportPolicyGetRulesArgType = []ShareExportPolicyRule +type CreateShareExportPolicyResponseShareExportPolicyGetRulesRetType = []ShareExportPolicyRule + +func getCreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeTypeOk(arg CreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeType) (ret CreateShareExportPolicyResponseShareExportPolicyGetRulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeType(arg *CreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeType, val CreateShareExportPolicyResponseShareExportPolicyGetRulesRetType) { + *arg = &val +} + +/* + types and functions for sharesUsingExportPolicy +*/ + +// isInteger +type CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType = *int64 +type CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyArgType = int64 +type CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType = int64 + +func getCreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(arg CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType) (ret CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType(arg *CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType, val CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType) { + *arg = &val +} + +// CreateShareExportPolicyResponseShareExportPolicy Created Share Export Policy +type CreateShareExportPolicyResponseShareExportPolicy struct { + CreatedAt CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Share Export Policy + Id CreateShareExportPolicyResponseShareExportPolicyGetIdAttributeType `json:"id,omitempty"` + // An optional object that represents the labels associated with the share export policy keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels CreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType `json:"labels,omitempty"` + // Name of the Share Export Policy + Name CreateShareExportPolicyResponseShareExportPolicyGetNameAttributeType `json:"name,omitempty"` + // List of rules of the Share Export Policy. The order of the rules within the array does not matter - what matters is the field \"order\" within each rule + Rules CreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeType `json:"rules,omitempty"` + // Number of Shares using this Share Export Policy + // Can be cast to int32 without loss of precision. + SharesUsingExportPolicy CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType `json:"sharesUsingExportPolicy,omitempty"` +} + +// NewCreateShareExportPolicyResponseShareExportPolicy instantiates a new CreateShareExportPolicyResponseShareExportPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateShareExportPolicyResponseShareExportPolicy() *CreateShareExportPolicyResponseShareExportPolicy { + this := CreateShareExportPolicyResponseShareExportPolicy{} + return &this +} + +// NewCreateShareExportPolicyResponseShareExportPolicyWithDefaults instantiates a new CreateShareExportPolicyResponseShareExportPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateShareExportPolicyResponseShareExportPolicyWithDefaults() *CreateShareExportPolicyResponseShareExportPolicy { + this := CreateShareExportPolicyResponseShareExportPolicy{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateShareExportPolicyResponseShareExportPolicy) GetCreatedAt() (res CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareExportPolicyResponseShareExportPolicy) GetCreatedAtOk() (ret CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType, ok bool) { + return getCreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateShareExportPolicyResponseShareExportPolicy) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateShareExportPolicyResponseShareExportPolicy) SetCreatedAt(v CreateShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType) { + setCreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateShareExportPolicyResponseShareExportPolicy) GetId() (res CreateShareExportPolicyResponseShareExportPolicyGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *CreateShareExportPolicyResponseShareExportPolicy) GetIdOk() (ret CreateShareExportPolicyResponseShareExportPolicyGetIdRetType, ok bool) { + return getCreateShareExportPolicyResponseShareExportPolicyGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *CreateShareExportPolicyResponseShareExportPolicy) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateShareExportPolicyResponseShareExportPolicy) SetId(v CreateShareExportPolicyResponseShareExportPolicyGetIdRetType) { + setCreateShareExportPolicyResponseShareExportPolicyGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateShareExportPolicyResponseShareExportPolicy) GetLabels() (res CreateShareExportPolicyResponseShareExportPolicyGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *CreateShareExportPolicyResponseShareExportPolicy) GetLabelsOk() (ret CreateShareExportPolicyResponseShareExportPolicyGetLabelsRetType, ok bool) { + return getCreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateShareExportPolicyResponseShareExportPolicy) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateShareExportPolicyResponseShareExportPolicy) SetLabels(v CreateShareExportPolicyResponseShareExportPolicyGetLabelsRetType) { + setCreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateShareExportPolicyResponseShareExportPolicy) GetName() (res CreateShareExportPolicyResponseShareExportPolicyGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *CreateShareExportPolicyResponseShareExportPolicy) GetNameOk() (ret CreateShareExportPolicyResponseShareExportPolicyGetNameRetType, ok bool) { + return getCreateShareExportPolicyResponseShareExportPolicyGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *CreateShareExportPolicyResponseShareExportPolicy) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateShareExportPolicyResponseShareExportPolicy) SetName(v CreateShareExportPolicyResponseShareExportPolicyGetNameRetType) { + setCreateShareExportPolicyResponseShareExportPolicyGetNameAttributeType(&o.Name, v) +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *CreateShareExportPolicyResponseShareExportPolicy) GetRules() (res CreateShareExportPolicyResponseShareExportPolicyGetRulesRetType) { + res, _ = o.GetRulesOk() + return +} + +// 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 *CreateShareExportPolicyResponseShareExportPolicy) GetRulesOk() (ret CreateShareExportPolicyResponseShareExportPolicyGetRulesRetType, ok bool) { + return getCreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeTypeOk(o.Rules) +} + +// HasRules returns a boolean if a field has been set. +func (o *CreateShareExportPolicyResponseShareExportPolicy) HasRules() bool { + _, ok := o.GetRulesOk() + return ok +} + +// SetRules gets a reference to the given []ShareExportPolicyRule and assigns it to the Rules field. +func (o *CreateShareExportPolicyResponseShareExportPolicy) SetRules(v CreateShareExportPolicyResponseShareExportPolicyGetRulesRetType) { + setCreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeType(&o.Rules, v) +} + +// GetSharesUsingExportPolicy returns the SharesUsingExportPolicy field value if set, zero value otherwise. +func (o *CreateShareExportPolicyResponseShareExportPolicy) GetSharesUsingExportPolicy() (res CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType) { + res, _ = o.GetSharesUsingExportPolicyOk() + return +} + +// GetSharesUsingExportPolicyOk returns a tuple with the SharesUsingExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareExportPolicyResponseShareExportPolicy) GetSharesUsingExportPolicyOk() (ret CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType, ok bool) { + return getCreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(o.SharesUsingExportPolicy) +} + +// HasSharesUsingExportPolicy returns a boolean if a field has been set. +func (o *CreateShareExportPolicyResponseShareExportPolicy) HasSharesUsingExportPolicy() bool { + _, ok := o.GetSharesUsingExportPolicyOk() + return ok +} + +// SetSharesUsingExportPolicy gets a reference to the given int64 and assigns it to the SharesUsingExportPolicy field. +func (o *CreateShareExportPolicyResponseShareExportPolicy) SetSharesUsingExportPolicy(v CreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType) { + setCreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType(&o.SharesUsingExportPolicy, v) +} + +func (o CreateShareExportPolicyResponseShareExportPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getCreateShareExportPolicyResponseShareExportPolicyGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getCreateShareExportPolicyResponseShareExportPolicyGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateShareExportPolicyResponseShareExportPolicyGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateShareExportPolicyResponseShareExportPolicyGetRulesAttributeTypeOk(o.Rules); ok { + toSerialize["Rules"] = val + } + if val, ok := getCreateShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(o.SharesUsingExportPolicy); ok { + toSerialize["SharesUsingExportPolicy"] = val + } + return toSerialize, nil +} + +type NullableCreateShareExportPolicyResponseShareExportPolicy struct { + value *CreateShareExportPolicyResponseShareExportPolicy + isSet bool +} + +func (v NullableCreateShareExportPolicyResponseShareExportPolicy) Get() *CreateShareExportPolicyResponseShareExportPolicy { + return v.value +} + +func (v *NullableCreateShareExportPolicyResponseShareExportPolicy) Set(val *CreateShareExportPolicyResponseShareExportPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableCreateShareExportPolicyResponseShareExportPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateShareExportPolicyResponseShareExportPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateShareExportPolicyResponseShareExportPolicy(val *CreateShareExportPolicyResponseShareExportPolicy) *NullableCreateShareExportPolicyResponseShareExportPolicy { + return &NullableCreateShareExportPolicyResponseShareExportPolicy{value: val, isSet: true} +} + +func (v NullableCreateShareExportPolicyResponseShareExportPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateShareExportPolicyResponseShareExportPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_share_export_policy_response_share_export_policy_test.go b/services/sfs/model_create_share_export_policy_response_share_export_policy_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_share_export_policy_response_share_export_policy_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_share_export_policy_response_test.go b/services/sfs/model_create_share_export_policy_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_share_export_policy_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_share_payload.go b/services/sfs/model_create_share_payload.go new file mode 100644 index 000000000..c28f818d5 --- /dev/null +++ b/services/sfs/model_create_share_payload.go @@ -0,0 +1,290 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSharePayload{} + +/* + types and functions for exportPolicyName +*/ + +// isNullableString +type CreateSharePayloadGetExportPolicyNameAttributeType = *NullableString + +func getCreateSharePayloadGetExportPolicyNameAttributeTypeOk(arg CreateSharePayloadGetExportPolicyNameAttributeType) (ret CreateSharePayloadGetExportPolicyNameRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreateSharePayloadGetExportPolicyNameAttributeType(arg *CreateSharePayloadGetExportPolicyNameAttributeType, val CreateSharePayloadGetExportPolicyNameRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreateSharePayloadGetExportPolicyNameArgType = *string +type CreateSharePayloadGetExportPolicyNameRetType = *string + +/* + types and functions for labels +*/ + +// isContainer +type CreateSharePayloadGetLabelsAttributeType = *map[string]string +type CreateSharePayloadGetLabelsArgType = map[string]string +type CreateSharePayloadGetLabelsRetType = map[string]string + +func getCreateSharePayloadGetLabelsAttributeTypeOk(arg CreateSharePayloadGetLabelsAttributeType) (ret CreateSharePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSharePayloadGetLabelsAttributeType(arg *CreateSharePayloadGetLabelsAttributeType, val CreateSharePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateSharePayloadGetNameAttributeType = *string + +func getCreateSharePayloadGetNameAttributeTypeOk(arg CreateSharePayloadGetNameAttributeType) (ret CreateSharePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSharePayloadGetNameAttributeType(arg *CreateSharePayloadGetNameAttributeType, val CreateSharePayloadGetNameRetType) { + *arg = &val +} + +type CreateSharePayloadGetNameArgType = string +type CreateSharePayloadGetNameRetType = string + +/* + types and functions for spaceHardLimitGigabytes +*/ + +// isInteger +type CreateSharePayloadGetSpaceHardLimitGigabytesAttributeType = *int64 +type CreateSharePayloadGetSpaceHardLimitGigabytesArgType = int64 +type CreateSharePayloadGetSpaceHardLimitGigabytesRetType = int64 + +func getCreateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(arg CreateSharePayloadGetSpaceHardLimitGigabytesAttributeType) (ret CreateSharePayloadGetSpaceHardLimitGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSharePayloadGetSpaceHardLimitGigabytesAttributeType(arg *CreateSharePayloadGetSpaceHardLimitGigabytesAttributeType, val CreateSharePayloadGetSpaceHardLimitGigabytesRetType) { + *arg = &val +} + +// CreateSharePayload struct for CreateSharePayload +type CreateSharePayload struct { + // Name of the Share Export Policy to use in the Share. Note that if this is not set, the Share can only be mounted in read only by clients with IPs matching the IP ACL of the Resource Pool hosting this Share. You can also assign a Share Export Policy after creating the Share + ExportPolicyName CreateSharePayloadGetExportPolicyNameAttributeType `json:"exportPolicyName,omitempty"` + // An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels CreateSharePayloadGetLabelsAttributeType `json:"labels,omitempty"` + // Name of the Share + Name CreateSharePayloadGetNameAttributeType `json:"name,omitempty"` + // Space hard limit for the Share. If zero, the Share will have access to the full space of the Resource Pool it lives in. (unit: gibibytes) + // Can be cast to int32 without loss of precision. + SpaceHardLimitGigabytes CreateSharePayloadGetSpaceHardLimitGigabytesAttributeType `json:"spaceHardLimitGigabytes,omitempty"` +} + +// NewCreateSharePayload instantiates a new CreateSharePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSharePayload() *CreateSharePayload { + this := CreateSharePayload{} + return &this +} + +// NewCreateSharePayloadWithDefaults instantiates a new CreateSharePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSharePayloadWithDefaults() *CreateSharePayload { + this := CreateSharePayload{} + return &this +} + +// GetExportPolicyName returns the ExportPolicyName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateSharePayload) GetExportPolicyName() (res CreateSharePayloadGetExportPolicyNameRetType) { + res, _ = o.GetExportPolicyNameOk() + return +} + +// GetExportPolicyNameOk returns a tuple with the ExportPolicyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateSharePayload) GetExportPolicyNameOk() (ret CreateSharePayloadGetExportPolicyNameRetType, ok bool) { + return getCreateSharePayloadGetExportPolicyNameAttributeTypeOk(o.ExportPolicyName) +} + +// HasExportPolicyName returns a boolean if a field has been set. +func (o *CreateSharePayload) HasExportPolicyName() bool { + _, ok := o.GetExportPolicyNameOk() + return ok +} + +// SetExportPolicyName gets a reference to the given string and assigns it to the ExportPolicyName field. +func (o *CreateSharePayload) SetExportPolicyName(v CreateSharePayloadGetExportPolicyNameRetType) { + setCreateSharePayloadGetExportPolicyNameAttributeType(&o.ExportPolicyName, v) +} + +// SetExportPolicyNameNil sets the value for ExportPolicyName to be an explicit nil +func (o *CreateSharePayload) SetExportPolicyNameNil() { + o.ExportPolicyName = nil +} + +// UnsetExportPolicyName ensures that no value is present for ExportPolicyName, not even an explicit nil +func (o *CreateSharePayload) UnsetExportPolicyName() { + o.ExportPolicyName = nil +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateSharePayload) GetLabels() (res CreateSharePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *CreateSharePayload) GetLabelsOk() (ret CreateSharePayloadGetLabelsRetType, ok bool) { + return getCreateSharePayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateSharePayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateSharePayload) SetLabels(v CreateSharePayloadGetLabelsRetType) { + setCreateSharePayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateSharePayload) GetName() (res CreateSharePayloadGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *CreateSharePayload) GetNameOk() (ret CreateSharePayloadGetNameRetType, ok bool) { + return getCreateSharePayloadGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *CreateSharePayload) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateSharePayload) SetName(v CreateSharePayloadGetNameRetType) { + setCreateSharePayloadGetNameAttributeType(&o.Name, v) +} + +// GetSpaceHardLimitGigabytes returns the SpaceHardLimitGigabytes field value if set, zero value otherwise. +func (o *CreateSharePayload) GetSpaceHardLimitGigabytes() (res CreateSharePayloadGetSpaceHardLimitGigabytesRetType) { + res, _ = o.GetSpaceHardLimitGigabytesOk() + return +} + +// GetSpaceHardLimitGigabytesOk returns a tuple with the SpaceHardLimitGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSharePayload) GetSpaceHardLimitGigabytesOk() (ret CreateSharePayloadGetSpaceHardLimitGigabytesRetType, ok bool) { + return getCreateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes) +} + +// HasSpaceHardLimitGigabytes returns a boolean if a field has been set. +func (o *CreateSharePayload) HasSpaceHardLimitGigabytes() bool { + _, ok := o.GetSpaceHardLimitGigabytesOk() + return ok +} + +// SetSpaceHardLimitGigabytes gets a reference to the given int64 and assigns it to the SpaceHardLimitGigabytes field. +func (o *CreateSharePayload) SetSpaceHardLimitGigabytes(v CreateSharePayloadGetSpaceHardLimitGigabytesRetType) { + setCreateSharePayloadGetSpaceHardLimitGigabytesAttributeType(&o.SpaceHardLimitGigabytes, v) +} + +func (o CreateSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateSharePayloadGetExportPolicyNameAttributeTypeOk(o.ExportPolicyName); ok { + toSerialize["ExportPolicyName"] = val + } + if val, ok := getCreateSharePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateSharePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes); ok { + toSerialize["SpaceHardLimitGigabytes"] = val + } + return toSerialize, nil +} + +type NullableCreateSharePayload struct { + value *CreateSharePayload + isSet bool +} + +func (v NullableCreateSharePayload) Get() *CreateSharePayload { + return v.value +} + +func (v *NullableCreateSharePayload) Set(val *CreateSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSharePayload(val *CreateSharePayload) *NullableCreateSharePayload { + return &NullableCreateSharePayload{value: val, isSet: true} +} + +func (v NullableCreateSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_share_payload_test.go b/services/sfs/model_create_share_payload_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_share_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_share_response.go b/services/sfs/model_create_share_response.go new file mode 100644 index 000000000..85dd13c5f --- /dev/null +++ b/services/sfs/model_create_share_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the CreateShareResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateShareResponse{} + +/* + types and functions for share +*/ + +// isModel +type CreateShareResponseGetShareAttributeType = *CreateShareResponseShare +type CreateShareResponseGetShareArgType = CreateShareResponseShare +type CreateShareResponseGetShareRetType = CreateShareResponseShare + +func getCreateShareResponseGetShareAttributeTypeOk(arg CreateShareResponseGetShareAttributeType) (ret CreateShareResponseGetShareRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareResponseGetShareAttributeType(arg *CreateShareResponseGetShareAttributeType, val CreateShareResponseGetShareRetType) { + *arg = &val +} + +// CreateShareResponse struct for CreateShareResponse +type CreateShareResponse struct { + Share CreateShareResponseGetShareAttributeType `json:"share,omitempty"` +} + +// NewCreateShareResponse instantiates a new CreateShareResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateShareResponse() *CreateShareResponse { + this := CreateShareResponse{} + return &this +} + +// NewCreateShareResponseWithDefaults instantiates a new CreateShareResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateShareResponseWithDefaults() *CreateShareResponse { + this := CreateShareResponse{} + return &this +} + +// GetShare returns the Share field value if set, zero value otherwise. +func (o *CreateShareResponse) GetShare() (res CreateShareResponseGetShareRetType) { + res, _ = o.GetShareOk() + return +} + +// GetShareOk returns a tuple with the Share field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareResponse) GetShareOk() (ret CreateShareResponseGetShareRetType, ok bool) { + return getCreateShareResponseGetShareAttributeTypeOk(o.Share) +} + +// HasShare returns a boolean if a field has been set. +func (o *CreateShareResponse) HasShare() bool { + _, ok := o.GetShareOk() + return ok +} + +// SetShare gets a reference to the given CreateShareResponseShare and assigns it to the Share field. +func (o *CreateShareResponse) SetShare(v CreateShareResponseGetShareRetType) { + setCreateShareResponseGetShareAttributeType(&o.Share, v) +} + +func (o CreateShareResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateShareResponseGetShareAttributeTypeOk(o.Share); ok { + toSerialize["Share"] = val + } + return toSerialize, nil +} + +type NullableCreateShareResponse struct { + value *CreateShareResponse + isSet bool +} + +func (v NullableCreateShareResponse) Get() *CreateShareResponse { + return v.value +} + +func (v *NullableCreateShareResponse) Set(val *CreateShareResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateShareResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateShareResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateShareResponse(val *CreateShareResponse) *NullableCreateShareResponse { + return &NullableCreateShareResponse{value: val, isSet: true} +} + +func (v NullableCreateShareResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateShareResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_share_response_share.go b/services/sfs/model_create_share_response_share.go new file mode 100644 index 000000000..eeba96d6c --- /dev/null +++ b/services/sfs/model_create_share_response_share.go @@ -0,0 +1,479 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the CreateShareResponseShare type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateShareResponseShare{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateShareResponseShareGetCreatedAtAttributeType = *time.Time +type CreateShareResponseShareGetCreatedAtArgType = time.Time +type CreateShareResponseShareGetCreatedAtRetType = time.Time + +func getCreateShareResponseShareGetCreatedAtAttributeTypeOk(arg CreateShareResponseShareGetCreatedAtAttributeType) (ret CreateShareResponseShareGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareResponseShareGetCreatedAtAttributeType(arg *CreateShareResponseShareGetCreatedAtAttributeType, val CreateShareResponseShareGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for exportPolicy +*/ + +// isModel +type CreateShareResponseShareGetExportPolicyAttributeType = *NullableShareExportPolicy +type CreateShareResponseShareGetExportPolicyArgType = *NullableShareExportPolicy +type CreateShareResponseShareGetExportPolicyRetType = *NullableShareExportPolicy + +func getCreateShareResponseShareGetExportPolicyAttributeTypeOk(arg CreateShareResponseShareGetExportPolicyAttributeType) (ret CreateShareResponseShareGetExportPolicyRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setCreateShareResponseShareGetExportPolicyAttributeType(arg *CreateShareResponseShareGetExportPolicyAttributeType, val CreateShareResponseShareGetExportPolicyRetType) { + *arg = val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateShareResponseShareGetIdAttributeType = *string + +func getCreateShareResponseShareGetIdAttributeTypeOk(arg CreateShareResponseShareGetIdAttributeType) (ret CreateShareResponseShareGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareResponseShareGetIdAttributeType(arg *CreateShareResponseShareGetIdAttributeType, val CreateShareResponseShareGetIdRetType) { + *arg = &val +} + +type CreateShareResponseShareGetIdArgType = string +type CreateShareResponseShareGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type CreateShareResponseShareGetLabelsAttributeType = *map[string]string +type CreateShareResponseShareGetLabelsArgType = map[string]string +type CreateShareResponseShareGetLabelsRetType = map[string]string + +func getCreateShareResponseShareGetLabelsAttributeTypeOk(arg CreateShareResponseShareGetLabelsAttributeType) (ret CreateShareResponseShareGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareResponseShareGetLabelsAttributeType(arg *CreateShareResponseShareGetLabelsAttributeType, val CreateShareResponseShareGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mountPath +*/ + +// isNotNullableString +type CreateShareResponseShareGetMountPathAttributeType = *string + +func getCreateShareResponseShareGetMountPathAttributeTypeOk(arg CreateShareResponseShareGetMountPathAttributeType) (ret CreateShareResponseShareGetMountPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareResponseShareGetMountPathAttributeType(arg *CreateShareResponseShareGetMountPathAttributeType, val CreateShareResponseShareGetMountPathRetType) { + *arg = &val +} + +type CreateShareResponseShareGetMountPathArgType = string +type CreateShareResponseShareGetMountPathRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateShareResponseShareGetNameAttributeType = *string + +func getCreateShareResponseShareGetNameAttributeTypeOk(arg CreateShareResponseShareGetNameAttributeType) (ret CreateShareResponseShareGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareResponseShareGetNameAttributeType(arg *CreateShareResponseShareGetNameAttributeType, val CreateShareResponseShareGetNameRetType) { + *arg = &val +} + +type CreateShareResponseShareGetNameArgType = string +type CreateShareResponseShareGetNameRetType = string + +/* + types and functions for spaceHardLimitGigabytes +*/ + +// isInteger +type CreateShareResponseShareGetSpaceHardLimitGigabytesAttributeType = *int64 +type CreateShareResponseShareGetSpaceHardLimitGigabytesArgType = int64 +type CreateShareResponseShareGetSpaceHardLimitGigabytesRetType = int64 + +func getCreateShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(arg CreateShareResponseShareGetSpaceHardLimitGigabytesAttributeType) (ret CreateShareResponseShareGetSpaceHardLimitGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareResponseShareGetSpaceHardLimitGigabytesAttributeType(arg *CreateShareResponseShareGetSpaceHardLimitGigabytesAttributeType, val CreateShareResponseShareGetSpaceHardLimitGigabytesRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type CreateShareResponseShareGetStateAttributeType = *string + +func getCreateShareResponseShareGetStateAttributeTypeOk(arg CreateShareResponseShareGetStateAttributeType) (ret CreateShareResponseShareGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShareResponseShareGetStateAttributeType(arg *CreateShareResponseShareGetStateAttributeType, val CreateShareResponseShareGetStateRetType) { + *arg = &val +} + +type CreateShareResponseShareGetStateArgType = string +type CreateShareResponseShareGetStateRetType = string + +// CreateShareResponseShare Created Share +type CreateShareResponseShare struct { + CreatedAt CreateShareResponseShareGetCreatedAtAttributeType `json:"createdAt,omitempty"` + ExportPolicy CreateShareResponseShareGetExportPolicyAttributeType `json:"exportPolicy,omitempty"` + // ID of the Share + Id CreateShareResponseShareGetIdAttributeType `json:"id,omitempty"` + // An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels CreateShareResponseShareGetLabelsAttributeType `json:"labels,omitempty"` + // Mount path of the Share, used to mount the Share + MountPath CreateShareResponseShareGetMountPathAttributeType `json:"mountPath,omitempty"` + // Name of the Share + Name CreateShareResponseShareGetNameAttributeType `json:"name,omitempty"` + // Space hard limit for the Share. If zero, the Share will have access to the full space of the Resource Pool it lives in. (unit: gibibytes) + // Can be cast to int32 without loss of precision. + SpaceHardLimitGigabytes CreateShareResponseShareGetSpaceHardLimitGigabytesAttributeType `json:"spaceHardLimitGigabytes,omitempty"` + // State of the Resource Pool Snapshot (possible values: [\"pending\", \"creating\", \"created\", \"error\", \"deleting\"]) + State CreateShareResponseShareGetStateAttributeType `json:"state,omitempty"` +} + +// NewCreateShareResponseShare instantiates a new CreateShareResponseShare object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateShareResponseShare() *CreateShareResponseShare { + this := CreateShareResponseShare{} + return &this +} + +// NewCreateShareResponseShareWithDefaults instantiates a new CreateShareResponseShare object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateShareResponseShareWithDefaults() *CreateShareResponseShare { + this := CreateShareResponseShare{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateShareResponseShare) GetCreatedAt() (res CreateShareResponseShareGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareResponseShare) GetCreatedAtOk() (ret CreateShareResponseShareGetCreatedAtRetType, ok bool) { + return getCreateShareResponseShareGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateShareResponseShare) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateShareResponseShare) SetCreatedAt(v CreateShareResponseShareGetCreatedAtRetType) { + setCreateShareResponseShareGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetExportPolicy returns the ExportPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateShareResponseShare) GetExportPolicy() (res CreateShareResponseShareGetExportPolicyRetType) { + res, _ = o.GetExportPolicyOk() + return +} + +// GetExportPolicyOk returns a tuple with the ExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateShareResponseShare) GetExportPolicyOk() (ret CreateShareResponseShareGetExportPolicyRetType, ok bool) { + return getCreateShareResponseShareGetExportPolicyAttributeTypeOk(o.ExportPolicy) +} + +// HasExportPolicy returns a boolean if a field has been set. +func (o *CreateShareResponseShare) HasExportPolicy() bool { + _, ok := o.GetExportPolicyOk() + return ok +} + +// SetExportPolicy gets a reference to the given ShareExportPolicy and assigns it to the ExportPolicy field. +func (o *CreateShareResponseShare) SetExportPolicy(v CreateShareResponseShareGetExportPolicyRetType) { + setCreateShareResponseShareGetExportPolicyAttributeType(&o.ExportPolicy, v) +} + +// SetExportPolicyNil sets the value for ExportPolicy to be an explicit nil +func (o *CreateShareResponseShare) SetExportPolicyNil() { + o.ExportPolicy = nil +} + +// UnsetExportPolicy ensures that no value is present for ExportPolicy, not even an explicit nil +func (o *CreateShareResponseShare) UnsetExportPolicy() { + o.ExportPolicy = nil +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateShareResponseShare) GetId() (res CreateShareResponseShareGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *CreateShareResponseShare) GetIdOk() (ret CreateShareResponseShareGetIdRetType, ok bool) { + return getCreateShareResponseShareGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *CreateShareResponseShare) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateShareResponseShare) SetId(v CreateShareResponseShareGetIdRetType) { + setCreateShareResponseShareGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateShareResponseShare) GetLabels() (res CreateShareResponseShareGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *CreateShareResponseShare) GetLabelsOk() (ret CreateShareResponseShareGetLabelsRetType, ok bool) { + return getCreateShareResponseShareGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateShareResponseShare) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateShareResponseShare) SetLabels(v CreateShareResponseShareGetLabelsRetType) { + setCreateShareResponseShareGetLabelsAttributeType(&o.Labels, v) +} + +// GetMountPath returns the MountPath field value if set, zero value otherwise. +func (o *CreateShareResponseShare) GetMountPath() (res CreateShareResponseShareGetMountPathRetType) { + res, _ = o.GetMountPathOk() + return +} + +// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareResponseShare) GetMountPathOk() (ret CreateShareResponseShareGetMountPathRetType, ok bool) { + return getCreateShareResponseShareGetMountPathAttributeTypeOk(o.MountPath) +} + +// HasMountPath returns a boolean if a field has been set. +func (o *CreateShareResponseShare) HasMountPath() bool { + _, ok := o.GetMountPathOk() + return ok +} + +// SetMountPath gets a reference to the given string and assigns it to the MountPath field. +func (o *CreateShareResponseShare) SetMountPath(v CreateShareResponseShareGetMountPathRetType) { + setCreateShareResponseShareGetMountPathAttributeType(&o.MountPath, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateShareResponseShare) GetName() (res CreateShareResponseShareGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *CreateShareResponseShare) GetNameOk() (ret CreateShareResponseShareGetNameRetType, ok bool) { + return getCreateShareResponseShareGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *CreateShareResponseShare) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateShareResponseShare) SetName(v CreateShareResponseShareGetNameRetType) { + setCreateShareResponseShareGetNameAttributeType(&o.Name, v) +} + +// GetSpaceHardLimitGigabytes returns the SpaceHardLimitGigabytes field value if set, zero value otherwise. +func (o *CreateShareResponseShare) GetSpaceHardLimitGigabytes() (res CreateShareResponseShareGetSpaceHardLimitGigabytesRetType) { + res, _ = o.GetSpaceHardLimitGigabytesOk() + return +} + +// GetSpaceHardLimitGigabytesOk returns a tuple with the SpaceHardLimitGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateShareResponseShare) GetSpaceHardLimitGigabytesOk() (ret CreateShareResponseShareGetSpaceHardLimitGigabytesRetType, ok bool) { + return getCreateShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes) +} + +// HasSpaceHardLimitGigabytes returns a boolean if a field has been set. +func (o *CreateShareResponseShare) HasSpaceHardLimitGigabytes() bool { + _, ok := o.GetSpaceHardLimitGigabytesOk() + return ok +} + +// SetSpaceHardLimitGigabytes gets a reference to the given int64 and assigns it to the SpaceHardLimitGigabytes field. +func (o *CreateShareResponseShare) SetSpaceHardLimitGigabytes(v CreateShareResponseShareGetSpaceHardLimitGigabytesRetType) { + setCreateShareResponseShareGetSpaceHardLimitGigabytesAttributeType(&o.SpaceHardLimitGigabytes, v) +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *CreateShareResponseShare) GetState() (res CreateShareResponseShareGetStateRetType) { + res, _ = o.GetStateOk() + return +} + +// 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 *CreateShareResponseShare) GetStateOk() (ret CreateShareResponseShareGetStateRetType, ok bool) { + return getCreateShareResponseShareGetStateAttributeTypeOk(o.State) +} + +// HasState returns a boolean if a field has been set. +func (o *CreateShareResponseShare) HasState() bool { + _, ok := o.GetStateOk() + return ok +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *CreateShareResponseShare) SetState(v CreateShareResponseShareGetStateRetType) { + setCreateShareResponseShareGetStateAttributeType(&o.State, v) +} + +func (o CreateShareResponseShare) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateShareResponseShareGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getCreateShareResponseShareGetExportPolicyAttributeTypeOk(o.ExportPolicy); ok { + toSerialize["ExportPolicy"] = val + } + if val, ok := getCreateShareResponseShareGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getCreateShareResponseShareGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateShareResponseShareGetMountPathAttributeTypeOk(o.MountPath); ok { + toSerialize["MountPath"] = val + } + if val, ok := getCreateShareResponseShareGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes); ok { + toSerialize["SpaceHardLimitGigabytes"] = val + } + if val, ok := getCreateShareResponseShareGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +type NullableCreateShareResponseShare struct { + value *CreateShareResponseShare + isSet bool +} + +func (v NullableCreateShareResponseShare) Get() *CreateShareResponseShare { + return v.value +} + +func (v *NullableCreateShareResponseShare) Set(val *CreateShareResponseShare) { + v.value = val + v.isSet = true +} + +func (v NullableCreateShareResponseShare) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateShareResponseShare) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateShareResponseShare(val *CreateShareResponseShare) *NullableCreateShareResponseShare { + return &NullableCreateShareResponseShare{value: val, isSet: true} +} + +func (v NullableCreateShareResponseShare) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateShareResponseShare) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_share_response_share_test.go b/services/sfs/model_create_share_response_share_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_share_response_share_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_share_response_test.go b/services/sfs/model_create_share_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_create_share_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_error.go b/services/sfs/model_error.go new file mode 100644 index 000000000..92723b7a0 --- /dev/null +++ b/services/sfs/model_error.go @@ -0,0 +1,224 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +/* + types and functions for error_description +*/ + +// isAny +type ErrorGetErrorDescriptionAttributeType = any +type ErrorGetErrorDescriptionArgType = any +type ErrorGetErrorDescriptionRetType = any + +func getErrorGetErrorDescriptionAttributeTypeOk(arg ErrorGetErrorDescriptionAttributeType) (ret ErrorGetErrorDescriptionRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setErrorGetErrorDescriptionAttributeType(arg *ErrorGetErrorDescriptionAttributeType, val ErrorGetErrorDescriptionRetType) { + *arg = val +} + +/* + types and functions for title +*/ + +// isNotNullableString +type ErrorGetTitleAttributeType = *string + +func getErrorGetTitleAttributeTypeOk(arg ErrorGetTitleAttributeType) (ret ErrorGetTitleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetTitleAttributeType(arg *ErrorGetTitleAttributeType, val ErrorGetTitleRetType) { + *arg = &val +} + +type ErrorGetTitleArgType = string +type ErrorGetTitleRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type ErrorGetTypeAttributeType = *string + +func getErrorGetTypeAttributeTypeOk(arg ErrorGetTypeAttributeType) (ret ErrorGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetTypeAttributeType(arg *ErrorGetTypeAttributeType, val ErrorGetTypeRetType) { + *arg = &val +} + +type ErrorGetTypeArgType = string +type ErrorGetTypeRetType = string + +// Error struct for Error +type Error struct { + // Deprecated: Human-readable string of the error that occured + ErrorDescription ErrorGetErrorDescriptionAttributeType `json:"error_description,omitempty"` + // Human-readable description of the error that occurred. + // REQUIRED + Title ErrorGetTitleAttributeType `json:"title" required:"true"` + // URI Uniquely identifies the error type. It will be in the format of storage.stackit.cloud/ e.g. storage.stackit.cloud/validation-error + // REQUIRED + Type ErrorGetTypeAttributeType `json:"type" required:"true"` +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(title ErrorGetTitleArgType, types ErrorGetTypeArgType) *Error { + this := Error{} + setErrorGetTitleAttributeType(&this.Title, title) + setErrorGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated +func (o *Error) GetErrorDescription() (res ErrorGetErrorDescriptionRetType) { + res, _ = o.GetErrorDescriptionOk() + return +} + +// GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated +func (o *Error) GetErrorDescriptionOk() (ret ErrorGetErrorDescriptionRetType, ok bool) { + return getErrorGetErrorDescriptionAttributeTypeOk(o.ErrorDescription) +} + +// HasErrorDescription returns a boolean if a field has been set. +func (o *Error) HasErrorDescription() bool { + _, ok := o.GetErrorDescriptionOk() + return ok +} + +// SetErrorDescription gets a reference to the given interface{} and assigns it to the ErrorDescription field. +// Deprecated +func (o *Error) SetErrorDescription(v ErrorGetErrorDescriptionRetType) { + setErrorGetErrorDescriptionAttributeType(&o.ErrorDescription, v) +} + +// GetTitle returns the Title field value +func (o *Error) GetTitle() (ret ErrorGetTitleRetType) { + ret, _ = o.GetTitleOk() + return ret +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *Error) GetTitleOk() (ret ErrorGetTitleRetType, ok bool) { + return getErrorGetTitleAttributeTypeOk(o.Title) +} + +// SetTitle sets field value +func (o *Error) SetTitle(v ErrorGetTitleRetType) { + setErrorGetTitleAttributeType(&o.Title, v) +} + +// GetType returns the Type field value +func (o *Error) GetType() (ret ErrorGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Error) GetTypeOk() (ret ErrorGetTypeRetType, ok bool) { + return getErrorGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *Error) SetType(v ErrorGetTypeRetType) { + setErrorGetTypeAttributeType(&o.Type, v) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getErrorGetErrorDescriptionAttributeTypeOk(o.ErrorDescription); ok { + toSerialize["ErrorDescription"] = val + } + if val, ok := getErrorGetTitleAttributeTypeOk(o.Title); ok { + toSerialize["Title"] = val + } + if val, ok := getErrorGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_error_test.go b/services/sfs/model_error_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_error_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_resource_pool_response.go b/services/sfs/model_get_resource_pool_response.go new file mode 100644 index 000000000..a391950d0 --- /dev/null +++ b/services/sfs/model_get_resource_pool_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the GetResourcePoolResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetResourcePoolResponse{} + +/* + types and functions for resourcePool +*/ + +// isModel +type GetResourcePoolResponseGetResourcePoolAttributeType = *GetResourcePoolResponseResourcePool +type GetResourcePoolResponseGetResourcePoolArgType = GetResourcePoolResponseResourcePool +type GetResourcePoolResponseGetResourcePoolRetType = GetResourcePoolResponseResourcePool + +func getGetResourcePoolResponseGetResourcePoolAttributeTypeOk(arg GetResourcePoolResponseGetResourcePoolAttributeType) (ret GetResourcePoolResponseGetResourcePoolRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseGetResourcePoolAttributeType(arg *GetResourcePoolResponseGetResourcePoolAttributeType, val GetResourcePoolResponseGetResourcePoolRetType) { + *arg = &val +} + +// GetResourcePoolResponse struct for GetResourcePoolResponse +type GetResourcePoolResponse struct { + ResourcePool GetResourcePoolResponseGetResourcePoolAttributeType `json:"resourcePool,omitempty"` +} + +// NewGetResourcePoolResponse instantiates a new GetResourcePoolResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetResourcePoolResponse() *GetResourcePoolResponse { + this := GetResourcePoolResponse{} + return &this +} + +// NewGetResourcePoolResponseWithDefaults instantiates a new GetResourcePoolResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetResourcePoolResponseWithDefaults() *GetResourcePoolResponse { + this := GetResourcePoolResponse{} + return &this +} + +// GetResourcePool returns the ResourcePool field value if set, zero value otherwise. +func (o *GetResourcePoolResponse) GetResourcePool() (res GetResourcePoolResponseGetResourcePoolRetType) { + res, _ = o.GetResourcePoolOk() + return +} + +// GetResourcePoolOk returns a tuple with the ResourcePool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponse) GetResourcePoolOk() (ret GetResourcePoolResponseGetResourcePoolRetType, ok bool) { + return getGetResourcePoolResponseGetResourcePoolAttributeTypeOk(o.ResourcePool) +} + +// HasResourcePool returns a boolean if a field has been set. +func (o *GetResourcePoolResponse) HasResourcePool() bool { + _, ok := o.GetResourcePoolOk() + return ok +} + +// SetResourcePool gets a reference to the given GetResourcePoolResponseResourcePool and assigns it to the ResourcePool field. +func (o *GetResourcePoolResponse) SetResourcePool(v GetResourcePoolResponseGetResourcePoolRetType) { + setGetResourcePoolResponseGetResourcePoolAttributeType(&o.ResourcePool, v) +} + +func (o GetResourcePoolResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetResourcePoolResponseGetResourcePoolAttributeTypeOk(o.ResourcePool); ok { + toSerialize["ResourcePool"] = val + } + return toSerialize, nil +} + +type NullableGetResourcePoolResponse struct { + value *GetResourcePoolResponse + isSet bool +} + +func (v NullableGetResourcePoolResponse) Get() *GetResourcePoolResponse { + return v.value +} + +func (v *NullableGetResourcePoolResponse) Set(val *GetResourcePoolResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetResourcePoolResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetResourcePoolResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetResourcePoolResponse(val *GetResourcePoolResponse) *NullableGetResourcePoolResponse { + return &NullableGetResourcePoolResponse{value: val, isSet: true} +} + +func (v NullableGetResourcePoolResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetResourcePoolResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_resource_pool_response_resource_pool.go b/services/sfs/model_get_resource_pool_response_resource_pool.go new file mode 100644 index 000000000..1578ef3ee --- /dev/null +++ b/services/sfs/model_get_resource_pool_response_resource_pool.go @@ -0,0 +1,802 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the GetResourcePoolResponseResourcePool type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetResourcePoolResponseResourcePool{} + +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type GetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType = *string + +func getGetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType) (ret GetResourcePoolResponseResourcePoolGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType(arg *GetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType, val GetResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + *arg = &val +} + +type GetResourcePoolResponseResourcePoolGetAvailabilityZoneArgType = string +type GetResourcePoolResponseResourcePoolGetAvailabilityZoneRetType = string + +/* + types and functions for countShares +*/ + +// isInteger +type GetResourcePoolResponseResourcePoolGetCountSharesAttributeType = *int64 +type GetResourcePoolResponseResourcePoolGetCountSharesArgType = int64 +type GetResourcePoolResponseResourcePoolGetCountSharesRetType = int64 + +func getGetResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetCountSharesAttributeType) (ret GetResourcePoolResponseResourcePoolGetCountSharesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetCountSharesAttributeType(arg *GetResourcePoolResponseResourcePoolGetCountSharesAttributeType, val GetResourcePoolResponseResourcePoolGetCountSharesRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type GetResourcePoolResponseResourcePoolGetCreatedAtAttributeType = *time.Time +type GetResourcePoolResponseResourcePoolGetCreatedAtArgType = time.Time +type GetResourcePoolResponseResourcePoolGetCreatedAtRetType = time.Time + +func getGetResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetCreatedAtAttributeType) (ret GetResourcePoolResponseResourcePoolGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetCreatedAtAttributeType(arg *GetResourcePoolResponseResourcePoolGetCreatedAtAttributeType, val GetResourcePoolResponseResourcePoolGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type GetResourcePoolResponseResourcePoolGetIdAttributeType = *string + +func getGetResourcePoolResponseResourcePoolGetIdAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetIdAttributeType) (ret GetResourcePoolResponseResourcePoolGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetIdAttributeType(arg *GetResourcePoolResponseResourcePoolGetIdAttributeType, val GetResourcePoolResponseResourcePoolGetIdRetType) { + *arg = &val +} + +type GetResourcePoolResponseResourcePoolGetIdArgType = string +type GetResourcePoolResponseResourcePoolGetIdRetType = string + +/* + types and functions for ipAcl +*/ + +// isArray +type GetResourcePoolResponseResourcePoolGetIpAclAttributeType = *[]string +type GetResourcePoolResponseResourcePoolGetIpAclArgType = []string +type GetResourcePoolResponseResourcePoolGetIpAclRetType = []string + +func getGetResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetIpAclAttributeType) (ret GetResourcePoolResponseResourcePoolGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetIpAclAttributeType(arg *GetResourcePoolResponseResourcePoolGetIpAclAttributeType, val GetResourcePoolResponseResourcePoolGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type GetResourcePoolResponseResourcePoolGetLabelsAttributeType = *map[string]string +type GetResourcePoolResponseResourcePoolGetLabelsArgType = map[string]string +type GetResourcePoolResponseResourcePoolGetLabelsRetType = map[string]string + +func getGetResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetLabelsAttributeType) (ret GetResourcePoolResponseResourcePoolGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetLabelsAttributeType(arg *GetResourcePoolResponseResourcePoolGetLabelsAttributeType, val GetResourcePoolResponseResourcePoolGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mountPath +*/ + +// isNotNullableString +type GetResourcePoolResponseResourcePoolGetMountPathAttributeType = *string + +func getGetResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetMountPathAttributeType) (ret GetResourcePoolResponseResourcePoolGetMountPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetMountPathAttributeType(arg *GetResourcePoolResponseResourcePoolGetMountPathAttributeType, val GetResourcePoolResponseResourcePoolGetMountPathRetType) { + *arg = &val +} + +type GetResourcePoolResponseResourcePoolGetMountPathArgType = string +type GetResourcePoolResponseResourcePoolGetMountPathRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type GetResourcePoolResponseResourcePoolGetNameAttributeType = *string + +func getGetResourcePoolResponseResourcePoolGetNameAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetNameAttributeType) (ret GetResourcePoolResponseResourcePoolGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetNameAttributeType(arg *GetResourcePoolResponseResourcePoolGetNameAttributeType, val GetResourcePoolResponseResourcePoolGetNameRetType) { + *arg = &val +} + +type GetResourcePoolResponseResourcePoolGetNameArgType = string +type GetResourcePoolResponseResourcePoolGetNameRetType = string + +/* + types and functions for performanceClass +*/ + +// isModel +type GetResourcePoolResponseResourcePoolGetPerformanceClassAttributeType = *ResourcePoolPerformanceClass +type GetResourcePoolResponseResourcePoolGetPerformanceClassArgType = ResourcePoolPerformanceClass +type GetResourcePoolResponseResourcePoolGetPerformanceClassRetType = ResourcePoolPerformanceClass + +func getGetResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetPerformanceClassAttributeType) (ret GetResourcePoolResponseResourcePoolGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetPerformanceClassAttributeType(arg *GetResourcePoolResponseResourcePoolGetPerformanceClassAttributeType, val GetResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + *arg = &val +} + +/* + types and functions for performanceClassDowngradableAt +*/ + +// isDateTime +type GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType = *time.Time +type GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtArgType = time.Time +type GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType = time.Time + +func getGetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType) (ret GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType(arg *GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType, val GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + *arg = &val +} + +/* + types and functions for sizeReducibleAt +*/ + +// isDateTime +type GetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType = *time.Time +type GetResourcePoolResponseResourcePoolGetSizeReducibleAtArgType = time.Time +type GetResourcePoolResponseResourcePoolGetSizeReducibleAtRetType = time.Time + +func getGetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType) (ret GetResourcePoolResponseResourcePoolGetSizeReducibleAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(arg *GetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType, val GetResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + *arg = &val +} + +/* + types and functions for snapshotSchedule +*/ + +// isModel +type GetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType = *SnapshotSchedule +type GetResourcePoolResponseResourcePoolGetSnapshotScheduleArgType = SnapshotSchedule +type GetResourcePoolResponseResourcePoolGetSnapshotScheduleRetType = SnapshotSchedule + +func getGetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType) (ret GetResourcePoolResponseResourcePoolGetSnapshotScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType(arg *GetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType, val GetResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + *arg = &val +} + +/* + types and functions for snapshotsAreVisible +*/ + +// isBoolean +type GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType = *bool +type GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleArgType = bool +type GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType = bool + +func getGetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(arg GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType) (ret GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType(arg *GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType, val GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + *arg = &val +} + +/* + types and functions for space +*/ + +// isModel +type GetResourcePoolResponseResourcePoolGetSpaceAttributeType = *ResourcePoolSpace +type GetResourcePoolResponseResourcePoolGetSpaceArgType = ResourcePoolSpace +type GetResourcePoolResponseResourcePoolGetSpaceRetType = ResourcePoolSpace + +func getGetResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetSpaceAttributeType) (ret GetResourcePoolResponseResourcePoolGetSpaceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetSpaceAttributeType(arg *GetResourcePoolResponseResourcePoolGetSpaceAttributeType, val GetResourcePoolResponseResourcePoolGetSpaceRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type GetResourcePoolResponseResourcePoolGetStateAttributeType = *string + +func getGetResourcePoolResponseResourcePoolGetStateAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetStateAttributeType) (ret GetResourcePoolResponseResourcePoolGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolResponseResourcePoolGetStateAttributeType(arg *GetResourcePoolResponseResourcePoolGetStateAttributeType, val GetResourcePoolResponseResourcePoolGetStateRetType) { + *arg = &val +} + +type GetResourcePoolResponseResourcePoolGetStateArgType = string +type GetResourcePoolResponseResourcePoolGetStateRetType = string + +// GetResourcePoolResponseResourcePool Resource Pool +type GetResourcePoolResponseResourcePool struct { + // Name of the respective availability zone + AvailabilityZone GetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` + // Number of Shares in the Resource Pool + // Can be cast to int32 without loss of precision. + CountShares GetResourcePoolResponseResourcePoolGetCountSharesAttributeType `json:"countShares,omitempty"` + CreatedAt GetResourcePoolResponseResourcePoolGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Resource Pool + Id GetResourcePoolResponseResourcePoolGetIdAttributeType `json:"id,omitempty"` + // List of IPs that can mount the Resource Pool in read-only; IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.250/32\" for a specific IP) + IpAcl GetResourcePoolResponseResourcePoolGetIpAclAttributeType `json:"ipAcl,omitempty"` + Labels GetResourcePoolResponseResourcePoolGetLabelsAttributeType `json:"labels,omitempty"` + // Mount path of the Resource Pool, used to mount the Resource Pool Note that a Resource Pool can only be mounted in read-only + MountPath GetResourcePoolResponseResourcePoolGetMountPathAttributeType `json:"mountPath,omitempty"` + // Name of the Resource Pool + Name GetResourcePoolResponseResourcePoolGetNameAttributeType `json:"name,omitempty"` + PerformanceClass GetResourcePoolResponseResourcePoolGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` + // Time when the performance class can be downgraded again. + PerformanceClassDowngradableAt GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType `json:"performanceClassDowngradableAt,omitempty"` + // Time when the size can be reduced again. + SizeReducibleAt GetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType `json:"sizeReducibleAt,omitempty"` + SnapshotSchedule GetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType `json:"snapshotSchedule,omitempty"` + // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. + SnapshotsAreVisible GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` + Space GetResourcePoolResponseResourcePoolGetSpaceAttributeType `json:"space,omitempty"` + // State of the Resource Pool (possible values: [\"pending\", \"creating\", \"created\", \"updating\", \"error\", \"deleting\"]) + State GetResourcePoolResponseResourcePoolGetStateAttributeType `json:"state,omitempty"` +} + +// NewGetResourcePoolResponseResourcePool instantiates a new GetResourcePoolResponseResourcePool object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetResourcePoolResponseResourcePool() *GetResourcePoolResponseResourcePool { + this := GetResourcePoolResponseResourcePool{} + return &this +} + +// NewGetResourcePoolResponseResourcePoolWithDefaults instantiates a new GetResourcePoolResponseResourcePool object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetResourcePoolResponseResourcePoolWithDefaults() *GetResourcePoolResponseResourcePool { + this := GetResourcePoolResponseResourcePool{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetAvailabilityZone() (res GetResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetAvailabilityZoneOk() (ret GetResourcePoolResponseResourcePoolGetAvailabilityZoneRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasAvailabilityZone() bool { + _, ok := o.GetAvailabilityZoneOk() + return ok +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *GetResourcePoolResponseResourcePool) SetAvailabilityZone(v GetResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + setGetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) +} + +// GetCountShares returns the CountShares field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetCountShares() (res GetResourcePoolResponseResourcePoolGetCountSharesRetType) { + res, _ = o.GetCountSharesOk() + return +} + +// GetCountSharesOk returns a tuple with the CountShares field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetCountSharesOk() (ret GetResourcePoolResponseResourcePoolGetCountSharesRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(o.CountShares) +} + +// HasCountShares returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasCountShares() bool { + _, ok := o.GetCountSharesOk() + return ok +} + +// SetCountShares gets a reference to the given int64 and assigns it to the CountShares field. +func (o *GetResourcePoolResponseResourcePool) SetCountShares(v GetResourcePoolResponseResourcePoolGetCountSharesRetType) { + setGetResourcePoolResponseResourcePoolGetCountSharesAttributeType(&o.CountShares, v) +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetCreatedAt() (res GetResourcePoolResponseResourcePoolGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetCreatedAtOk() (ret GetResourcePoolResponseResourcePoolGetCreatedAtRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *GetResourcePoolResponseResourcePool) SetCreatedAt(v GetResourcePoolResponseResourcePoolGetCreatedAtRetType) { + setGetResourcePoolResponseResourcePoolGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetId() (res GetResourcePoolResponseResourcePoolGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *GetResourcePoolResponseResourcePool) GetIdOk() (ret GetResourcePoolResponseResourcePoolGetIdRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GetResourcePoolResponseResourcePool) SetId(v GetResourcePoolResponseResourcePoolGetIdRetType) { + setGetResourcePoolResponseResourcePoolGetIdAttributeType(&o.Id, v) +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetIpAcl() (res GetResourcePoolResponseResourcePoolGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetIpAclOk() (ret GetResourcePoolResponseResourcePoolGetIpAclRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *GetResourcePoolResponseResourcePool) SetIpAcl(v GetResourcePoolResponseResourcePoolGetIpAclRetType) { + setGetResourcePoolResponseResourcePoolGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetLabels() (res GetResourcePoolResponseResourcePoolGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *GetResourcePoolResponseResourcePool) GetLabelsOk() (ret GetResourcePoolResponseResourcePoolGetLabelsRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *GetResourcePoolResponseResourcePool) SetLabels(v GetResourcePoolResponseResourcePoolGetLabelsRetType) { + setGetResourcePoolResponseResourcePoolGetLabelsAttributeType(&o.Labels, v) +} + +// GetMountPath returns the MountPath field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetMountPath() (res GetResourcePoolResponseResourcePoolGetMountPathRetType) { + res, _ = o.GetMountPathOk() + return +} + +// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetMountPathOk() (ret GetResourcePoolResponseResourcePoolGetMountPathRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(o.MountPath) +} + +// HasMountPath returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasMountPath() bool { + _, ok := o.GetMountPathOk() + return ok +} + +// SetMountPath gets a reference to the given string and assigns it to the MountPath field. +func (o *GetResourcePoolResponseResourcePool) SetMountPath(v GetResourcePoolResponseResourcePoolGetMountPathRetType) { + setGetResourcePoolResponseResourcePoolGetMountPathAttributeType(&o.MountPath, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetName() (res GetResourcePoolResponseResourcePoolGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *GetResourcePoolResponseResourcePool) GetNameOk() (ret GetResourcePoolResponseResourcePoolGetNameRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GetResourcePoolResponseResourcePool) SetName(v GetResourcePoolResponseResourcePoolGetNameRetType) { + setGetResourcePoolResponseResourcePoolGetNameAttributeType(&o.Name, v) +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetPerformanceClass() (res GetResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetPerformanceClassOk() (ret GetResourcePoolResponseResourcePoolGetPerformanceClassRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(o.PerformanceClass) +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasPerformanceClass() bool { + _, ok := o.GetPerformanceClassOk() + return ok +} + +// SetPerformanceClass gets a reference to the given ResourcePoolPerformanceClass and assigns it to the PerformanceClass field. +func (o *GetResourcePoolResponseResourcePool) SetPerformanceClass(v GetResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + setGetResourcePoolResponseResourcePoolGetPerformanceClassAttributeType(&o.PerformanceClass, v) +} + +// GetPerformanceClassDowngradableAt returns the PerformanceClassDowngradableAt field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetPerformanceClassDowngradableAt() (res GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + res, _ = o.GetPerformanceClassDowngradableAtOk() + return +} + +// GetPerformanceClassDowngradableAtOk returns a tuple with the PerformanceClassDowngradableAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetPerformanceClassDowngradableAtOk() (ret GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(o.PerformanceClassDowngradableAt) +} + +// HasPerformanceClassDowngradableAt returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasPerformanceClassDowngradableAt() bool { + _, ok := o.GetPerformanceClassDowngradableAtOk() + return ok +} + +// SetPerformanceClassDowngradableAt gets a reference to the given time.Time and assigns it to the PerformanceClassDowngradableAt field. +func (o *GetResourcePoolResponseResourcePool) SetPerformanceClassDowngradableAt(v GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + setGetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType(&o.PerformanceClassDowngradableAt, v) +} + +// GetSizeReducibleAt returns the SizeReducibleAt field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetSizeReducibleAt() (res GetResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + res, _ = o.GetSizeReducibleAtOk() + return +} + +// GetSizeReducibleAtOk returns a tuple with the SizeReducibleAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetSizeReducibleAtOk() (ret GetResourcePoolResponseResourcePoolGetSizeReducibleAtRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt) +} + +// HasSizeReducibleAt returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasSizeReducibleAt() bool { + _, ok := o.GetSizeReducibleAtOk() + return ok +} + +// SetSizeReducibleAt gets a reference to the given time.Time and assigns it to the SizeReducibleAt field. +func (o *GetResourcePoolResponseResourcePool) SetSizeReducibleAt(v GetResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + setGetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(&o.SizeReducibleAt, v) +} + +// GetSnapshotSchedule returns the SnapshotSchedule field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetSnapshotSchedule() (res GetResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + res, _ = o.GetSnapshotScheduleOk() + return +} + +// GetSnapshotScheduleOk returns a tuple with the SnapshotSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetSnapshotScheduleOk() (ret GetResourcePoolResponseResourcePoolGetSnapshotScheduleRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(o.SnapshotSchedule) +} + +// HasSnapshotSchedule returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasSnapshotSchedule() bool { + _, ok := o.GetSnapshotScheduleOk() + return ok +} + +// SetSnapshotSchedule gets a reference to the given SnapshotSchedule and assigns it to the SnapshotSchedule field. +func (o *GetResourcePoolResponseResourcePool) SetSnapshotSchedule(v GetResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + setGetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType(&o.SnapshotSchedule, v) +} + +// GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetSnapshotsAreVisible() (res GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + res, _ = o.GetSnapshotsAreVisibleOk() + return +} + +// GetSnapshotsAreVisibleOk returns a tuple with the SnapshotsAreVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetSnapshotsAreVisibleOk() (ret GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible) +} + +// HasSnapshotsAreVisible returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasSnapshotsAreVisible() bool { + _, ok := o.GetSnapshotsAreVisibleOk() + return ok +} + +// SetSnapshotsAreVisible gets a reference to the given bool and assigns it to the SnapshotsAreVisible field. +func (o *GetResourcePoolResponseResourcePool) SetSnapshotsAreVisible(v GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + setGetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType(&o.SnapshotsAreVisible, v) +} + +// GetSpace returns the Space field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetSpace() (res GetResourcePoolResponseResourcePoolGetSpaceRetType) { + res, _ = o.GetSpaceOk() + return +} + +// GetSpaceOk returns a tuple with the Space field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolResponseResourcePool) GetSpaceOk() (ret GetResourcePoolResponseResourcePoolGetSpaceRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(o.Space) +} + +// HasSpace returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasSpace() bool { + _, ok := o.GetSpaceOk() + return ok +} + +// SetSpace gets a reference to the given ResourcePoolSpace and assigns it to the Space field. +func (o *GetResourcePoolResponseResourcePool) SetSpace(v GetResourcePoolResponseResourcePoolGetSpaceRetType) { + setGetResourcePoolResponseResourcePoolGetSpaceAttributeType(&o.Space, v) +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *GetResourcePoolResponseResourcePool) GetState() (res GetResourcePoolResponseResourcePoolGetStateRetType) { + res, _ = o.GetStateOk() + return +} + +// 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 *GetResourcePoolResponseResourcePool) GetStateOk() (ret GetResourcePoolResponseResourcePoolGetStateRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetStateAttributeTypeOk(o.State) +} + +// HasState returns a boolean if a field has been set. +func (o *GetResourcePoolResponseResourcePool) HasState() bool { + _, ok := o.GetStateOk() + return ok +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *GetResourcePoolResponseResourcePool) SetState(v GetResourcePoolResponseResourcePoolGetStateRetType) { + setGetResourcePoolResponseResourcePoolGetStateAttributeType(&o.State, v) +} + +func (o GetResourcePoolResponseResourcePool) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(o.CountShares); ok { + toSerialize["CountShares"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(o.MountPath); ok { + toSerialize["MountPath"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(o.PerformanceClassDowngradableAt); ok { + toSerialize["PerformanceClassDowngradableAt"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt); ok { + toSerialize["SizeReducibleAt"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(o.SnapshotSchedule); ok { + toSerialize["SnapshotSchedule"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { + toSerialize["SnapshotsAreVisible"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(o.Space); ok { + toSerialize["Space"] = val + } + if val, ok := getGetResourcePoolResponseResourcePoolGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +type NullableGetResourcePoolResponseResourcePool struct { + value *GetResourcePoolResponseResourcePool + isSet bool +} + +func (v NullableGetResourcePoolResponseResourcePool) Get() *GetResourcePoolResponseResourcePool { + return v.value +} + +func (v *NullableGetResourcePoolResponseResourcePool) Set(val *GetResourcePoolResponseResourcePool) { + v.value = val + v.isSet = true +} + +func (v NullableGetResourcePoolResponseResourcePool) IsSet() bool { + return v.isSet +} + +func (v *NullableGetResourcePoolResponseResourcePool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetResourcePoolResponseResourcePool(val *GetResourcePoolResponseResourcePool) *NullableGetResourcePoolResponseResourcePool { + return &NullableGetResourcePoolResponseResourcePool{value: val, isSet: true} +} + +func (v NullableGetResourcePoolResponseResourcePool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetResourcePoolResponseResourcePool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_resource_pool_response_resource_pool_test.go b/services/sfs/model_get_resource_pool_response_resource_pool_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_get_resource_pool_response_resource_pool_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_resource_pool_response_test.go b/services/sfs/model_get_resource_pool_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_get_resource_pool_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_resource_pool_snapshot_response.go b/services/sfs/model_get_resource_pool_snapshot_response.go new file mode 100644 index 000000000..5a307c545 --- /dev/null +++ b/services/sfs/model_get_resource_pool_snapshot_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the GetResourcePoolSnapshotResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetResourcePoolSnapshotResponse{} + +/* + types and functions for resourcePoolSnapshot +*/ + +// isModel +type GetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType = *GetResourcePoolSnapshotResponseResourcePoolSnapshot +type GetResourcePoolSnapshotResponseGetResourcePoolSnapshotArgType = GetResourcePoolSnapshotResponseResourcePoolSnapshot +type GetResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType = GetResourcePoolSnapshotResponseResourcePoolSnapshot + +func getGetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeTypeOk(arg GetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType) (ret GetResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType(arg *GetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType, val GetResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType) { + *arg = &val +} + +// GetResourcePoolSnapshotResponse struct for GetResourcePoolSnapshotResponse +type GetResourcePoolSnapshotResponse struct { + ResourcePoolSnapshot GetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType `json:"resourcePoolSnapshot,omitempty"` +} + +// NewGetResourcePoolSnapshotResponse instantiates a new GetResourcePoolSnapshotResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetResourcePoolSnapshotResponse() *GetResourcePoolSnapshotResponse { + this := GetResourcePoolSnapshotResponse{} + return &this +} + +// NewGetResourcePoolSnapshotResponseWithDefaults instantiates a new GetResourcePoolSnapshotResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetResourcePoolSnapshotResponseWithDefaults() *GetResourcePoolSnapshotResponse { + this := GetResourcePoolSnapshotResponse{} + return &this +} + +// GetResourcePoolSnapshot returns the ResourcePoolSnapshot field value if set, zero value otherwise. +func (o *GetResourcePoolSnapshotResponse) GetResourcePoolSnapshot() (res GetResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType) { + res, _ = o.GetResourcePoolSnapshotOk() + return +} + +// GetResourcePoolSnapshotOk returns a tuple with the ResourcePoolSnapshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolSnapshotResponse) GetResourcePoolSnapshotOk() (ret GetResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType, ok bool) { + return getGetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeTypeOk(o.ResourcePoolSnapshot) +} + +// HasResourcePoolSnapshot returns a boolean if a field has been set. +func (o *GetResourcePoolSnapshotResponse) HasResourcePoolSnapshot() bool { + _, ok := o.GetResourcePoolSnapshotOk() + return ok +} + +// SetResourcePoolSnapshot gets a reference to the given GetResourcePoolSnapshotResponseResourcePoolSnapshot and assigns it to the ResourcePoolSnapshot field. +func (o *GetResourcePoolSnapshotResponse) SetResourcePoolSnapshot(v GetResourcePoolSnapshotResponseGetResourcePoolSnapshotRetType) { + setGetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeType(&o.ResourcePoolSnapshot, v) +} + +func (o GetResourcePoolSnapshotResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetResourcePoolSnapshotResponseGetResourcePoolSnapshotAttributeTypeOk(o.ResourcePoolSnapshot); ok { + toSerialize["ResourcePoolSnapshot"] = val + } + return toSerialize, nil +} + +type NullableGetResourcePoolSnapshotResponse struct { + value *GetResourcePoolSnapshotResponse + isSet bool +} + +func (v NullableGetResourcePoolSnapshotResponse) Get() *GetResourcePoolSnapshotResponse { + return v.value +} + +func (v *NullableGetResourcePoolSnapshotResponse) Set(val *GetResourcePoolSnapshotResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetResourcePoolSnapshotResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetResourcePoolSnapshotResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetResourcePoolSnapshotResponse(val *GetResourcePoolSnapshotResponse) *NullableGetResourcePoolSnapshotResponse { + return &NullableGetResourcePoolSnapshotResponse{value: val, isSet: true} +} + +func (v NullableGetResourcePoolSnapshotResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetResourcePoolSnapshotResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot.go b/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot.go new file mode 100644 index 000000000..8dd7f99e7 --- /dev/null +++ b/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot.go @@ -0,0 +1,388 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the GetResourcePoolSnapshotResponseResourcePoolSnapshot type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetResourcePoolSnapshotResponseResourcePoolSnapshot{} + +/* + types and functions for comment +*/ + +// isNullableString +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType = *NullableString + +func getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeTypeOk(arg GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType) (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType(arg *GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType, val GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentArgType = *string +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType = *string + +/* + types and functions for createdAt +*/ + +// isDateTime +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType = *time.Time +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtArgType = time.Time +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType = time.Time + +func getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeTypeOk(arg GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType) (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType(arg *GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType, val GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for logicalSizeGigabytes +*/ + +// isInteger +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType = *int64 +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesArgType = int64 +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType = int64 + +func getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(arg GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType) (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType(arg *GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType, val GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + *arg = &val +} + +/* + types and functions for resourcePoolId +*/ + +// isNotNullableString +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType = *string + +func getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(arg GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType) (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType(arg *GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType, val GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType) { + *arg = &val +} + +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdArgType = string +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType = string + +/* + types and functions for sizeGigabytes +*/ + +// isInteger +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType = *int64 +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesArgType = int64 +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType = int64 + +func getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(arg GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType) (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType(arg *GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType, val GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType) { + *arg = &val +} + +/* + types and functions for snapshotName +*/ + +// isNotNullableString +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType = *string + +func getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(arg GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType) (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType(arg *GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType, val GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType) { + *arg = &val +} + +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameArgType = string +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType = string + +// GetResourcePoolSnapshotResponseResourcePoolSnapshot Resource Pool Snapshot +type GetResourcePoolSnapshotResponseResourcePoolSnapshot struct { + // (optional) A comment to add more information about a snapshot + Comment GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType `json:"comment,omitempty"` + CreatedAt GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // Represents the user-visible data size at the time of the snapshot in Gibibytes (e.g. what’s in the snapshot) + // Can be cast to int32 without loss of precision. + LogicalSizeGigabytes GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType `json:"logicalSizeGigabytes,omitempty"` + // ID of the Resource Pool of the Snapshot + ResourcePoolId GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType `json:"resourcePoolId,omitempty"` + // Reflects the actual storage footprint in the backend at snapshot time in Gibibytes (e.g. how much storage from the Resource Pool does it use). + // Can be cast to int32 without loss of precision. + SizeGigabytes GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // Name of the Resource Pool Snapshot + SnapshotName GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType `json:"snapshotName,omitempty"` +} + +// NewGetResourcePoolSnapshotResponseResourcePoolSnapshot instantiates a new GetResourcePoolSnapshotResponseResourcePoolSnapshot object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetResourcePoolSnapshotResponseResourcePoolSnapshot() *GetResourcePoolSnapshotResponseResourcePoolSnapshot { + this := GetResourcePoolSnapshotResponseResourcePoolSnapshot{} + return &this +} + +// NewGetResourcePoolSnapshotResponseResourcePoolSnapshotWithDefaults instantiates a new GetResourcePoolSnapshotResponseResourcePoolSnapshot object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetResourcePoolSnapshotResponseResourcePoolSnapshotWithDefaults() *GetResourcePoolSnapshotResponseResourcePoolSnapshot { + this := GetResourcePoolSnapshotResponseResourcePoolSnapshot{} + return &this +} + +// GetComment returns the Comment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetComment() (res GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType) { + res, _ = o.GetCommentOk() + return +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetCommentOk() (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType, ok bool) { + return getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeTypeOk(o.Comment) +} + +// HasComment returns a boolean if a field has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) HasComment() bool { + _, ok := o.GetCommentOk() + return ok +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetComment(v GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentRetType) { + setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeType(&o.Comment, v) +} + +// SetCommentNil sets the value for Comment to be an explicit nil +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetCommentNil() { + o.Comment = nil +} + +// UnsetComment ensures that no value is present for Comment, not even an explicit nil +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) UnsetComment() { + o.Comment = nil +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetCreatedAt() (res GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetCreatedAtOk() (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType, ok bool) { + return getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetCreatedAt(v GetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtRetType) { + setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetLogicalSizeGigabytes returns the LogicalSizeGigabytes field value if set, zero value otherwise. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetLogicalSizeGigabytes() (res GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + res, _ = o.GetLogicalSizeGigabytesOk() + return +} + +// GetLogicalSizeGigabytesOk returns a tuple with the LogicalSizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetLogicalSizeGigabytesOk() (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType, ok bool) { + return getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(o.LogicalSizeGigabytes) +} + +// HasLogicalSizeGigabytes returns a boolean if a field has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) HasLogicalSizeGigabytes() bool { + _, ok := o.GetLogicalSizeGigabytesOk() + return ok +} + +// SetLogicalSizeGigabytes gets a reference to the given int64 and assigns it to the LogicalSizeGigabytes field. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetLogicalSizeGigabytes(v GetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType(&o.LogicalSizeGigabytes, v) +} + +// GetResourcePoolId returns the ResourcePoolId field value if set, zero value otherwise. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetResourcePoolId() (res GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType) { + res, _ = o.GetResourcePoolIdOk() + return +} + +// GetResourcePoolIdOk returns a tuple with the ResourcePoolId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetResourcePoolIdOk() (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType, ok bool) { + return getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(o.ResourcePoolId) +} + +// HasResourcePoolId returns a boolean if a field has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) HasResourcePoolId() bool { + _, ok := o.GetResourcePoolIdOk() + return ok +} + +// SetResourcePoolId gets a reference to the given string and assigns it to the ResourcePoolId field. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetResourcePoolId(v GetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdRetType) { + setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeType(&o.ResourcePoolId, v) +} + +// GetSizeGigabytes returns the SizeGigabytes field value if set, zero value otherwise. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetSizeGigabytes() (res GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType) { + res, _ = o.GetSizeGigabytesOk() + return +} + +// GetSizeGigabytesOk returns a tuple with the SizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetSizeGigabytesOk() (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType, ok bool) { + return getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes) +} + +// HasSizeGigabytes returns a boolean if a field has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) HasSizeGigabytes() bool { + _, ok := o.GetSizeGigabytesOk() + return ok +} + +// SetSizeGigabytes gets a reference to the given int64 and assigns it to the SizeGigabytes field. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetSizeGigabytes(v GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesRetType) { + setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) +} + +// GetSnapshotName returns the SnapshotName field value if set, zero value otherwise. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnapshotName() (res GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType) { + res, _ = o.GetSnapshotNameOk() + return +} + +// GetSnapshotNameOk returns a tuple with the SnapshotName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnapshotNameOk() (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType, ok bool) { + return getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName) +} + +// HasSnapshotName returns a boolean if a field has been set. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) HasSnapshotName() bool { + _, ok := o.GetSnapshotNameOk() + return ok +} + +// SetSnapshotName gets a reference to the given string and assigns it to the SnapshotName field. +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetSnapshotName(v GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType) { + setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType(&o.SnapshotName, v) +} + +func (o GetResourcePoolSnapshotResponseResourcePoolSnapshot) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCommentAttributeTypeOk(o.Comment); ok { + toSerialize["Comment"] = val + } + if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(o.LogicalSizeGigabytes); ok { + toSerialize["LogicalSizeGigabytes"] = val + } + if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(o.ResourcePoolId); ok { + toSerialize["ResourcePoolId"] = val + } + if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { + toSerialize["SizeGigabytes"] = val + } + if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName); ok { + toSerialize["SnapshotName"] = val + } + return toSerialize, nil +} + +type NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot struct { + value *GetResourcePoolSnapshotResponseResourcePoolSnapshot + isSet bool +} + +func (v NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot) Get() *GetResourcePoolSnapshotResponseResourcePoolSnapshot { + return v.value +} + +func (v *NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot) Set(val *GetResourcePoolSnapshotResponseResourcePoolSnapshot) { + v.value = val + v.isSet = true +} + +func (v NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot) IsSet() bool { + return v.isSet +} + +func (v *NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetResourcePoolSnapshotResponseResourcePoolSnapshot(val *GetResourcePoolSnapshotResponseResourcePoolSnapshot) *NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot { + return &NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot{value: val, isSet: true} +} + +func (v NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetResourcePoolSnapshotResponseResourcePoolSnapshot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot_test.go b/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_resource_pool_snapshot_response_test.go b/services/sfs/model_get_resource_pool_snapshot_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_get_resource_pool_snapshot_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_share_export_policy_response.go b/services/sfs/model_get_share_export_policy_response.go new file mode 100644 index 000000000..3beb62a99 --- /dev/null +++ b/services/sfs/model_get_share_export_policy_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the GetShareExportPolicyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetShareExportPolicyResponse{} + +/* + types and functions for shareExportPolicy +*/ + +// isModel +type GetShareExportPolicyResponseGetShareExportPolicyAttributeType = *GetShareExportPolicyResponseShareExportPolicy +type GetShareExportPolicyResponseGetShareExportPolicyArgType = GetShareExportPolicyResponseShareExportPolicy +type GetShareExportPolicyResponseGetShareExportPolicyRetType = GetShareExportPolicyResponseShareExportPolicy + +func getGetShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(arg GetShareExportPolicyResponseGetShareExportPolicyAttributeType) (ret GetShareExportPolicyResponseGetShareExportPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareExportPolicyResponseGetShareExportPolicyAttributeType(arg *GetShareExportPolicyResponseGetShareExportPolicyAttributeType, val GetShareExportPolicyResponseGetShareExportPolicyRetType) { + *arg = &val +} + +// GetShareExportPolicyResponse struct for GetShareExportPolicyResponse +type GetShareExportPolicyResponse struct { + ShareExportPolicy GetShareExportPolicyResponseGetShareExportPolicyAttributeType `json:"shareExportPolicy,omitempty"` +} + +// NewGetShareExportPolicyResponse instantiates a new GetShareExportPolicyResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetShareExportPolicyResponse() *GetShareExportPolicyResponse { + this := GetShareExportPolicyResponse{} + return &this +} + +// NewGetShareExportPolicyResponseWithDefaults instantiates a new GetShareExportPolicyResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetShareExportPolicyResponseWithDefaults() *GetShareExportPolicyResponse { + this := GetShareExportPolicyResponse{} + return &this +} + +// GetShareExportPolicy returns the ShareExportPolicy field value if set, zero value otherwise. +func (o *GetShareExportPolicyResponse) GetShareExportPolicy() (res GetShareExportPolicyResponseGetShareExportPolicyRetType) { + res, _ = o.GetShareExportPolicyOk() + return +} + +// GetShareExportPolicyOk returns a tuple with the ShareExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetShareExportPolicyResponse) GetShareExportPolicyOk() (ret GetShareExportPolicyResponseGetShareExportPolicyRetType, ok bool) { + return getGetShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(o.ShareExportPolicy) +} + +// HasShareExportPolicy returns a boolean if a field has been set. +func (o *GetShareExportPolicyResponse) HasShareExportPolicy() bool { + _, ok := o.GetShareExportPolicyOk() + return ok +} + +// SetShareExportPolicy gets a reference to the given GetShareExportPolicyResponseShareExportPolicy and assigns it to the ShareExportPolicy field. +func (o *GetShareExportPolicyResponse) SetShareExportPolicy(v GetShareExportPolicyResponseGetShareExportPolicyRetType) { + setGetShareExportPolicyResponseGetShareExportPolicyAttributeType(&o.ShareExportPolicy, v) +} + +func (o GetShareExportPolicyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(o.ShareExportPolicy); ok { + toSerialize["ShareExportPolicy"] = val + } + return toSerialize, nil +} + +type NullableGetShareExportPolicyResponse struct { + value *GetShareExportPolicyResponse + isSet bool +} + +func (v NullableGetShareExportPolicyResponse) Get() *GetShareExportPolicyResponse { + return v.value +} + +func (v *NullableGetShareExportPolicyResponse) Set(val *GetShareExportPolicyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetShareExportPolicyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetShareExportPolicyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetShareExportPolicyResponse(val *GetShareExportPolicyResponse) *NullableGetShareExportPolicyResponse { + return &NullableGetShareExportPolicyResponse{value: val, isSet: true} +} + +func (v NullableGetShareExportPolicyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetShareExportPolicyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_share_export_policy_response_share_export_policy.go b/services/sfs/model_get_share_export_policy_response_share_export_policy.go new file mode 100644 index 000000000..ea854f30e --- /dev/null +++ b/services/sfs/model_get_share_export_policy_response_share_export_policy.go @@ -0,0 +1,371 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the GetShareExportPolicyResponseShareExportPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetShareExportPolicyResponseShareExportPolicy{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type GetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType = *time.Time +type GetShareExportPolicyResponseShareExportPolicyGetCreatedAtArgType = time.Time +type GetShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType = time.Time + +func getGetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeTypeOk(arg GetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType) (ret GetShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType(arg *GetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType, val GetShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type GetShareExportPolicyResponseShareExportPolicyGetIdAttributeType = *string + +func getGetShareExportPolicyResponseShareExportPolicyGetIdAttributeTypeOk(arg GetShareExportPolicyResponseShareExportPolicyGetIdAttributeType) (ret GetShareExportPolicyResponseShareExportPolicyGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareExportPolicyResponseShareExportPolicyGetIdAttributeType(arg *GetShareExportPolicyResponseShareExportPolicyGetIdAttributeType, val GetShareExportPolicyResponseShareExportPolicyGetIdRetType) { + *arg = &val +} + +type GetShareExportPolicyResponseShareExportPolicyGetIdArgType = string +type GetShareExportPolicyResponseShareExportPolicyGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type GetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType = *map[string]string +type GetShareExportPolicyResponseShareExportPolicyGetLabelsArgType = map[string]string +type GetShareExportPolicyResponseShareExportPolicyGetLabelsRetType = map[string]string + +func getGetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeTypeOk(arg GetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType) (ret GetShareExportPolicyResponseShareExportPolicyGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType(arg *GetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType, val GetShareExportPolicyResponseShareExportPolicyGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type GetShareExportPolicyResponseShareExportPolicyGetNameAttributeType = *string + +func getGetShareExportPolicyResponseShareExportPolicyGetNameAttributeTypeOk(arg GetShareExportPolicyResponseShareExportPolicyGetNameAttributeType) (ret GetShareExportPolicyResponseShareExportPolicyGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareExportPolicyResponseShareExportPolicyGetNameAttributeType(arg *GetShareExportPolicyResponseShareExportPolicyGetNameAttributeType, val GetShareExportPolicyResponseShareExportPolicyGetNameRetType) { + *arg = &val +} + +type GetShareExportPolicyResponseShareExportPolicyGetNameArgType = string +type GetShareExportPolicyResponseShareExportPolicyGetNameRetType = string + +/* + types and functions for rules +*/ + +// isArray +type GetShareExportPolicyResponseShareExportPolicyGetRulesAttributeType = *[]ShareExportPolicyRule +type GetShareExportPolicyResponseShareExportPolicyGetRulesArgType = []ShareExportPolicyRule +type GetShareExportPolicyResponseShareExportPolicyGetRulesRetType = []ShareExportPolicyRule + +func getGetShareExportPolicyResponseShareExportPolicyGetRulesAttributeTypeOk(arg GetShareExportPolicyResponseShareExportPolicyGetRulesAttributeType) (ret GetShareExportPolicyResponseShareExportPolicyGetRulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareExportPolicyResponseShareExportPolicyGetRulesAttributeType(arg *GetShareExportPolicyResponseShareExportPolicyGetRulesAttributeType, val GetShareExportPolicyResponseShareExportPolicyGetRulesRetType) { + *arg = &val +} + +/* + types and functions for sharesUsingExportPolicy +*/ + +// isInteger +type GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType = *int64 +type GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyArgType = int64 +type GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType = int64 + +func getGetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(arg GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType) (ret GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType(arg *GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType, val GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType) { + *arg = &val +} + +// GetShareExportPolicyResponseShareExportPolicy Share Export Policies +type GetShareExportPolicyResponseShareExportPolicy struct { + CreatedAt GetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Share Export Policy + Id GetShareExportPolicyResponseShareExportPolicyGetIdAttributeType `json:"id,omitempty"` + // An optional object that represents the labels associated with the share export policy keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels GetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType `json:"labels,omitempty"` + // Name of the Share Export Policy + Name GetShareExportPolicyResponseShareExportPolicyGetNameAttributeType `json:"name,omitempty"` + // List of rules of the Share Export Policy. The order of the rules within the array does not matter - what matters is the field \"order\" within each rule + Rules GetShareExportPolicyResponseShareExportPolicyGetRulesAttributeType `json:"rules,omitempty"` + // Number of Shares using this Share Export Policy + // Can be cast to int32 without loss of precision. + SharesUsingExportPolicy GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType `json:"sharesUsingExportPolicy,omitempty"` +} + +// NewGetShareExportPolicyResponseShareExportPolicy instantiates a new GetShareExportPolicyResponseShareExportPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetShareExportPolicyResponseShareExportPolicy() *GetShareExportPolicyResponseShareExportPolicy { + this := GetShareExportPolicyResponseShareExportPolicy{} + return &this +} + +// NewGetShareExportPolicyResponseShareExportPolicyWithDefaults instantiates a new GetShareExportPolicyResponseShareExportPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetShareExportPolicyResponseShareExportPolicyWithDefaults() *GetShareExportPolicyResponseShareExportPolicy { + this := GetShareExportPolicyResponseShareExportPolicy{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GetShareExportPolicyResponseShareExportPolicy) GetCreatedAt() (res GetShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetShareExportPolicyResponseShareExportPolicy) GetCreatedAtOk() (ret GetShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType, ok bool) { + return getGetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GetShareExportPolicyResponseShareExportPolicy) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *GetShareExportPolicyResponseShareExportPolicy) SetCreatedAt(v GetShareExportPolicyResponseShareExportPolicyGetCreatedAtRetType) { + setGetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GetShareExportPolicyResponseShareExportPolicy) GetId() (res GetShareExportPolicyResponseShareExportPolicyGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *GetShareExportPolicyResponseShareExportPolicy) GetIdOk() (ret GetShareExportPolicyResponseShareExportPolicyGetIdRetType, ok bool) { + return getGetShareExportPolicyResponseShareExportPolicyGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *GetShareExportPolicyResponseShareExportPolicy) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GetShareExportPolicyResponseShareExportPolicy) SetId(v GetShareExportPolicyResponseShareExportPolicyGetIdRetType) { + setGetShareExportPolicyResponseShareExportPolicyGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *GetShareExportPolicyResponseShareExportPolicy) GetLabels() (res GetShareExportPolicyResponseShareExportPolicyGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *GetShareExportPolicyResponseShareExportPolicy) GetLabelsOk() (ret GetShareExportPolicyResponseShareExportPolicyGetLabelsRetType, ok bool) { + return getGetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *GetShareExportPolicyResponseShareExportPolicy) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *GetShareExportPolicyResponseShareExportPolicy) SetLabels(v GetShareExportPolicyResponseShareExportPolicyGetLabelsRetType) { + setGetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetShareExportPolicyResponseShareExportPolicy) GetName() (res GetShareExportPolicyResponseShareExportPolicyGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *GetShareExportPolicyResponseShareExportPolicy) GetNameOk() (ret GetShareExportPolicyResponseShareExportPolicyGetNameRetType, ok bool) { + return getGetShareExportPolicyResponseShareExportPolicyGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *GetShareExportPolicyResponseShareExportPolicy) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GetShareExportPolicyResponseShareExportPolicy) SetName(v GetShareExportPolicyResponseShareExportPolicyGetNameRetType) { + setGetShareExportPolicyResponseShareExportPolicyGetNameAttributeType(&o.Name, v) +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *GetShareExportPolicyResponseShareExportPolicy) GetRules() (res GetShareExportPolicyResponseShareExportPolicyGetRulesRetType) { + res, _ = o.GetRulesOk() + return +} + +// 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 *GetShareExportPolicyResponseShareExportPolicy) GetRulesOk() (ret GetShareExportPolicyResponseShareExportPolicyGetRulesRetType, ok bool) { + return getGetShareExportPolicyResponseShareExportPolicyGetRulesAttributeTypeOk(o.Rules) +} + +// HasRules returns a boolean if a field has been set. +func (o *GetShareExportPolicyResponseShareExportPolicy) HasRules() bool { + _, ok := o.GetRulesOk() + return ok +} + +// SetRules gets a reference to the given []ShareExportPolicyRule and assigns it to the Rules field. +func (o *GetShareExportPolicyResponseShareExportPolicy) SetRules(v GetShareExportPolicyResponseShareExportPolicyGetRulesRetType) { + setGetShareExportPolicyResponseShareExportPolicyGetRulesAttributeType(&o.Rules, v) +} + +// GetSharesUsingExportPolicy returns the SharesUsingExportPolicy field value if set, zero value otherwise. +func (o *GetShareExportPolicyResponseShareExportPolicy) GetSharesUsingExportPolicy() (res GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType) { + res, _ = o.GetSharesUsingExportPolicyOk() + return +} + +// GetSharesUsingExportPolicyOk returns a tuple with the SharesUsingExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetShareExportPolicyResponseShareExportPolicy) GetSharesUsingExportPolicyOk() (ret GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType, ok bool) { + return getGetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(o.SharesUsingExportPolicy) +} + +// HasSharesUsingExportPolicy returns a boolean if a field has been set. +func (o *GetShareExportPolicyResponseShareExportPolicy) HasSharesUsingExportPolicy() bool { + _, ok := o.GetSharesUsingExportPolicyOk() + return ok +} + +// SetSharesUsingExportPolicy gets a reference to the given int64 and assigns it to the SharesUsingExportPolicy field. +func (o *GetShareExportPolicyResponseShareExportPolicy) SetSharesUsingExportPolicy(v GetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyRetType) { + setGetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeType(&o.SharesUsingExportPolicy, v) +} + +func (o GetShareExportPolicyResponseShareExportPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetShareExportPolicyResponseShareExportPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getGetShareExportPolicyResponseShareExportPolicyGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getGetShareExportPolicyResponseShareExportPolicyGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getGetShareExportPolicyResponseShareExportPolicyGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getGetShareExportPolicyResponseShareExportPolicyGetRulesAttributeTypeOk(o.Rules); ok { + toSerialize["Rules"] = val + } + if val, ok := getGetShareExportPolicyResponseShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(o.SharesUsingExportPolicy); ok { + toSerialize["SharesUsingExportPolicy"] = val + } + return toSerialize, nil +} + +type NullableGetShareExportPolicyResponseShareExportPolicy struct { + value *GetShareExportPolicyResponseShareExportPolicy + isSet bool +} + +func (v NullableGetShareExportPolicyResponseShareExportPolicy) Get() *GetShareExportPolicyResponseShareExportPolicy { + return v.value +} + +func (v *NullableGetShareExportPolicyResponseShareExportPolicy) Set(val *GetShareExportPolicyResponseShareExportPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableGetShareExportPolicyResponseShareExportPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableGetShareExportPolicyResponseShareExportPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetShareExportPolicyResponseShareExportPolicy(val *GetShareExportPolicyResponseShareExportPolicy) *NullableGetShareExportPolicyResponseShareExportPolicy { + return &NullableGetShareExportPolicyResponseShareExportPolicy{value: val, isSet: true} +} + +func (v NullableGetShareExportPolicyResponseShareExportPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetShareExportPolicyResponseShareExportPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_share_export_policy_response_share_export_policy_test.go b/services/sfs/model_get_share_export_policy_response_share_export_policy_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_get_share_export_policy_response_share_export_policy_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_share_export_policy_response_test.go b/services/sfs/model_get_share_export_policy_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_get_share_export_policy_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_share_response.go b/services/sfs/model_get_share_response.go new file mode 100644 index 000000000..c3ee6cf6c --- /dev/null +++ b/services/sfs/model_get_share_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the GetShareResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetShareResponse{} + +/* + types and functions for share +*/ + +// isModel +type GetShareResponseGetShareAttributeType = *GetShareResponseShare +type GetShareResponseGetShareArgType = GetShareResponseShare +type GetShareResponseGetShareRetType = GetShareResponseShare + +func getGetShareResponseGetShareAttributeTypeOk(arg GetShareResponseGetShareAttributeType) (ret GetShareResponseGetShareRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareResponseGetShareAttributeType(arg *GetShareResponseGetShareAttributeType, val GetShareResponseGetShareRetType) { + *arg = &val +} + +// GetShareResponse struct for GetShareResponse +type GetShareResponse struct { + Share GetShareResponseGetShareAttributeType `json:"share,omitempty"` +} + +// NewGetShareResponse instantiates a new GetShareResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetShareResponse() *GetShareResponse { + this := GetShareResponse{} + return &this +} + +// NewGetShareResponseWithDefaults instantiates a new GetShareResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetShareResponseWithDefaults() *GetShareResponse { + this := GetShareResponse{} + return &this +} + +// GetShare returns the Share field value if set, zero value otherwise. +func (o *GetShareResponse) GetShare() (res GetShareResponseGetShareRetType) { + res, _ = o.GetShareOk() + return +} + +// GetShareOk returns a tuple with the Share field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetShareResponse) GetShareOk() (ret GetShareResponseGetShareRetType, ok bool) { + return getGetShareResponseGetShareAttributeTypeOk(o.Share) +} + +// HasShare returns a boolean if a field has been set. +func (o *GetShareResponse) HasShare() bool { + _, ok := o.GetShareOk() + return ok +} + +// SetShare gets a reference to the given GetShareResponseShare and assigns it to the Share field. +func (o *GetShareResponse) SetShare(v GetShareResponseGetShareRetType) { + setGetShareResponseGetShareAttributeType(&o.Share, v) +} + +func (o GetShareResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetShareResponseGetShareAttributeTypeOk(o.Share); ok { + toSerialize["Share"] = val + } + return toSerialize, nil +} + +type NullableGetShareResponse struct { + value *GetShareResponse + isSet bool +} + +func (v NullableGetShareResponse) Get() *GetShareResponse { + return v.value +} + +func (v *NullableGetShareResponse) Set(val *GetShareResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetShareResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetShareResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetShareResponse(val *GetShareResponse) *NullableGetShareResponse { + return &NullableGetShareResponse{value: val, isSet: true} +} + +func (v NullableGetShareResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetShareResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_share_response_share.go b/services/sfs/model_get_share_response_share.go new file mode 100644 index 000000000..735f5d0f7 --- /dev/null +++ b/services/sfs/model_get_share_response_share.go @@ -0,0 +1,479 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the GetShareResponseShare type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetShareResponseShare{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type GetShareResponseShareGetCreatedAtAttributeType = *time.Time +type GetShareResponseShareGetCreatedAtArgType = time.Time +type GetShareResponseShareGetCreatedAtRetType = time.Time + +func getGetShareResponseShareGetCreatedAtAttributeTypeOk(arg GetShareResponseShareGetCreatedAtAttributeType) (ret GetShareResponseShareGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareResponseShareGetCreatedAtAttributeType(arg *GetShareResponseShareGetCreatedAtAttributeType, val GetShareResponseShareGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for exportPolicy +*/ + +// isModel +type GetShareResponseShareGetExportPolicyAttributeType = *NullableShareExportPolicy +type GetShareResponseShareGetExportPolicyArgType = *NullableShareExportPolicy +type GetShareResponseShareGetExportPolicyRetType = *NullableShareExportPolicy + +func getGetShareResponseShareGetExportPolicyAttributeTypeOk(arg GetShareResponseShareGetExportPolicyAttributeType) (ret GetShareResponseShareGetExportPolicyRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setGetShareResponseShareGetExportPolicyAttributeType(arg *GetShareResponseShareGetExportPolicyAttributeType, val GetShareResponseShareGetExportPolicyRetType) { + *arg = val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type GetShareResponseShareGetIdAttributeType = *string + +func getGetShareResponseShareGetIdAttributeTypeOk(arg GetShareResponseShareGetIdAttributeType) (ret GetShareResponseShareGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareResponseShareGetIdAttributeType(arg *GetShareResponseShareGetIdAttributeType, val GetShareResponseShareGetIdRetType) { + *arg = &val +} + +type GetShareResponseShareGetIdArgType = string +type GetShareResponseShareGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type GetShareResponseShareGetLabelsAttributeType = *map[string]string +type GetShareResponseShareGetLabelsArgType = map[string]string +type GetShareResponseShareGetLabelsRetType = map[string]string + +func getGetShareResponseShareGetLabelsAttributeTypeOk(arg GetShareResponseShareGetLabelsAttributeType) (ret GetShareResponseShareGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareResponseShareGetLabelsAttributeType(arg *GetShareResponseShareGetLabelsAttributeType, val GetShareResponseShareGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mountPath +*/ + +// isNotNullableString +type GetShareResponseShareGetMountPathAttributeType = *string + +func getGetShareResponseShareGetMountPathAttributeTypeOk(arg GetShareResponseShareGetMountPathAttributeType) (ret GetShareResponseShareGetMountPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareResponseShareGetMountPathAttributeType(arg *GetShareResponseShareGetMountPathAttributeType, val GetShareResponseShareGetMountPathRetType) { + *arg = &val +} + +type GetShareResponseShareGetMountPathArgType = string +type GetShareResponseShareGetMountPathRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type GetShareResponseShareGetNameAttributeType = *string + +func getGetShareResponseShareGetNameAttributeTypeOk(arg GetShareResponseShareGetNameAttributeType) (ret GetShareResponseShareGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareResponseShareGetNameAttributeType(arg *GetShareResponseShareGetNameAttributeType, val GetShareResponseShareGetNameRetType) { + *arg = &val +} + +type GetShareResponseShareGetNameArgType = string +type GetShareResponseShareGetNameRetType = string + +/* + types and functions for spaceHardLimitGigabytes +*/ + +// isInteger +type GetShareResponseShareGetSpaceHardLimitGigabytesAttributeType = *int64 +type GetShareResponseShareGetSpaceHardLimitGigabytesArgType = int64 +type GetShareResponseShareGetSpaceHardLimitGigabytesRetType = int64 + +func getGetShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(arg GetShareResponseShareGetSpaceHardLimitGigabytesAttributeType) (ret GetShareResponseShareGetSpaceHardLimitGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareResponseShareGetSpaceHardLimitGigabytesAttributeType(arg *GetShareResponseShareGetSpaceHardLimitGigabytesAttributeType, val GetShareResponseShareGetSpaceHardLimitGigabytesRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type GetShareResponseShareGetStateAttributeType = *string + +func getGetShareResponseShareGetStateAttributeTypeOk(arg GetShareResponseShareGetStateAttributeType) (ret GetShareResponseShareGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetShareResponseShareGetStateAttributeType(arg *GetShareResponseShareGetStateAttributeType, val GetShareResponseShareGetStateRetType) { + *arg = &val +} + +type GetShareResponseShareGetStateArgType = string +type GetShareResponseShareGetStateRetType = string + +// GetShareResponseShare Share +type GetShareResponseShare struct { + CreatedAt GetShareResponseShareGetCreatedAtAttributeType `json:"createdAt,omitempty"` + ExportPolicy GetShareResponseShareGetExportPolicyAttributeType `json:"exportPolicy,omitempty"` + // ID of the Share + Id GetShareResponseShareGetIdAttributeType `json:"id,omitempty"` + // An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels GetShareResponseShareGetLabelsAttributeType `json:"labels,omitempty"` + // Mount path of the Share, used to mount the Share + MountPath GetShareResponseShareGetMountPathAttributeType `json:"mountPath,omitempty"` + // Name of the Share + Name GetShareResponseShareGetNameAttributeType `json:"name,omitempty"` + // Space hard limit for the Share. If zero, the Share will have access to the full space of the Resource Pool it lives in. (unit: gibibytes) + // Can be cast to int32 without loss of precision. + SpaceHardLimitGigabytes GetShareResponseShareGetSpaceHardLimitGigabytesAttributeType `json:"spaceHardLimitGigabytes,omitempty"` + // State of the Resource Pool Snapshot (possible values: [\"pending\", \"creating\", \"created\", \"error\", \"deleting\"]) + State GetShareResponseShareGetStateAttributeType `json:"state,omitempty"` +} + +// NewGetShareResponseShare instantiates a new GetShareResponseShare object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetShareResponseShare() *GetShareResponseShare { + this := GetShareResponseShare{} + return &this +} + +// NewGetShareResponseShareWithDefaults instantiates a new GetShareResponseShare object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetShareResponseShareWithDefaults() *GetShareResponseShare { + this := GetShareResponseShare{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GetShareResponseShare) GetCreatedAt() (res GetShareResponseShareGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetShareResponseShare) GetCreatedAtOk() (ret GetShareResponseShareGetCreatedAtRetType, ok bool) { + return getGetShareResponseShareGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GetShareResponseShare) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *GetShareResponseShare) SetCreatedAt(v GetShareResponseShareGetCreatedAtRetType) { + setGetShareResponseShareGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetExportPolicy returns the ExportPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetShareResponseShare) GetExportPolicy() (res GetShareResponseShareGetExportPolicyRetType) { + res, _ = o.GetExportPolicyOk() + return +} + +// GetExportPolicyOk returns a tuple with the ExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetShareResponseShare) GetExportPolicyOk() (ret GetShareResponseShareGetExportPolicyRetType, ok bool) { + return getGetShareResponseShareGetExportPolicyAttributeTypeOk(o.ExportPolicy) +} + +// HasExportPolicy returns a boolean if a field has been set. +func (o *GetShareResponseShare) HasExportPolicy() bool { + _, ok := o.GetExportPolicyOk() + return ok +} + +// SetExportPolicy gets a reference to the given ShareExportPolicy and assigns it to the ExportPolicy field. +func (o *GetShareResponseShare) SetExportPolicy(v GetShareResponseShareGetExportPolicyRetType) { + setGetShareResponseShareGetExportPolicyAttributeType(&o.ExportPolicy, v) +} + +// SetExportPolicyNil sets the value for ExportPolicy to be an explicit nil +func (o *GetShareResponseShare) SetExportPolicyNil() { + o.ExportPolicy = nil +} + +// UnsetExportPolicy ensures that no value is present for ExportPolicy, not even an explicit nil +func (o *GetShareResponseShare) UnsetExportPolicy() { + o.ExportPolicy = nil +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GetShareResponseShare) GetId() (res GetShareResponseShareGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *GetShareResponseShare) GetIdOk() (ret GetShareResponseShareGetIdRetType, ok bool) { + return getGetShareResponseShareGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *GetShareResponseShare) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GetShareResponseShare) SetId(v GetShareResponseShareGetIdRetType) { + setGetShareResponseShareGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *GetShareResponseShare) GetLabels() (res GetShareResponseShareGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *GetShareResponseShare) GetLabelsOk() (ret GetShareResponseShareGetLabelsRetType, ok bool) { + return getGetShareResponseShareGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *GetShareResponseShare) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *GetShareResponseShare) SetLabels(v GetShareResponseShareGetLabelsRetType) { + setGetShareResponseShareGetLabelsAttributeType(&o.Labels, v) +} + +// GetMountPath returns the MountPath field value if set, zero value otherwise. +func (o *GetShareResponseShare) GetMountPath() (res GetShareResponseShareGetMountPathRetType) { + res, _ = o.GetMountPathOk() + return +} + +// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetShareResponseShare) GetMountPathOk() (ret GetShareResponseShareGetMountPathRetType, ok bool) { + return getGetShareResponseShareGetMountPathAttributeTypeOk(o.MountPath) +} + +// HasMountPath returns a boolean if a field has been set. +func (o *GetShareResponseShare) HasMountPath() bool { + _, ok := o.GetMountPathOk() + return ok +} + +// SetMountPath gets a reference to the given string and assigns it to the MountPath field. +func (o *GetShareResponseShare) SetMountPath(v GetShareResponseShareGetMountPathRetType) { + setGetShareResponseShareGetMountPathAttributeType(&o.MountPath, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetShareResponseShare) GetName() (res GetShareResponseShareGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *GetShareResponseShare) GetNameOk() (ret GetShareResponseShareGetNameRetType, ok bool) { + return getGetShareResponseShareGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *GetShareResponseShare) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GetShareResponseShare) SetName(v GetShareResponseShareGetNameRetType) { + setGetShareResponseShareGetNameAttributeType(&o.Name, v) +} + +// GetSpaceHardLimitGigabytes returns the SpaceHardLimitGigabytes field value if set, zero value otherwise. +func (o *GetShareResponseShare) GetSpaceHardLimitGigabytes() (res GetShareResponseShareGetSpaceHardLimitGigabytesRetType) { + res, _ = o.GetSpaceHardLimitGigabytesOk() + return +} + +// GetSpaceHardLimitGigabytesOk returns a tuple with the SpaceHardLimitGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetShareResponseShare) GetSpaceHardLimitGigabytesOk() (ret GetShareResponseShareGetSpaceHardLimitGigabytesRetType, ok bool) { + return getGetShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes) +} + +// HasSpaceHardLimitGigabytes returns a boolean if a field has been set. +func (o *GetShareResponseShare) HasSpaceHardLimitGigabytes() bool { + _, ok := o.GetSpaceHardLimitGigabytesOk() + return ok +} + +// SetSpaceHardLimitGigabytes gets a reference to the given int64 and assigns it to the SpaceHardLimitGigabytes field. +func (o *GetShareResponseShare) SetSpaceHardLimitGigabytes(v GetShareResponseShareGetSpaceHardLimitGigabytesRetType) { + setGetShareResponseShareGetSpaceHardLimitGigabytesAttributeType(&o.SpaceHardLimitGigabytes, v) +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *GetShareResponseShare) GetState() (res GetShareResponseShareGetStateRetType) { + res, _ = o.GetStateOk() + return +} + +// 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 *GetShareResponseShare) GetStateOk() (ret GetShareResponseShareGetStateRetType, ok bool) { + return getGetShareResponseShareGetStateAttributeTypeOk(o.State) +} + +// HasState returns a boolean if a field has been set. +func (o *GetShareResponseShare) HasState() bool { + _, ok := o.GetStateOk() + return ok +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *GetShareResponseShare) SetState(v GetShareResponseShareGetStateRetType) { + setGetShareResponseShareGetStateAttributeType(&o.State, v) +} + +func (o GetShareResponseShare) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetShareResponseShareGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getGetShareResponseShareGetExportPolicyAttributeTypeOk(o.ExportPolicy); ok { + toSerialize["ExportPolicy"] = val + } + if val, ok := getGetShareResponseShareGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getGetShareResponseShareGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getGetShareResponseShareGetMountPathAttributeTypeOk(o.MountPath); ok { + toSerialize["MountPath"] = val + } + if val, ok := getGetShareResponseShareGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getGetShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes); ok { + toSerialize["SpaceHardLimitGigabytes"] = val + } + if val, ok := getGetShareResponseShareGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +type NullableGetShareResponseShare struct { + value *GetShareResponseShare + isSet bool +} + +func (v NullableGetShareResponseShare) Get() *GetShareResponseShare { + return v.value +} + +func (v *NullableGetShareResponseShare) Set(val *GetShareResponseShare) { + v.value = val + v.isSet = true +} + +func (v NullableGetShareResponseShare) IsSet() bool { + return v.isSet +} + +func (v *NullableGetShareResponseShare) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetShareResponseShare(val *GetShareResponseShare) *NullableGetShareResponseShare { + return &NullableGetShareResponseShare{value: val, isSet: true} +} + +func (v NullableGetShareResponseShare) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetShareResponseShare) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_share_response_share_test.go b/services/sfs/model_get_share_response_share_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_get_share_response_share_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_share_response_test.go b/services/sfs/model_get_share_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_get_share_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_google_protobuf_any.go b/services/sfs/model_google_protobuf_any.go new file mode 100644 index 000000000..fafe640f7 --- /dev/null +++ b/services/sfs/model_google_protobuf_any.go @@ -0,0 +1,137 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the GoogleProtobufAny type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleProtobufAny{} + +/* + types and functions for @type +*/ + +// isNotNullableString +type GoogleProtobufAnyGetTypeAttributeType = *string + +func getGoogleProtobufAnyGetTypeAttributeTypeOk(arg GoogleProtobufAnyGetTypeAttributeType) (ret GoogleProtobufAnyGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGoogleProtobufAnyGetTypeAttributeType(arg *GoogleProtobufAnyGetTypeAttributeType, val GoogleProtobufAnyGetTypeRetType) { + *arg = &val +} + +type GoogleProtobufAnyGetTypeArgType = string +type GoogleProtobufAnyGetTypeRetType = string + +// 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 GoogleProtobufAnyGetTypeAttributeType `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() (res GoogleProtobufAnyGetTypeRetType) { + res, _ = o.GetTypeOk() + return +} + +// 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() (ret GoogleProtobufAnyGetTypeRetType, ok bool) { + return getGoogleProtobufAnyGetTypeAttributeTypeOk(o.Type) +} + +// HasType returns a boolean if a field has been set. +func (o *GoogleProtobufAny) HasType() bool { + _, ok := o.GetTypeOk() + return ok +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *GoogleProtobufAny) SetType(v GoogleProtobufAnyGetTypeRetType) { + setGoogleProtobufAnyGetTypeAttributeType(&o.Type, v) +} + +func (o GoogleProtobufAny) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGoogleProtobufAnyGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + + 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/sfs/model_google_protobuf_any_test.go b/services/sfs/model_google_protobuf_any_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_google_protobuf_any_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_list_performance_classes_response.go b/services/sfs/model_list_performance_classes_response.go new file mode 100644 index 000000000..22cec1e32 --- /dev/null +++ b/services/sfs/model_list_performance_classes_response.go @@ -0,0 +1,128 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ListPerformanceClassesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListPerformanceClassesResponse{} + +/* + types and functions for performanceClasses +*/ + +// isArray +type ListPerformanceClassesResponseGetPerformanceClassesAttributeType = *[]PerformanceClass +type ListPerformanceClassesResponseGetPerformanceClassesArgType = []PerformanceClass +type ListPerformanceClassesResponseGetPerformanceClassesRetType = []PerformanceClass + +func getListPerformanceClassesResponseGetPerformanceClassesAttributeTypeOk(arg ListPerformanceClassesResponseGetPerformanceClassesAttributeType) (ret ListPerformanceClassesResponseGetPerformanceClassesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListPerformanceClassesResponseGetPerformanceClassesAttributeType(arg *ListPerformanceClassesResponseGetPerformanceClassesAttributeType, val ListPerformanceClassesResponseGetPerformanceClassesRetType) { + *arg = &val +} + +// ListPerformanceClassesResponse struct for ListPerformanceClassesResponse +type ListPerformanceClassesResponse struct { + // List of Performance Classes + PerformanceClasses ListPerformanceClassesResponseGetPerformanceClassesAttributeType `json:"performanceClasses,omitempty"` +} + +// NewListPerformanceClassesResponse instantiates a new ListPerformanceClassesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListPerformanceClassesResponse() *ListPerformanceClassesResponse { + this := ListPerformanceClassesResponse{} + return &this +} + +// NewListPerformanceClassesResponseWithDefaults instantiates a new ListPerformanceClassesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListPerformanceClassesResponseWithDefaults() *ListPerformanceClassesResponse { + this := ListPerformanceClassesResponse{} + return &this +} + +// GetPerformanceClasses returns the PerformanceClasses field value if set, zero value otherwise. +func (o *ListPerformanceClassesResponse) GetPerformanceClasses() (res ListPerformanceClassesResponseGetPerformanceClassesRetType) { + res, _ = o.GetPerformanceClassesOk() + return +} + +// GetPerformanceClassesOk returns a tuple with the PerformanceClasses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListPerformanceClassesResponse) GetPerformanceClassesOk() (ret ListPerformanceClassesResponseGetPerformanceClassesRetType, ok bool) { + return getListPerformanceClassesResponseGetPerformanceClassesAttributeTypeOk(o.PerformanceClasses) +} + +// HasPerformanceClasses returns a boolean if a field has been set. +func (o *ListPerformanceClassesResponse) HasPerformanceClasses() bool { + _, ok := o.GetPerformanceClassesOk() + return ok +} + +// SetPerformanceClasses gets a reference to the given []PerformanceClass and assigns it to the PerformanceClasses field. +func (o *ListPerformanceClassesResponse) SetPerformanceClasses(v ListPerformanceClassesResponseGetPerformanceClassesRetType) { + setListPerformanceClassesResponseGetPerformanceClassesAttributeType(&o.PerformanceClasses, v) +} + +func (o ListPerformanceClassesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListPerformanceClassesResponseGetPerformanceClassesAttributeTypeOk(o.PerformanceClasses); ok { + toSerialize["PerformanceClasses"] = val + } + return toSerialize, nil +} + +type NullableListPerformanceClassesResponse struct { + value *ListPerformanceClassesResponse + isSet bool +} + +func (v NullableListPerformanceClassesResponse) Get() *ListPerformanceClassesResponse { + return v.value +} + +func (v *NullableListPerformanceClassesResponse) Set(val *ListPerformanceClassesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListPerformanceClassesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListPerformanceClassesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListPerformanceClassesResponse(val *ListPerformanceClassesResponse) *NullableListPerformanceClassesResponse { + return &NullableListPerformanceClassesResponse{value: val, isSet: true} +} + +func (v NullableListPerformanceClassesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListPerformanceClassesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_list_performance_classes_response_test.go b/services/sfs/model_list_performance_classes_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_list_performance_classes_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_list_resource_pool_snapshots_response.go b/services/sfs/model_list_resource_pool_snapshots_response.go new file mode 100644 index 000000000..7ce52212f --- /dev/null +++ b/services/sfs/model_list_resource_pool_snapshots_response.go @@ -0,0 +1,128 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ListResourcePoolSnapshotsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResourcePoolSnapshotsResponse{} + +/* + types and functions for resourcePoolSnapshots +*/ + +// isArray +type ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeType = *[]ResourcePoolSnapshot +type ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsArgType = []ResourcePoolSnapshot +type ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsRetType = []ResourcePoolSnapshot + +func getListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeTypeOk(arg ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeType) (ret ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeType(arg *ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeType, val ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsRetType) { + *arg = &val +} + +// ListResourcePoolSnapshotsResponse struct for ListResourcePoolSnapshotsResponse +type ListResourcePoolSnapshotsResponse struct { + // List of Resource Pool Snapshots + ResourcePoolSnapshots ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeType `json:"resourcePoolSnapshots,omitempty"` +} + +// NewListResourcePoolSnapshotsResponse instantiates a new ListResourcePoolSnapshotsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListResourcePoolSnapshotsResponse() *ListResourcePoolSnapshotsResponse { + this := ListResourcePoolSnapshotsResponse{} + return &this +} + +// NewListResourcePoolSnapshotsResponseWithDefaults instantiates a new ListResourcePoolSnapshotsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListResourcePoolSnapshotsResponseWithDefaults() *ListResourcePoolSnapshotsResponse { + this := ListResourcePoolSnapshotsResponse{} + return &this +} + +// GetResourcePoolSnapshots returns the ResourcePoolSnapshots field value if set, zero value otherwise. +func (o *ListResourcePoolSnapshotsResponse) GetResourcePoolSnapshots() (res ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsRetType) { + res, _ = o.GetResourcePoolSnapshotsOk() + return +} + +// GetResourcePoolSnapshotsOk returns a tuple with the ResourcePoolSnapshots field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListResourcePoolSnapshotsResponse) GetResourcePoolSnapshotsOk() (ret ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsRetType, ok bool) { + return getListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeTypeOk(o.ResourcePoolSnapshots) +} + +// HasResourcePoolSnapshots returns a boolean if a field has been set. +func (o *ListResourcePoolSnapshotsResponse) HasResourcePoolSnapshots() bool { + _, ok := o.GetResourcePoolSnapshotsOk() + return ok +} + +// SetResourcePoolSnapshots gets a reference to the given []ResourcePoolSnapshot and assigns it to the ResourcePoolSnapshots field. +func (o *ListResourcePoolSnapshotsResponse) SetResourcePoolSnapshots(v ListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsRetType) { + setListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeType(&o.ResourcePoolSnapshots, v) +} + +func (o ListResourcePoolSnapshotsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListResourcePoolSnapshotsResponseGetResourcePoolSnapshotsAttributeTypeOk(o.ResourcePoolSnapshots); ok { + toSerialize["ResourcePoolSnapshots"] = val + } + return toSerialize, nil +} + +type NullableListResourcePoolSnapshotsResponse struct { + value *ListResourcePoolSnapshotsResponse + isSet bool +} + +func (v NullableListResourcePoolSnapshotsResponse) Get() *ListResourcePoolSnapshotsResponse { + return v.value +} + +func (v *NullableListResourcePoolSnapshotsResponse) Set(val *ListResourcePoolSnapshotsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListResourcePoolSnapshotsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListResourcePoolSnapshotsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListResourcePoolSnapshotsResponse(val *ListResourcePoolSnapshotsResponse) *NullableListResourcePoolSnapshotsResponse { + return &NullableListResourcePoolSnapshotsResponse{value: val, isSet: true} +} + +func (v NullableListResourcePoolSnapshotsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListResourcePoolSnapshotsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_list_resource_pool_snapshots_response_test.go b/services/sfs/model_list_resource_pool_snapshots_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_list_resource_pool_snapshots_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_list_resource_pools_response.go b/services/sfs/model_list_resource_pools_response.go new file mode 100644 index 000000000..def39a1c1 --- /dev/null +++ b/services/sfs/model_list_resource_pools_response.go @@ -0,0 +1,128 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ListResourcePoolsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResourcePoolsResponse{} + +/* + types and functions for resourcePools +*/ + +// isArray +type ListResourcePoolsResponseGetResourcePoolsAttributeType = *[]ResourcePool +type ListResourcePoolsResponseGetResourcePoolsArgType = []ResourcePool +type ListResourcePoolsResponseGetResourcePoolsRetType = []ResourcePool + +func getListResourcePoolsResponseGetResourcePoolsAttributeTypeOk(arg ListResourcePoolsResponseGetResourcePoolsAttributeType) (ret ListResourcePoolsResponseGetResourcePoolsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListResourcePoolsResponseGetResourcePoolsAttributeType(arg *ListResourcePoolsResponseGetResourcePoolsAttributeType, val ListResourcePoolsResponseGetResourcePoolsRetType) { + *arg = &val +} + +// ListResourcePoolsResponse struct for ListResourcePoolsResponse +type ListResourcePoolsResponse struct { + // List of Resource Pools + ResourcePools ListResourcePoolsResponseGetResourcePoolsAttributeType `json:"resourcePools,omitempty"` +} + +// NewListResourcePoolsResponse instantiates a new ListResourcePoolsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListResourcePoolsResponse() *ListResourcePoolsResponse { + this := ListResourcePoolsResponse{} + return &this +} + +// NewListResourcePoolsResponseWithDefaults instantiates a new ListResourcePoolsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListResourcePoolsResponseWithDefaults() *ListResourcePoolsResponse { + this := ListResourcePoolsResponse{} + return &this +} + +// GetResourcePools returns the ResourcePools field value if set, zero value otherwise. +func (o *ListResourcePoolsResponse) GetResourcePools() (res ListResourcePoolsResponseGetResourcePoolsRetType) { + res, _ = o.GetResourcePoolsOk() + return +} + +// GetResourcePoolsOk returns a tuple with the ResourcePools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListResourcePoolsResponse) GetResourcePoolsOk() (ret ListResourcePoolsResponseGetResourcePoolsRetType, ok bool) { + return getListResourcePoolsResponseGetResourcePoolsAttributeTypeOk(o.ResourcePools) +} + +// HasResourcePools returns a boolean if a field has been set. +func (o *ListResourcePoolsResponse) HasResourcePools() bool { + _, ok := o.GetResourcePoolsOk() + return ok +} + +// SetResourcePools gets a reference to the given []ResourcePool and assigns it to the ResourcePools field. +func (o *ListResourcePoolsResponse) SetResourcePools(v ListResourcePoolsResponseGetResourcePoolsRetType) { + setListResourcePoolsResponseGetResourcePoolsAttributeType(&o.ResourcePools, v) +} + +func (o ListResourcePoolsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListResourcePoolsResponseGetResourcePoolsAttributeTypeOk(o.ResourcePools); ok { + toSerialize["ResourcePools"] = val + } + return toSerialize, nil +} + +type NullableListResourcePoolsResponse struct { + value *ListResourcePoolsResponse + isSet bool +} + +func (v NullableListResourcePoolsResponse) Get() *ListResourcePoolsResponse { + return v.value +} + +func (v *NullableListResourcePoolsResponse) Set(val *ListResourcePoolsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListResourcePoolsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListResourcePoolsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListResourcePoolsResponse(val *ListResourcePoolsResponse) *NullableListResourcePoolsResponse { + return &NullableListResourcePoolsResponse{value: val, isSet: true} +} + +func (v NullableListResourcePoolsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListResourcePoolsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_list_resource_pools_response_test.go b/services/sfs/model_list_resource_pools_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_list_resource_pools_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_list_share_export_policies_response.go b/services/sfs/model_list_share_export_policies_response.go new file mode 100644 index 000000000..793a52f2a --- /dev/null +++ b/services/sfs/model_list_share_export_policies_response.go @@ -0,0 +1,128 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ListShareExportPoliciesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListShareExportPoliciesResponse{} + +/* + types and functions for shareExportPolicies +*/ + +// isArray +type ListShareExportPoliciesResponseGetShareExportPoliciesAttributeType = *[]ShareExportPolicy +type ListShareExportPoliciesResponseGetShareExportPoliciesArgType = []ShareExportPolicy +type ListShareExportPoliciesResponseGetShareExportPoliciesRetType = []ShareExportPolicy + +func getListShareExportPoliciesResponseGetShareExportPoliciesAttributeTypeOk(arg ListShareExportPoliciesResponseGetShareExportPoliciesAttributeType) (ret ListShareExportPoliciesResponseGetShareExportPoliciesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListShareExportPoliciesResponseGetShareExportPoliciesAttributeType(arg *ListShareExportPoliciesResponseGetShareExportPoliciesAttributeType, val ListShareExportPoliciesResponseGetShareExportPoliciesRetType) { + *arg = &val +} + +// ListShareExportPoliciesResponse struct for ListShareExportPoliciesResponse +type ListShareExportPoliciesResponse struct { + // List of Share Export Policies + ShareExportPolicies ListShareExportPoliciesResponseGetShareExportPoliciesAttributeType `json:"shareExportPolicies,omitempty"` +} + +// NewListShareExportPoliciesResponse instantiates a new ListShareExportPoliciesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListShareExportPoliciesResponse() *ListShareExportPoliciesResponse { + this := ListShareExportPoliciesResponse{} + return &this +} + +// NewListShareExportPoliciesResponseWithDefaults instantiates a new ListShareExportPoliciesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListShareExportPoliciesResponseWithDefaults() *ListShareExportPoliciesResponse { + this := ListShareExportPoliciesResponse{} + return &this +} + +// GetShareExportPolicies returns the ShareExportPolicies field value if set, zero value otherwise. +func (o *ListShareExportPoliciesResponse) GetShareExportPolicies() (res ListShareExportPoliciesResponseGetShareExportPoliciesRetType) { + res, _ = o.GetShareExportPoliciesOk() + return +} + +// GetShareExportPoliciesOk returns a tuple with the ShareExportPolicies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListShareExportPoliciesResponse) GetShareExportPoliciesOk() (ret ListShareExportPoliciesResponseGetShareExportPoliciesRetType, ok bool) { + return getListShareExportPoliciesResponseGetShareExportPoliciesAttributeTypeOk(o.ShareExportPolicies) +} + +// HasShareExportPolicies returns a boolean if a field has been set. +func (o *ListShareExportPoliciesResponse) HasShareExportPolicies() bool { + _, ok := o.GetShareExportPoliciesOk() + return ok +} + +// SetShareExportPolicies gets a reference to the given []ShareExportPolicy and assigns it to the ShareExportPolicies field. +func (o *ListShareExportPoliciesResponse) SetShareExportPolicies(v ListShareExportPoliciesResponseGetShareExportPoliciesRetType) { + setListShareExportPoliciesResponseGetShareExportPoliciesAttributeType(&o.ShareExportPolicies, v) +} + +func (o ListShareExportPoliciesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListShareExportPoliciesResponseGetShareExportPoliciesAttributeTypeOk(o.ShareExportPolicies); ok { + toSerialize["ShareExportPolicies"] = val + } + return toSerialize, nil +} + +type NullableListShareExportPoliciesResponse struct { + value *ListShareExportPoliciesResponse + isSet bool +} + +func (v NullableListShareExportPoliciesResponse) Get() *ListShareExportPoliciesResponse { + return v.value +} + +func (v *NullableListShareExportPoliciesResponse) Set(val *ListShareExportPoliciesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListShareExportPoliciesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListShareExportPoliciesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListShareExportPoliciesResponse(val *ListShareExportPoliciesResponse) *NullableListShareExportPoliciesResponse { + return &NullableListShareExportPoliciesResponse{value: val, isSet: true} +} + +func (v NullableListShareExportPoliciesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListShareExportPoliciesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_list_share_export_policies_response_test.go b/services/sfs/model_list_share_export_policies_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_list_share_export_policies_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_list_shares_response.go b/services/sfs/model_list_shares_response.go new file mode 100644 index 000000000..c1e127fd2 --- /dev/null +++ b/services/sfs/model_list_shares_response.go @@ -0,0 +1,128 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ListSharesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListSharesResponse{} + +/* + types and functions for shares +*/ + +// isArray +type ListSharesResponseGetSharesAttributeType = *[]Share +type ListSharesResponseGetSharesArgType = []Share +type ListSharesResponseGetSharesRetType = []Share + +func getListSharesResponseGetSharesAttributeTypeOk(arg ListSharesResponseGetSharesAttributeType) (ret ListSharesResponseGetSharesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListSharesResponseGetSharesAttributeType(arg *ListSharesResponseGetSharesAttributeType, val ListSharesResponseGetSharesRetType) { + *arg = &val +} + +// ListSharesResponse struct for ListSharesResponse +type ListSharesResponse struct { + // List of Shares + Shares ListSharesResponseGetSharesAttributeType `json:"shares,omitempty"` +} + +// NewListSharesResponse instantiates a new ListSharesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListSharesResponse() *ListSharesResponse { + this := ListSharesResponse{} + return &this +} + +// NewListSharesResponseWithDefaults instantiates a new ListSharesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListSharesResponseWithDefaults() *ListSharesResponse { + this := ListSharesResponse{} + return &this +} + +// GetShares returns the Shares field value if set, zero value otherwise. +func (o *ListSharesResponse) GetShares() (res ListSharesResponseGetSharesRetType) { + res, _ = o.GetSharesOk() + return +} + +// GetSharesOk returns a tuple with the Shares field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListSharesResponse) GetSharesOk() (ret ListSharesResponseGetSharesRetType, ok bool) { + return getListSharesResponseGetSharesAttributeTypeOk(o.Shares) +} + +// HasShares returns a boolean if a field has been set. +func (o *ListSharesResponse) HasShares() bool { + _, ok := o.GetSharesOk() + return ok +} + +// SetShares gets a reference to the given []Share and assigns it to the Shares field. +func (o *ListSharesResponse) SetShares(v ListSharesResponseGetSharesRetType) { + setListSharesResponseGetSharesAttributeType(&o.Shares, v) +} + +func (o ListSharesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListSharesResponseGetSharesAttributeTypeOk(o.Shares); ok { + toSerialize["Shares"] = val + } + return toSerialize, nil +} + +type NullableListSharesResponse struct { + value *ListSharesResponse + isSet bool +} + +func (v NullableListSharesResponse) Get() *ListSharesResponse { + return v.value +} + +func (v *NullableListSharesResponse) Set(val *ListSharesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListSharesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListSharesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListSharesResponse(val *ListSharesResponse) *NullableListSharesResponse { + return &NullableListSharesResponse{value: val, isSet: true} +} + +func (v NullableListSharesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListSharesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_list_shares_response_test.go b/services/sfs/model_list_shares_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_list_shares_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_list_snapshot_schedules_response.go b/services/sfs/model_list_snapshot_schedules_response.go new file mode 100644 index 000000000..c0977b14e --- /dev/null +++ b/services/sfs/model_list_snapshot_schedules_response.go @@ -0,0 +1,128 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ListSnapshotSchedulesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListSnapshotSchedulesResponse{} + +/* + types and functions for snapshotSchedules +*/ + +// isArray +type ListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeType = *[]SnapshotSchedule +type ListSnapshotSchedulesResponseGetSnapshotSchedulesArgType = []SnapshotSchedule +type ListSnapshotSchedulesResponseGetSnapshotSchedulesRetType = []SnapshotSchedule + +func getListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeTypeOk(arg ListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeType) (ret ListSnapshotSchedulesResponseGetSnapshotSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeType(arg *ListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeType, val ListSnapshotSchedulesResponseGetSnapshotSchedulesRetType) { + *arg = &val +} + +// ListSnapshotSchedulesResponse struct for ListSnapshotSchedulesResponse +type ListSnapshotSchedulesResponse struct { + // List of Snapshot Schedules + SnapshotSchedules ListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeType `json:"snapshotSchedules,omitempty"` +} + +// NewListSnapshotSchedulesResponse instantiates a new ListSnapshotSchedulesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListSnapshotSchedulesResponse() *ListSnapshotSchedulesResponse { + this := ListSnapshotSchedulesResponse{} + return &this +} + +// NewListSnapshotSchedulesResponseWithDefaults instantiates a new ListSnapshotSchedulesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListSnapshotSchedulesResponseWithDefaults() *ListSnapshotSchedulesResponse { + this := ListSnapshotSchedulesResponse{} + return &this +} + +// GetSnapshotSchedules returns the SnapshotSchedules field value if set, zero value otherwise. +func (o *ListSnapshotSchedulesResponse) GetSnapshotSchedules() (res ListSnapshotSchedulesResponseGetSnapshotSchedulesRetType) { + res, _ = o.GetSnapshotSchedulesOk() + return +} + +// GetSnapshotSchedulesOk returns a tuple with the SnapshotSchedules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListSnapshotSchedulesResponse) GetSnapshotSchedulesOk() (ret ListSnapshotSchedulesResponseGetSnapshotSchedulesRetType, ok bool) { + return getListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeTypeOk(o.SnapshotSchedules) +} + +// HasSnapshotSchedules returns a boolean if a field has been set. +func (o *ListSnapshotSchedulesResponse) HasSnapshotSchedules() bool { + _, ok := o.GetSnapshotSchedulesOk() + return ok +} + +// SetSnapshotSchedules gets a reference to the given []SnapshotSchedule and assigns it to the SnapshotSchedules field. +func (o *ListSnapshotSchedulesResponse) SetSnapshotSchedules(v ListSnapshotSchedulesResponseGetSnapshotSchedulesRetType) { + setListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeType(&o.SnapshotSchedules, v) +} + +func (o ListSnapshotSchedulesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListSnapshotSchedulesResponseGetSnapshotSchedulesAttributeTypeOk(o.SnapshotSchedules); ok { + toSerialize["SnapshotSchedules"] = val + } + return toSerialize, nil +} + +type NullableListSnapshotSchedulesResponse struct { + value *ListSnapshotSchedulesResponse + isSet bool +} + +func (v NullableListSnapshotSchedulesResponse) Get() *ListSnapshotSchedulesResponse { + return v.value +} + +func (v *NullableListSnapshotSchedulesResponse) Set(val *ListSnapshotSchedulesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListSnapshotSchedulesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListSnapshotSchedulesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListSnapshotSchedulesResponse(val *ListSnapshotSchedulesResponse) *NullableListSnapshotSchedulesResponse { + return &NullableListSnapshotSchedulesResponse{value: val, isSet: true} +} + +func (v NullableListSnapshotSchedulesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListSnapshotSchedulesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_list_snapshot_schedules_response_test.go b/services/sfs/model_list_snapshot_schedules_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_list_snapshot_schedules_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_performance_class.go b/services/sfs/model_performance_class.go new file mode 100644 index 000000000..6741d0199 --- /dev/null +++ b/services/sfs/model_performance_class.go @@ -0,0 +1,227 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the PerformanceClass type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PerformanceClass{} + +/* + types and functions for iops +*/ + +// isInteger +type PerformanceClassGetIopsAttributeType = *int64 +type PerformanceClassGetIopsArgType = int64 +type PerformanceClassGetIopsRetType = int64 + +func getPerformanceClassGetIopsAttributeTypeOk(arg PerformanceClassGetIopsAttributeType) (ret PerformanceClassGetIopsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPerformanceClassGetIopsAttributeType(arg *PerformanceClassGetIopsAttributeType, val PerformanceClassGetIopsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type PerformanceClassGetNameAttributeType = *string + +func getPerformanceClassGetNameAttributeTypeOk(arg PerformanceClassGetNameAttributeType) (ret PerformanceClassGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPerformanceClassGetNameAttributeType(arg *PerformanceClassGetNameAttributeType, val PerformanceClassGetNameRetType) { + *arg = &val +} + +type PerformanceClassGetNameArgType = string +type PerformanceClassGetNameRetType = string + +/* + types and functions for throughput +*/ + +// isInteger +type PerformanceClassGetThroughputAttributeType = *int64 +type PerformanceClassGetThroughputArgType = int64 +type PerformanceClassGetThroughputRetType = int64 + +func getPerformanceClassGetThroughputAttributeTypeOk(arg PerformanceClassGetThroughputAttributeType) (ret PerformanceClassGetThroughputRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPerformanceClassGetThroughputAttributeType(arg *PerformanceClassGetThroughputAttributeType, val PerformanceClassGetThroughputRetType) { + *arg = &val +} + +// PerformanceClass struct for PerformanceClass +type PerformanceClass struct { + // IOPS of the Performance Class + // Can be cast to int32 without loss of precision. + Iops PerformanceClassGetIopsAttributeType `json:"iops,omitempty"` + // Name of the Performance Class + Name PerformanceClassGetNameAttributeType `json:"name,omitempty"` + // Throughput of the Performance Class + // Can be cast to int32 without loss of precision. + Throughput PerformanceClassGetThroughputAttributeType `json:"throughput,omitempty"` +} + +// NewPerformanceClass instantiates a new PerformanceClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPerformanceClass() *PerformanceClass { + this := PerformanceClass{} + return &this +} + +// NewPerformanceClassWithDefaults instantiates a new PerformanceClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPerformanceClassWithDefaults() *PerformanceClass { + this := PerformanceClass{} + return &this +} + +// GetIops returns the Iops field value if set, zero value otherwise. +func (o *PerformanceClass) GetIops() (res PerformanceClassGetIopsRetType) { + res, _ = o.GetIopsOk() + return +} + +// GetIopsOk returns a tuple with the Iops field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PerformanceClass) GetIopsOk() (ret PerformanceClassGetIopsRetType, ok bool) { + return getPerformanceClassGetIopsAttributeTypeOk(o.Iops) +} + +// HasIops returns a boolean if a field has been set. +func (o *PerformanceClass) HasIops() bool { + _, ok := o.GetIopsOk() + return ok +} + +// SetIops gets a reference to the given int64 and assigns it to the Iops field. +func (o *PerformanceClass) SetIops(v PerformanceClassGetIopsRetType) { + setPerformanceClassGetIopsAttributeType(&o.Iops, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PerformanceClass) GetName() (res PerformanceClassGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *PerformanceClass) GetNameOk() (ret PerformanceClassGetNameRetType, ok bool) { + return getPerformanceClassGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *PerformanceClass) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PerformanceClass) SetName(v PerformanceClassGetNameRetType) { + setPerformanceClassGetNameAttributeType(&o.Name, v) +} + +// GetThroughput returns the Throughput field value if set, zero value otherwise. +func (o *PerformanceClass) GetThroughput() (res PerformanceClassGetThroughputRetType) { + res, _ = o.GetThroughputOk() + return +} + +// GetThroughputOk returns a tuple with the Throughput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PerformanceClass) GetThroughputOk() (ret PerformanceClassGetThroughputRetType, ok bool) { + return getPerformanceClassGetThroughputAttributeTypeOk(o.Throughput) +} + +// HasThroughput returns a boolean if a field has been set. +func (o *PerformanceClass) HasThroughput() bool { + _, ok := o.GetThroughputOk() + return ok +} + +// SetThroughput gets a reference to the given int64 and assigns it to the Throughput field. +func (o *PerformanceClass) SetThroughput(v PerformanceClassGetThroughputRetType) { + setPerformanceClassGetThroughputAttributeType(&o.Throughput, v) +} + +func (o PerformanceClass) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPerformanceClassGetIopsAttributeTypeOk(o.Iops); ok { + toSerialize["Iops"] = val + } + if val, ok := getPerformanceClassGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getPerformanceClassGetThroughputAttributeTypeOk(o.Throughput); ok { + toSerialize["Throughput"] = val + } + return toSerialize, nil +} + +type NullablePerformanceClass struct { + value *PerformanceClass + isSet bool +} + +func (v NullablePerformanceClass) Get() *PerformanceClass { + return v.value +} + +func (v *NullablePerformanceClass) Set(val *PerformanceClass) { + v.value = val + v.isSet = true +} + +func (v NullablePerformanceClass) IsSet() bool { + return v.isSet +} + +func (v *NullablePerformanceClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePerformanceClass(val *PerformanceClass) *NullablePerformanceClass { + return &NullablePerformanceClass{value: val, isSet: true} +} + +func (v NullablePerformanceClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePerformanceClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_performance_class_test.go b/services/sfs/model_performance_class_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_performance_class_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_resource_pool.go b/services/sfs/model_resource_pool.go new file mode 100644 index 000000000..1a3ebf5b1 --- /dev/null +++ b/services/sfs/model_resource_pool.go @@ -0,0 +1,802 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the ResourcePool type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourcePool{} + +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type ResourcePoolGetAvailabilityZoneAttributeType = *string + +func getResourcePoolGetAvailabilityZoneAttributeTypeOk(arg ResourcePoolGetAvailabilityZoneAttributeType) (ret ResourcePoolGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetAvailabilityZoneAttributeType(arg *ResourcePoolGetAvailabilityZoneAttributeType, val ResourcePoolGetAvailabilityZoneRetType) { + *arg = &val +} + +type ResourcePoolGetAvailabilityZoneArgType = string +type ResourcePoolGetAvailabilityZoneRetType = string + +/* + types and functions for countShares +*/ + +// isInteger +type ResourcePoolGetCountSharesAttributeType = *int64 +type ResourcePoolGetCountSharesArgType = int64 +type ResourcePoolGetCountSharesRetType = int64 + +func getResourcePoolGetCountSharesAttributeTypeOk(arg ResourcePoolGetCountSharesAttributeType) (ret ResourcePoolGetCountSharesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetCountSharesAttributeType(arg *ResourcePoolGetCountSharesAttributeType, val ResourcePoolGetCountSharesRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type ResourcePoolGetCreatedAtAttributeType = *time.Time +type ResourcePoolGetCreatedAtArgType = time.Time +type ResourcePoolGetCreatedAtRetType = time.Time + +func getResourcePoolGetCreatedAtAttributeTypeOk(arg ResourcePoolGetCreatedAtAttributeType) (ret ResourcePoolGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetCreatedAtAttributeType(arg *ResourcePoolGetCreatedAtAttributeType, val ResourcePoolGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type ResourcePoolGetIdAttributeType = *string + +func getResourcePoolGetIdAttributeTypeOk(arg ResourcePoolGetIdAttributeType) (ret ResourcePoolGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetIdAttributeType(arg *ResourcePoolGetIdAttributeType, val ResourcePoolGetIdRetType) { + *arg = &val +} + +type ResourcePoolGetIdArgType = string +type ResourcePoolGetIdRetType = string + +/* + types and functions for ipAcl +*/ + +// isArray +type ResourcePoolGetIpAclAttributeType = *[]string +type ResourcePoolGetIpAclArgType = []string +type ResourcePoolGetIpAclRetType = []string + +func getResourcePoolGetIpAclAttributeTypeOk(arg ResourcePoolGetIpAclAttributeType) (ret ResourcePoolGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetIpAclAttributeType(arg *ResourcePoolGetIpAclAttributeType, val ResourcePoolGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type ResourcePoolGetLabelsAttributeType = *map[string]string +type ResourcePoolGetLabelsArgType = map[string]string +type ResourcePoolGetLabelsRetType = map[string]string + +func getResourcePoolGetLabelsAttributeTypeOk(arg ResourcePoolGetLabelsAttributeType) (ret ResourcePoolGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetLabelsAttributeType(arg *ResourcePoolGetLabelsAttributeType, val ResourcePoolGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mountPath +*/ + +// isNotNullableString +type ResourcePoolGetMountPathAttributeType = *string + +func getResourcePoolGetMountPathAttributeTypeOk(arg ResourcePoolGetMountPathAttributeType) (ret ResourcePoolGetMountPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetMountPathAttributeType(arg *ResourcePoolGetMountPathAttributeType, val ResourcePoolGetMountPathRetType) { + *arg = &val +} + +type ResourcePoolGetMountPathArgType = string +type ResourcePoolGetMountPathRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type ResourcePoolGetNameAttributeType = *string + +func getResourcePoolGetNameAttributeTypeOk(arg ResourcePoolGetNameAttributeType) (ret ResourcePoolGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetNameAttributeType(arg *ResourcePoolGetNameAttributeType, val ResourcePoolGetNameRetType) { + *arg = &val +} + +type ResourcePoolGetNameArgType = string +type ResourcePoolGetNameRetType = string + +/* + types and functions for performanceClass +*/ + +// isModel +type ResourcePoolGetPerformanceClassAttributeType = *ResourcePoolPerformanceClass +type ResourcePoolGetPerformanceClassArgType = ResourcePoolPerformanceClass +type ResourcePoolGetPerformanceClassRetType = ResourcePoolPerformanceClass + +func getResourcePoolGetPerformanceClassAttributeTypeOk(arg ResourcePoolGetPerformanceClassAttributeType) (ret ResourcePoolGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetPerformanceClassAttributeType(arg *ResourcePoolGetPerformanceClassAttributeType, val ResourcePoolGetPerformanceClassRetType) { + *arg = &val +} + +/* + types and functions for performanceClassDowngradableAt +*/ + +// isDateTime +type ResourcePoolGetPerformanceClassDowngradableAtAttributeType = *time.Time +type ResourcePoolGetPerformanceClassDowngradableAtArgType = time.Time +type ResourcePoolGetPerformanceClassDowngradableAtRetType = time.Time + +func getResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(arg ResourcePoolGetPerformanceClassDowngradableAtAttributeType) (ret ResourcePoolGetPerformanceClassDowngradableAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetPerformanceClassDowngradableAtAttributeType(arg *ResourcePoolGetPerformanceClassDowngradableAtAttributeType, val ResourcePoolGetPerformanceClassDowngradableAtRetType) { + *arg = &val +} + +/* + types and functions for sizeReducibleAt +*/ + +// isDateTime +type ResourcePoolGetSizeReducibleAtAttributeType = *time.Time +type ResourcePoolGetSizeReducibleAtArgType = time.Time +type ResourcePoolGetSizeReducibleAtRetType = time.Time + +func getResourcePoolGetSizeReducibleAtAttributeTypeOk(arg ResourcePoolGetSizeReducibleAtAttributeType) (ret ResourcePoolGetSizeReducibleAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetSizeReducibleAtAttributeType(arg *ResourcePoolGetSizeReducibleAtAttributeType, val ResourcePoolGetSizeReducibleAtRetType) { + *arg = &val +} + +/* + types and functions for snapshotSchedule +*/ + +// isModel +type ResourcePoolGetSnapshotScheduleAttributeType = *SnapshotSchedule +type ResourcePoolGetSnapshotScheduleArgType = SnapshotSchedule +type ResourcePoolGetSnapshotScheduleRetType = SnapshotSchedule + +func getResourcePoolGetSnapshotScheduleAttributeTypeOk(arg ResourcePoolGetSnapshotScheduleAttributeType) (ret ResourcePoolGetSnapshotScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetSnapshotScheduleAttributeType(arg *ResourcePoolGetSnapshotScheduleAttributeType, val ResourcePoolGetSnapshotScheduleRetType) { + *arg = &val +} + +/* + types and functions for snapshotsAreVisible +*/ + +// isBoolean +type ResourcePoolgetSnapshotsAreVisibleAttributeType = *bool +type ResourcePoolgetSnapshotsAreVisibleArgType = bool +type ResourcePoolgetSnapshotsAreVisibleRetType = bool + +func getResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(arg ResourcePoolgetSnapshotsAreVisibleAttributeType) (ret ResourcePoolgetSnapshotsAreVisibleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolgetSnapshotsAreVisibleAttributeType(arg *ResourcePoolgetSnapshotsAreVisibleAttributeType, val ResourcePoolgetSnapshotsAreVisibleRetType) { + *arg = &val +} + +/* + types and functions for space +*/ + +// isModel +type ResourcePoolGetSpaceAttributeType = *ResourcePoolSpace +type ResourcePoolGetSpaceArgType = ResourcePoolSpace +type ResourcePoolGetSpaceRetType = ResourcePoolSpace + +func getResourcePoolGetSpaceAttributeTypeOk(arg ResourcePoolGetSpaceAttributeType) (ret ResourcePoolGetSpaceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetSpaceAttributeType(arg *ResourcePoolGetSpaceAttributeType, val ResourcePoolGetSpaceRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type ResourcePoolGetStateAttributeType = *string + +func getResourcePoolGetStateAttributeTypeOk(arg ResourcePoolGetStateAttributeType) (ret ResourcePoolGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolGetStateAttributeType(arg *ResourcePoolGetStateAttributeType, val ResourcePoolGetStateRetType) { + *arg = &val +} + +type ResourcePoolGetStateArgType = string +type ResourcePoolGetStateRetType = string + +// ResourcePool struct for ResourcePool +type ResourcePool struct { + // Name of the respective availability zone + AvailabilityZone ResourcePoolGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` + // Number of Shares in the Resource Pool + // Can be cast to int32 without loss of precision. + CountShares ResourcePoolGetCountSharesAttributeType `json:"countShares,omitempty"` + CreatedAt ResourcePoolGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Resource Pool + Id ResourcePoolGetIdAttributeType `json:"id,omitempty"` + // List of IPs that can mount the Resource Pool in read-only; IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.250/32\" for a specific IP) + IpAcl ResourcePoolGetIpAclAttributeType `json:"ipAcl,omitempty"` + Labels ResourcePoolGetLabelsAttributeType `json:"labels,omitempty"` + // Mount path of the Resource Pool, used to mount the Resource Pool Note that a Resource Pool can only be mounted in read-only + MountPath ResourcePoolGetMountPathAttributeType `json:"mountPath,omitempty"` + // Name of the Resource Pool + Name ResourcePoolGetNameAttributeType `json:"name,omitempty"` + PerformanceClass ResourcePoolGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` + // Time when the performance class can be downgraded again. + PerformanceClassDowngradableAt ResourcePoolGetPerformanceClassDowngradableAtAttributeType `json:"performanceClassDowngradableAt,omitempty"` + // Time when the size can be reduced again. + SizeReducibleAt ResourcePoolGetSizeReducibleAtAttributeType `json:"sizeReducibleAt,omitempty"` + SnapshotSchedule ResourcePoolGetSnapshotScheduleAttributeType `json:"snapshotSchedule,omitempty"` + // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. + SnapshotsAreVisible ResourcePoolgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` + Space ResourcePoolGetSpaceAttributeType `json:"space,omitempty"` + // State of the Resource Pool (possible values: [\"pending\", \"creating\", \"created\", \"updating\", \"error\", \"deleting\"]) + State ResourcePoolGetStateAttributeType `json:"state,omitempty"` +} + +// NewResourcePool instantiates a new ResourcePool object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourcePool() *ResourcePool { + this := ResourcePool{} + return &this +} + +// NewResourcePoolWithDefaults instantiates a new ResourcePool object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourcePoolWithDefaults() *ResourcePool { + this := ResourcePool{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *ResourcePool) GetAvailabilityZone() (res ResourcePoolGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetAvailabilityZoneOk() (ret ResourcePoolGetAvailabilityZoneRetType, ok bool) { + return getResourcePoolGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *ResourcePool) HasAvailabilityZone() bool { + _, ok := o.GetAvailabilityZoneOk() + return ok +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *ResourcePool) SetAvailabilityZone(v ResourcePoolGetAvailabilityZoneRetType) { + setResourcePoolGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) +} + +// GetCountShares returns the CountShares field value if set, zero value otherwise. +func (o *ResourcePool) GetCountShares() (res ResourcePoolGetCountSharesRetType) { + res, _ = o.GetCountSharesOk() + return +} + +// GetCountSharesOk returns a tuple with the CountShares field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetCountSharesOk() (ret ResourcePoolGetCountSharesRetType, ok bool) { + return getResourcePoolGetCountSharesAttributeTypeOk(o.CountShares) +} + +// HasCountShares returns a boolean if a field has been set. +func (o *ResourcePool) HasCountShares() bool { + _, ok := o.GetCountSharesOk() + return ok +} + +// SetCountShares gets a reference to the given int64 and assigns it to the CountShares field. +func (o *ResourcePool) SetCountShares(v ResourcePoolGetCountSharesRetType) { + setResourcePoolGetCountSharesAttributeType(&o.CountShares, v) +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ResourcePool) GetCreatedAt() (res ResourcePoolGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetCreatedAtOk() (ret ResourcePoolGetCreatedAtRetType, ok bool) { + return getResourcePoolGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ResourcePool) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ResourcePool) SetCreatedAt(v ResourcePoolGetCreatedAtRetType) { + setResourcePoolGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ResourcePool) GetId() (res ResourcePoolGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *ResourcePool) GetIdOk() (ret ResourcePoolGetIdRetType, ok bool) { + return getResourcePoolGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *ResourcePool) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ResourcePool) SetId(v ResourcePoolGetIdRetType) { + setResourcePoolGetIdAttributeType(&o.Id, v) +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *ResourcePool) GetIpAcl() (res ResourcePoolGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetIpAclOk() (ret ResourcePoolGetIpAclRetType, ok bool) { + return getResourcePoolGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *ResourcePool) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *ResourcePool) SetIpAcl(v ResourcePoolGetIpAclRetType) { + setResourcePoolGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *ResourcePool) GetLabels() (res ResourcePoolGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *ResourcePool) GetLabelsOk() (ret ResourcePoolGetLabelsRetType, ok bool) { + return getResourcePoolGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *ResourcePool) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *ResourcePool) SetLabels(v ResourcePoolGetLabelsRetType) { + setResourcePoolGetLabelsAttributeType(&o.Labels, v) +} + +// GetMountPath returns the MountPath field value if set, zero value otherwise. +func (o *ResourcePool) GetMountPath() (res ResourcePoolGetMountPathRetType) { + res, _ = o.GetMountPathOk() + return +} + +// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetMountPathOk() (ret ResourcePoolGetMountPathRetType, ok bool) { + return getResourcePoolGetMountPathAttributeTypeOk(o.MountPath) +} + +// HasMountPath returns a boolean if a field has been set. +func (o *ResourcePool) HasMountPath() bool { + _, ok := o.GetMountPathOk() + return ok +} + +// SetMountPath gets a reference to the given string and assigns it to the MountPath field. +func (o *ResourcePool) SetMountPath(v ResourcePoolGetMountPathRetType) { + setResourcePoolGetMountPathAttributeType(&o.MountPath, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ResourcePool) GetName() (res ResourcePoolGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *ResourcePool) GetNameOk() (ret ResourcePoolGetNameRetType, ok bool) { + return getResourcePoolGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *ResourcePool) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ResourcePool) SetName(v ResourcePoolGetNameRetType) { + setResourcePoolGetNameAttributeType(&o.Name, v) +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *ResourcePool) GetPerformanceClass() (res ResourcePoolGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetPerformanceClassOk() (ret ResourcePoolGetPerformanceClassRetType, ok bool) { + return getResourcePoolGetPerformanceClassAttributeTypeOk(o.PerformanceClass) +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *ResourcePool) HasPerformanceClass() bool { + _, ok := o.GetPerformanceClassOk() + return ok +} + +// SetPerformanceClass gets a reference to the given ResourcePoolPerformanceClass and assigns it to the PerformanceClass field. +func (o *ResourcePool) SetPerformanceClass(v ResourcePoolGetPerformanceClassRetType) { + setResourcePoolGetPerformanceClassAttributeType(&o.PerformanceClass, v) +} + +// GetPerformanceClassDowngradableAt returns the PerformanceClassDowngradableAt field value if set, zero value otherwise. +func (o *ResourcePool) GetPerformanceClassDowngradableAt() (res ResourcePoolGetPerformanceClassDowngradableAtRetType) { + res, _ = o.GetPerformanceClassDowngradableAtOk() + return +} + +// GetPerformanceClassDowngradableAtOk returns a tuple with the PerformanceClassDowngradableAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetPerformanceClassDowngradableAtOk() (ret ResourcePoolGetPerformanceClassDowngradableAtRetType, ok bool) { + return getResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(o.PerformanceClassDowngradableAt) +} + +// HasPerformanceClassDowngradableAt returns a boolean if a field has been set. +func (o *ResourcePool) HasPerformanceClassDowngradableAt() bool { + _, ok := o.GetPerformanceClassDowngradableAtOk() + return ok +} + +// SetPerformanceClassDowngradableAt gets a reference to the given time.Time and assigns it to the PerformanceClassDowngradableAt field. +func (o *ResourcePool) SetPerformanceClassDowngradableAt(v ResourcePoolGetPerformanceClassDowngradableAtRetType) { + setResourcePoolGetPerformanceClassDowngradableAtAttributeType(&o.PerformanceClassDowngradableAt, v) +} + +// GetSizeReducibleAt returns the SizeReducibleAt field value if set, zero value otherwise. +func (o *ResourcePool) GetSizeReducibleAt() (res ResourcePoolGetSizeReducibleAtRetType) { + res, _ = o.GetSizeReducibleAtOk() + return +} + +// GetSizeReducibleAtOk returns a tuple with the SizeReducibleAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetSizeReducibleAtOk() (ret ResourcePoolGetSizeReducibleAtRetType, ok bool) { + return getResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt) +} + +// HasSizeReducibleAt returns a boolean if a field has been set. +func (o *ResourcePool) HasSizeReducibleAt() bool { + _, ok := o.GetSizeReducibleAtOk() + return ok +} + +// SetSizeReducibleAt gets a reference to the given time.Time and assigns it to the SizeReducibleAt field. +func (o *ResourcePool) SetSizeReducibleAt(v ResourcePoolGetSizeReducibleAtRetType) { + setResourcePoolGetSizeReducibleAtAttributeType(&o.SizeReducibleAt, v) +} + +// GetSnapshotSchedule returns the SnapshotSchedule field value if set, zero value otherwise. +func (o *ResourcePool) GetSnapshotSchedule() (res ResourcePoolGetSnapshotScheduleRetType) { + res, _ = o.GetSnapshotScheduleOk() + return +} + +// GetSnapshotScheduleOk returns a tuple with the SnapshotSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetSnapshotScheduleOk() (ret ResourcePoolGetSnapshotScheduleRetType, ok bool) { + return getResourcePoolGetSnapshotScheduleAttributeTypeOk(o.SnapshotSchedule) +} + +// HasSnapshotSchedule returns a boolean if a field has been set. +func (o *ResourcePool) HasSnapshotSchedule() bool { + _, ok := o.GetSnapshotScheduleOk() + return ok +} + +// SetSnapshotSchedule gets a reference to the given SnapshotSchedule and assigns it to the SnapshotSchedule field. +func (o *ResourcePool) SetSnapshotSchedule(v ResourcePoolGetSnapshotScheduleRetType) { + setResourcePoolGetSnapshotScheduleAttributeType(&o.SnapshotSchedule, v) +} + +// GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. +func (o *ResourcePool) GetSnapshotsAreVisible() (res ResourcePoolgetSnapshotsAreVisibleRetType) { + res, _ = o.GetSnapshotsAreVisibleOk() + return +} + +// GetSnapshotsAreVisibleOk returns a tuple with the SnapshotsAreVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetSnapshotsAreVisibleOk() (ret ResourcePoolgetSnapshotsAreVisibleRetType, ok bool) { + return getResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible) +} + +// HasSnapshotsAreVisible returns a boolean if a field has been set. +func (o *ResourcePool) HasSnapshotsAreVisible() bool { + _, ok := o.GetSnapshotsAreVisibleOk() + return ok +} + +// SetSnapshotsAreVisible gets a reference to the given bool and assigns it to the SnapshotsAreVisible field. +func (o *ResourcePool) SetSnapshotsAreVisible(v ResourcePoolgetSnapshotsAreVisibleRetType) { + setResourcePoolgetSnapshotsAreVisibleAttributeType(&o.SnapshotsAreVisible, v) +} + +// GetSpace returns the Space field value if set, zero value otherwise. +func (o *ResourcePool) GetSpace() (res ResourcePoolGetSpaceRetType) { + res, _ = o.GetSpaceOk() + return +} + +// GetSpaceOk returns a tuple with the Space field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePool) GetSpaceOk() (ret ResourcePoolGetSpaceRetType, ok bool) { + return getResourcePoolGetSpaceAttributeTypeOk(o.Space) +} + +// HasSpace returns a boolean if a field has been set. +func (o *ResourcePool) HasSpace() bool { + _, ok := o.GetSpaceOk() + return ok +} + +// SetSpace gets a reference to the given ResourcePoolSpace and assigns it to the Space field. +func (o *ResourcePool) SetSpace(v ResourcePoolGetSpaceRetType) { + setResourcePoolGetSpaceAttributeType(&o.Space, v) +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *ResourcePool) GetState() (res ResourcePoolGetStateRetType) { + res, _ = o.GetStateOk() + return +} + +// 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 *ResourcePool) GetStateOk() (ret ResourcePoolGetStateRetType, ok bool) { + return getResourcePoolGetStateAttributeTypeOk(o.State) +} + +// HasState returns a boolean if a field has been set. +func (o *ResourcePool) HasState() bool { + _, ok := o.GetStateOk() + return ok +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *ResourcePool) SetState(v ResourcePoolGetStateRetType) { + setResourcePoolGetStateAttributeType(&o.State, v) +} + +func (o ResourcePool) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getResourcePoolGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getResourcePoolGetCountSharesAttributeTypeOk(o.CountShares); ok { + toSerialize["CountShares"] = val + } + if val, ok := getResourcePoolGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getResourcePoolGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getResourcePoolGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getResourcePoolGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getResourcePoolGetMountPathAttributeTypeOk(o.MountPath); ok { + toSerialize["MountPath"] = val + } + if val, ok := getResourcePoolGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getResourcePoolGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val + } + if val, ok := getResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(o.PerformanceClassDowngradableAt); ok { + toSerialize["PerformanceClassDowngradableAt"] = val + } + if val, ok := getResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt); ok { + toSerialize["SizeReducibleAt"] = val + } + if val, ok := getResourcePoolGetSnapshotScheduleAttributeTypeOk(o.SnapshotSchedule); ok { + toSerialize["SnapshotSchedule"] = val + } + if val, ok := getResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { + toSerialize["SnapshotsAreVisible"] = val + } + if val, ok := getResourcePoolGetSpaceAttributeTypeOk(o.Space); ok { + toSerialize["Space"] = val + } + if val, ok := getResourcePoolGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +type NullableResourcePool struct { + value *ResourcePool + isSet bool +} + +func (v NullableResourcePool) Get() *ResourcePool { + return v.value +} + +func (v *NullableResourcePool) Set(val *ResourcePool) { + v.value = val + v.isSet = true +} + +func (v NullableResourcePool) IsSet() bool { + return v.isSet +} + +func (v *NullableResourcePool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourcePool(val *ResourcePool) *NullableResourcePool { + return &NullableResourcePool{value: val, isSet: true} +} + +func (v NullableResourcePool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourcePool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_resource_pool_performance_class.go b/services/sfs/model_resource_pool_performance_class.go new file mode 100644 index 000000000..b03fdc829 --- /dev/null +++ b/services/sfs/model_resource_pool_performance_class.go @@ -0,0 +1,227 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ResourcePoolPerformanceClass type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourcePoolPerformanceClass{} + +/* + types and functions for name +*/ + +// isNotNullableString +type ResourcePoolPerformanceClassGetNameAttributeType = *string + +func getResourcePoolPerformanceClassGetNameAttributeTypeOk(arg ResourcePoolPerformanceClassGetNameAttributeType) (ret ResourcePoolPerformanceClassGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolPerformanceClassGetNameAttributeType(arg *ResourcePoolPerformanceClassGetNameAttributeType, val ResourcePoolPerformanceClassGetNameRetType) { + *arg = &val +} + +type ResourcePoolPerformanceClassGetNameArgType = string +type ResourcePoolPerformanceClassGetNameRetType = string + +/* + types and functions for peakIops +*/ + +// isInteger +type ResourcePoolPerformanceClassGetPeakIopsAttributeType = *int64 +type ResourcePoolPerformanceClassGetPeakIopsArgType = int64 +type ResourcePoolPerformanceClassGetPeakIopsRetType = int64 + +func getResourcePoolPerformanceClassGetPeakIopsAttributeTypeOk(arg ResourcePoolPerformanceClassGetPeakIopsAttributeType) (ret ResourcePoolPerformanceClassGetPeakIopsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolPerformanceClassGetPeakIopsAttributeType(arg *ResourcePoolPerformanceClassGetPeakIopsAttributeType, val ResourcePoolPerformanceClassGetPeakIopsRetType) { + *arg = &val +} + +/* + types and functions for throughput +*/ + +// isInteger +type ResourcePoolPerformanceClassGetThroughputAttributeType = *int64 +type ResourcePoolPerformanceClassGetThroughputArgType = int64 +type ResourcePoolPerformanceClassGetThroughputRetType = int64 + +func getResourcePoolPerformanceClassGetThroughputAttributeTypeOk(arg ResourcePoolPerformanceClassGetThroughputAttributeType) (ret ResourcePoolPerformanceClassGetThroughputRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolPerformanceClassGetThroughputAttributeType(arg *ResourcePoolPerformanceClassGetThroughputAttributeType, val ResourcePoolPerformanceClassGetThroughputRetType) { + *arg = &val +} + +// ResourcePoolPerformanceClass Information about the performance class +type ResourcePoolPerformanceClass struct { + // Name of the performance class + Name ResourcePoolPerformanceClassGetNameAttributeType `json:"name,omitempty"` + // Max. IOPS of the Resource Pool. This is shared between every Share in the Resource Pool. + // Can be cast to int32 without loss of precision. + PeakIops ResourcePoolPerformanceClassGetPeakIopsAttributeType `json:"peakIops,omitempty"` + // Throughput of the Resource Pool. + // Can be cast to int32 without loss of precision. + Throughput ResourcePoolPerformanceClassGetThroughputAttributeType `json:"throughput,omitempty"` +} + +// NewResourcePoolPerformanceClass instantiates a new ResourcePoolPerformanceClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourcePoolPerformanceClass() *ResourcePoolPerformanceClass { + this := ResourcePoolPerformanceClass{} + return &this +} + +// NewResourcePoolPerformanceClassWithDefaults instantiates a new ResourcePoolPerformanceClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourcePoolPerformanceClassWithDefaults() *ResourcePoolPerformanceClass { + this := ResourcePoolPerformanceClass{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ResourcePoolPerformanceClass) GetName() (res ResourcePoolPerformanceClassGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *ResourcePoolPerformanceClass) GetNameOk() (ret ResourcePoolPerformanceClassGetNameRetType, ok bool) { + return getResourcePoolPerformanceClassGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *ResourcePoolPerformanceClass) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ResourcePoolPerformanceClass) SetName(v ResourcePoolPerformanceClassGetNameRetType) { + setResourcePoolPerformanceClassGetNameAttributeType(&o.Name, v) +} + +// GetPeakIops returns the PeakIops field value if set, zero value otherwise. +func (o *ResourcePoolPerformanceClass) GetPeakIops() (res ResourcePoolPerformanceClassGetPeakIopsRetType) { + res, _ = o.GetPeakIopsOk() + return +} + +// GetPeakIopsOk returns a tuple with the PeakIops field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePoolPerformanceClass) GetPeakIopsOk() (ret ResourcePoolPerformanceClassGetPeakIopsRetType, ok bool) { + return getResourcePoolPerformanceClassGetPeakIopsAttributeTypeOk(o.PeakIops) +} + +// HasPeakIops returns a boolean if a field has been set. +func (o *ResourcePoolPerformanceClass) HasPeakIops() bool { + _, ok := o.GetPeakIopsOk() + return ok +} + +// SetPeakIops gets a reference to the given int64 and assigns it to the PeakIops field. +func (o *ResourcePoolPerformanceClass) SetPeakIops(v ResourcePoolPerformanceClassGetPeakIopsRetType) { + setResourcePoolPerformanceClassGetPeakIopsAttributeType(&o.PeakIops, v) +} + +// GetThroughput returns the Throughput field value if set, zero value otherwise. +func (o *ResourcePoolPerformanceClass) GetThroughput() (res ResourcePoolPerformanceClassGetThroughputRetType) { + res, _ = o.GetThroughputOk() + return +} + +// GetThroughputOk returns a tuple with the Throughput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePoolPerformanceClass) GetThroughputOk() (ret ResourcePoolPerformanceClassGetThroughputRetType, ok bool) { + return getResourcePoolPerformanceClassGetThroughputAttributeTypeOk(o.Throughput) +} + +// HasThroughput returns a boolean if a field has been set. +func (o *ResourcePoolPerformanceClass) HasThroughput() bool { + _, ok := o.GetThroughputOk() + return ok +} + +// SetThroughput gets a reference to the given int64 and assigns it to the Throughput field. +func (o *ResourcePoolPerformanceClass) SetThroughput(v ResourcePoolPerformanceClassGetThroughputRetType) { + setResourcePoolPerformanceClassGetThroughputAttributeType(&o.Throughput, v) +} + +func (o ResourcePoolPerformanceClass) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getResourcePoolPerformanceClassGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getResourcePoolPerformanceClassGetPeakIopsAttributeTypeOk(o.PeakIops); ok { + toSerialize["PeakIops"] = val + } + if val, ok := getResourcePoolPerformanceClassGetThroughputAttributeTypeOk(o.Throughput); ok { + toSerialize["Throughput"] = val + } + return toSerialize, nil +} + +type NullableResourcePoolPerformanceClass struct { + value *ResourcePoolPerformanceClass + isSet bool +} + +func (v NullableResourcePoolPerformanceClass) Get() *ResourcePoolPerformanceClass { + return v.value +} + +func (v *NullableResourcePoolPerformanceClass) Set(val *ResourcePoolPerformanceClass) { + v.value = val + v.isSet = true +} + +func (v NullableResourcePoolPerformanceClass) IsSet() bool { + return v.isSet +} + +func (v *NullableResourcePoolPerformanceClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourcePoolPerformanceClass(val *ResourcePoolPerformanceClass) *NullableResourcePoolPerformanceClass { + return &NullableResourcePoolPerformanceClass{value: val, isSet: true} +} + +func (v NullableResourcePoolPerformanceClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourcePoolPerformanceClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_resource_pool_performance_class_test.go b/services/sfs/model_resource_pool_performance_class_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_resource_pool_performance_class_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_resource_pool_snapshot.go b/services/sfs/model_resource_pool_snapshot.go new file mode 100644 index 000000000..0484b7152 --- /dev/null +++ b/services/sfs/model_resource_pool_snapshot.go @@ -0,0 +1,388 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the ResourcePoolSnapshot type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourcePoolSnapshot{} + +/* + types and functions for comment +*/ + +// isNullableString +type ResourcePoolSnapshotGetCommentAttributeType = *NullableString + +func getResourcePoolSnapshotGetCommentAttributeTypeOk(arg ResourcePoolSnapshotGetCommentAttributeType) (ret ResourcePoolSnapshotGetCommentRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setResourcePoolSnapshotGetCommentAttributeType(arg *ResourcePoolSnapshotGetCommentAttributeType, val ResourcePoolSnapshotGetCommentRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ResourcePoolSnapshotGetCommentArgType = *string +type ResourcePoolSnapshotGetCommentRetType = *string + +/* + types and functions for createdAt +*/ + +// isDateTime +type ResourcePoolSnapshotGetCreatedAtAttributeType = *time.Time +type ResourcePoolSnapshotGetCreatedAtArgType = time.Time +type ResourcePoolSnapshotGetCreatedAtRetType = time.Time + +func getResourcePoolSnapshotGetCreatedAtAttributeTypeOk(arg ResourcePoolSnapshotGetCreatedAtAttributeType) (ret ResourcePoolSnapshotGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolSnapshotGetCreatedAtAttributeType(arg *ResourcePoolSnapshotGetCreatedAtAttributeType, val ResourcePoolSnapshotGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for logicalSizeGigabytes +*/ + +// isInteger +type ResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType = *int64 +type ResourcePoolSnapshotGetLogicalSizeGigabytesArgType = int64 +type ResourcePoolSnapshotGetLogicalSizeGigabytesRetType = int64 + +func getResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(arg ResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType) (ret ResourcePoolSnapshotGetLogicalSizeGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType(arg *ResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType, val ResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + *arg = &val +} + +/* + types and functions for resourcePoolId +*/ + +// isNotNullableString +type ResourcePoolSnapshotGetResourcePoolIdAttributeType = *string + +func getResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(arg ResourcePoolSnapshotGetResourcePoolIdAttributeType) (ret ResourcePoolSnapshotGetResourcePoolIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolSnapshotGetResourcePoolIdAttributeType(arg *ResourcePoolSnapshotGetResourcePoolIdAttributeType, val ResourcePoolSnapshotGetResourcePoolIdRetType) { + *arg = &val +} + +type ResourcePoolSnapshotGetResourcePoolIdArgType = string +type ResourcePoolSnapshotGetResourcePoolIdRetType = string + +/* + types and functions for sizeGigabytes +*/ + +// isInteger +type ResourcePoolSnapshotGetSizeGigabytesAttributeType = *int64 +type ResourcePoolSnapshotGetSizeGigabytesArgType = int64 +type ResourcePoolSnapshotGetSizeGigabytesRetType = int64 + +func getResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(arg ResourcePoolSnapshotGetSizeGigabytesAttributeType) (ret ResourcePoolSnapshotGetSizeGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolSnapshotGetSizeGigabytesAttributeType(arg *ResourcePoolSnapshotGetSizeGigabytesAttributeType, val ResourcePoolSnapshotGetSizeGigabytesRetType) { + *arg = &val +} + +/* + types and functions for snapshotName +*/ + +// isNotNullableString +type ResourcePoolSnapshotGetSnapshotNameAttributeType = *string + +func getResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(arg ResourcePoolSnapshotGetSnapshotNameAttributeType) (ret ResourcePoolSnapshotGetSnapshotNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolSnapshotGetSnapshotNameAttributeType(arg *ResourcePoolSnapshotGetSnapshotNameAttributeType, val ResourcePoolSnapshotGetSnapshotNameRetType) { + *arg = &val +} + +type ResourcePoolSnapshotGetSnapshotNameArgType = string +type ResourcePoolSnapshotGetSnapshotNameRetType = string + +// ResourcePoolSnapshot struct for ResourcePoolSnapshot +type ResourcePoolSnapshot struct { + // (optional) A comment to add more information about a snapshot + Comment ResourcePoolSnapshotGetCommentAttributeType `json:"comment,omitempty"` + CreatedAt ResourcePoolSnapshotGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // Represents the user-visible data size at the time of the snapshot in Gibibytes (e.g. what’s in the snapshot) + // Can be cast to int32 without loss of precision. + LogicalSizeGigabytes ResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType `json:"logicalSizeGigabytes,omitempty"` + // ID of the Resource Pool of the Snapshot + ResourcePoolId ResourcePoolSnapshotGetResourcePoolIdAttributeType `json:"resourcePoolId,omitempty"` + // Reflects the actual storage footprint in the backend at snapshot time in Gibibytes (e.g. how much storage from the Resource Pool does it use). + // Can be cast to int32 without loss of precision. + SizeGigabytes ResourcePoolSnapshotGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // Name of the Resource Pool Snapshot + SnapshotName ResourcePoolSnapshotGetSnapshotNameAttributeType `json:"snapshotName,omitempty"` +} + +// NewResourcePoolSnapshot instantiates a new ResourcePoolSnapshot object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourcePoolSnapshot() *ResourcePoolSnapshot { + this := ResourcePoolSnapshot{} + return &this +} + +// NewResourcePoolSnapshotWithDefaults instantiates a new ResourcePoolSnapshot object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourcePoolSnapshotWithDefaults() *ResourcePoolSnapshot { + this := ResourcePoolSnapshot{} + return &this +} + +// GetComment returns the Comment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ResourcePoolSnapshot) GetComment() (res ResourcePoolSnapshotGetCommentRetType) { + res, _ = o.GetCommentOk() + return +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ResourcePoolSnapshot) GetCommentOk() (ret ResourcePoolSnapshotGetCommentRetType, ok bool) { + return getResourcePoolSnapshotGetCommentAttributeTypeOk(o.Comment) +} + +// HasComment returns a boolean if a field has been set. +func (o *ResourcePoolSnapshot) HasComment() bool { + _, ok := o.GetCommentOk() + return ok +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *ResourcePoolSnapshot) SetComment(v ResourcePoolSnapshotGetCommentRetType) { + setResourcePoolSnapshotGetCommentAttributeType(&o.Comment, v) +} + +// SetCommentNil sets the value for Comment to be an explicit nil +func (o *ResourcePoolSnapshot) SetCommentNil() { + o.Comment = nil +} + +// UnsetComment ensures that no value is present for Comment, not even an explicit nil +func (o *ResourcePoolSnapshot) UnsetComment() { + o.Comment = nil +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ResourcePoolSnapshot) GetCreatedAt() (res ResourcePoolSnapshotGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePoolSnapshot) GetCreatedAtOk() (ret ResourcePoolSnapshotGetCreatedAtRetType, ok bool) { + return getResourcePoolSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ResourcePoolSnapshot) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ResourcePoolSnapshot) SetCreatedAt(v ResourcePoolSnapshotGetCreatedAtRetType) { + setResourcePoolSnapshotGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetLogicalSizeGigabytes returns the LogicalSizeGigabytes field value if set, zero value otherwise. +func (o *ResourcePoolSnapshot) GetLogicalSizeGigabytes() (res ResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + res, _ = o.GetLogicalSizeGigabytesOk() + return +} + +// GetLogicalSizeGigabytesOk returns a tuple with the LogicalSizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePoolSnapshot) GetLogicalSizeGigabytesOk() (ret ResourcePoolSnapshotGetLogicalSizeGigabytesRetType, ok bool) { + return getResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(o.LogicalSizeGigabytes) +} + +// HasLogicalSizeGigabytes returns a boolean if a field has been set. +func (o *ResourcePoolSnapshot) HasLogicalSizeGigabytes() bool { + _, ok := o.GetLogicalSizeGigabytesOk() + return ok +} + +// SetLogicalSizeGigabytes gets a reference to the given int64 and assigns it to the LogicalSizeGigabytes field. +func (o *ResourcePoolSnapshot) SetLogicalSizeGigabytes(v ResourcePoolSnapshotGetLogicalSizeGigabytesRetType) { + setResourcePoolSnapshotGetLogicalSizeGigabytesAttributeType(&o.LogicalSizeGigabytes, v) +} + +// GetResourcePoolId returns the ResourcePoolId field value if set, zero value otherwise. +func (o *ResourcePoolSnapshot) GetResourcePoolId() (res ResourcePoolSnapshotGetResourcePoolIdRetType) { + res, _ = o.GetResourcePoolIdOk() + return +} + +// GetResourcePoolIdOk returns a tuple with the ResourcePoolId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePoolSnapshot) GetResourcePoolIdOk() (ret ResourcePoolSnapshotGetResourcePoolIdRetType, ok bool) { + return getResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(o.ResourcePoolId) +} + +// HasResourcePoolId returns a boolean if a field has been set. +func (o *ResourcePoolSnapshot) HasResourcePoolId() bool { + _, ok := o.GetResourcePoolIdOk() + return ok +} + +// SetResourcePoolId gets a reference to the given string and assigns it to the ResourcePoolId field. +func (o *ResourcePoolSnapshot) SetResourcePoolId(v ResourcePoolSnapshotGetResourcePoolIdRetType) { + setResourcePoolSnapshotGetResourcePoolIdAttributeType(&o.ResourcePoolId, v) +} + +// GetSizeGigabytes returns the SizeGigabytes field value if set, zero value otherwise. +func (o *ResourcePoolSnapshot) GetSizeGigabytes() (res ResourcePoolSnapshotGetSizeGigabytesRetType) { + res, _ = o.GetSizeGigabytesOk() + return +} + +// GetSizeGigabytesOk returns a tuple with the SizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePoolSnapshot) GetSizeGigabytesOk() (ret ResourcePoolSnapshotGetSizeGigabytesRetType, ok bool) { + return getResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes) +} + +// HasSizeGigabytes returns a boolean if a field has been set. +func (o *ResourcePoolSnapshot) HasSizeGigabytes() bool { + _, ok := o.GetSizeGigabytesOk() + return ok +} + +// SetSizeGigabytes gets a reference to the given int64 and assigns it to the SizeGigabytes field. +func (o *ResourcePoolSnapshot) SetSizeGigabytes(v ResourcePoolSnapshotGetSizeGigabytesRetType) { + setResourcePoolSnapshotGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) +} + +// GetSnapshotName returns the SnapshotName field value if set, zero value otherwise. +func (o *ResourcePoolSnapshot) GetSnapshotName() (res ResourcePoolSnapshotGetSnapshotNameRetType) { + res, _ = o.GetSnapshotNameOk() + return +} + +// GetSnapshotNameOk returns a tuple with the SnapshotName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePoolSnapshot) GetSnapshotNameOk() (ret ResourcePoolSnapshotGetSnapshotNameRetType, ok bool) { + return getResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName) +} + +// HasSnapshotName returns a boolean if a field has been set. +func (o *ResourcePoolSnapshot) HasSnapshotName() bool { + _, ok := o.GetSnapshotNameOk() + return ok +} + +// SetSnapshotName gets a reference to the given string and assigns it to the SnapshotName field. +func (o *ResourcePoolSnapshot) SetSnapshotName(v ResourcePoolSnapshotGetSnapshotNameRetType) { + setResourcePoolSnapshotGetSnapshotNameAttributeType(&o.SnapshotName, v) +} + +func (o ResourcePoolSnapshot) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getResourcePoolSnapshotGetCommentAttributeTypeOk(o.Comment); ok { + toSerialize["Comment"] = val + } + if val, ok := getResourcePoolSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getResourcePoolSnapshotGetLogicalSizeGigabytesAttributeTypeOk(o.LogicalSizeGigabytes); ok { + toSerialize["LogicalSizeGigabytes"] = val + } + if val, ok := getResourcePoolSnapshotGetResourcePoolIdAttributeTypeOk(o.ResourcePoolId); ok { + toSerialize["ResourcePoolId"] = val + } + if val, ok := getResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { + toSerialize["SizeGigabytes"] = val + } + if val, ok := getResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName); ok { + toSerialize["SnapshotName"] = val + } + return toSerialize, nil +} + +type NullableResourcePoolSnapshot struct { + value *ResourcePoolSnapshot + isSet bool +} + +func (v NullableResourcePoolSnapshot) Get() *ResourcePoolSnapshot { + return v.value +} + +func (v *NullableResourcePoolSnapshot) Set(val *ResourcePoolSnapshot) { + v.value = val + v.isSet = true +} + +func (v NullableResourcePoolSnapshot) IsSet() bool { + return v.isSet +} + +func (v *NullableResourcePoolSnapshot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourcePoolSnapshot(val *ResourcePoolSnapshot) *NullableResourcePoolSnapshot { + return &NullableResourcePoolSnapshot{value: val, isSet: true} +} + +func (v NullableResourcePoolSnapshot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourcePoolSnapshot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_resource_pool_snapshot_test.go b/services/sfs/model_resource_pool_snapshot_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_resource_pool_snapshot_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_resource_pool_space.go b/services/sfs/model_resource_pool_space.go new file mode 100644 index 000000000..0df5ae97e --- /dev/null +++ b/services/sfs/model_resource_pool_space.go @@ -0,0 +1,247 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ResourcePoolSpace type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourcePoolSpace{} + +/* + types and functions for availableGigabytes +*/ + +// isDouble +type ResourcePoolSpaceGetAvailableGigabytesAttributeType = *float64 +type ResourcePoolSpaceGetAvailableGigabytesArgType = *float64 +type ResourcePoolSpaceGetAvailableGigabytesRetType = *float64 + +func getResourcePoolSpaceGetAvailableGigabytesAttributeTypeOk(arg ResourcePoolSpaceGetAvailableGigabytesAttributeType) (ret ResourcePoolSpaceGetAvailableGigabytesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setResourcePoolSpaceGetAvailableGigabytesAttributeType(arg *ResourcePoolSpaceGetAvailableGigabytesAttributeType, val ResourcePoolSpaceGetAvailableGigabytesRetType) { + *arg = val +} + +/* + types and functions for sizeGigabytes +*/ + +// isInteger +type ResourcePoolSpaceGetSizeGigabytesAttributeType = *int64 +type ResourcePoolSpaceGetSizeGigabytesArgType = int64 +type ResourcePoolSpaceGetSizeGigabytesRetType = int64 + +func getResourcePoolSpaceGetSizeGigabytesAttributeTypeOk(arg ResourcePoolSpaceGetSizeGigabytesAttributeType) (ret ResourcePoolSpaceGetSizeGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResourcePoolSpaceGetSizeGigabytesAttributeType(arg *ResourcePoolSpaceGetSizeGigabytesAttributeType, val ResourcePoolSpaceGetSizeGigabytesRetType) { + *arg = &val +} + +/* + types and functions for usedGigabytes +*/ + +// isDouble +type ResourcePoolSpaceGetUsedGigabytesAttributeType = *float64 +type ResourcePoolSpaceGetUsedGigabytesArgType = *float64 +type ResourcePoolSpaceGetUsedGigabytesRetType = *float64 + +func getResourcePoolSpaceGetUsedGigabytesAttributeTypeOk(arg ResourcePoolSpaceGetUsedGigabytesAttributeType) (ret ResourcePoolSpaceGetUsedGigabytesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setResourcePoolSpaceGetUsedGigabytesAttributeType(arg *ResourcePoolSpaceGetUsedGigabytesAttributeType, val ResourcePoolSpaceGetUsedGigabytesRetType) { + *arg = val +} + +// ResourcePoolSpace Space information +type ResourcePoolSpace struct { + // Available space of the Resource Pool (only available when retrieving a single Resource Pool by ID) + AvailableGigabytes ResourcePoolSpaceGetAvailableGigabytesAttributeType `json:"availableGigabytes,omitempty"` + // Size of the Resource Pool in Gibibytes. + // Can be cast to int32 without loss of precision. + SizeGigabytes ResourcePoolSpaceGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // Used space of the Resource Pool (only available when retrieving a single Resource Pool by ID) + UsedGigabytes ResourcePoolSpaceGetUsedGigabytesAttributeType `json:"usedGigabytes,omitempty"` +} + +// NewResourcePoolSpace instantiates a new ResourcePoolSpace object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourcePoolSpace() *ResourcePoolSpace { + this := ResourcePoolSpace{} + return &this +} + +// NewResourcePoolSpaceWithDefaults instantiates a new ResourcePoolSpace object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourcePoolSpaceWithDefaults() *ResourcePoolSpace { + this := ResourcePoolSpace{} + return &this +} + +// GetAvailableGigabytes returns the AvailableGigabytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ResourcePoolSpace) GetAvailableGigabytes() (res ResourcePoolSpaceGetAvailableGigabytesRetType) { + res, _ = o.GetAvailableGigabytesOk() + return +} + +// GetAvailableGigabytesOk returns a tuple with the AvailableGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ResourcePoolSpace) GetAvailableGigabytesOk() (ret ResourcePoolSpaceGetAvailableGigabytesRetType, ok bool) { + return getResourcePoolSpaceGetAvailableGigabytesAttributeTypeOk(o.AvailableGigabytes) +} + +// HasAvailableGigabytes returns a boolean if a field has been set. +func (o *ResourcePoolSpace) HasAvailableGigabytes() bool { + _, ok := o.GetAvailableGigabytesOk() + return ok +} + +// SetAvailableGigabytes gets a reference to the given float64 and assigns it to the AvailableGigabytes field. +func (o *ResourcePoolSpace) SetAvailableGigabytes(v ResourcePoolSpaceGetAvailableGigabytesRetType) { + setResourcePoolSpaceGetAvailableGigabytesAttributeType(&o.AvailableGigabytes, v) +} + +// SetAvailableGigabytesNil sets the value for AvailableGigabytes to be an explicit nil +func (o *ResourcePoolSpace) SetAvailableGigabytesNil() { + o.AvailableGigabytes = nil +} + +// UnsetAvailableGigabytes ensures that no value is present for AvailableGigabytes, not even an explicit nil +func (o *ResourcePoolSpace) UnsetAvailableGigabytes() { + o.AvailableGigabytes = nil +} + +// GetSizeGigabytes returns the SizeGigabytes field value if set, zero value otherwise. +func (o *ResourcePoolSpace) GetSizeGigabytes() (res ResourcePoolSpaceGetSizeGigabytesRetType) { + res, _ = o.GetSizeGigabytesOk() + return +} + +// GetSizeGigabytesOk returns a tuple with the SizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourcePoolSpace) GetSizeGigabytesOk() (ret ResourcePoolSpaceGetSizeGigabytesRetType, ok bool) { + return getResourcePoolSpaceGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes) +} + +// HasSizeGigabytes returns a boolean if a field has been set. +func (o *ResourcePoolSpace) HasSizeGigabytes() bool { + _, ok := o.GetSizeGigabytesOk() + return ok +} + +// SetSizeGigabytes gets a reference to the given int64 and assigns it to the SizeGigabytes field. +func (o *ResourcePoolSpace) SetSizeGigabytes(v ResourcePoolSpaceGetSizeGigabytesRetType) { + setResourcePoolSpaceGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) +} + +// GetUsedGigabytes returns the UsedGigabytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ResourcePoolSpace) GetUsedGigabytes() (res ResourcePoolSpaceGetUsedGigabytesRetType) { + res, _ = o.GetUsedGigabytesOk() + return +} + +// GetUsedGigabytesOk returns a tuple with the UsedGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ResourcePoolSpace) GetUsedGigabytesOk() (ret ResourcePoolSpaceGetUsedGigabytesRetType, ok bool) { + return getResourcePoolSpaceGetUsedGigabytesAttributeTypeOk(o.UsedGigabytes) +} + +// HasUsedGigabytes returns a boolean if a field has been set. +func (o *ResourcePoolSpace) HasUsedGigabytes() bool { + _, ok := o.GetUsedGigabytesOk() + return ok +} + +// SetUsedGigabytes gets a reference to the given float64 and assigns it to the UsedGigabytes field. +func (o *ResourcePoolSpace) SetUsedGigabytes(v ResourcePoolSpaceGetUsedGigabytesRetType) { + setResourcePoolSpaceGetUsedGigabytesAttributeType(&o.UsedGigabytes, v) +} + +// SetUsedGigabytesNil sets the value for UsedGigabytes to be an explicit nil +func (o *ResourcePoolSpace) SetUsedGigabytesNil() { + o.UsedGigabytes = nil +} + +// UnsetUsedGigabytes ensures that no value is present for UsedGigabytes, not even an explicit nil +func (o *ResourcePoolSpace) UnsetUsedGigabytes() { + o.UsedGigabytes = nil +} + +func (o ResourcePoolSpace) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getResourcePoolSpaceGetAvailableGigabytesAttributeTypeOk(o.AvailableGigabytes); ok { + toSerialize["AvailableGigabytes"] = val + } + if val, ok := getResourcePoolSpaceGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { + toSerialize["SizeGigabytes"] = val + } + if val, ok := getResourcePoolSpaceGetUsedGigabytesAttributeTypeOk(o.UsedGigabytes); ok { + toSerialize["UsedGigabytes"] = val + } + return toSerialize, nil +} + +type NullableResourcePoolSpace struct { + value *ResourcePoolSpace + isSet bool +} + +func (v NullableResourcePoolSpace) Get() *ResourcePoolSpace { + return v.value +} + +func (v *NullableResourcePoolSpace) Set(val *ResourcePoolSpace) { + v.value = val + v.isSet = true +} + +func (v NullableResourcePoolSpace) IsSet() bool { + return v.isSet +} + +func (v *NullableResourcePoolSpace) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourcePoolSpace(val *ResourcePoolSpace) *NullableResourcePoolSpace { + return &NullableResourcePoolSpace{value: val, isSet: true} +} + +func (v NullableResourcePoolSpace) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourcePoolSpace) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_resource_pool_space_test.go b/services/sfs/model_resource_pool_space_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_resource_pool_space_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_resource_pool_test.go b/services/sfs/model_resource_pool_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_resource_pool_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_share.go b/services/sfs/model_share.go new file mode 100644 index 000000000..5bad3879d --- /dev/null +++ b/services/sfs/model_share.go @@ -0,0 +1,479 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the Share type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Share{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type ShareGetCreatedAtAttributeType = *time.Time +type ShareGetCreatedAtArgType = time.Time +type ShareGetCreatedAtRetType = time.Time + +func getShareGetCreatedAtAttributeTypeOk(arg ShareGetCreatedAtAttributeType) (ret ShareGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareGetCreatedAtAttributeType(arg *ShareGetCreatedAtAttributeType, val ShareGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for exportPolicy +*/ + +// isModel +type ShareGetExportPolicyAttributeType = *NullableShareExportPolicy +type ShareGetExportPolicyArgType = *NullableShareExportPolicy +type ShareGetExportPolicyRetType = *NullableShareExportPolicy + +func getShareGetExportPolicyAttributeTypeOk(arg ShareGetExportPolicyAttributeType) (ret ShareGetExportPolicyRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setShareGetExportPolicyAttributeType(arg *ShareGetExportPolicyAttributeType, val ShareGetExportPolicyRetType) { + *arg = val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type ShareGetIdAttributeType = *string + +func getShareGetIdAttributeTypeOk(arg ShareGetIdAttributeType) (ret ShareGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareGetIdAttributeType(arg *ShareGetIdAttributeType, val ShareGetIdRetType) { + *arg = &val +} + +type ShareGetIdArgType = string +type ShareGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type ShareGetLabelsAttributeType = *map[string]string +type ShareGetLabelsArgType = map[string]string +type ShareGetLabelsRetType = map[string]string + +func getShareGetLabelsAttributeTypeOk(arg ShareGetLabelsAttributeType) (ret ShareGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareGetLabelsAttributeType(arg *ShareGetLabelsAttributeType, val ShareGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mountPath +*/ + +// isNotNullableString +type ShareGetMountPathAttributeType = *string + +func getShareGetMountPathAttributeTypeOk(arg ShareGetMountPathAttributeType) (ret ShareGetMountPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareGetMountPathAttributeType(arg *ShareGetMountPathAttributeType, val ShareGetMountPathRetType) { + *arg = &val +} + +type ShareGetMountPathArgType = string +type ShareGetMountPathRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type ShareGetNameAttributeType = *string + +func getShareGetNameAttributeTypeOk(arg ShareGetNameAttributeType) (ret ShareGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareGetNameAttributeType(arg *ShareGetNameAttributeType, val ShareGetNameRetType) { + *arg = &val +} + +type ShareGetNameArgType = string +type ShareGetNameRetType = string + +/* + types and functions for spaceHardLimitGigabytes +*/ + +// isInteger +type ShareGetSpaceHardLimitGigabytesAttributeType = *int64 +type ShareGetSpaceHardLimitGigabytesArgType = int64 +type ShareGetSpaceHardLimitGigabytesRetType = int64 + +func getShareGetSpaceHardLimitGigabytesAttributeTypeOk(arg ShareGetSpaceHardLimitGigabytesAttributeType) (ret ShareGetSpaceHardLimitGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareGetSpaceHardLimitGigabytesAttributeType(arg *ShareGetSpaceHardLimitGigabytesAttributeType, val ShareGetSpaceHardLimitGigabytesRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type ShareGetStateAttributeType = *string + +func getShareGetStateAttributeTypeOk(arg ShareGetStateAttributeType) (ret ShareGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareGetStateAttributeType(arg *ShareGetStateAttributeType, val ShareGetStateRetType) { + *arg = &val +} + +type ShareGetStateArgType = string +type ShareGetStateRetType = string + +// Share struct for Share +type Share struct { + CreatedAt ShareGetCreatedAtAttributeType `json:"createdAt,omitempty"` + ExportPolicy ShareGetExportPolicyAttributeType `json:"exportPolicy,omitempty"` + // ID of the Share + Id ShareGetIdAttributeType `json:"id,omitempty"` + // An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels ShareGetLabelsAttributeType `json:"labels,omitempty"` + // Mount path of the Share, used to mount the Share + MountPath ShareGetMountPathAttributeType `json:"mountPath,omitempty"` + // Name of the Share + Name ShareGetNameAttributeType `json:"name,omitempty"` + // Space hard limit for the Share. If zero, the Share will have access to the full space of the Resource Pool it lives in. (unit: gibibytes) + // Can be cast to int32 without loss of precision. + SpaceHardLimitGigabytes ShareGetSpaceHardLimitGigabytesAttributeType `json:"spaceHardLimitGigabytes,omitempty"` + // State of the Resource Pool Snapshot (possible values: [\"pending\", \"creating\", \"created\", \"error\", \"deleting\"]) + State ShareGetStateAttributeType `json:"state,omitempty"` +} + +// NewShare instantiates a new Share object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewShare() *Share { + this := Share{} + return &this +} + +// NewShareWithDefaults instantiates a new Share object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewShareWithDefaults() *Share { + this := Share{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Share) GetCreatedAt() (res ShareGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Share) GetCreatedAtOk() (ret ShareGetCreatedAtRetType, ok bool) { + return getShareGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Share) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Share) SetCreatedAt(v ShareGetCreatedAtRetType) { + setShareGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetExportPolicy returns the ExportPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Share) GetExportPolicy() (res ShareGetExportPolicyRetType) { + res, _ = o.GetExportPolicyOk() + return +} + +// GetExportPolicyOk returns a tuple with the ExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Share) GetExportPolicyOk() (ret ShareGetExportPolicyRetType, ok bool) { + return getShareGetExportPolicyAttributeTypeOk(o.ExportPolicy) +} + +// HasExportPolicy returns a boolean if a field has been set. +func (o *Share) HasExportPolicy() bool { + _, ok := o.GetExportPolicyOk() + return ok +} + +// SetExportPolicy gets a reference to the given ShareExportPolicy and assigns it to the ExportPolicy field. +func (o *Share) SetExportPolicy(v ShareGetExportPolicyRetType) { + setShareGetExportPolicyAttributeType(&o.ExportPolicy, v) +} + +// SetExportPolicyNil sets the value for ExportPolicy to be an explicit nil +func (o *Share) SetExportPolicyNil() { + o.ExportPolicy = nil +} + +// UnsetExportPolicy ensures that no value is present for ExportPolicy, not even an explicit nil +func (o *Share) UnsetExportPolicy() { + o.ExportPolicy = nil +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Share) GetId() (res ShareGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *Share) GetIdOk() (ret ShareGetIdRetType, ok bool) { + return getShareGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *Share) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Share) SetId(v ShareGetIdRetType) { + setShareGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Share) GetLabels() (res ShareGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *Share) GetLabelsOk() (ret ShareGetLabelsRetType, ok bool) { + return getShareGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *Share) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *Share) SetLabels(v ShareGetLabelsRetType) { + setShareGetLabelsAttributeType(&o.Labels, v) +} + +// GetMountPath returns the MountPath field value if set, zero value otherwise. +func (o *Share) GetMountPath() (res ShareGetMountPathRetType) { + res, _ = o.GetMountPathOk() + return +} + +// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Share) GetMountPathOk() (ret ShareGetMountPathRetType, ok bool) { + return getShareGetMountPathAttributeTypeOk(o.MountPath) +} + +// HasMountPath returns a boolean if a field has been set. +func (o *Share) HasMountPath() bool { + _, ok := o.GetMountPathOk() + return ok +} + +// SetMountPath gets a reference to the given string and assigns it to the MountPath field. +func (o *Share) SetMountPath(v ShareGetMountPathRetType) { + setShareGetMountPathAttributeType(&o.MountPath, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Share) GetName() (res ShareGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *Share) GetNameOk() (ret ShareGetNameRetType, ok bool) { + return getShareGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *Share) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Share) SetName(v ShareGetNameRetType) { + setShareGetNameAttributeType(&o.Name, v) +} + +// GetSpaceHardLimitGigabytes returns the SpaceHardLimitGigabytes field value if set, zero value otherwise. +func (o *Share) GetSpaceHardLimitGigabytes() (res ShareGetSpaceHardLimitGigabytesRetType) { + res, _ = o.GetSpaceHardLimitGigabytesOk() + return +} + +// GetSpaceHardLimitGigabytesOk returns a tuple with the SpaceHardLimitGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Share) GetSpaceHardLimitGigabytesOk() (ret ShareGetSpaceHardLimitGigabytesRetType, ok bool) { + return getShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes) +} + +// HasSpaceHardLimitGigabytes returns a boolean if a field has been set. +func (o *Share) HasSpaceHardLimitGigabytes() bool { + _, ok := o.GetSpaceHardLimitGigabytesOk() + return ok +} + +// SetSpaceHardLimitGigabytes gets a reference to the given int64 and assigns it to the SpaceHardLimitGigabytes field. +func (o *Share) SetSpaceHardLimitGigabytes(v ShareGetSpaceHardLimitGigabytesRetType) { + setShareGetSpaceHardLimitGigabytesAttributeType(&o.SpaceHardLimitGigabytes, v) +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Share) GetState() (res ShareGetStateRetType) { + res, _ = o.GetStateOk() + return +} + +// 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 *Share) GetStateOk() (ret ShareGetStateRetType, ok bool) { + return getShareGetStateAttributeTypeOk(o.State) +} + +// HasState returns a boolean if a field has been set. +func (o *Share) HasState() bool { + _, ok := o.GetStateOk() + return ok +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *Share) SetState(v ShareGetStateRetType) { + setShareGetStateAttributeType(&o.State, v) +} + +func (o Share) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getShareGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getShareGetExportPolicyAttributeTypeOk(o.ExportPolicy); ok { + toSerialize["ExportPolicy"] = val + } + if val, ok := getShareGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getShareGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getShareGetMountPathAttributeTypeOk(o.MountPath); ok { + toSerialize["MountPath"] = val + } + if val, ok := getShareGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes); ok { + toSerialize["SpaceHardLimitGigabytes"] = val + } + if val, ok := getShareGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +type NullableShare struct { + value *Share + isSet bool +} + +func (v NullableShare) Get() *Share { + return v.value +} + +func (v *NullableShare) Set(val *Share) { + v.value = val + v.isSet = true +} + +func (v NullableShare) IsSet() bool { + return v.isSet +} + +func (v *NullableShare) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableShare(val *Share) *NullableShare { + return &NullableShare{value: val, isSet: true} +} + +func (v NullableShare) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableShare) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_share_export_policy.go b/services/sfs/model_share_export_policy.go new file mode 100644 index 000000000..daf589c7a --- /dev/null +++ b/services/sfs/model_share_export_policy.go @@ -0,0 +1,371 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the ShareExportPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ShareExportPolicy{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type ShareExportPolicyGetCreatedAtAttributeType = *time.Time +type ShareExportPolicyGetCreatedAtArgType = time.Time +type ShareExportPolicyGetCreatedAtRetType = time.Time + +func getShareExportPolicyGetCreatedAtAttributeTypeOk(arg ShareExportPolicyGetCreatedAtAttributeType) (ret ShareExportPolicyGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyGetCreatedAtAttributeType(arg *ShareExportPolicyGetCreatedAtAttributeType, val ShareExportPolicyGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type ShareExportPolicyGetIdAttributeType = *string + +func getShareExportPolicyGetIdAttributeTypeOk(arg ShareExportPolicyGetIdAttributeType) (ret ShareExportPolicyGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyGetIdAttributeType(arg *ShareExportPolicyGetIdAttributeType, val ShareExportPolicyGetIdRetType) { + *arg = &val +} + +type ShareExportPolicyGetIdArgType = string +type ShareExportPolicyGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type ShareExportPolicyGetLabelsAttributeType = *map[string]string +type ShareExportPolicyGetLabelsArgType = map[string]string +type ShareExportPolicyGetLabelsRetType = map[string]string + +func getShareExportPolicyGetLabelsAttributeTypeOk(arg ShareExportPolicyGetLabelsAttributeType) (ret ShareExportPolicyGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyGetLabelsAttributeType(arg *ShareExportPolicyGetLabelsAttributeType, val ShareExportPolicyGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type ShareExportPolicyGetNameAttributeType = *string + +func getShareExportPolicyGetNameAttributeTypeOk(arg ShareExportPolicyGetNameAttributeType) (ret ShareExportPolicyGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyGetNameAttributeType(arg *ShareExportPolicyGetNameAttributeType, val ShareExportPolicyGetNameRetType) { + *arg = &val +} + +type ShareExportPolicyGetNameArgType = string +type ShareExportPolicyGetNameRetType = string + +/* + types and functions for rules +*/ + +// isArray +type ShareExportPolicyGetRulesAttributeType = *[]ShareExportPolicyRule +type ShareExportPolicyGetRulesArgType = []ShareExportPolicyRule +type ShareExportPolicyGetRulesRetType = []ShareExportPolicyRule + +func getShareExportPolicyGetRulesAttributeTypeOk(arg ShareExportPolicyGetRulesAttributeType) (ret ShareExportPolicyGetRulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyGetRulesAttributeType(arg *ShareExportPolicyGetRulesAttributeType, val ShareExportPolicyGetRulesRetType) { + *arg = &val +} + +/* + types and functions for sharesUsingExportPolicy +*/ + +// isInteger +type ShareExportPolicyGetSharesUsingExportPolicyAttributeType = *int64 +type ShareExportPolicyGetSharesUsingExportPolicyArgType = int64 +type ShareExportPolicyGetSharesUsingExportPolicyRetType = int64 + +func getShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(arg ShareExportPolicyGetSharesUsingExportPolicyAttributeType) (ret ShareExportPolicyGetSharesUsingExportPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyGetSharesUsingExportPolicyAttributeType(arg *ShareExportPolicyGetSharesUsingExportPolicyAttributeType, val ShareExportPolicyGetSharesUsingExportPolicyRetType) { + *arg = &val +} + +// ShareExportPolicy Details of the Share Export Policy to use in the Share. Note that if this is not set, the Share can only be mounted in read only by clients with IPs matching the IP ACL of the Resource Pool hosting this Share +type ShareExportPolicy struct { + CreatedAt ShareExportPolicyGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Share Export Policy + Id ShareExportPolicyGetIdAttributeType `json:"id,omitempty"` + // An optional object that represents the labels associated with the share export policy keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels ShareExportPolicyGetLabelsAttributeType `json:"labels,omitempty"` + // Name of the Share Export Policy + Name ShareExportPolicyGetNameAttributeType `json:"name,omitempty"` + // List of rules of the Share Export Policy. The order of the rules within the array does not matter - what matters is the field \"order\" within each rule + Rules ShareExportPolicyGetRulesAttributeType `json:"rules,omitempty"` + // Number of Shares using this Share Export Policy + // Can be cast to int32 without loss of precision. + SharesUsingExportPolicy ShareExportPolicyGetSharesUsingExportPolicyAttributeType `json:"sharesUsingExportPolicy,omitempty"` +} + +// NewShareExportPolicy instantiates a new ShareExportPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewShareExportPolicy() *ShareExportPolicy { + this := ShareExportPolicy{} + return &this +} + +// NewShareExportPolicyWithDefaults instantiates a new ShareExportPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewShareExportPolicyWithDefaults() *ShareExportPolicy { + this := ShareExportPolicy{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ShareExportPolicy) GetCreatedAt() (res ShareExportPolicyGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShareExportPolicy) GetCreatedAtOk() (ret ShareExportPolicyGetCreatedAtRetType, ok bool) { + return getShareExportPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ShareExportPolicy) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ShareExportPolicy) SetCreatedAt(v ShareExportPolicyGetCreatedAtRetType) { + setShareExportPolicyGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ShareExportPolicy) GetId() (res ShareExportPolicyGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *ShareExportPolicy) GetIdOk() (ret ShareExportPolicyGetIdRetType, ok bool) { + return getShareExportPolicyGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *ShareExportPolicy) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ShareExportPolicy) SetId(v ShareExportPolicyGetIdRetType) { + setShareExportPolicyGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *ShareExportPolicy) GetLabels() (res ShareExportPolicyGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *ShareExportPolicy) GetLabelsOk() (ret ShareExportPolicyGetLabelsRetType, ok bool) { + return getShareExportPolicyGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *ShareExportPolicy) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *ShareExportPolicy) SetLabels(v ShareExportPolicyGetLabelsRetType) { + setShareExportPolicyGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ShareExportPolicy) GetName() (res ShareExportPolicyGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *ShareExportPolicy) GetNameOk() (ret ShareExportPolicyGetNameRetType, ok bool) { + return getShareExportPolicyGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *ShareExportPolicy) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ShareExportPolicy) SetName(v ShareExportPolicyGetNameRetType) { + setShareExportPolicyGetNameAttributeType(&o.Name, v) +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *ShareExportPolicy) GetRules() (res ShareExportPolicyGetRulesRetType) { + res, _ = o.GetRulesOk() + return +} + +// 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 *ShareExportPolicy) GetRulesOk() (ret ShareExportPolicyGetRulesRetType, ok bool) { + return getShareExportPolicyGetRulesAttributeTypeOk(o.Rules) +} + +// HasRules returns a boolean if a field has been set. +func (o *ShareExportPolicy) HasRules() bool { + _, ok := o.GetRulesOk() + return ok +} + +// SetRules gets a reference to the given []ShareExportPolicyRule and assigns it to the Rules field. +func (o *ShareExportPolicy) SetRules(v ShareExportPolicyGetRulesRetType) { + setShareExportPolicyGetRulesAttributeType(&o.Rules, v) +} + +// GetSharesUsingExportPolicy returns the SharesUsingExportPolicy field value if set, zero value otherwise. +func (o *ShareExportPolicy) GetSharesUsingExportPolicy() (res ShareExportPolicyGetSharesUsingExportPolicyRetType) { + res, _ = o.GetSharesUsingExportPolicyOk() + return +} + +// GetSharesUsingExportPolicyOk returns a tuple with the SharesUsingExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShareExportPolicy) GetSharesUsingExportPolicyOk() (ret ShareExportPolicyGetSharesUsingExportPolicyRetType, ok bool) { + return getShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(o.SharesUsingExportPolicy) +} + +// HasSharesUsingExportPolicy returns a boolean if a field has been set. +func (o *ShareExportPolicy) HasSharesUsingExportPolicy() bool { + _, ok := o.GetSharesUsingExportPolicyOk() + return ok +} + +// SetSharesUsingExportPolicy gets a reference to the given int64 and assigns it to the SharesUsingExportPolicy field. +func (o *ShareExportPolicy) SetSharesUsingExportPolicy(v ShareExportPolicyGetSharesUsingExportPolicyRetType) { + setShareExportPolicyGetSharesUsingExportPolicyAttributeType(&o.SharesUsingExportPolicy, v) +} + +func (o ShareExportPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getShareExportPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getShareExportPolicyGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getShareExportPolicyGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getShareExportPolicyGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getShareExportPolicyGetRulesAttributeTypeOk(o.Rules); ok { + toSerialize["Rules"] = val + } + if val, ok := getShareExportPolicyGetSharesUsingExportPolicyAttributeTypeOk(o.SharesUsingExportPolicy); ok { + toSerialize["SharesUsingExportPolicy"] = val + } + return toSerialize, nil +} + +type NullableShareExportPolicy struct { + value *ShareExportPolicy + isSet bool +} + +func (v NullableShareExportPolicy) Get() *ShareExportPolicy { + return v.value +} + +func (v *NullableShareExportPolicy) Set(val *ShareExportPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableShareExportPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableShareExportPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableShareExportPolicy(val *ShareExportPolicy) *NullableShareExportPolicy { + return &NullableShareExportPolicy{value: val, isSet: true} +} + +func (v NullableShareExportPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableShareExportPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_share_export_policy_rule.go b/services/sfs/model_share_export_policy_rule.go new file mode 100644 index 000000000..98b650648 --- /dev/null +++ b/services/sfs/model_share_export_policy_rule.go @@ -0,0 +1,482 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the ShareExportPolicyRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ShareExportPolicyRule{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type ShareExportPolicyRuleGetCreatedAtAttributeType = *time.Time +type ShareExportPolicyRuleGetCreatedAtArgType = time.Time +type ShareExportPolicyRuleGetCreatedAtRetType = time.Time + +func getShareExportPolicyRuleGetCreatedAtAttributeTypeOk(arg ShareExportPolicyRuleGetCreatedAtAttributeType) (ret ShareExportPolicyRuleGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyRuleGetCreatedAtAttributeType(arg *ShareExportPolicyRuleGetCreatedAtAttributeType, val ShareExportPolicyRuleGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNullableString +type ShareExportPolicyRuleGetDescriptionAttributeType = *NullableString + +func getShareExportPolicyRuleGetDescriptionAttributeTypeOk(arg ShareExportPolicyRuleGetDescriptionAttributeType) (ret ShareExportPolicyRuleGetDescriptionRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setShareExportPolicyRuleGetDescriptionAttributeType(arg *ShareExportPolicyRuleGetDescriptionAttributeType, val ShareExportPolicyRuleGetDescriptionRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ShareExportPolicyRuleGetDescriptionArgType = *string +type ShareExportPolicyRuleGetDescriptionRetType = *string + +/* + types and functions for id +*/ + +// isNotNullableString +type ShareExportPolicyRuleGetIdAttributeType = *string + +func getShareExportPolicyRuleGetIdAttributeTypeOk(arg ShareExportPolicyRuleGetIdAttributeType) (ret ShareExportPolicyRuleGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyRuleGetIdAttributeType(arg *ShareExportPolicyRuleGetIdAttributeType, val ShareExportPolicyRuleGetIdRetType) { + *arg = &val +} + +type ShareExportPolicyRuleGetIdArgType = string +type ShareExportPolicyRuleGetIdRetType = string + +/* + types and functions for ipAcl +*/ + +// isArray +type ShareExportPolicyRuleGetIpAclAttributeType = *[]string +type ShareExportPolicyRuleGetIpAclArgType = []string +type ShareExportPolicyRuleGetIpAclRetType = []string + +func getShareExportPolicyRuleGetIpAclAttributeTypeOk(arg ShareExportPolicyRuleGetIpAclAttributeType) (ret ShareExportPolicyRuleGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyRuleGetIpAclAttributeType(arg *ShareExportPolicyRuleGetIpAclAttributeType, val ShareExportPolicyRuleGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for order +*/ + +// isInteger +type ShareExportPolicyRuleGetOrderAttributeType = *int64 +type ShareExportPolicyRuleGetOrderArgType = int64 +type ShareExportPolicyRuleGetOrderRetType = int64 + +func getShareExportPolicyRuleGetOrderAttributeTypeOk(arg ShareExportPolicyRuleGetOrderAttributeType) (ret ShareExportPolicyRuleGetOrderRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyRuleGetOrderAttributeType(arg *ShareExportPolicyRuleGetOrderAttributeType, val ShareExportPolicyRuleGetOrderRetType) { + *arg = &val +} + +/* + types and functions for readOnly +*/ + +// isBoolean +type ShareExportPolicyRulegetReadOnlyAttributeType = *bool +type ShareExportPolicyRulegetReadOnlyArgType = bool +type ShareExportPolicyRulegetReadOnlyRetType = bool + +func getShareExportPolicyRulegetReadOnlyAttributeTypeOk(arg ShareExportPolicyRulegetReadOnlyAttributeType) (ret ShareExportPolicyRulegetReadOnlyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyRulegetReadOnlyAttributeType(arg *ShareExportPolicyRulegetReadOnlyAttributeType, val ShareExportPolicyRulegetReadOnlyRetType) { + *arg = &val +} + +/* + types and functions for setUuid +*/ + +// isBoolean +type ShareExportPolicyRulegetSetUuidAttributeType = *bool +type ShareExportPolicyRulegetSetUuidArgType = bool +type ShareExportPolicyRulegetSetUuidRetType = bool + +func getShareExportPolicyRulegetSetUuidAttributeTypeOk(arg ShareExportPolicyRulegetSetUuidAttributeType) (ret ShareExportPolicyRulegetSetUuidRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyRulegetSetUuidAttributeType(arg *ShareExportPolicyRulegetSetUuidAttributeType, val ShareExportPolicyRulegetSetUuidRetType) { + *arg = &val +} + +/* + types and functions for superUser +*/ + +// isBoolean +type ShareExportPolicyRulegetSuperUserAttributeType = *bool +type ShareExportPolicyRulegetSuperUserArgType = bool +type ShareExportPolicyRulegetSuperUserRetType = bool + +func getShareExportPolicyRulegetSuperUserAttributeTypeOk(arg ShareExportPolicyRulegetSuperUserAttributeType) (ret ShareExportPolicyRulegetSuperUserRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setShareExportPolicyRulegetSuperUserAttributeType(arg *ShareExportPolicyRulegetSuperUserAttributeType, val ShareExportPolicyRulegetSuperUserRetType) { + *arg = &val +} + +// ShareExportPolicyRule struct for ShareExportPolicyRule +type ShareExportPolicyRule struct { + CreatedAt ShareExportPolicyRuleGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // Description of the Rule (optional) + Description ShareExportPolicyRuleGetDescriptionAttributeType `json:"description,omitempty"` + // ID of the Share Export Policy Rule + Id ShareExportPolicyRuleGetIdAttributeType `json:"id,omitempty"` + // IP access control list, where IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.251/32\" for a specific IP) This array cannot be empty + IpAcl ShareExportPolicyRuleGetIpAclAttributeType `json:"ipAcl,omitempty"` + // Order of the rule within a Share Export Policy. The order is used so that when a client IP matches multiple rules, the first rule is applied This field must be set + // Can be cast to int32 without loss of precision. + Order ShareExportPolicyRuleGetOrderAttributeType `json:"order,omitempty"` + // Flag to indicate if client IPs matching this rule can only mount the share in read only mode Default: false + ReadOnly ShareExportPolicyRulegetReadOnlyAttributeType `json:"readOnly,omitempty"` + // Flag to honor set UUID Default: false + SetUuid ShareExportPolicyRulegetSetUuidAttributeType `json:"setUuid,omitempty"` + // Flag to indicate if client IPs matching this rule have root access on the Share Default: true + SuperUser ShareExportPolicyRulegetSuperUserAttributeType `json:"superUser,omitempty"` +} + +// NewShareExportPolicyRule instantiates a new ShareExportPolicyRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewShareExportPolicyRule() *ShareExportPolicyRule { + this := ShareExportPolicyRule{} + return &this +} + +// NewShareExportPolicyRuleWithDefaults instantiates a new ShareExportPolicyRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewShareExportPolicyRuleWithDefaults() *ShareExportPolicyRule { + this := ShareExportPolicyRule{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ShareExportPolicyRule) GetCreatedAt() (res ShareExportPolicyRuleGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShareExportPolicyRule) GetCreatedAtOk() (ret ShareExportPolicyRuleGetCreatedAtRetType, ok bool) { + return getShareExportPolicyRuleGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ShareExportPolicyRule) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ShareExportPolicyRule) SetCreatedAt(v ShareExportPolicyRuleGetCreatedAtRetType) { + setShareExportPolicyRuleGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ShareExportPolicyRule) GetDescription() (res ShareExportPolicyRuleGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ShareExportPolicyRule) GetDescriptionOk() (ret ShareExportPolicyRuleGetDescriptionRetType, ok bool) { + return getShareExportPolicyRuleGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *ShareExportPolicyRule) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ShareExportPolicyRule) SetDescription(v ShareExportPolicyRuleGetDescriptionRetType) { + setShareExportPolicyRuleGetDescriptionAttributeType(&o.Description, v) +} + +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *ShareExportPolicyRule) SetDescriptionNil() { + o.Description = nil +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *ShareExportPolicyRule) UnsetDescription() { + o.Description = nil +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ShareExportPolicyRule) GetId() (res ShareExportPolicyRuleGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *ShareExportPolicyRule) GetIdOk() (ret ShareExportPolicyRuleGetIdRetType, ok bool) { + return getShareExportPolicyRuleGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *ShareExportPolicyRule) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ShareExportPolicyRule) SetId(v ShareExportPolicyRuleGetIdRetType) { + setShareExportPolicyRuleGetIdAttributeType(&o.Id, v) +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *ShareExportPolicyRule) GetIpAcl() (res ShareExportPolicyRuleGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShareExportPolicyRule) GetIpAclOk() (ret ShareExportPolicyRuleGetIpAclRetType, ok bool) { + return getShareExportPolicyRuleGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *ShareExportPolicyRule) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *ShareExportPolicyRule) SetIpAcl(v ShareExportPolicyRuleGetIpAclRetType) { + setShareExportPolicyRuleGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *ShareExportPolicyRule) GetOrder() (res ShareExportPolicyRuleGetOrderRetType) { + res, _ = o.GetOrderOk() + return +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShareExportPolicyRule) GetOrderOk() (ret ShareExportPolicyRuleGetOrderRetType, ok bool) { + return getShareExportPolicyRuleGetOrderAttributeTypeOk(o.Order) +} + +// HasOrder returns a boolean if a field has been set. +func (o *ShareExportPolicyRule) HasOrder() bool { + _, ok := o.GetOrderOk() + return ok +} + +// SetOrder gets a reference to the given int64 and assigns it to the Order field. +func (o *ShareExportPolicyRule) SetOrder(v ShareExportPolicyRuleGetOrderRetType) { + setShareExportPolicyRuleGetOrderAttributeType(&o.Order, v) +} + +// GetReadOnly returns the ReadOnly field value if set, zero value otherwise. +func (o *ShareExportPolicyRule) GetReadOnly() (res ShareExportPolicyRulegetReadOnlyRetType) { + res, _ = o.GetReadOnlyOk() + return +} + +// GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShareExportPolicyRule) GetReadOnlyOk() (ret ShareExportPolicyRulegetReadOnlyRetType, ok bool) { + return getShareExportPolicyRulegetReadOnlyAttributeTypeOk(o.ReadOnly) +} + +// HasReadOnly returns a boolean if a field has been set. +func (o *ShareExportPolicyRule) HasReadOnly() bool { + _, ok := o.GetReadOnlyOk() + return ok +} + +// SetReadOnly gets a reference to the given bool and assigns it to the ReadOnly field. +func (o *ShareExportPolicyRule) SetReadOnly(v ShareExportPolicyRulegetReadOnlyRetType) { + setShareExportPolicyRulegetReadOnlyAttributeType(&o.ReadOnly, v) +} + +// GetSetUuid returns the SetUuid field value if set, zero value otherwise. +func (o *ShareExportPolicyRule) GetSetUuid() (res ShareExportPolicyRulegetSetUuidRetType) { + res, _ = o.GetSetUuidOk() + return +} + +// GetSetUuidOk returns a tuple with the SetUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShareExportPolicyRule) GetSetUuidOk() (ret ShareExportPolicyRulegetSetUuidRetType, ok bool) { + return getShareExportPolicyRulegetSetUuidAttributeTypeOk(o.SetUuid) +} + +// HasSetUuid returns a boolean if a field has been set. +func (o *ShareExportPolicyRule) HasSetUuid() bool { + _, ok := o.GetSetUuidOk() + return ok +} + +// SetSetUuid gets a reference to the given bool and assigns it to the SetUuid field. +func (o *ShareExportPolicyRule) SetSetUuid(v ShareExportPolicyRulegetSetUuidRetType) { + setShareExportPolicyRulegetSetUuidAttributeType(&o.SetUuid, v) +} + +// GetSuperUser returns the SuperUser field value if set, zero value otherwise. +func (o *ShareExportPolicyRule) GetSuperUser() (res ShareExportPolicyRulegetSuperUserRetType) { + res, _ = o.GetSuperUserOk() + return +} + +// GetSuperUserOk returns a tuple with the SuperUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShareExportPolicyRule) GetSuperUserOk() (ret ShareExportPolicyRulegetSuperUserRetType, ok bool) { + return getShareExportPolicyRulegetSuperUserAttributeTypeOk(o.SuperUser) +} + +// HasSuperUser returns a boolean if a field has been set. +func (o *ShareExportPolicyRule) HasSuperUser() bool { + _, ok := o.GetSuperUserOk() + return ok +} + +// SetSuperUser gets a reference to the given bool and assigns it to the SuperUser field. +func (o *ShareExportPolicyRule) SetSuperUser(v ShareExportPolicyRulegetSuperUserRetType) { + setShareExportPolicyRulegetSuperUserAttributeType(&o.SuperUser, v) +} + +func (o ShareExportPolicyRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getShareExportPolicyRuleGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getShareExportPolicyRuleGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getShareExportPolicyRuleGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getShareExportPolicyRuleGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getShareExportPolicyRuleGetOrderAttributeTypeOk(o.Order); ok { + toSerialize["Order"] = val + } + if val, ok := getShareExportPolicyRulegetReadOnlyAttributeTypeOk(o.ReadOnly); ok { + toSerialize["ReadOnly"] = val + } + if val, ok := getShareExportPolicyRulegetSetUuidAttributeTypeOk(o.SetUuid); ok { + toSerialize["SetUuid"] = val + } + if val, ok := getShareExportPolicyRulegetSuperUserAttributeTypeOk(o.SuperUser); ok { + toSerialize["SuperUser"] = val + } + return toSerialize, nil +} + +type NullableShareExportPolicyRule struct { + value *ShareExportPolicyRule + isSet bool +} + +func (v NullableShareExportPolicyRule) Get() *ShareExportPolicyRule { + return v.value +} + +func (v *NullableShareExportPolicyRule) Set(val *ShareExportPolicyRule) { + v.value = val + v.isSet = true +} + +func (v NullableShareExportPolicyRule) IsSet() bool { + return v.isSet +} + +func (v *NullableShareExportPolicyRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableShareExportPolicyRule(val *ShareExportPolicyRule) *NullableShareExportPolicyRule { + return &NullableShareExportPolicyRule{value: val, isSet: true} +} + +func (v NullableShareExportPolicyRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableShareExportPolicyRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_share_export_policy_rule_test.go b/services/sfs/model_share_export_policy_rule_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_share_export_policy_rule_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_share_export_policy_test.go b/services/sfs/model_share_export_policy_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_share_export_policy_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_share_test.go b/services/sfs/model_share_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_share_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_snapshot_schedule.go b/services/sfs/model_snapshot_schedule.go new file mode 100644 index 000000000..652dedbb2 --- /dev/null +++ b/services/sfs/model_snapshot_schedule.go @@ -0,0 +1,178 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the SnapshotSchedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotSchedule{} + +/* + types and functions for cron +*/ + +// isNotNullableString +type SnapshotScheduleGetCronAttributeType = *string + +func getSnapshotScheduleGetCronAttributeTypeOk(arg SnapshotScheduleGetCronAttributeType) (ret SnapshotScheduleGetCronRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotScheduleGetCronAttributeType(arg *SnapshotScheduleGetCronAttributeType, val SnapshotScheduleGetCronRetType) { + *arg = &val +} + +type SnapshotScheduleGetCronArgType = string +type SnapshotScheduleGetCronRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type SnapshotScheduleGetNameAttributeType = *string + +func getSnapshotScheduleGetNameAttributeTypeOk(arg SnapshotScheduleGetNameAttributeType) (ret SnapshotScheduleGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotScheduleGetNameAttributeType(arg *SnapshotScheduleGetNameAttributeType, val SnapshotScheduleGetNameRetType) { + *arg = &val +} + +type SnapshotScheduleGetNameArgType = string +type SnapshotScheduleGetNameRetType = string + +// SnapshotSchedule struct for SnapshotSchedule +type SnapshotSchedule struct { + // Cron of the Snapshot Schedule (follows the cron schedule expression in Unix-like systems) + Cron SnapshotScheduleGetCronAttributeType `json:"cron,omitempty"` + // Name of the Snapshot Schedule + Name SnapshotScheduleGetNameAttributeType `json:"name,omitempty"` +} + +// NewSnapshotSchedule instantiates a new SnapshotSchedule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotSchedule() *SnapshotSchedule { + this := SnapshotSchedule{} + return &this +} + +// NewSnapshotScheduleWithDefaults instantiates a new SnapshotSchedule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotScheduleWithDefaults() *SnapshotSchedule { + this := SnapshotSchedule{} + return &this +} + +// GetCron returns the Cron field value if set, zero value otherwise. +func (o *SnapshotSchedule) GetCron() (res SnapshotScheduleGetCronRetType) { + res, _ = o.GetCronOk() + return +} + +// GetCronOk returns a tuple with the Cron field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SnapshotSchedule) GetCronOk() (ret SnapshotScheduleGetCronRetType, ok bool) { + return getSnapshotScheduleGetCronAttributeTypeOk(o.Cron) +} + +// HasCron returns a boolean if a field has been set. +func (o *SnapshotSchedule) HasCron() bool { + _, ok := o.GetCronOk() + return ok +} + +// SetCron gets a reference to the given string and assigns it to the Cron field. +func (o *SnapshotSchedule) SetCron(v SnapshotScheduleGetCronRetType) { + setSnapshotScheduleGetCronAttributeType(&o.Cron, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SnapshotSchedule) GetName() (res SnapshotScheduleGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *SnapshotSchedule) GetNameOk() (ret SnapshotScheduleGetNameRetType, ok bool) { + return getSnapshotScheduleGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *SnapshotSchedule) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SnapshotSchedule) SetName(v SnapshotScheduleGetNameRetType) { + setSnapshotScheduleGetNameAttributeType(&o.Name, v) +} + +func (o SnapshotSchedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getSnapshotScheduleGetCronAttributeTypeOk(o.Cron); ok { + toSerialize["Cron"] = val + } + if val, ok := getSnapshotScheduleGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + return toSerialize, nil +} + +type NullableSnapshotSchedule struct { + value *SnapshotSchedule + isSet bool +} + +func (v NullableSnapshotSchedule) Get() *SnapshotSchedule { + return v.value +} + +func (v *NullableSnapshotSchedule) Set(val *SnapshotSchedule) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotSchedule) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotSchedule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotSchedule(val *SnapshotSchedule) *NullableSnapshotSchedule { + return &NullableSnapshotSchedule{value: val, isSet: true} +} + +func (v NullableSnapshotSchedule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_snapshot_schedule_test.go b/services/sfs/model_snapshot_schedule_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_snapshot_schedule_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_status.go b/services/sfs/model_status.go new file mode 100644 index 000000000..c948781eb --- /dev/null +++ b/services/sfs/model_status.go @@ -0,0 +1,226 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the Status type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Status{} + +/* + types and functions for code +*/ + +// isInteger +type StatusGetCodeAttributeType = *int64 +type StatusGetCodeArgType = int64 +type StatusGetCodeRetType = int64 + +func getStatusGetCodeAttributeTypeOk(arg StatusGetCodeAttributeType) (ret StatusGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetCodeAttributeType(arg *StatusGetCodeAttributeType, val StatusGetCodeRetType) { + *arg = &val +} + +/* + types and functions for details +*/ + +// isArray +type StatusGetDetailsAttributeType = *[]GoogleProtobufAny +type StatusGetDetailsArgType = []GoogleProtobufAny +type StatusGetDetailsRetType = []GoogleProtobufAny + +func getStatusGetDetailsAttributeTypeOk(arg StatusGetDetailsAttributeType) (ret StatusGetDetailsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetDetailsAttributeType(arg *StatusGetDetailsAttributeType, val StatusGetDetailsRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type StatusGetMessageAttributeType = *string + +func getStatusGetMessageAttributeTypeOk(arg StatusGetMessageAttributeType) (ret StatusGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetMessageAttributeType(arg *StatusGetMessageAttributeType, val StatusGetMessageRetType) { + *arg = &val +} + +type StatusGetMessageArgType = string +type StatusGetMessageRetType = string + +// 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 StatusGetCodeAttributeType `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 StatusGetDetailsAttributeType `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 StatusGetMessageAttributeType `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() (res StatusGetCodeRetType) { + res, _ = o.GetCodeOk() + return +} + +// 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() (ret StatusGetCodeRetType, ok bool) { + return getStatusGetCodeAttributeTypeOk(o.Code) +} + +// HasCode returns a boolean if a field has been set. +func (o *Status) HasCode() bool { + _, ok := o.GetCodeOk() + return ok +} + +// SetCode gets a reference to the given int64 and assigns it to the Code field. +func (o *Status) SetCode(v StatusGetCodeRetType) { + setStatusGetCodeAttributeType(&o.Code, v) +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Status) GetDetails() (res StatusGetDetailsRetType) { + res, _ = o.GetDetailsOk() + return +} + +// 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() (ret StatusGetDetailsRetType, ok bool) { + return getStatusGetDetailsAttributeTypeOk(o.Details) +} + +// HasDetails returns a boolean if a field has been set. +func (o *Status) HasDetails() bool { + _, ok := o.GetDetailsOk() + return ok +} + +// SetDetails gets a reference to the given []GoogleProtobufAny and assigns it to the Details field. +func (o *Status) SetDetails(v StatusGetDetailsRetType) { + setStatusGetDetailsAttributeType(&o.Details, v) +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *Status) GetMessage() (res StatusGetMessageRetType) { + res, _ = o.GetMessageOk() + return +} + +// 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() (ret StatusGetMessageRetType, ok bool) { + return getStatusGetMessageAttributeTypeOk(o.Message) +} + +// HasMessage returns a boolean if a field has been set. +func (o *Status) HasMessage() bool { + _, ok := o.GetMessageOk() + return ok +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *Status) SetMessage(v StatusGetMessageRetType) { + setStatusGetMessageAttributeType(&o.Message, v) +} + +func (o Status) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getStatusGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val + } + if val, ok := getStatusGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val + } + if val, ok := getStatusGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + 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/sfs/model_status_test.go b/services/sfs/model_status_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_status_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_resource_pool_payload.go b/services/sfs/model_update_resource_pool_payload.go new file mode 100644 index 000000000..8020f1a26 --- /dev/null +++ b/services/sfs/model_update_resource_pool_payload.go @@ -0,0 +1,382 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the UpdateResourcePoolPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateResourcePoolPayload{} + +/* + types and functions for ipAcl +*/ + +// isArray +type UpdateResourcePoolPayloadGetIpAclAttributeType = *[]string +type UpdateResourcePoolPayloadGetIpAclArgType = []string +type UpdateResourcePoolPayloadGetIpAclRetType = []string + +func getUpdateResourcePoolPayloadGetIpAclAttributeTypeOk(arg UpdateResourcePoolPayloadGetIpAclAttributeType) (ret UpdateResourcePoolPayloadGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolPayloadGetIpAclAttributeType(arg *UpdateResourcePoolPayloadGetIpAclAttributeType, val UpdateResourcePoolPayloadGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type UpdateResourcePoolPayloadGetLabelsAttributeType = *map[string]string +type UpdateResourcePoolPayloadGetLabelsArgType = map[string]string +type UpdateResourcePoolPayloadGetLabelsRetType = map[string]string + +func getUpdateResourcePoolPayloadGetLabelsAttributeTypeOk(arg UpdateResourcePoolPayloadGetLabelsAttributeType) (ret UpdateResourcePoolPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolPayloadGetLabelsAttributeType(arg *UpdateResourcePoolPayloadGetLabelsAttributeType, val UpdateResourcePoolPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for performanceClass +*/ + +// isNotNullableString +type UpdateResourcePoolPayloadGetPerformanceClassAttributeType = *string + +func getUpdateResourcePoolPayloadGetPerformanceClassAttributeTypeOk(arg UpdateResourcePoolPayloadGetPerformanceClassAttributeType) (ret UpdateResourcePoolPayloadGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolPayloadGetPerformanceClassAttributeType(arg *UpdateResourcePoolPayloadGetPerformanceClassAttributeType, val UpdateResourcePoolPayloadGetPerformanceClassRetType) { + *arg = &val +} + +type UpdateResourcePoolPayloadGetPerformanceClassArgType = string +type UpdateResourcePoolPayloadGetPerformanceClassRetType = string + +/* + types and functions for sizeGigabytes +*/ + +// isInteger +type UpdateResourcePoolPayloadGetSizeGigabytesAttributeType = *int64 +type UpdateResourcePoolPayloadGetSizeGigabytesArgType = *int64 +type UpdateResourcePoolPayloadGetSizeGigabytesRetType = *int64 + +func getUpdateResourcePoolPayloadGetSizeGigabytesAttributeTypeOk(arg UpdateResourcePoolPayloadGetSizeGigabytesAttributeType) (ret UpdateResourcePoolPayloadGetSizeGigabytesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setUpdateResourcePoolPayloadGetSizeGigabytesAttributeType(arg *UpdateResourcePoolPayloadGetSizeGigabytesAttributeType, val UpdateResourcePoolPayloadGetSizeGigabytesRetType) { + *arg = val +} + +/* + types and functions for snapshotScheduleName +*/ + +// isNotNullableString +type UpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeType = *string + +func getUpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeTypeOk(arg UpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeType) (ret UpdateResourcePoolPayloadGetSnapshotScheduleNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeType(arg *UpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeType, val UpdateResourcePoolPayloadGetSnapshotScheduleNameRetType) { + *arg = &val +} + +type UpdateResourcePoolPayloadGetSnapshotScheduleNameArgType = string +type UpdateResourcePoolPayloadGetSnapshotScheduleNameRetType = string + +/* + types and functions for snapshotsAreVisible +*/ + +// isBoolean +type UpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType = *bool +type UpdateResourcePoolPayloadgetSnapshotsAreVisibleArgType = bool +type UpdateResourcePoolPayloadgetSnapshotsAreVisibleRetType = bool + +func getUpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeTypeOk(arg UpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType) (ret UpdateResourcePoolPayloadgetSnapshotsAreVisibleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType(arg *UpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType, val UpdateResourcePoolPayloadgetSnapshotsAreVisibleRetType) { + *arg = &val +} + +// UpdateResourcePoolPayload struct for UpdateResourcePoolPayload +type UpdateResourcePoolPayload struct { + // (optional) List of IPs that can mount the Resource Pool in read-only; IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.250/32\" for a specific IP) + IpAcl UpdateResourcePoolPayloadGetIpAclAttributeType `json:"ipAcl,omitempty"` + // An optional object that represents the labels associated with the resource pool keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels UpdateResourcePoolPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // (optional) Name of the performance class + PerformanceClass UpdateResourcePoolPayloadGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` + // (optional) Size of the Resource Pool (unit: gigabytes) + // Can be cast to int32 without loss of precision. + SizeGigabytes UpdateResourcePoolPayloadGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // (optional) Name of the Snapshot Schedule to use If not set, the Snapshot Schedule is not updated If set to an empty string, the Snapshot Schedule is removed + SnapshotScheduleName UpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeType `json:"snapshotScheduleName,omitempty"` + // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. + SnapshotsAreVisible UpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` +} + +// NewUpdateResourcePoolPayload instantiates a new UpdateResourcePoolPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateResourcePoolPayload() *UpdateResourcePoolPayload { + this := UpdateResourcePoolPayload{} + return &this +} + +// NewUpdateResourcePoolPayloadWithDefaults instantiates a new UpdateResourcePoolPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateResourcePoolPayloadWithDefaults() *UpdateResourcePoolPayload { + this := UpdateResourcePoolPayload{} + return &this +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *UpdateResourcePoolPayload) GetIpAcl() (res UpdateResourcePoolPayloadGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolPayload) GetIpAclOk() (ret UpdateResourcePoolPayloadGetIpAclRetType, ok bool) { + return getUpdateResourcePoolPayloadGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *UpdateResourcePoolPayload) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *UpdateResourcePoolPayload) SetIpAcl(v UpdateResourcePoolPayloadGetIpAclRetType) { + setUpdateResourcePoolPayloadGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateResourcePoolPayload) GetLabels() (res UpdateResourcePoolPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *UpdateResourcePoolPayload) GetLabelsOk() (ret UpdateResourcePoolPayloadGetLabelsRetType, ok bool) { + return getUpdateResourcePoolPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateResourcePoolPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateResourcePoolPayload) SetLabels(v UpdateResourcePoolPayloadGetLabelsRetType) { + setUpdateResourcePoolPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *UpdateResourcePoolPayload) GetPerformanceClass() (res UpdateResourcePoolPayloadGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolPayload) GetPerformanceClassOk() (ret UpdateResourcePoolPayloadGetPerformanceClassRetType, ok bool) { + return getUpdateResourcePoolPayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass) +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *UpdateResourcePoolPayload) HasPerformanceClass() bool { + _, ok := o.GetPerformanceClassOk() + return ok +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *UpdateResourcePoolPayload) SetPerformanceClass(v UpdateResourcePoolPayloadGetPerformanceClassRetType) { + setUpdateResourcePoolPayloadGetPerformanceClassAttributeType(&o.PerformanceClass, v) +} + +// GetSizeGigabytes returns the SizeGigabytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateResourcePoolPayload) GetSizeGigabytes() (res UpdateResourcePoolPayloadGetSizeGigabytesRetType) { + res, _ = o.GetSizeGigabytesOk() + return +} + +// GetSizeGigabytesOk returns a tuple with the SizeGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateResourcePoolPayload) GetSizeGigabytesOk() (ret UpdateResourcePoolPayloadGetSizeGigabytesRetType, ok bool) { + return getUpdateResourcePoolPayloadGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes) +} + +// HasSizeGigabytes returns a boolean if a field has been set. +func (o *UpdateResourcePoolPayload) HasSizeGigabytes() bool { + _, ok := o.GetSizeGigabytesOk() + return ok +} + +// SetSizeGigabytes gets a reference to the given int64 and assigns it to the SizeGigabytes field. +func (o *UpdateResourcePoolPayload) SetSizeGigabytes(v UpdateResourcePoolPayloadGetSizeGigabytesRetType) { + setUpdateResourcePoolPayloadGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) +} + +// SetSizeGigabytesNil sets the value for SizeGigabytes to be an explicit nil +func (o *UpdateResourcePoolPayload) SetSizeGigabytesNil() { + o.SizeGigabytes = nil +} + +// UnsetSizeGigabytes ensures that no value is present for SizeGigabytes, not even an explicit nil +func (o *UpdateResourcePoolPayload) UnsetSizeGigabytes() { + o.SizeGigabytes = nil +} + +// GetSnapshotScheduleName returns the SnapshotScheduleName field value if set, zero value otherwise. +func (o *UpdateResourcePoolPayload) GetSnapshotScheduleName() (res UpdateResourcePoolPayloadGetSnapshotScheduleNameRetType) { + res, _ = o.GetSnapshotScheduleNameOk() + return +} + +// GetSnapshotScheduleNameOk returns a tuple with the SnapshotScheduleName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolPayload) GetSnapshotScheduleNameOk() (ret UpdateResourcePoolPayloadGetSnapshotScheduleNameRetType, ok bool) { + return getUpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeTypeOk(o.SnapshotScheduleName) +} + +// HasSnapshotScheduleName returns a boolean if a field has been set. +func (o *UpdateResourcePoolPayload) HasSnapshotScheduleName() bool { + _, ok := o.GetSnapshotScheduleNameOk() + return ok +} + +// SetSnapshotScheduleName gets a reference to the given string and assigns it to the SnapshotScheduleName field. +func (o *UpdateResourcePoolPayload) SetSnapshotScheduleName(v UpdateResourcePoolPayloadGetSnapshotScheduleNameRetType) { + setUpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeType(&o.SnapshotScheduleName, v) +} + +// GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. +func (o *UpdateResourcePoolPayload) GetSnapshotsAreVisible() (res UpdateResourcePoolPayloadgetSnapshotsAreVisibleRetType) { + res, _ = o.GetSnapshotsAreVisibleOk() + return +} + +// GetSnapshotsAreVisibleOk returns a tuple with the SnapshotsAreVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolPayload) GetSnapshotsAreVisibleOk() (ret UpdateResourcePoolPayloadgetSnapshotsAreVisibleRetType, ok bool) { + return getUpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible) +} + +// HasSnapshotsAreVisible returns a boolean if a field has been set. +func (o *UpdateResourcePoolPayload) HasSnapshotsAreVisible() bool { + _, ok := o.GetSnapshotsAreVisibleOk() + return ok +} + +// SetSnapshotsAreVisible gets a reference to the given bool and assigns it to the SnapshotsAreVisible field. +func (o *UpdateResourcePoolPayload) SetSnapshotsAreVisible(v UpdateResourcePoolPayloadgetSnapshotsAreVisibleRetType) { + setUpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType(&o.SnapshotsAreVisible, v) +} + +func (o UpdateResourcePoolPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateResourcePoolPayloadGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getUpdateResourcePoolPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateResourcePoolPayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val + } + if val, ok := getUpdateResourcePoolPayloadGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { + toSerialize["SizeGigabytes"] = val + } + if val, ok := getUpdateResourcePoolPayloadGetSnapshotScheduleNameAttributeTypeOk(o.SnapshotScheduleName); ok { + toSerialize["SnapshotScheduleName"] = val + } + if val, ok := getUpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { + toSerialize["SnapshotsAreVisible"] = val + } + return toSerialize, nil +} + +type NullableUpdateResourcePoolPayload struct { + value *UpdateResourcePoolPayload + isSet bool +} + +func (v NullableUpdateResourcePoolPayload) Get() *UpdateResourcePoolPayload { + return v.value +} + +func (v *NullableUpdateResourcePoolPayload) Set(val *UpdateResourcePoolPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateResourcePoolPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateResourcePoolPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateResourcePoolPayload(val *UpdateResourcePoolPayload) *NullableUpdateResourcePoolPayload { + return &NullableUpdateResourcePoolPayload{value: val, isSet: true} +} + +func (v NullableUpdateResourcePoolPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateResourcePoolPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_resource_pool_payload_test.go b/services/sfs/model_update_resource_pool_payload_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_resource_pool_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_resource_pool_response.go b/services/sfs/model_update_resource_pool_response.go new file mode 100644 index 000000000..d1cacfa07 --- /dev/null +++ b/services/sfs/model_update_resource_pool_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the UpdateResourcePoolResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateResourcePoolResponse{} + +/* + types and functions for resourcePool +*/ + +// isModel +type UpdateResourcePoolResponseGetResourcePoolAttributeType = *UpdateResourcePoolResponseResourcePool +type UpdateResourcePoolResponseGetResourcePoolArgType = UpdateResourcePoolResponseResourcePool +type UpdateResourcePoolResponseGetResourcePoolRetType = UpdateResourcePoolResponseResourcePool + +func getUpdateResourcePoolResponseGetResourcePoolAttributeTypeOk(arg UpdateResourcePoolResponseGetResourcePoolAttributeType) (ret UpdateResourcePoolResponseGetResourcePoolRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseGetResourcePoolAttributeType(arg *UpdateResourcePoolResponseGetResourcePoolAttributeType, val UpdateResourcePoolResponseGetResourcePoolRetType) { + *arg = &val +} + +// UpdateResourcePoolResponse struct for UpdateResourcePoolResponse +type UpdateResourcePoolResponse struct { + ResourcePool UpdateResourcePoolResponseGetResourcePoolAttributeType `json:"resourcePool,omitempty"` +} + +// NewUpdateResourcePoolResponse instantiates a new UpdateResourcePoolResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateResourcePoolResponse() *UpdateResourcePoolResponse { + this := UpdateResourcePoolResponse{} + return &this +} + +// NewUpdateResourcePoolResponseWithDefaults instantiates a new UpdateResourcePoolResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateResourcePoolResponseWithDefaults() *UpdateResourcePoolResponse { + this := UpdateResourcePoolResponse{} + return &this +} + +// GetResourcePool returns the ResourcePool field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponse) GetResourcePool() (res UpdateResourcePoolResponseGetResourcePoolRetType) { + res, _ = o.GetResourcePoolOk() + return +} + +// GetResourcePoolOk returns a tuple with the ResourcePool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponse) GetResourcePoolOk() (ret UpdateResourcePoolResponseGetResourcePoolRetType, ok bool) { + return getUpdateResourcePoolResponseGetResourcePoolAttributeTypeOk(o.ResourcePool) +} + +// HasResourcePool returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponse) HasResourcePool() bool { + _, ok := o.GetResourcePoolOk() + return ok +} + +// SetResourcePool gets a reference to the given UpdateResourcePoolResponseResourcePool and assigns it to the ResourcePool field. +func (o *UpdateResourcePoolResponse) SetResourcePool(v UpdateResourcePoolResponseGetResourcePoolRetType) { + setUpdateResourcePoolResponseGetResourcePoolAttributeType(&o.ResourcePool, v) +} + +func (o UpdateResourcePoolResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateResourcePoolResponseGetResourcePoolAttributeTypeOk(o.ResourcePool); ok { + toSerialize["ResourcePool"] = val + } + return toSerialize, nil +} + +type NullableUpdateResourcePoolResponse struct { + value *UpdateResourcePoolResponse + isSet bool +} + +func (v NullableUpdateResourcePoolResponse) Get() *UpdateResourcePoolResponse { + return v.value +} + +func (v *NullableUpdateResourcePoolResponse) Set(val *UpdateResourcePoolResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateResourcePoolResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateResourcePoolResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateResourcePoolResponse(val *UpdateResourcePoolResponse) *NullableUpdateResourcePoolResponse { + return &NullableUpdateResourcePoolResponse{value: val, isSet: true} +} + +func (v NullableUpdateResourcePoolResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateResourcePoolResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_resource_pool_response_resource_pool.go b/services/sfs/model_update_resource_pool_response_resource_pool.go new file mode 100644 index 000000000..710bfb7ae --- /dev/null +++ b/services/sfs/model_update_resource_pool_response_resource_pool.go @@ -0,0 +1,802 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the UpdateResourcePoolResponseResourcePool type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateResourcePoolResponseResourcePool{} + +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType = *string + +func getUpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType, val UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + *arg = &val +} + +type UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneArgType = string +type UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType = string + +/* + types and functions for countShares +*/ + +// isInteger +type UpdateResourcePoolResponseResourcePoolGetCountSharesAttributeType = *int64 +type UpdateResourcePoolResponseResourcePoolGetCountSharesArgType = int64 +type UpdateResourcePoolResponseResourcePoolGetCountSharesRetType = int64 + +func getUpdateResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetCountSharesAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetCountSharesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetCountSharesAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetCountSharesAttributeType, val UpdateResourcePoolResponseResourcePoolGetCountSharesRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type UpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeType = *time.Time +type UpdateResourcePoolResponseResourcePoolGetCreatedAtArgType = time.Time +type UpdateResourcePoolResponseResourcePoolGetCreatedAtRetType = time.Time + +func getUpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeType, val UpdateResourcePoolResponseResourcePoolGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type UpdateResourcePoolResponseResourcePoolGetIdAttributeType = *string + +func getUpdateResourcePoolResponseResourcePoolGetIdAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetIdAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetIdAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetIdAttributeType, val UpdateResourcePoolResponseResourcePoolGetIdRetType) { + *arg = &val +} + +type UpdateResourcePoolResponseResourcePoolGetIdArgType = string +type UpdateResourcePoolResponseResourcePoolGetIdRetType = string + +/* + types and functions for ipAcl +*/ + +// isArray +type UpdateResourcePoolResponseResourcePoolGetIpAclAttributeType = *[]string +type UpdateResourcePoolResponseResourcePoolGetIpAclArgType = []string +type UpdateResourcePoolResponseResourcePoolGetIpAclRetType = []string + +func getUpdateResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetIpAclAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetIpAclAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetIpAclAttributeType, val UpdateResourcePoolResponseResourcePoolGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type UpdateResourcePoolResponseResourcePoolGetLabelsAttributeType = *map[string]string +type UpdateResourcePoolResponseResourcePoolGetLabelsArgType = map[string]string +type UpdateResourcePoolResponseResourcePoolGetLabelsRetType = map[string]string + +func getUpdateResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetLabelsAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetLabelsAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetLabelsAttributeType, val UpdateResourcePoolResponseResourcePoolGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mountPath +*/ + +// isNotNullableString +type UpdateResourcePoolResponseResourcePoolGetMountPathAttributeType = *string + +func getUpdateResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetMountPathAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetMountPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetMountPathAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetMountPathAttributeType, val UpdateResourcePoolResponseResourcePoolGetMountPathRetType) { + *arg = &val +} + +type UpdateResourcePoolResponseResourcePoolGetMountPathArgType = string +type UpdateResourcePoolResponseResourcePoolGetMountPathRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateResourcePoolResponseResourcePoolGetNameAttributeType = *string + +func getUpdateResourcePoolResponseResourcePoolGetNameAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetNameAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetNameAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetNameAttributeType, val UpdateResourcePoolResponseResourcePoolGetNameRetType) { + *arg = &val +} + +type UpdateResourcePoolResponseResourcePoolGetNameArgType = string +type UpdateResourcePoolResponseResourcePoolGetNameRetType = string + +/* + types and functions for performanceClass +*/ + +// isModel +type UpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType = *ResourcePoolPerformanceClass +type UpdateResourcePoolResponseResourcePoolGetPerformanceClassArgType = ResourcePoolPerformanceClass +type UpdateResourcePoolResponseResourcePoolGetPerformanceClassRetType = ResourcePoolPerformanceClass + +func getUpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType, val UpdateResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + *arg = &val +} + +/* + types and functions for performanceClassDowngradableAt +*/ + +// isDateTime +type UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType = *time.Time +type UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtArgType = time.Time +type UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType = time.Time + +func getUpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType, val UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + *arg = &val +} + +/* + types and functions for sizeReducibleAt +*/ + +// isDateTime +type UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType = *time.Time +type UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtArgType = time.Time +type UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType = time.Time + +func getUpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType, val UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + *arg = &val +} + +/* + types and functions for snapshotSchedule +*/ + +// isModel +type UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType = *SnapshotSchedule +type UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleArgType = SnapshotSchedule +type UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType = SnapshotSchedule + +func getUpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType, val UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + *arg = &val +} + +/* + types and functions for snapshotsAreVisible +*/ + +// isBoolean +type UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType = *bool +type UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleArgType = bool +type UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType = bool + +func getUpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType) (ret UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType(arg *UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType, val UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + *arg = &val +} + +/* + types and functions for space +*/ + +// isModel +type UpdateResourcePoolResponseResourcePoolGetSpaceAttributeType = *ResourcePoolSpace +type UpdateResourcePoolResponseResourcePoolGetSpaceArgType = ResourcePoolSpace +type UpdateResourcePoolResponseResourcePoolGetSpaceRetType = ResourcePoolSpace + +func getUpdateResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetSpaceAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetSpaceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetSpaceAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetSpaceAttributeType, val UpdateResourcePoolResponseResourcePoolGetSpaceRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type UpdateResourcePoolResponseResourcePoolGetStateAttributeType = *string + +func getUpdateResourcePoolResponseResourcePoolGetStateAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetStateAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateResourcePoolResponseResourcePoolGetStateAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetStateAttributeType, val UpdateResourcePoolResponseResourcePoolGetStateRetType) { + *arg = &val +} + +type UpdateResourcePoolResponseResourcePoolGetStateArgType = string +type UpdateResourcePoolResponseResourcePoolGetStateRetType = string + +// UpdateResourcePoolResponseResourcePool Updated Resource Pool +type UpdateResourcePoolResponseResourcePool struct { + // Name of the respective availability zone + AvailabilityZone UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` + // Number of Shares in the Resource Pool + // Can be cast to int32 without loss of precision. + CountShares UpdateResourcePoolResponseResourcePoolGetCountSharesAttributeType `json:"countShares,omitempty"` + CreatedAt UpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Resource Pool + Id UpdateResourcePoolResponseResourcePoolGetIdAttributeType `json:"id,omitempty"` + // List of IPs that can mount the Resource Pool in read-only; IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.250/32\" for a specific IP) + IpAcl UpdateResourcePoolResponseResourcePoolGetIpAclAttributeType `json:"ipAcl,omitempty"` + Labels UpdateResourcePoolResponseResourcePoolGetLabelsAttributeType `json:"labels,omitempty"` + // Mount path of the Resource Pool, used to mount the Resource Pool Note that a Resource Pool can only be mounted in read-only + MountPath UpdateResourcePoolResponseResourcePoolGetMountPathAttributeType `json:"mountPath,omitempty"` + // Name of the Resource Pool + Name UpdateResourcePoolResponseResourcePoolGetNameAttributeType `json:"name,omitempty"` + PerformanceClass UpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` + // Time when the performance class can be downgraded again. + PerformanceClassDowngradableAt UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType `json:"performanceClassDowngradableAt,omitempty"` + // Time when the size can be reduced again. + SizeReducibleAt UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType `json:"sizeReducibleAt,omitempty"` + SnapshotSchedule UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType `json:"snapshotSchedule,omitempty"` + // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. + SnapshotsAreVisible UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` + Space UpdateResourcePoolResponseResourcePoolGetSpaceAttributeType `json:"space,omitempty"` + // State of the Resource Pool (possible values: [\"pending\", \"creating\", \"created\", \"updating\", \"error\", \"deleting\"]) + State UpdateResourcePoolResponseResourcePoolGetStateAttributeType `json:"state,omitempty"` +} + +// NewUpdateResourcePoolResponseResourcePool instantiates a new UpdateResourcePoolResponseResourcePool object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateResourcePoolResponseResourcePool() *UpdateResourcePoolResponseResourcePool { + this := UpdateResourcePoolResponseResourcePool{} + return &this +} + +// NewUpdateResourcePoolResponseResourcePoolWithDefaults instantiates a new UpdateResourcePoolResponseResourcePool object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateResourcePoolResponseResourcePoolWithDefaults() *UpdateResourcePoolResponseResourcePool { + this := UpdateResourcePoolResponseResourcePool{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetAvailabilityZone() (res UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetAvailabilityZoneOk() (ret UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasAvailabilityZone() bool { + _, ok := o.GetAvailabilityZoneOk() + return ok +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *UpdateResourcePoolResponseResourcePool) SetAvailabilityZone(v UpdateResourcePoolResponseResourcePoolGetAvailabilityZoneRetType) { + setUpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) +} + +// GetCountShares returns the CountShares field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetCountShares() (res UpdateResourcePoolResponseResourcePoolGetCountSharesRetType) { + res, _ = o.GetCountSharesOk() + return +} + +// GetCountSharesOk returns a tuple with the CountShares field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetCountSharesOk() (ret UpdateResourcePoolResponseResourcePoolGetCountSharesRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(o.CountShares) +} + +// HasCountShares returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasCountShares() bool { + _, ok := o.GetCountSharesOk() + return ok +} + +// SetCountShares gets a reference to the given int64 and assigns it to the CountShares field. +func (o *UpdateResourcePoolResponseResourcePool) SetCountShares(v UpdateResourcePoolResponseResourcePoolGetCountSharesRetType) { + setUpdateResourcePoolResponseResourcePoolGetCountSharesAttributeType(&o.CountShares, v) +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetCreatedAt() (res UpdateResourcePoolResponseResourcePoolGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetCreatedAtOk() (ret UpdateResourcePoolResponseResourcePoolGetCreatedAtRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *UpdateResourcePoolResponseResourcePool) SetCreatedAt(v UpdateResourcePoolResponseResourcePoolGetCreatedAtRetType) { + setUpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetId() (res UpdateResourcePoolResponseResourcePoolGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *UpdateResourcePoolResponseResourcePool) GetIdOk() (ret UpdateResourcePoolResponseResourcePoolGetIdRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdateResourcePoolResponseResourcePool) SetId(v UpdateResourcePoolResponseResourcePoolGetIdRetType) { + setUpdateResourcePoolResponseResourcePoolGetIdAttributeType(&o.Id, v) +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetIpAcl() (res UpdateResourcePoolResponseResourcePoolGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetIpAclOk() (ret UpdateResourcePoolResponseResourcePoolGetIpAclRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *UpdateResourcePoolResponseResourcePool) SetIpAcl(v UpdateResourcePoolResponseResourcePoolGetIpAclRetType) { + setUpdateResourcePoolResponseResourcePoolGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetLabels() (res UpdateResourcePoolResponseResourcePoolGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *UpdateResourcePoolResponseResourcePool) GetLabelsOk() (ret UpdateResourcePoolResponseResourcePoolGetLabelsRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateResourcePoolResponseResourcePool) SetLabels(v UpdateResourcePoolResponseResourcePoolGetLabelsRetType) { + setUpdateResourcePoolResponseResourcePoolGetLabelsAttributeType(&o.Labels, v) +} + +// GetMountPath returns the MountPath field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetMountPath() (res UpdateResourcePoolResponseResourcePoolGetMountPathRetType) { + res, _ = o.GetMountPathOk() + return +} + +// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetMountPathOk() (ret UpdateResourcePoolResponseResourcePoolGetMountPathRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(o.MountPath) +} + +// HasMountPath returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasMountPath() bool { + _, ok := o.GetMountPathOk() + return ok +} + +// SetMountPath gets a reference to the given string and assigns it to the MountPath field. +func (o *UpdateResourcePoolResponseResourcePool) SetMountPath(v UpdateResourcePoolResponseResourcePoolGetMountPathRetType) { + setUpdateResourcePoolResponseResourcePoolGetMountPathAttributeType(&o.MountPath, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetName() (res UpdateResourcePoolResponseResourcePoolGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *UpdateResourcePoolResponseResourcePool) GetNameOk() (ret UpdateResourcePoolResponseResourcePoolGetNameRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateResourcePoolResponseResourcePool) SetName(v UpdateResourcePoolResponseResourcePoolGetNameRetType) { + setUpdateResourcePoolResponseResourcePoolGetNameAttributeType(&o.Name, v) +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetPerformanceClass() (res UpdateResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetPerformanceClassOk() (ret UpdateResourcePoolResponseResourcePoolGetPerformanceClassRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(o.PerformanceClass) +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasPerformanceClass() bool { + _, ok := o.GetPerformanceClassOk() + return ok +} + +// SetPerformanceClass gets a reference to the given ResourcePoolPerformanceClass and assigns it to the PerformanceClass field. +func (o *UpdateResourcePoolResponseResourcePool) SetPerformanceClass(v UpdateResourcePoolResponseResourcePoolGetPerformanceClassRetType) { + setUpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeType(&o.PerformanceClass, v) +} + +// GetPerformanceClassDowngradableAt returns the PerformanceClassDowngradableAt field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetPerformanceClassDowngradableAt() (res UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + res, _ = o.GetPerformanceClassDowngradableAtOk() + return +} + +// GetPerformanceClassDowngradableAtOk returns a tuple with the PerformanceClassDowngradableAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetPerformanceClassDowngradableAtOk() (ret UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(o.PerformanceClassDowngradableAt) +} + +// HasPerformanceClassDowngradableAt returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasPerformanceClassDowngradableAt() bool { + _, ok := o.GetPerformanceClassDowngradableAtOk() + return ok +} + +// SetPerformanceClassDowngradableAt gets a reference to the given time.Time and assigns it to the PerformanceClassDowngradableAt field. +func (o *UpdateResourcePoolResponseResourcePool) SetPerformanceClassDowngradableAt(v UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtRetType) { + setUpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType(&o.PerformanceClassDowngradableAt, v) +} + +// GetSizeReducibleAt returns the SizeReducibleAt field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetSizeReducibleAt() (res UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + res, _ = o.GetSizeReducibleAtOk() + return +} + +// GetSizeReducibleAtOk returns a tuple with the SizeReducibleAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetSizeReducibleAtOk() (ret UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt) +} + +// HasSizeReducibleAt returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasSizeReducibleAt() bool { + _, ok := o.GetSizeReducibleAtOk() + return ok +} + +// SetSizeReducibleAt gets a reference to the given time.Time and assigns it to the SizeReducibleAt field. +func (o *UpdateResourcePoolResponseResourcePool) SetSizeReducibleAt(v UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtRetType) { + setUpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(&o.SizeReducibleAt, v) +} + +// GetSnapshotSchedule returns the SnapshotSchedule field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetSnapshotSchedule() (res UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + res, _ = o.GetSnapshotScheduleOk() + return +} + +// GetSnapshotScheduleOk returns a tuple with the SnapshotSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetSnapshotScheduleOk() (ret UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(o.SnapshotSchedule) +} + +// HasSnapshotSchedule returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasSnapshotSchedule() bool { + _, ok := o.GetSnapshotScheduleOk() + return ok +} + +// SetSnapshotSchedule gets a reference to the given SnapshotSchedule and assigns it to the SnapshotSchedule field. +func (o *UpdateResourcePoolResponseResourcePool) SetSnapshotSchedule(v UpdateResourcePoolResponseResourcePoolGetSnapshotScheduleRetType) { + setUpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeType(&o.SnapshotSchedule, v) +} + +// GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetSnapshotsAreVisible() (res UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + res, _ = o.GetSnapshotsAreVisibleOk() + return +} + +// GetSnapshotsAreVisibleOk returns a tuple with the SnapshotsAreVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetSnapshotsAreVisibleOk() (ret UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible) +} + +// HasSnapshotsAreVisible returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasSnapshotsAreVisible() bool { + _, ok := o.GetSnapshotsAreVisibleOk() + return ok +} + +// SetSnapshotsAreVisible gets a reference to the given bool and assigns it to the SnapshotsAreVisible field. +func (o *UpdateResourcePoolResponseResourcePool) SetSnapshotsAreVisible(v UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { + setUpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType(&o.SnapshotsAreVisible, v) +} + +// GetSpace returns the Space field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetSpace() (res UpdateResourcePoolResponseResourcePoolGetSpaceRetType) { + res, _ = o.GetSpaceOk() + return +} + +// GetSpaceOk returns a tuple with the Space field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolResponseResourcePool) GetSpaceOk() (ret UpdateResourcePoolResponseResourcePoolGetSpaceRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(o.Space) +} + +// HasSpace returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasSpace() bool { + _, ok := o.GetSpaceOk() + return ok +} + +// SetSpace gets a reference to the given ResourcePoolSpace and assigns it to the Space field. +func (o *UpdateResourcePoolResponseResourcePool) SetSpace(v UpdateResourcePoolResponseResourcePoolGetSpaceRetType) { + setUpdateResourcePoolResponseResourcePoolGetSpaceAttributeType(&o.Space, v) +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *UpdateResourcePoolResponseResourcePool) GetState() (res UpdateResourcePoolResponseResourcePoolGetStateRetType) { + res, _ = o.GetStateOk() + return +} + +// 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 *UpdateResourcePoolResponseResourcePool) GetStateOk() (ret UpdateResourcePoolResponseResourcePoolGetStateRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetStateAttributeTypeOk(o.State) +} + +// HasState returns a boolean if a field has been set. +func (o *UpdateResourcePoolResponseResourcePool) HasState() bool { + _, ok := o.GetStateOk() + return ok +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *UpdateResourcePoolResponseResourcePool) SetState(v UpdateResourcePoolResponseResourcePoolGetStateRetType) { + setUpdateResourcePoolResponseResourcePoolGetStateAttributeType(&o.State, v) +} + +func (o UpdateResourcePoolResponseResourcePool) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateResourcePoolResponseResourcePoolGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetCountSharesAttributeTypeOk(o.CountShares); ok { + toSerialize["CountShares"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetMountPathAttributeTypeOk(o.MountPath); ok { + toSerialize["MountPath"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeTypeOk(o.PerformanceClassDowngradableAt); ok { + toSerialize["PerformanceClassDowngradableAt"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt); ok { + toSerialize["SizeReducibleAt"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetSnapshotScheduleAttributeTypeOk(o.SnapshotSchedule); ok { + toSerialize["SnapshotSchedule"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { + toSerialize["SnapshotsAreVisible"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetSpaceAttributeTypeOk(o.Space); ok { + toSerialize["Space"] = val + } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +type NullableUpdateResourcePoolResponseResourcePool struct { + value *UpdateResourcePoolResponseResourcePool + isSet bool +} + +func (v NullableUpdateResourcePoolResponseResourcePool) Get() *UpdateResourcePoolResponseResourcePool { + return v.value +} + +func (v *NullableUpdateResourcePoolResponseResourcePool) Set(val *UpdateResourcePoolResponseResourcePool) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateResourcePoolResponseResourcePool) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateResourcePoolResponseResourcePool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateResourcePoolResponseResourcePool(val *UpdateResourcePoolResponseResourcePool) *NullableUpdateResourcePoolResponseResourcePool { + return &NullableUpdateResourcePoolResponseResourcePool{value: val, isSet: true} +} + +func (v NullableUpdateResourcePoolResponseResourcePool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateResourcePoolResponseResourcePool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_resource_pool_response_resource_pool_test.go b/services/sfs/model_update_resource_pool_response_resource_pool_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_resource_pool_response_resource_pool_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_resource_pool_response_test.go b/services/sfs/model_update_resource_pool_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_resource_pool_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_share_export_policy_body_rule.go b/services/sfs/model_update_share_export_policy_body_rule.go new file mode 100644 index 000000000..f35a09ac6 --- /dev/null +++ b/services/sfs/model_update_share_export_policy_body_rule.go @@ -0,0 +1,391 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the UpdateShareExportPolicyBodyRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateShareExportPolicyBodyRule{} + +/* + types and functions for description +*/ + +// isNullableString +type UpdateShareExportPolicyBodyRuleGetDescriptionAttributeType = *NullableString + +func getUpdateShareExportPolicyBodyRuleGetDescriptionAttributeTypeOk(arg UpdateShareExportPolicyBodyRuleGetDescriptionAttributeType) (ret UpdateShareExportPolicyBodyRuleGetDescriptionRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setUpdateShareExportPolicyBodyRuleGetDescriptionAttributeType(arg *UpdateShareExportPolicyBodyRuleGetDescriptionAttributeType, val UpdateShareExportPolicyBodyRuleGetDescriptionRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type UpdateShareExportPolicyBodyRuleGetDescriptionArgType = *string +type UpdateShareExportPolicyBodyRuleGetDescriptionRetType = *string + +/* + types and functions for ipAcl +*/ + +// isArray +type UpdateShareExportPolicyBodyRuleGetIpAclAttributeType = *[]string +type UpdateShareExportPolicyBodyRuleGetIpAclArgType = []string +type UpdateShareExportPolicyBodyRuleGetIpAclRetType = []string + +func getUpdateShareExportPolicyBodyRuleGetIpAclAttributeTypeOk(arg UpdateShareExportPolicyBodyRuleGetIpAclAttributeType) (ret UpdateShareExportPolicyBodyRuleGetIpAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareExportPolicyBodyRuleGetIpAclAttributeType(arg *UpdateShareExportPolicyBodyRuleGetIpAclAttributeType, val UpdateShareExportPolicyBodyRuleGetIpAclRetType) { + *arg = &val +} + +/* + types and functions for order +*/ + +// isInteger +type UpdateShareExportPolicyBodyRuleGetOrderAttributeType = *int64 +type UpdateShareExportPolicyBodyRuleGetOrderArgType = int64 +type UpdateShareExportPolicyBodyRuleGetOrderRetType = int64 + +func getUpdateShareExportPolicyBodyRuleGetOrderAttributeTypeOk(arg UpdateShareExportPolicyBodyRuleGetOrderAttributeType) (ret UpdateShareExportPolicyBodyRuleGetOrderRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareExportPolicyBodyRuleGetOrderAttributeType(arg *UpdateShareExportPolicyBodyRuleGetOrderAttributeType, val UpdateShareExportPolicyBodyRuleGetOrderRetType) { + *arg = &val +} + +/* + types and functions for readOnly +*/ + +// isBoolean +type UpdateShareExportPolicyBodyRulegetReadOnlyAttributeType = *bool +type UpdateShareExportPolicyBodyRulegetReadOnlyArgType = bool +type UpdateShareExportPolicyBodyRulegetReadOnlyRetType = bool + +func getUpdateShareExportPolicyBodyRulegetReadOnlyAttributeTypeOk(arg UpdateShareExportPolicyBodyRulegetReadOnlyAttributeType) (ret UpdateShareExportPolicyBodyRulegetReadOnlyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareExportPolicyBodyRulegetReadOnlyAttributeType(arg *UpdateShareExportPolicyBodyRulegetReadOnlyAttributeType, val UpdateShareExportPolicyBodyRulegetReadOnlyRetType) { + *arg = &val +} + +/* + types and functions for setUuid +*/ + +// isBoolean +type UpdateShareExportPolicyBodyRulegetSetUuidAttributeType = *bool +type UpdateShareExportPolicyBodyRulegetSetUuidArgType = bool +type UpdateShareExportPolicyBodyRulegetSetUuidRetType = bool + +func getUpdateShareExportPolicyBodyRulegetSetUuidAttributeTypeOk(arg UpdateShareExportPolicyBodyRulegetSetUuidAttributeType) (ret UpdateShareExportPolicyBodyRulegetSetUuidRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareExportPolicyBodyRulegetSetUuidAttributeType(arg *UpdateShareExportPolicyBodyRulegetSetUuidAttributeType, val UpdateShareExportPolicyBodyRulegetSetUuidRetType) { + *arg = &val +} + +/* + types and functions for superUser +*/ + +// isBoolean +type UpdateShareExportPolicyBodyRulegetSuperUserAttributeType = *bool +type UpdateShareExportPolicyBodyRulegetSuperUserArgType = bool +type UpdateShareExportPolicyBodyRulegetSuperUserRetType = bool + +func getUpdateShareExportPolicyBodyRulegetSuperUserAttributeTypeOk(arg UpdateShareExportPolicyBodyRulegetSuperUserAttributeType) (ret UpdateShareExportPolicyBodyRulegetSuperUserRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareExportPolicyBodyRulegetSuperUserAttributeType(arg *UpdateShareExportPolicyBodyRulegetSuperUserAttributeType, val UpdateShareExportPolicyBodyRulegetSuperUserRetType) { + *arg = &val +} + +// UpdateShareExportPolicyBodyRule struct for UpdateShareExportPolicyBodyRule +type UpdateShareExportPolicyBodyRule struct { + // Description of the Rule (optional) + Description UpdateShareExportPolicyBodyRuleGetDescriptionAttributeType `json:"description,omitempty"` + // IP access control list, where IPs must have a subnet mask (e.g. \"172.16.0.0/24\" for a range of IPs, or \"172.16.0.250/32\" for a specific IP) This array cannot be empty + IpAcl UpdateShareExportPolicyBodyRuleGetIpAclAttributeType `json:"ipAcl,omitempty"` + // Order of the rule within a Share Export Policy. The order is used so that when a client IP matches multiple rules, the first rule is applied This field must be set + // Can be cast to int32 without loss of precision. + Order UpdateShareExportPolicyBodyRuleGetOrderAttributeType `json:"order,omitempty"` + // Flag to indicate if client IPs matching this rule can only mount the share in read only mode Default: false + ReadOnly UpdateShareExportPolicyBodyRulegetReadOnlyAttributeType `json:"readOnly,omitempty"` + // Flag to honor set UUID Default: false + SetUuid UpdateShareExportPolicyBodyRulegetSetUuidAttributeType `json:"setUuid,omitempty"` + // Flag to indicate if client IPs matching this rule have root access on the Share Default: true + SuperUser UpdateShareExportPolicyBodyRulegetSuperUserAttributeType `json:"superUser,omitempty"` +} + +// NewUpdateShareExportPolicyBodyRule instantiates a new UpdateShareExportPolicyBodyRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateShareExportPolicyBodyRule() *UpdateShareExportPolicyBodyRule { + this := UpdateShareExportPolicyBodyRule{} + return &this +} + +// NewUpdateShareExportPolicyBodyRuleWithDefaults instantiates a new UpdateShareExportPolicyBodyRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateShareExportPolicyBodyRuleWithDefaults() *UpdateShareExportPolicyBodyRule { + this := UpdateShareExportPolicyBodyRule{} + var readOnly bool = false + this.ReadOnly = &readOnly + var setUuid bool = false + this.SetUuid = &setUuid + var superUser bool = true + this.SuperUser = &superUser + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateShareExportPolicyBodyRule) GetDescription() (res UpdateShareExportPolicyBodyRuleGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateShareExportPolicyBodyRule) GetDescriptionOk() (ret UpdateShareExportPolicyBodyRuleGetDescriptionRetType, ok bool) { + return getUpdateShareExportPolicyBodyRuleGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyBodyRule) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateShareExportPolicyBodyRule) SetDescription(v UpdateShareExportPolicyBodyRuleGetDescriptionRetType) { + setUpdateShareExportPolicyBodyRuleGetDescriptionAttributeType(&o.Description, v) +} + +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *UpdateShareExportPolicyBodyRule) SetDescriptionNil() { + o.Description = nil +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *UpdateShareExportPolicyBodyRule) UnsetDescription() { + o.Description = nil +} + +// GetIpAcl returns the IpAcl field value if set, zero value otherwise. +func (o *UpdateShareExportPolicyBodyRule) GetIpAcl() (res UpdateShareExportPolicyBodyRuleGetIpAclRetType) { + res, _ = o.GetIpAclOk() + return +} + +// GetIpAclOk returns a tuple with the IpAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareExportPolicyBodyRule) GetIpAclOk() (ret UpdateShareExportPolicyBodyRuleGetIpAclRetType, ok bool) { + return getUpdateShareExportPolicyBodyRuleGetIpAclAttributeTypeOk(o.IpAcl) +} + +// HasIpAcl returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyBodyRule) HasIpAcl() bool { + _, ok := o.GetIpAclOk() + return ok +} + +// SetIpAcl gets a reference to the given []string and assigns it to the IpAcl field. +func (o *UpdateShareExportPolicyBodyRule) SetIpAcl(v UpdateShareExportPolicyBodyRuleGetIpAclRetType) { + setUpdateShareExportPolicyBodyRuleGetIpAclAttributeType(&o.IpAcl, v) +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *UpdateShareExportPolicyBodyRule) GetOrder() (res UpdateShareExportPolicyBodyRuleGetOrderRetType) { + res, _ = o.GetOrderOk() + return +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareExportPolicyBodyRule) GetOrderOk() (ret UpdateShareExportPolicyBodyRuleGetOrderRetType, ok bool) { + return getUpdateShareExportPolicyBodyRuleGetOrderAttributeTypeOk(o.Order) +} + +// HasOrder returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyBodyRule) HasOrder() bool { + _, ok := o.GetOrderOk() + return ok +} + +// SetOrder gets a reference to the given int64 and assigns it to the Order field. +func (o *UpdateShareExportPolicyBodyRule) SetOrder(v UpdateShareExportPolicyBodyRuleGetOrderRetType) { + setUpdateShareExportPolicyBodyRuleGetOrderAttributeType(&o.Order, v) +} + +// GetReadOnly returns the ReadOnly field value if set, zero value otherwise. +func (o *UpdateShareExportPolicyBodyRule) GetReadOnly() (res UpdateShareExportPolicyBodyRulegetReadOnlyRetType) { + res, _ = o.GetReadOnlyOk() + return +} + +// GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareExportPolicyBodyRule) GetReadOnlyOk() (ret UpdateShareExportPolicyBodyRulegetReadOnlyRetType, ok bool) { + return getUpdateShareExportPolicyBodyRulegetReadOnlyAttributeTypeOk(o.ReadOnly) +} + +// HasReadOnly returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyBodyRule) HasReadOnly() bool { + _, ok := o.GetReadOnlyOk() + return ok +} + +// SetReadOnly gets a reference to the given bool and assigns it to the ReadOnly field. +func (o *UpdateShareExportPolicyBodyRule) SetReadOnly(v UpdateShareExportPolicyBodyRulegetReadOnlyRetType) { + setUpdateShareExportPolicyBodyRulegetReadOnlyAttributeType(&o.ReadOnly, v) +} + +// GetSetUuid returns the SetUuid field value if set, zero value otherwise. +func (o *UpdateShareExportPolicyBodyRule) GetSetUuid() (res UpdateShareExportPolicyBodyRulegetSetUuidRetType) { + res, _ = o.GetSetUuidOk() + return +} + +// GetSetUuidOk returns a tuple with the SetUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareExportPolicyBodyRule) GetSetUuidOk() (ret UpdateShareExportPolicyBodyRulegetSetUuidRetType, ok bool) { + return getUpdateShareExportPolicyBodyRulegetSetUuidAttributeTypeOk(o.SetUuid) +} + +// HasSetUuid returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyBodyRule) HasSetUuid() bool { + _, ok := o.GetSetUuidOk() + return ok +} + +// SetSetUuid gets a reference to the given bool and assigns it to the SetUuid field. +func (o *UpdateShareExportPolicyBodyRule) SetSetUuid(v UpdateShareExportPolicyBodyRulegetSetUuidRetType) { + setUpdateShareExportPolicyBodyRulegetSetUuidAttributeType(&o.SetUuid, v) +} + +// GetSuperUser returns the SuperUser field value if set, zero value otherwise. +func (o *UpdateShareExportPolicyBodyRule) GetSuperUser() (res UpdateShareExportPolicyBodyRulegetSuperUserRetType) { + res, _ = o.GetSuperUserOk() + return +} + +// GetSuperUserOk returns a tuple with the SuperUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareExportPolicyBodyRule) GetSuperUserOk() (ret UpdateShareExportPolicyBodyRulegetSuperUserRetType, ok bool) { + return getUpdateShareExportPolicyBodyRulegetSuperUserAttributeTypeOk(o.SuperUser) +} + +// HasSuperUser returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyBodyRule) HasSuperUser() bool { + _, ok := o.GetSuperUserOk() + return ok +} + +// SetSuperUser gets a reference to the given bool and assigns it to the SuperUser field. +func (o *UpdateShareExportPolicyBodyRule) SetSuperUser(v UpdateShareExportPolicyBodyRulegetSuperUserRetType) { + setUpdateShareExportPolicyBodyRulegetSuperUserAttributeType(&o.SuperUser, v) +} + +func (o UpdateShareExportPolicyBodyRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateShareExportPolicyBodyRuleGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getUpdateShareExportPolicyBodyRuleGetIpAclAttributeTypeOk(o.IpAcl); ok { + toSerialize["IpAcl"] = val + } + if val, ok := getUpdateShareExportPolicyBodyRuleGetOrderAttributeTypeOk(o.Order); ok { + toSerialize["Order"] = val + } + if val, ok := getUpdateShareExportPolicyBodyRulegetReadOnlyAttributeTypeOk(o.ReadOnly); ok { + toSerialize["ReadOnly"] = val + } + if val, ok := getUpdateShareExportPolicyBodyRulegetSetUuidAttributeTypeOk(o.SetUuid); ok { + toSerialize["SetUuid"] = val + } + if val, ok := getUpdateShareExportPolicyBodyRulegetSuperUserAttributeTypeOk(o.SuperUser); ok { + toSerialize["SuperUser"] = val + } + return toSerialize, nil +} + +type NullableUpdateShareExportPolicyBodyRule struct { + value *UpdateShareExportPolicyBodyRule + isSet bool +} + +func (v NullableUpdateShareExportPolicyBodyRule) Get() *UpdateShareExportPolicyBodyRule { + return v.value +} + +func (v *NullableUpdateShareExportPolicyBodyRule) Set(val *UpdateShareExportPolicyBodyRule) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateShareExportPolicyBodyRule) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateShareExportPolicyBodyRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateShareExportPolicyBodyRule(val *UpdateShareExportPolicyBodyRule) *NullableUpdateShareExportPolicyBodyRule { + return &NullableUpdateShareExportPolicyBodyRule{value: val, isSet: true} +} + +func (v NullableUpdateShareExportPolicyBodyRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateShareExportPolicyBodyRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_share_export_policy_body_rule_test.go b/services/sfs/model_update_share_export_policy_body_rule_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_share_export_policy_body_rule_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_share_export_policy_payload.go b/services/sfs/model_update_share_export_policy_payload.go new file mode 100644 index 000000000..aa93631bc --- /dev/null +++ b/services/sfs/model_update_share_export_policy_payload.go @@ -0,0 +1,177 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the UpdateShareExportPolicyPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateShareExportPolicyPayload{} + +/* + types and functions for labels +*/ + +// isContainer +type UpdateShareExportPolicyPayloadGetLabelsAttributeType = *map[string]string +type UpdateShareExportPolicyPayloadGetLabelsArgType = map[string]string +type UpdateShareExportPolicyPayloadGetLabelsRetType = map[string]string + +func getUpdateShareExportPolicyPayloadGetLabelsAttributeTypeOk(arg UpdateShareExportPolicyPayloadGetLabelsAttributeType) (ret UpdateShareExportPolicyPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareExportPolicyPayloadGetLabelsAttributeType(arg *UpdateShareExportPolicyPayloadGetLabelsAttributeType, val UpdateShareExportPolicyPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for rules +*/ + +// isArray +type UpdateShareExportPolicyPayloadGetRulesAttributeType = *[]UpdateShareExportPolicyBodyRule +type UpdateShareExportPolicyPayloadGetRulesArgType = *[]UpdateShareExportPolicyBodyRule +type UpdateShareExportPolicyPayloadGetRulesRetType = *[]UpdateShareExportPolicyBodyRule + +func getUpdateShareExportPolicyPayloadGetRulesAttributeTypeOk(arg UpdateShareExportPolicyPayloadGetRulesAttributeType) (ret UpdateShareExportPolicyPayloadGetRulesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setUpdateShareExportPolicyPayloadGetRulesAttributeType(arg *UpdateShareExportPolicyPayloadGetRulesAttributeType, val UpdateShareExportPolicyPayloadGetRulesRetType) { + *arg = val +} + +// UpdateShareExportPolicyPayload struct for UpdateShareExportPolicyPayload +type UpdateShareExportPolicyPayload struct { + // An optional object that represents the labels associated with the share export policy keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels UpdateShareExportPolicyPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // List of rules of the Share Export Policy. The order of the rules within the array does not matter - what matters is the field \"order\" within each rule. The whole set of rules needs to be sent in the same request, e.g. if 1 rule is sent, the share export policy will have just that 1 rule, as opposed to extending the existing set of rules with the 1 rule that was sent Important note: the array of rules passed always overwrites the rule array (i.e. sending an empty array removes all rules) + Rules UpdateShareExportPolicyPayloadGetRulesAttributeType `json:"rules,omitempty"` +} + +// NewUpdateShareExportPolicyPayload instantiates a new UpdateShareExportPolicyPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateShareExportPolicyPayload() *UpdateShareExportPolicyPayload { + this := UpdateShareExportPolicyPayload{} + return &this +} + +// NewUpdateShareExportPolicyPayloadWithDefaults instantiates a new UpdateShareExportPolicyPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateShareExportPolicyPayloadWithDefaults() *UpdateShareExportPolicyPayload { + this := UpdateShareExportPolicyPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateShareExportPolicyPayload) GetLabels() (res UpdateShareExportPolicyPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *UpdateShareExportPolicyPayload) GetLabelsOk() (ret UpdateShareExportPolicyPayloadGetLabelsRetType, ok bool) { + return getUpdateShareExportPolicyPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateShareExportPolicyPayload) SetLabels(v UpdateShareExportPolicyPayloadGetLabelsRetType) { + setUpdateShareExportPolicyPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetRules returns the Rules field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateShareExportPolicyPayload) GetRules() (res UpdateShareExportPolicyPayloadGetRulesRetType) { + res, _ = o.GetRulesOk() + return +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateShareExportPolicyPayload) GetRulesOk() (ret UpdateShareExportPolicyPayloadGetRulesRetType, ok bool) { + return getUpdateShareExportPolicyPayloadGetRulesAttributeTypeOk(o.Rules) +} + +// HasRules returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyPayload) HasRules() bool { + _, ok := o.GetRulesOk() + return ok +} + +// SetRules gets a reference to the given []UpdateShareExportPolicyBodyRule and assigns it to the Rules field. +func (o *UpdateShareExportPolicyPayload) SetRules(v UpdateShareExportPolicyPayloadGetRulesRetType) { + setUpdateShareExportPolicyPayloadGetRulesAttributeType(&o.Rules, v) +} + +func (o UpdateShareExportPolicyPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateShareExportPolicyPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateShareExportPolicyPayloadGetRulesAttributeTypeOk(o.Rules); ok { + toSerialize["Rules"] = val + } + return toSerialize, nil +} + +type NullableUpdateShareExportPolicyPayload struct { + value *UpdateShareExportPolicyPayload + isSet bool +} + +func (v NullableUpdateShareExportPolicyPayload) Get() *UpdateShareExportPolicyPayload { + return v.value +} + +func (v *NullableUpdateShareExportPolicyPayload) Set(val *UpdateShareExportPolicyPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateShareExportPolicyPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateShareExportPolicyPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateShareExportPolicyPayload(val *UpdateShareExportPolicyPayload) *NullableUpdateShareExportPolicyPayload { + return &NullableUpdateShareExportPolicyPayload{value: val, isSet: true} +} + +func (v NullableUpdateShareExportPolicyPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateShareExportPolicyPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_share_export_policy_payload_test.go b/services/sfs/model_update_share_export_policy_payload_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_share_export_policy_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_share_export_policy_response.go b/services/sfs/model_update_share_export_policy_response.go new file mode 100644 index 000000000..333e42cfe --- /dev/null +++ b/services/sfs/model_update_share_export_policy_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the UpdateShareExportPolicyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateShareExportPolicyResponse{} + +/* + types and functions for shareExportPolicy +*/ + +// isModel +type UpdateShareExportPolicyResponseGetShareExportPolicyAttributeType = *ShareExportPolicy +type UpdateShareExportPolicyResponseGetShareExportPolicyArgType = ShareExportPolicy +type UpdateShareExportPolicyResponseGetShareExportPolicyRetType = ShareExportPolicy + +func getUpdateShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(arg UpdateShareExportPolicyResponseGetShareExportPolicyAttributeType) (ret UpdateShareExportPolicyResponseGetShareExportPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareExportPolicyResponseGetShareExportPolicyAttributeType(arg *UpdateShareExportPolicyResponseGetShareExportPolicyAttributeType, val UpdateShareExportPolicyResponseGetShareExportPolicyRetType) { + *arg = &val +} + +// UpdateShareExportPolicyResponse struct for UpdateShareExportPolicyResponse +type UpdateShareExportPolicyResponse struct { + ShareExportPolicy UpdateShareExportPolicyResponseGetShareExportPolicyAttributeType `json:"shareExportPolicy,omitempty"` +} + +// NewUpdateShareExportPolicyResponse instantiates a new UpdateShareExportPolicyResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateShareExportPolicyResponse() *UpdateShareExportPolicyResponse { + this := UpdateShareExportPolicyResponse{} + return &this +} + +// NewUpdateShareExportPolicyResponseWithDefaults instantiates a new UpdateShareExportPolicyResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateShareExportPolicyResponseWithDefaults() *UpdateShareExportPolicyResponse { + this := UpdateShareExportPolicyResponse{} + return &this +} + +// GetShareExportPolicy returns the ShareExportPolicy field value if set, zero value otherwise. +func (o *UpdateShareExportPolicyResponse) GetShareExportPolicy() (res UpdateShareExportPolicyResponseGetShareExportPolicyRetType) { + res, _ = o.GetShareExportPolicyOk() + return +} + +// GetShareExportPolicyOk returns a tuple with the ShareExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareExportPolicyResponse) GetShareExportPolicyOk() (ret UpdateShareExportPolicyResponseGetShareExportPolicyRetType, ok bool) { + return getUpdateShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(o.ShareExportPolicy) +} + +// HasShareExportPolicy returns a boolean if a field has been set. +func (o *UpdateShareExportPolicyResponse) HasShareExportPolicy() bool { + _, ok := o.GetShareExportPolicyOk() + return ok +} + +// SetShareExportPolicy gets a reference to the given ShareExportPolicy and assigns it to the ShareExportPolicy field. +func (o *UpdateShareExportPolicyResponse) SetShareExportPolicy(v UpdateShareExportPolicyResponseGetShareExportPolicyRetType) { + setUpdateShareExportPolicyResponseGetShareExportPolicyAttributeType(&o.ShareExportPolicy, v) +} + +func (o UpdateShareExportPolicyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateShareExportPolicyResponseGetShareExportPolicyAttributeTypeOk(o.ShareExportPolicy); ok { + toSerialize["ShareExportPolicy"] = val + } + return toSerialize, nil +} + +type NullableUpdateShareExportPolicyResponse struct { + value *UpdateShareExportPolicyResponse + isSet bool +} + +func (v NullableUpdateShareExportPolicyResponse) Get() *UpdateShareExportPolicyResponse { + return v.value +} + +func (v *NullableUpdateShareExportPolicyResponse) Set(val *UpdateShareExportPolicyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateShareExportPolicyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateShareExportPolicyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateShareExportPolicyResponse(val *UpdateShareExportPolicyResponse) *NullableUpdateShareExportPolicyResponse { + return &NullableUpdateShareExportPolicyResponse{value: val, isSet: true} +} + +func (v NullableUpdateShareExportPolicyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateShareExportPolicyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_share_export_policy_response_test.go b/services/sfs/model_update_share_export_policy_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_share_export_policy_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_share_payload.go b/services/sfs/model_update_share_payload.go new file mode 100644 index 000000000..0565bc891 --- /dev/null +++ b/services/sfs/model_update_share_payload.go @@ -0,0 +1,252 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the UpdateSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateSharePayload{} + +/* + types and functions for exportPolicyName +*/ + +// isNullableString +type UpdateSharePayloadGetExportPolicyNameAttributeType = *NullableString + +func getUpdateSharePayloadGetExportPolicyNameAttributeTypeOk(arg UpdateSharePayloadGetExportPolicyNameAttributeType) (ret UpdateSharePayloadGetExportPolicyNameRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setUpdateSharePayloadGetExportPolicyNameAttributeType(arg *UpdateSharePayloadGetExportPolicyNameAttributeType, val UpdateSharePayloadGetExportPolicyNameRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type UpdateSharePayloadGetExportPolicyNameArgType = *string +type UpdateSharePayloadGetExportPolicyNameRetType = *string + +/* + types and functions for labels +*/ + +// isContainer +type UpdateSharePayloadGetLabelsAttributeType = *map[string]string +type UpdateSharePayloadGetLabelsArgType = map[string]string +type UpdateSharePayloadGetLabelsRetType = map[string]string + +func getUpdateSharePayloadGetLabelsAttributeTypeOk(arg UpdateSharePayloadGetLabelsAttributeType) (ret UpdateSharePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateSharePayloadGetLabelsAttributeType(arg *UpdateSharePayloadGetLabelsAttributeType, val UpdateSharePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for spaceHardLimitGigabytes +*/ + +// isInteger +type UpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType = *int64 +type UpdateSharePayloadGetSpaceHardLimitGigabytesArgType = *int64 +type UpdateSharePayloadGetSpaceHardLimitGigabytesRetType = *int64 + +func getUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(arg UpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType) (ret UpdateSharePayloadGetSpaceHardLimitGigabytesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType(arg *UpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType, val UpdateSharePayloadGetSpaceHardLimitGigabytesRetType) { + *arg = val +} + +// UpdateSharePayload struct for UpdateSharePayload +type UpdateSharePayload struct { + // Name of the Share Export Policy to use in the Share. The behavior depends on the value: - If not set (null): Keep the existing export policy (if any) - If set to empty string (\"\"): Remove the existing export policy - If set to a policy name: Update to use the specified policy, creating a new association if none exists + ExportPolicyName UpdateSharePayloadGetExportPolicyNameAttributeType `json:"exportPolicyName,omitempty"` + // An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels UpdateSharePayloadGetLabelsAttributeType `json:"labels,omitempty"` + // Space hard limit for the Share. If zero, the Share will have access to the full space of the Resource Pool it lives in. (unit: gibibytes) + // Can be cast to int32 without loss of precision. + SpaceHardLimitGigabytes UpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType `json:"spaceHardLimitGigabytes,omitempty"` +} + +// NewUpdateSharePayload instantiates a new UpdateSharePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateSharePayload() *UpdateSharePayload { + this := UpdateSharePayload{} + return &this +} + +// NewUpdateSharePayloadWithDefaults instantiates a new UpdateSharePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateSharePayloadWithDefaults() *UpdateSharePayload { + this := UpdateSharePayload{} + return &this +} + +// GetExportPolicyName returns the ExportPolicyName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateSharePayload) GetExportPolicyName() (res UpdateSharePayloadGetExportPolicyNameRetType) { + res, _ = o.GetExportPolicyNameOk() + return +} + +// GetExportPolicyNameOk returns a tuple with the ExportPolicyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateSharePayload) GetExportPolicyNameOk() (ret UpdateSharePayloadGetExportPolicyNameRetType, ok bool) { + return getUpdateSharePayloadGetExportPolicyNameAttributeTypeOk(o.ExportPolicyName) +} + +// HasExportPolicyName returns a boolean if a field has been set. +func (o *UpdateSharePayload) HasExportPolicyName() bool { + _, ok := o.GetExportPolicyNameOk() + return ok +} + +// SetExportPolicyName gets a reference to the given string and assigns it to the ExportPolicyName field. +func (o *UpdateSharePayload) SetExportPolicyName(v UpdateSharePayloadGetExportPolicyNameRetType) { + setUpdateSharePayloadGetExportPolicyNameAttributeType(&o.ExportPolicyName, v) +} + +// SetExportPolicyNameNil sets the value for ExportPolicyName to be an explicit nil +func (o *UpdateSharePayload) SetExportPolicyNameNil() { + o.ExportPolicyName = nil +} + +// UnsetExportPolicyName ensures that no value is present for ExportPolicyName, not even an explicit nil +func (o *UpdateSharePayload) UnsetExportPolicyName() { + o.ExportPolicyName = nil +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateSharePayload) GetLabels() (res UpdateSharePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *UpdateSharePayload) GetLabelsOk() (ret UpdateSharePayloadGetLabelsRetType, ok bool) { + return getUpdateSharePayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateSharePayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateSharePayload) SetLabels(v UpdateSharePayloadGetLabelsRetType) { + setUpdateSharePayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetSpaceHardLimitGigabytes returns the SpaceHardLimitGigabytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateSharePayload) GetSpaceHardLimitGigabytes() (res UpdateSharePayloadGetSpaceHardLimitGigabytesRetType) { + res, _ = o.GetSpaceHardLimitGigabytesOk() + return +} + +// GetSpaceHardLimitGigabytesOk returns a tuple with the SpaceHardLimitGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateSharePayload) GetSpaceHardLimitGigabytesOk() (ret UpdateSharePayloadGetSpaceHardLimitGigabytesRetType, ok bool) { + return getUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes) +} + +// HasSpaceHardLimitGigabytes returns a boolean if a field has been set. +func (o *UpdateSharePayload) HasSpaceHardLimitGigabytes() bool { + _, ok := o.GetSpaceHardLimitGigabytesOk() + return ok +} + +// SetSpaceHardLimitGigabytes gets a reference to the given int64 and assigns it to the SpaceHardLimitGigabytes field. +func (o *UpdateSharePayload) SetSpaceHardLimitGigabytes(v UpdateSharePayloadGetSpaceHardLimitGigabytesRetType) { + setUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType(&o.SpaceHardLimitGigabytes, v) +} + +// SetSpaceHardLimitGigabytesNil sets the value for SpaceHardLimitGigabytes to be an explicit nil +func (o *UpdateSharePayload) SetSpaceHardLimitGigabytesNil() { + o.SpaceHardLimitGigabytes = nil +} + +// UnsetSpaceHardLimitGigabytes ensures that no value is present for SpaceHardLimitGigabytes, not even an explicit nil +func (o *UpdateSharePayload) UnsetSpaceHardLimitGigabytes() { + o.SpaceHardLimitGigabytes = nil +} + +func (o UpdateSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateSharePayloadGetExportPolicyNameAttributeTypeOk(o.ExportPolicyName); ok { + toSerialize["ExportPolicyName"] = val + } + if val, ok := getUpdateSharePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes); ok { + toSerialize["SpaceHardLimitGigabytes"] = val + } + return toSerialize, nil +} + +type NullableUpdateSharePayload struct { + value *UpdateSharePayload + isSet bool +} + +func (v NullableUpdateSharePayload) Get() *UpdateSharePayload { + return v.value +} + +func (v *NullableUpdateSharePayload) Set(val *UpdateSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSharePayload(val *UpdateSharePayload) *NullableUpdateSharePayload { + return &NullableUpdateSharePayload{value: val, isSet: true} +} + +func (v NullableUpdateSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_share_payload_test.go b/services/sfs/model_update_share_payload_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_share_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_share_response.go b/services/sfs/model_update_share_response.go new file mode 100644 index 000000000..46aa1a530 --- /dev/null +++ b/services/sfs/model_update_share_response.go @@ -0,0 +1,127 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the UpdateShareResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateShareResponse{} + +/* + types and functions for share +*/ + +// isModel +type UpdateShareResponseGetShareAttributeType = *UpdateShareResponseShare +type UpdateShareResponseGetShareArgType = UpdateShareResponseShare +type UpdateShareResponseGetShareRetType = UpdateShareResponseShare + +func getUpdateShareResponseGetShareAttributeTypeOk(arg UpdateShareResponseGetShareAttributeType) (ret UpdateShareResponseGetShareRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareResponseGetShareAttributeType(arg *UpdateShareResponseGetShareAttributeType, val UpdateShareResponseGetShareRetType) { + *arg = &val +} + +// UpdateShareResponse struct for UpdateShareResponse +type UpdateShareResponse struct { + Share UpdateShareResponseGetShareAttributeType `json:"share,omitempty"` +} + +// NewUpdateShareResponse instantiates a new UpdateShareResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateShareResponse() *UpdateShareResponse { + this := UpdateShareResponse{} + return &this +} + +// NewUpdateShareResponseWithDefaults instantiates a new UpdateShareResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateShareResponseWithDefaults() *UpdateShareResponse { + this := UpdateShareResponse{} + return &this +} + +// GetShare returns the Share field value if set, zero value otherwise. +func (o *UpdateShareResponse) GetShare() (res UpdateShareResponseGetShareRetType) { + res, _ = o.GetShareOk() + return +} + +// GetShareOk returns a tuple with the Share field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareResponse) GetShareOk() (ret UpdateShareResponseGetShareRetType, ok bool) { + return getUpdateShareResponseGetShareAttributeTypeOk(o.Share) +} + +// HasShare returns a boolean if a field has been set. +func (o *UpdateShareResponse) HasShare() bool { + _, ok := o.GetShareOk() + return ok +} + +// SetShare gets a reference to the given UpdateShareResponseShare and assigns it to the Share field. +func (o *UpdateShareResponse) SetShare(v UpdateShareResponseGetShareRetType) { + setUpdateShareResponseGetShareAttributeType(&o.Share, v) +} + +func (o UpdateShareResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateShareResponseGetShareAttributeTypeOk(o.Share); ok { + toSerialize["Share"] = val + } + return toSerialize, nil +} + +type NullableUpdateShareResponse struct { + value *UpdateShareResponse + isSet bool +} + +func (v NullableUpdateShareResponse) Get() *UpdateShareResponse { + return v.value +} + +func (v *NullableUpdateShareResponse) Set(val *UpdateShareResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateShareResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateShareResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateShareResponse(val *UpdateShareResponse) *NullableUpdateShareResponse { + return &NullableUpdateShareResponse{value: val, isSet: true} +} + +func (v NullableUpdateShareResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateShareResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_share_response_share.go b/services/sfs/model_update_share_response_share.go new file mode 100644 index 000000000..34763c1f7 --- /dev/null +++ b/services/sfs/model_update_share_response_share.go @@ -0,0 +1,479 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "time" +) + +// checks if the UpdateShareResponseShare type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateShareResponseShare{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type UpdateShareResponseShareGetCreatedAtAttributeType = *time.Time +type UpdateShareResponseShareGetCreatedAtArgType = time.Time +type UpdateShareResponseShareGetCreatedAtRetType = time.Time + +func getUpdateShareResponseShareGetCreatedAtAttributeTypeOk(arg UpdateShareResponseShareGetCreatedAtAttributeType) (ret UpdateShareResponseShareGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareResponseShareGetCreatedAtAttributeType(arg *UpdateShareResponseShareGetCreatedAtAttributeType, val UpdateShareResponseShareGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for exportPolicy +*/ + +// isModel +type UpdateShareResponseShareGetExportPolicyAttributeType = *NullableShareExportPolicy +type UpdateShareResponseShareGetExportPolicyArgType = *NullableShareExportPolicy +type UpdateShareResponseShareGetExportPolicyRetType = *NullableShareExportPolicy + +func getUpdateShareResponseShareGetExportPolicyAttributeTypeOk(arg UpdateShareResponseShareGetExportPolicyAttributeType) (ret UpdateShareResponseShareGetExportPolicyRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setUpdateShareResponseShareGetExportPolicyAttributeType(arg *UpdateShareResponseShareGetExportPolicyAttributeType, val UpdateShareResponseShareGetExportPolicyRetType) { + *arg = val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type UpdateShareResponseShareGetIdAttributeType = *string + +func getUpdateShareResponseShareGetIdAttributeTypeOk(arg UpdateShareResponseShareGetIdAttributeType) (ret UpdateShareResponseShareGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareResponseShareGetIdAttributeType(arg *UpdateShareResponseShareGetIdAttributeType, val UpdateShareResponseShareGetIdRetType) { + *arg = &val +} + +type UpdateShareResponseShareGetIdArgType = string +type UpdateShareResponseShareGetIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type UpdateShareResponseShareGetLabelsAttributeType = *map[string]string +type UpdateShareResponseShareGetLabelsArgType = map[string]string +type UpdateShareResponseShareGetLabelsRetType = map[string]string + +func getUpdateShareResponseShareGetLabelsAttributeTypeOk(arg UpdateShareResponseShareGetLabelsAttributeType) (ret UpdateShareResponseShareGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareResponseShareGetLabelsAttributeType(arg *UpdateShareResponseShareGetLabelsAttributeType, val UpdateShareResponseShareGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mountPath +*/ + +// isNotNullableString +type UpdateShareResponseShareGetMountPathAttributeType = *string + +func getUpdateShareResponseShareGetMountPathAttributeTypeOk(arg UpdateShareResponseShareGetMountPathAttributeType) (ret UpdateShareResponseShareGetMountPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareResponseShareGetMountPathAttributeType(arg *UpdateShareResponseShareGetMountPathAttributeType, val UpdateShareResponseShareGetMountPathRetType) { + *arg = &val +} + +type UpdateShareResponseShareGetMountPathArgType = string +type UpdateShareResponseShareGetMountPathRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateShareResponseShareGetNameAttributeType = *string + +func getUpdateShareResponseShareGetNameAttributeTypeOk(arg UpdateShareResponseShareGetNameAttributeType) (ret UpdateShareResponseShareGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareResponseShareGetNameAttributeType(arg *UpdateShareResponseShareGetNameAttributeType, val UpdateShareResponseShareGetNameRetType) { + *arg = &val +} + +type UpdateShareResponseShareGetNameArgType = string +type UpdateShareResponseShareGetNameRetType = string + +/* + types and functions for spaceHardLimitGigabytes +*/ + +// isInteger +type UpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeType = *int64 +type UpdateShareResponseShareGetSpaceHardLimitGigabytesArgType = int64 +type UpdateShareResponseShareGetSpaceHardLimitGigabytesRetType = int64 + +func getUpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(arg UpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeType) (ret UpdateShareResponseShareGetSpaceHardLimitGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeType(arg *UpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeType, val UpdateShareResponseShareGetSpaceHardLimitGigabytesRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type UpdateShareResponseShareGetStateAttributeType = *string + +func getUpdateShareResponseShareGetStateAttributeTypeOk(arg UpdateShareResponseShareGetStateAttributeType) (ret UpdateShareResponseShareGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateShareResponseShareGetStateAttributeType(arg *UpdateShareResponseShareGetStateAttributeType, val UpdateShareResponseShareGetStateRetType) { + *arg = &val +} + +type UpdateShareResponseShareGetStateArgType = string +type UpdateShareResponseShareGetStateRetType = string + +// UpdateShareResponseShare Updated Share +type UpdateShareResponseShare struct { + CreatedAt UpdateShareResponseShareGetCreatedAtAttributeType `json:"createdAt,omitempty"` + ExportPolicy UpdateShareResponseShareGetExportPolicyAttributeType `json:"exportPolicy,omitempty"` + // ID of the Share + Id UpdateShareResponseShareGetIdAttributeType `json:"id,omitempty"` + // An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$' + Labels UpdateShareResponseShareGetLabelsAttributeType `json:"labels,omitempty"` + // Mount path of the Share, used to mount the Share + MountPath UpdateShareResponseShareGetMountPathAttributeType `json:"mountPath,omitempty"` + // Name of the Share + Name UpdateShareResponseShareGetNameAttributeType `json:"name,omitempty"` + // Space hard limit for the Share. If zero, the Share will have access to the full space of the Resource Pool it lives in. (unit: gibibytes) + // Can be cast to int32 without loss of precision. + SpaceHardLimitGigabytes UpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeType `json:"spaceHardLimitGigabytes,omitempty"` + // State of the Resource Pool Snapshot (possible values: [\"pending\", \"creating\", \"created\", \"error\", \"deleting\"]) + State UpdateShareResponseShareGetStateAttributeType `json:"state,omitempty"` +} + +// NewUpdateShareResponseShare instantiates a new UpdateShareResponseShare object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateShareResponseShare() *UpdateShareResponseShare { + this := UpdateShareResponseShare{} + return &this +} + +// NewUpdateShareResponseShareWithDefaults instantiates a new UpdateShareResponseShare object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateShareResponseShareWithDefaults() *UpdateShareResponseShare { + this := UpdateShareResponseShare{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *UpdateShareResponseShare) GetCreatedAt() (res UpdateShareResponseShareGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareResponseShare) GetCreatedAtOk() (ret UpdateShareResponseShareGetCreatedAtRetType, ok bool) { + return getUpdateShareResponseShareGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *UpdateShareResponseShare) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *UpdateShareResponseShare) SetCreatedAt(v UpdateShareResponseShareGetCreatedAtRetType) { + setUpdateShareResponseShareGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetExportPolicy returns the ExportPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateShareResponseShare) GetExportPolicy() (res UpdateShareResponseShareGetExportPolicyRetType) { + res, _ = o.GetExportPolicyOk() + return +} + +// GetExportPolicyOk returns a tuple with the ExportPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateShareResponseShare) GetExportPolicyOk() (ret UpdateShareResponseShareGetExportPolicyRetType, ok bool) { + return getUpdateShareResponseShareGetExportPolicyAttributeTypeOk(o.ExportPolicy) +} + +// HasExportPolicy returns a boolean if a field has been set. +func (o *UpdateShareResponseShare) HasExportPolicy() bool { + _, ok := o.GetExportPolicyOk() + return ok +} + +// SetExportPolicy gets a reference to the given ShareExportPolicy and assigns it to the ExportPolicy field. +func (o *UpdateShareResponseShare) SetExportPolicy(v UpdateShareResponseShareGetExportPolicyRetType) { + setUpdateShareResponseShareGetExportPolicyAttributeType(&o.ExportPolicy, v) +} + +// SetExportPolicyNil sets the value for ExportPolicy to be an explicit nil +func (o *UpdateShareResponseShare) SetExportPolicyNil() { + o.ExportPolicy = nil +} + +// UnsetExportPolicy ensures that no value is present for ExportPolicy, not even an explicit nil +func (o *UpdateShareResponseShare) UnsetExportPolicy() { + o.ExportPolicy = nil +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdateShareResponseShare) GetId() (res UpdateShareResponseShareGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// 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 *UpdateShareResponseShare) GetIdOk() (ret UpdateShareResponseShareGetIdRetType, ok bool) { + return getUpdateShareResponseShareGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *UpdateShareResponseShare) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdateShareResponseShare) SetId(v UpdateShareResponseShareGetIdRetType) { + setUpdateShareResponseShareGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateShareResponseShare) GetLabels() (res UpdateShareResponseShareGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *UpdateShareResponseShare) GetLabelsOk() (ret UpdateShareResponseShareGetLabelsRetType, ok bool) { + return getUpdateShareResponseShareGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateShareResponseShare) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateShareResponseShare) SetLabels(v UpdateShareResponseShareGetLabelsRetType) { + setUpdateShareResponseShareGetLabelsAttributeType(&o.Labels, v) +} + +// GetMountPath returns the MountPath field value if set, zero value otherwise. +func (o *UpdateShareResponseShare) GetMountPath() (res UpdateShareResponseShareGetMountPathRetType) { + res, _ = o.GetMountPathOk() + return +} + +// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareResponseShare) GetMountPathOk() (ret UpdateShareResponseShareGetMountPathRetType, ok bool) { + return getUpdateShareResponseShareGetMountPathAttributeTypeOk(o.MountPath) +} + +// HasMountPath returns a boolean if a field has been set. +func (o *UpdateShareResponseShare) HasMountPath() bool { + _, ok := o.GetMountPathOk() + return ok +} + +// SetMountPath gets a reference to the given string and assigns it to the MountPath field. +func (o *UpdateShareResponseShare) SetMountPath(v UpdateShareResponseShareGetMountPathRetType) { + setUpdateShareResponseShareGetMountPathAttributeType(&o.MountPath, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateShareResponseShare) GetName() (res UpdateShareResponseShareGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// 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 *UpdateShareResponseShare) GetNameOk() (ret UpdateShareResponseShareGetNameRetType, ok bool) { + return getUpdateShareResponseShareGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateShareResponseShare) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateShareResponseShare) SetName(v UpdateShareResponseShareGetNameRetType) { + setUpdateShareResponseShareGetNameAttributeType(&o.Name, v) +} + +// GetSpaceHardLimitGigabytes returns the SpaceHardLimitGigabytes field value if set, zero value otherwise. +func (o *UpdateShareResponseShare) GetSpaceHardLimitGigabytes() (res UpdateShareResponseShareGetSpaceHardLimitGigabytesRetType) { + res, _ = o.GetSpaceHardLimitGigabytesOk() + return +} + +// GetSpaceHardLimitGigabytesOk returns a tuple with the SpaceHardLimitGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateShareResponseShare) GetSpaceHardLimitGigabytesOk() (ret UpdateShareResponseShareGetSpaceHardLimitGigabytesRetType, ok bool) { + return getUpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes) +} + +// HasSpaceHardLimitGigabytes returns a boolean if a field has been set. +func (o *UpdateShareResponseShare) HasSpaceHardLimitGigabytes() bool { + _, ok := o.GetSpaceHardLimitGigabytesOk() + return ok +} + +// SetSpaceHardLimitGigabytes gets a reference to the given int64 and assigns it to the SpaceHardLimitGigabytes field. +func (o *UpdateShareResponseShare) SetSpaceHardLimitGigabytes(v UpdateShareResponseShareGetSpaceHardLimitGigabytesRetType) { + setUpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeType(&o.SpaceHardLimitGigabytes, v) +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *UpdateShareResponseShare) GetState() (res UpdateShareResponseShareGetStateRetType) { + res, _ = o.GetStateOk() + return +} + +// 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 *UpdateShareResponseShare) GetStateOk() (ret UpdateShareResponseShareGetStateRetType, ok bool) { + return getUpdateShareResponseShareGetStateAttributeTypeOk(o.State) +} + +// HasState returns a boolean if a field has been set. +func (o *UpdateShareResponseShare) HasState() bool { + _, ok := o.GetStateOk() + return ok +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *UpdateShareResponseShare) SetState(v UpdateShareResponseShareGetStateRetType) { + setUpdateShareResponseShareGetStateAttributeType(&o.State, v) +} + +func (o UpdateShareResponseShare) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateShareResponseShareGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getUpdateShareResponseShareGetExportPolicyAttributeTypeOk(o.ExportPolicy); ok { + toSerialize["ExportPolicy"] = val + } + if val, ok := getUpdateShareResponseShareGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getUpdateShareResponseShareGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateShareResponseShareGetMountPathAttributeTypeOk(o.MountPath); ok { + toSerialize["MountPath"] = val + } + if val, ok := getUpdateShareResponseShareGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getUpdateShareResponseShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes); ok { + toSerialize["SpaceHardLimitGigabytes"] = val + } + if val, ok := getUpdateShareResponseShareGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +type NullableUpdateShareResponseShare struct { + value *UpdateShareResponseShare + isSet bool +} + +func (v NullableUpdateShareResponseShare) Get() *UpdateShareResponseShare { + return v.value +} + +func (v *NullableUpdateShareResponseShare) Set(val *UpdateShareResponseShare) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateShareResponseShare) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateShareResponseShare) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateShareResponseShare(val *UpdateShareResponseShare) *NullableUpdateShareResponseShare { + return &NullableUpdateShareResponseShare{value: val, isSet: true} +} + +func (v NullableUpdateShareResponseShare) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateShareResponseShare) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_update_share_response_share_test.go b/services/sfs/model_update_share_response_share_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_share_response_share_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_share_response_test.go b/services/sfs/model_update_share_response_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_update_share_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_validation_error.go b/services/sfs/model_validation_error.go new file mode 100644 index 000000000..57c414a14 --- /dev/null +++ b/services/sfs/model_validation_error.go @@ -0,0 +1,267 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationError{} + +/* + types and functions for error_description +*/ + +// isAny +type ValidationErrorGetErrorDescriptionAttributeType = any +type ValidationErrorGetErrorDescriptionArgType = any +type ValidationErrorGetErrorDescriptionRetType = any + +func getValidationErrorGetErrorDescriptionAttributeTypeOk(arg ValidationErrorGetErrorDescriptionAttributeType) (ret ValidationErrorGetErrorDescriptionRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setValidationErrorGetErrorDescriptionAttributeType(arg *ValidationErrorGetErrorDescriptionAttributeType, val ValidationErrorGetErrorDescriptionRetType) { + *arg = val +} + +/* + types and functions for title +*/ + +// isNotNullableString +type ValidationErrorGetTitleAttributeType = *string + +func getValidationErrorGetTitleAttributeTypeOk(arg ValidationErrorGetTitleAttributeType) (ret ValidationErrorGetTitleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setValidationErrorGetTitleAttributeType(arg *ValidationErrorGetTitleAttributeType, val ValidationErrorGetTitleRetType) { + *arg = &val +} + +type ValidationErrorGetTitleArgType = string +type ValidationErrorGetTitleRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type ValidationErrorGetTypeAttributeType = *string + +func getValidationErrorGetTypeAttributeTypeOk(arg ValidationErrorGetTypeAttributeType) (ret ValidationErrorGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setValidationErrorGetTypeAttributeType(arg *ValidationErrorGetTypeAttributeType, val ValidationErrorGetTypeRetType) { + *arg = &val +} + +type ValidationErrorGetTypeArgType = string +type ValidationErrorGetTypeRetType = string + +/* + types and functions for fields +*/ + +// isArray +type ValidationErrorGetFieldsAttributeType = *[]ValidationErrorField +type ValidationErrorGetFieldsArgType = []ValidationErrorField +type ValidationErrorGetFieldsRetType = []ValidationErrorField + +func getValidationErrorGetFieldsAttributeTypeOk(arg ValidationErrorGetFieldsAttributeType) (ret ValidationErrorGetFieldsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setValidationErrorGetFieldsAttributeType(arg *ValidationErrorGetFieldsAttributeType, val ValidationErrorGetFieldsRetType) { + *arg = &val +} + +// ValidationError struct for ValidationError +type ValidationError struct { + // Deprecated: Human-readable string of the error that occured + ErrorDescription ValidationErrorGetErrorDescriptionAttributeType `json:"error_description,omitempty"` + // Human-readable description of the error that occurred. + // REQUIRED + Title ValidationErrorGetTitleAttributeType `json:"title" required:"true"` + // URI Uniquely identifies the error type. It will be in the format of storage.stackit.cloud/ e.g. storage.stackit.cloud/validation-error + // REQUIRED + Type ValidationErrorGetTypeAttributeType `json:"type" required:"true"` + // REQUIRED + Fields ValidationErrorGetFieldsAttributeType `json:"fields" required:"true"` +} + +type _ValidationError ValidationError + +// NewValidationError instantiates a new ValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationError(title ValidationErrorGetTitleArgType, types ValidationErrorGetTypeArgType, fields ValidationErrorGetFieldsArgType) *ValidationError { + this := ValidationError{} + setValidationErrorGetTitleAttributeType(&this.Title, title) + setValidationErrorGetTypeAttributeType(&this.Type, types) + setValidationErrorGetFieldsAttributeType(&this.Fields, fields) + return &this +} + +// NewValidationErrorWithDefaults instantiates a new ValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorWithDefaults() *ValidationError { + this := ValidationError{} + return &this +} + +// GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated +func (o *ValidationError) GetErrorDescription() (res ValidationErrorGetErrorDescriptionRetType) { + res, _ = o.GetErrorDescriptionOk() + return +} + +// GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated +func (o *ValidationError) GetErrorDescriptionOk() (ret ValidationErrorGetErrorDescriptionRetType, ok bool) { + return getValidationErrorGetErrorDescriptionAttributeTypeOk(o.ErrorDescription) +} + +// HasErrorDescription returns a boolean if a field has been set. +func (o *ValidationError) HasErrorDescription() bool { + _, ok := o.GetErrorDescriptionOk() + return ok +} + +// SetErrorDescription gets a reference to the given interface{} and assigns it to the ErrorDescription field. +// Deprecated +func (o *ValidationError) SetErrorDescription(v ValidationErrorGetErrorDescriptionRetType) { + setValidationErrorGetErrorDescriptionAttributeType(&o.ErrorDescription, v) +} + +// GetTitle returns the Title field value +func (o *ValidationError) GetTitle() (ret ValidationErrorGetTitleRetType) { + ret, _ = o.GetTitleOk() + return ret +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetTitleOk() (ret ValidationErrorGetTitleRetType, ok bool) { + return getValidationErrorGetTitleAttributeTypeOk(o.Title) +} + +// SetTitle sets field value +func (o *ValidationError) SetTitle(v ValidationErrorGetTitleRetType) { + setValidationErrorGetTitleAttributeType(&o.Title, v) +} + +// GetType returns the Type field value +func (o *ValidationError) GetType() (ret ValidationErrorGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetTypeOk() (ret ValidationErrorGetTypeRetType, ok bool) { + return getValidationErrorGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *ValidationError) SetType(v ValidationErrorGetTypeRetType) { + setValidationErrorGetTypeAttributeType(&o.Type, v) +} + +// GetFields returns the Fields field value +func (o *ValidationError) GetFields() (ret ValidationErrorGetFieldsRetType) { + ret, _ = o.GetFieldsOk() + return ret +} + +// GetFieldsOk returns a tuple with the Fields field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetFieldsOk() (ret ValidationErrorGetFieldsRetType, ok bool) { + return getValidationErrorGetFieldsAttributeTypeOk(o.Fields) +} + +// SetFields sets field value +func (o *ValidationError) SetFields(v ValidationErrorGetFieldsRetType) { + setValidationErrorGetFieldsAttributeType(&o.Fields, v) +} + +func (o ValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getValidationErrorGetErrorDescriptionAttributeTypeOk(o.ErrorDescription); ok { + toSerialize["ErrorDescription"] = val + } + if val, ok := getValidationErrorGetTitleAttributeTypeOk(o.Title); ok { + toSerialize["Title"] = val + } + if val, ok := getValidationErrorGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + if val, ok := getValidationErrorGetFieldsAttributeTypeOk(o.Fields); ok { + toSerialize["Fields"] = val + } + return toSerialize, nil +} + +type NullableValidationError struct { + value *ValidationError + isSet bool +} + +func (v NullableValidationError) Get() *ValidationError { + return v.value +} + +func (v *NullableValidationError) Set(val *ValidationError) { + v.value = val + v.isSet = true +} + +func (v NullableValidationError) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationError(val *ValidationError) *NullableValidationError { + return &NullableValidationError{value: val, isSet: true} +} + +func (v NullableValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_validation_error_all_of.go b/services/sfs/model_validation_error_all_of.go new file mode 100644 index 000000000..f9556af6b --- /dev/null +++ b/services/sfs/model_validation_error_all_of.go @@ -0,0 +1,125 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ValidationErrorAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationErrorAllOf{} + +/* + types and functions for fields +*/ + +// isArray +type ValidationErrorAllOfGetFieldsAttributeType = *[]ValidationErrorField +type ValidationErrorAllOfGetFieldsArgType = []ValidationErrorField +type ValidationErrorAllOfGetFieldsRetType = []ValidationErrorField + +func getValidationErrorAllOfGetFieldsAttributeTypeOk(arg ValidationErrorAllOfGetFieldsAttributeType) (ret ValidationErrorAllOfGetFieldsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setValidationErrorAllOfGetFieldsAttributeType(arg *ValidationErrorAllOfGetFieldsAttributeType, val ValidationErrorAllOfGetFieldsRetType) { + *arg = &val +} + +// ValidationErrorAllOf struct for ValidationErrorAllOf +type ValidationErrorAllOf struct { + // REQUIRED + Fields ValidationErrorAllOfGetFieldsAttributeType `json:"fields" required:"true"` +} + +type _ValidationErrorAllOf ValidationErrorAllOf + +// NewValidationErrorAllOf instantiates a new ValidationErrorAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationErrorAllOf(fields ValidationErrorAllOfGetFieldsArgType) *ValidationErrorAllOf { + this := ValidationErrorAllOf{} + setValidationErrorAllOfGetFieldsAttributeType(&this.Fields, fields) + return &this +} + +// NewValidationErrorAllOfWithDefaults instantiates a new ValidationErrorAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorAllOfWithDefaults() *ValidationErrorAllOf { + this := ValidationErrorAllOf{} + return &this +} + +// GetFields returns the Fields field value +func (o *ValidationErrorAllOf) GetFields() (ret ValidationErrorAllOfGetFieldsRetType) { + ret, _ = o.GetFieldsOk() + return ret +} + +// GetFieldsOk returns a tuple with the Fields field value +// and a boolean to check if the value has been set. +func (o *ValidationErrorAllOf) GetFieldsOk() (ret ValidationErrorAllOfGetFieldsRetType, ok bool) { + return getValidationErrorAllOfGetFieldsAttributeTypeOk(o.Fields) +} + +// SetFields sets field value +func (o *ValidationErrorAllOf) SetFields(v ValidationErrorAllOfGetFieldsRetType) { + setValidationErrorAllOfGetFieldsAttributeType(&o.Fields, v) +} + +func (o ValidationErrorAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getValidationErrorAllOfGetFieldsAttributeTypeOk(o.Fields); ok { + toSerialize["Fields"] = val + } + return toSerialize, nil +} + +type NullableValidationErrorAllOf struct { + value *ValidationErrorAllOf + isSet bool +} + +func (v NullableValidationErrorAllOf) Get() *ValidationErrorAllOf { + return v.value +} + +func (v *NullableValidationErrorAllOf) Set(val *ValidationErrorAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableValidationErrorAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationErrorAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationErrorAllOf(val *ValidationErrorAllOf) *NullableValidationErrorAllOf { + return &NullableValidationErrorAllOf{value: val, isSet: true} +} + +func (v NullableValidationErrorAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationErrorAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_validation_error_all_of_test.go b/services/sfs/model_validation_error_all_of_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_validation_error_all_of_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_validation_error_field.go b/services/sfs/model_validation_error_field.go new file mode 100644 index 000000000..dc230c393 --- /dev/null +++ b/services/sfs/model_validation_error_field.go @@ -0,0 +1,172 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" +) + +// checks if the ValidationErrorField type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationErrorField{} + +/* + types and functions for field +*/ + +// isNotNullableString +type ValidationErrorFieldGetFieldAttributeType = *string + +func getValidationErrorFieldGetFieldAttributeTypeOk(arg ValidationErrorFieldGetFieldAttributeType) (ret ValidationErrorFieldGetFieldRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setValidationErrorFieldGetFieldAttributeType(arg *ValidationErrorFieldGetFieldAttributeType, val ValidationErrorFieldGetFieldRetType) { + *arg = &val +} + +type ValidationErrorFieldGetFieldArgType = string +type ValidationErrorFieldGetFieldRetType = string + +/* + types and functions for reason +*/ + +// isNotNullableString +type ValidationErrorFieldGetReasonAttributeType = *string + +func getValidationErrorFieldGetReasonAttributeTypeOk(arg ValidationErrorFieldGetReasonAttributeType) (ret ValidationErrorFieldGetReasonRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setValidationErrorFieldGetReasonAttributeType(arg *ValidationErrorFieldGetReasonAttributeType, val ValidationErrorFieldGetReasonRetType) { + *arg = &val +} + +type ValidationErrorFieldGetReasonArgType = string +type ValidationErrorFieldGetReasonRetType = string + +// ValidationErrorField struct for ValidationErrorField +type ValidationErrorField struct { + // The name of the field in the request that has failed the validation + // REQUIRED + Field ValidationErrorFieldGetFieldAttributeType `json:"field" required:"true"` + // The reason why the validation failed + // REQUIRED + Reason ValidationErrorFieldGetReasonAttributeType `json:"reason" required:"true"` +} + +type _ValidationErrorField ValidationErrorField + +// NewValidationErrorField instantiates a new ValidationErrorField object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationErrorField(field ValidationErrorFieldGetFieldArgType, reason ValidationErrorFieldGetReasonArgType) *ValidationErrorField { + this := ValidationErrorField{} + setValidationErrorFieldGetFieldAttributeType(&this.Field, field) + setValidationErrorFieldGetReasonAttributeType(&this.Reason, reason) + return &this +} + +// NewValidationErrorFieldWithDefaults instantiates a new ValidationErrorField object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorFieldWithDefaults() *ValidationErrorField { + this := ValidationErrorField{} + return &this +} + +// GetField returns the Field field value +func (o *ValidationErrorField) GetField() (ret ValidationErrorFieldGetFieldRetType) { + ret, _ = o.GetFieldOk() + return ret +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *ValidationErrorField) GetFieldOk() (ret ValidationErrorFieldGetFieldRetType, ok bool) { + return getValidationErrorFieldGetFieldAttributeTypeOk(o.Field) +} + +// SetField sets field value +func (o *ValidationErrorField) SetField(v ValidationErrorFieldGetFieldRetType) { + setValidationErrorFieldGetFieldAttributeType(&o.Field, v) +} + +// GetReason returns the Reason field value +func (o *ValidationErrorField) GetReason() (ret ValidationErrorFieldGetReasonRetType) { + ret, _ = o.GetReasonOk() + return ret +} + +// GetReasonOk returns a tuple with the Reason field value +// and a boolean to check if the value has been set. +func (o *ValidationErrorField) GetReasonOk() (ret ValidationErrorFieldGetReasonRetType, ok bool) { + return getValidationErrorFieldGetReasonAttributeTypeOk(o.Reason) +} + +// SetReason sets field value +func (o *ValidationErrorField) SetReason(v ValidationErrorFieldGetReasonRetType) { + setValidationErrorFieldGetReasonAttributeType(&o.Reason, v) +} + +func (o ValidationErrorField) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getValidationErrorFieldGetFieldAttributeTypeOk(o.Field); ok { + toSerialize["Field"] = val + } + if val, ok := getValidationErrorFieldGetReasonAttributeTypeOk(o.Reason); ok { + toSerialize["Reason"] = val + } + return toSerialize, nil +} + +type NullableValidationErrorField struct { + value *ValidationErrorField + isSet bool +} + +func (v NullableValidationErrorField) Get() *ValidationErrorField { + return v.value +} + +func (v *NullableValidationErrorField) Set(val *ValidationErrorField) { + v.value = val + v.isSet = true +} + +func (v NullableValidationErrorField) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationErrorField) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationErrorField(val *ValidationErrorField) *NullableValidationErrorField { + return &NullableValidationErrorField{value: val, isSet: true} +} + +func (v NullableValidationErrorField) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationErrorField) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_validation_error_field_test.go b/services/sfs/model_validation_error_field_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_validation_error_field_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_validation_error_test.go b/services/sfs/model_validation_error_test.go new file mode 100644 index 000000000..808482bcc --- /dev/null +++ b/services/sfs/model_validation_error_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/utils.go b/services/sfs/utils.go new file mode 100644 index 000000000..0765ee572 --- /dev/null +++ b/services/sfs/utils.go @@ -0,0 +1,385 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs + +import ( + "encoding/json" + "math/rand" + "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 NullableValue[T any] struct { + value *T + isSet bool +} + +func (v NullableValue[T]) Get() *T { + return v.value +} + +func (v *NullableValue[T]) Set(val *T) { + v.value = val + v.isSet = true +} + +func (v NullableValue[T]) IsSet() bool { + return v.isSet +} + +func (v *NullableValue[T]) Unset() { + v.value = nil + v.isSet = false +} + +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 + } + if t, ok := i.(interface{ IsSet() bool }); ok { + return !t.IsSet() + } + 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) +} + +const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +// randString returns a random string with a specified length. It panics if n <= 0. +func randString(n int) string { + b := make([]byte, n) + for i := range b { + b[i] = letterRunes[rand.Intn(len(letterRunes))] + } + return string(b) +} diff --git a/services/sfs/wait/wait.go b/services/sfs/wait/wait.go new file mode 100644 index 000000000..cded70908 --- /dev/null +++ b/services/sfs/wait/wait.go @@ -0,0 +1,184 @@ +package wait + +import ( + "context" + "errors" + "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/sfs" +) + +const ( + ResourcePoolStatePending = "pending" + ResourcePoolStateCreating = "creating" + ResourcePoolStateCreated = "created" + ResourcePoolStateUpdating = "updating" + ResourcePoolStateError = "error" + ResourcePoolStateDeleting = "deleting" +) + +const ( + ShareStatePending = "pending" + ShareStateCreating = "creating" + ShareStateCreated = "created" + ShareStateError = "error" + ShareStateDeleting = "deleting" +) + +// Interfaces needed for tests +type APIClientInterface interface { + GetResourcePoolExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*sfs.GetResourcePoolResponse, error) + GetShareExecute(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) (*sfs.GetShareResponse, error) +} + +func CreateResourcePoolWaitHandler(ctx context.Context, api APIClientInterface, projectId, region, resourcePoolId string) *wait.AsyncActionHandler[sfs.GetResourcePoolResponse] { + handler := wait.New(func() (waitFinished bool, resourcePool *sfs.GetResourcePoolResponse, err error) { + resourcePool, err = api.GetResourcePoolExecute(ctx, projectId, region, resourcePoolId) + if err != nil { + return false, resourcePool, err + } + if resourcePool == nil || + resourcePool.ResourcePool == nil || + resourcePool.ResourcePool.Id == nil || + resourcePool.ResourcePool.State == nil { + return false, resourcePool, fmt.Errorf("create failed for resourcepool with id %s, the response is not valid (state missing)", resourcePoolId) + } + if *resourcePool.ResourcePool.Id == resourcePoolId { + switch *resourcePool.ResourcePool.State { + case ResourcePoolStateCreated: + return true, resourcePool, err + default: + return false, resourcePool, err + } + } + + return false, nil, nil + }) + + handler.SetTimeout(10 * time.Minute) + return handler +} + +func UpdateResourcePoolWaitHandler(ctx context.Context, api APIClientInterface, projectId, region, resourcePoolId string) *wait.AsyncActionHandler[sfs.GetResourcePoolResponse] { + handler := wait.New(func() (waitFinished bool, resourcePool *sfs.GetResourcePoolResponse, err error) { + resourcePool, err = api.GetResourcePoolExecute(ctx, projectId, region, resourcePoolId) + if err != nil { + return false, resourcePool, err + } + if resourcePool == nil || + resourcePool.ResourcePool == nil || + resourcePool.ResourcePool.Id == nil || + resourcePool.ResourcePool.State == nil { + return false, resourcePool, fmt.Errorf("update failed for resourcepool with id %s, the response is not valid (state missing)", resourcePoolId) + } + if *resourcePool.ResourcePool.Id == resourcePoolId { + switch *resourcePool.ResourcePool.State { + case ResourcePoolStateCreated: + return true, resourcePool, err + default: + return false, resourcePool, err + } + } + + return false, nil, nil + }) + + handler.SetTimeout(10 * time.Minute) + return handler +} + +func DeleteResourcePoolWaitHandler(ctx context.Context, api APIClientInterface, projectId, region, resourcePoolId string) *wait.AsyncActionHandler[sfs.GetResourcePoolResponse] { + handler := wait.New(func() (waitFinished bool, resourcePool *sfs.GetResourcePoolResponse, err error) { + resourcePool, err = api.GetResourcePoolExecute(ctx, projectId, region, resourcePoolId) + if err != nil { + var oapiError *oapierror.GenericOpenAPIError + if errors.As(err, &oapiError) { + if statusCode := oapiError.StatusCode; statusCode == http.StatusNotFound || statusCode == http.StatusGone { + return true, resourcePool, nil + } + } + } + return false, nil, nil + }) + + handler.SetTimeout(10 * time.Minute) + return handler +} + +func CreateShareWaitHandler(ctx context.Context, api APIClientInterface, projectId, region, resourcePoolId, shareId string) *wait.AsyncActionHandler[sfs.GetShareResponse] { + handler := wait.New(func() (waitFinished bool, share *sfs.GetShareResponse, err error) { + share, err = api.GetShareExecute(ctx, projectId, region, resourcePoolId, shareId) + if err != nil { + return false, share, err + } + if share == nil || + share.Share == nil || + share.Share.Id == nil || + share.Share.State == nil { + return false, share, fmt.Errorf("create failed for share with id %s %s, the response is not valid (state missing)", resourcePoolId, shareId) + } + if *share.Share.Id == shareId { + switch *share.Share.State { + case ShareStateCreated: + return true, share, err + default: + return false, share, err + } + } + + return false, nil, nil + }) + + handler.SetTimeout(10 * time.Minute) + return handler +} + +func UpdateShareWaitHandler(ctx context.Context, api APIClientInterface, projectId, region, resourcePoolId, shareId string) *wait.AsyncActionHandler[sfs.GetShareResponse] { + handler := wait.New(func() (waitFinished bool, share *sfs.GetShareResponse, err error) { + share, err = api.GetShareExecute(ctx, projectId, region, resourcePoolId, shareId) + if err != nil { + return false, share, err + } + if share == nil || + share.Share == nil || + share.Share.Id == nil || + share.Share.State == nil { + return false, share, fmt.Errorf("update failed for resourcepool with id %s, the response is not valid (state missing)", resourcePoolId) + } + if *share.Share.Id == shareId { + switch *share.Share.State { + case ResourcePoolStateCreated: + return true, share, err + default: + return false, share, err + } + } + + return false, nil, nil + }) + + handler.SetTimeout(10 * time.Minute) + return handler +} + +func DeleteShareWaitHandler(ctx context.Context, api APIClientInterface, projectId, region, resourcePoolId, shareId string) *wait.AsyncActionHandler[sfs.GetShareResponse] { + handler := wait.New(func() (waitFinished bool, share *sfs.GetShareResponse, err error) { + share, err = api.GetShareExecute(ctx, projectId, region, resourcePoolId, shareId) + if err != nil { + var oapiError *oapierror.GenericOpenAPIError + if errors.As(err, &oapiError) { + if statusCode := oapiError.StatusCode; statusCode == http.StatusNotFound || statusCode == http.StatusGone { + return true, share, nil + } + } + } + return false, nil, nil + }) + + handler.SetTimeout(10 * time.Minute) + return handler +} diff --git a/services/sfs/wait/wait_test.go b/services/sfs/wait/wait_test.go new file mode 100644 index 000000000..35494f0cf --- /dev/null +++ b/services/sfs/wait/wait_test.go @@ -0,0 +1,594 @@ +package wait + +import ( + "context" + "net/http" + "testing" + "time" + + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/services/sfs" +) + +var _ APIClientInterface = (*apiClientMock)(nil) + +type response struct { + state string + status int +} + +type apiClientMock struct { + responseIndex int + responses []response +} + +// GetShareExecute implements APIClientInterface. +func (mock *apiClientMock) GetShareExecute(_ context.Context, _, _, _, shareId string) (*sfs.GetShareResponse, error) { + response := mock.responses[mock.responseIndex] + mock.responseIndex++ + mock.responseIndex %= len(mock.responses) + if response.status >= http.StatusBadRequest { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: response.status, + ErrorMessage: "simulated error", + } + } + return &sfs.GetShareResponse{ + Share: &sfs.GetShareResponseShare{ + Id: &shareId, + State: &response.state, + }, + }, nil +} + +var ( + testResourcePoolId = "testResourcePoolId" + testShareId = "testShareId" +) + +// GetResourcePoolExecute implements APIClientInterface. +func (mock *apiClientMock) GetResourcePoolExecute(_ context.Context, _, _, _ string) (*sfs.GetResourcePoolResponse, error) { + response := mock.responses[mock.responseIndex] + mock.responseIndex++ + mock.responseIndex %= len(mock.responses) + if response.status >= http.StatusBadRequest { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: response.status, + ErrorMessage: "simulated error", + } + } + return &sfs.GetResourcePoolResponse{ + ResourcePool: &sfs.GetResourcePoolResponseResourcePool{ + Id: &testResourcePoolId, + State: &response.state, + }, + }, nil +} + +func TestCreateResourcePoolWaitHandler(t *testing.T) { + type args struct { + projectId string + region string + } + type fields struct { + responses []response + } + tests := []struct { + name string + args args + fields fields + wantState string + wantErr bool + }{ + { + "success immediately", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreated, 0}, + }, + }, + ResourcePoolStateCreated, + false, + }, + { + "success delayed", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreating, 0}, + {ResourcePoolStateCreating, 0}, + {ResourcePoolStateCreated, http.StatusOK}, + }, + }, + ResourcePoolStateCreated, + false, + }, + { + "request fails", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreating, 0}, + {ResourcePoolStateCreating, 0}, + {ResourcePoolStateCreating, http.StatusInternalServerError}, + }, + }, + "", + true, + }, + { + "timeout", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreating, 0}, + }, + }, + ResourcePoolStateCreating, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + apiClientMock := apiClientMock{ + responses: tt.fields.responses, + } + ctx := context.Background() + handler := CreateResourcePoolWaitHandler(ctx, &apiClientMock, tt.args.projectId, tt.args.region, testResourcePoolId) + handler.SetTimeout(2 * time.Second) + handler.SetSleepBeforeWait(100 * time.Millisecond) + handler.SetThrottle(50 * time.Millisecond) + response, err := handler.WaitWithContext(ctx) + if (err != nil) != tt.wantErr { + t.Fatalf("handler error %s, wantErr %v", err, tt.wantErr) + } + var actualState string + if response != nil { + actualState = *response.ResourcePool.State + } + if tt.wantState != actualState { + t.Errorf("wrong state want %q but got %q", tt.wantState, actualState) + } + }) + } +} + +func TestUpdateResourcePoolWaitHandler(t *testing.T) { + type args struct { + projectId string + region string + } + type fields struct { + responses []response + } + tests := []struct { + name string + args args + fields fields + wantState string + wantErr bool + }{ + { + "success immediately", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreated, 0}, + }, + }, + ResourcePoolStateCreated, + false, + }, + { + "success delayed", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateUpdating, 0}, + {ResourcePoolStateUpdating, 0}, + {ResourcePoolStateCreated, http.StatusOK}, + }, + }, + ResourcePoolStateCreated, + false, + }, + { + "request fails", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateUpdating, 0}, + {ResourcePoolStateUpdating, 0}, + {ResourcePoolStateUpdating, http.StatusInternalServerError}, + }, + }, + "", + true, + }, + { + "timeout", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateUpdating, 0}, + }, + }, + ResourcePoolStateUpdating, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + apiClientMock := apiClientMock{ + responses: tt.fields.responses, + } + ctx := context.Background() + handler := UpdateResourcePoolWaitHandler(ctx, &apiClientMock, tt.args.projectId, tt.args.region, testResourcePoolId) + handler.SetTimeout(2 * time.Second) + handler.SetSleepBeforeWait(100 * time.Millisecond) + handler.SetThrottle(50 * time.Millisecond) + response, err := handler.WaitWithContext(ctx) + if (err != nil) != tt.wantErr { + t.Fatalf("handler error %s, wantErr %v", err, tt.wantErr) + } + var actualState string + if response != nil { + actualState = *response.ResourcePool.State + } + if tt.wantState != actualState { + t.Errorf("wrong state want %q but got %q", tt.wantState, actualState) + } + }) + } +} + +func TestDeleteResourcePoolWaitHandler(t *testing.T) { + type args struct { + projectId string + region string + } + type fields struct { + responses []response + } + tests := []struct { + name string + args args + fields fields + wantErr bool + }{ + { + "success immediately", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreated, http.StatusNotFound}, + }, + }, + false, + }, + { + "success delayed", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreating, http.StatusOK}, + {ResourcePoolStateCreating, http.StatusOK}, + {ResourcePoolStateCreated, http.StatusNotFound}, + }, + }, + false, + }, + { + "request fails", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreating, http.StatusInternalServerError}, + }, + }, + true, + }, + { + "timeout", + args{}, + fields{ + responses: []response{ + {ResourcePoolStateCreating, 0}, + }, + }, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + apiClientMock := apiClientMock{ + responses: tt.fields.responses, + } + ctx := context.Background() + handler := DeleteResourcePoolWaitHandler(ctx, &apiClientMock, tt.args.projectId, tt.args.region, testResourcePoolId) + handler.SetTimeout(2 * time.Second) + handler.SetSleepBeforeWait(100 * time.Millisecond) + handler.SetThrottle(50 * time.Millisecond) + _, err := handler.WaitWithContext(ctx) + if (err != nil) != tt.wantErr { + t.Fatalf("handler error %s, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestCreateShareWaitHandler(t *testing.T) { + type args struct { + projectId string + region string + } + type fields struct { + responses []response + } + tests := []struct { + name string + args args + fields fields + wantState string + wantErr bool + }{ + { + "success immediately", + args{}, + fields{ + responses: []response{ + {ShareStateCreated, 0}, + }, + }, + ShareStateCreated, + false, + }, + { + "success delayed", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, 0}, + {ShareStateCreating, 0}, + {ShareStateCreated, http.StatusOK}, + }, + }, + ShareStateCreated, + false, + }, + { + "request fails", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, 0}, + {ShareStateCreating, 0}, + {ShareStateCreating, http.StatusInternalServerError}, + }, + }, + "", + true, + }, + { + "timeout", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, 0}, + }, + }, + ShareStateCreating, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + apiClientMock := apiClientMock{ + responses: tt.fields.responses, + } + ctx := context.Background() + handler := CreateShareWaitHandler(ctx, &apiClientMock, tt.args.projectId, tt.args.region, testResourcePoolId, testShareId) + handler.SetTimeout(2 * time.Second) + handler.SetSleepBeforeWait(100 * time.Millisecond) + handler.SetThrottle(50 * time.Millisecond) + response, err := handler.WaitWithContext(ctx) + if (err != nil) != tt.wantErr { + t.Fatalf("handler error %s, wantErr %v", err, tt.wantErr) + } + var actualState string + if response != nil { + actualState = *response.Share.State + } + if tt.wantState != actualState { + t.Errorf("wrong state want %q but got %q", tt.wantState, actualState) + } + }) + } +} + +func TestUpdateShareWaitHandler(t *testing.T) { + type args struct { + projectId string + region string + } + type fields struct { + responses []response + } + tests := []struct { + name string + args args + fields fields + wantState string + wantErr bool + }{ + { + "success immediately", + args{}, + fields{ + responses: []response{ + {ShareStateCreated, 0}, + }, + }, + ShareStateCreated, + false, + }, + { + "success delayed", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, 0}, + {ShareStateCreating, 0}, + {ShareStateCreated, http.StatusOK}, + }, + }, + ShareStateCreated, + false, + }, + { + "request fails", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, 0}, + {ShareStateCreating, 0}, + {ShareStateCreating, http.StatusInternalServerError}, + }, + }, + "", + true, + }, + { + "timeout", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, 0}, + }, + }, + ShareStateCreating, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + apiClientMock := apiClientMock{ + responses: tt.fields.responses, + } + ctx := context.Background() + handler := UpdateShareWaitHandler(ctx, &apiClientMock, tt.args.projectId, tt.args.region, testResourcePoolId, testShareId) + handler.SetTimeout(2 * time.Second) + handler.SetSleepBeforeWait(100 * time.Millisecond) + handler.SetThrottle(50 * time.Millisecond) + response, err := handler.WaitWithContext(ctx) + if (err != nil) != tt.wantErr { + t.Fatalf("handler error %s, wantErr %v", err, tt.wantErr) + } + var actualState string + if response != nil { + actualState = *response.Share.State + } + if tt.wantState != actualState { + t.Errorf("wrong state want %q but got %q", tt.wantState, actualState) + } + }) + } +} + +func TestDeleteShareWaitHandler(t *testing.T) { + type args struct { + projectId string + region string + } + type fields struct { + responses []response + } + tests := []struct { + name string + args args + fields fields + wantErr bool + }{ + { + "success immediately", + args{}, + fields{ + responses: []response{ + {ShareStateCreated, http.StatusNotFound}, + }, + }, + false, + }, + { + "success immediately with gone status", + args{}, + fields{ + responses: []response{ + {ShareStateCreated, http.StatusGone}, + }, + }, + false, + }, + { + "success delayed", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, http.StatusOK}, + {ShareStateCreating, http.StatusOK}, + {ShareStateCreated, http.StatusNotFound}, + }, + }, + false, + }, + { + "success delayed with gone state", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, http.StatusOK}, + {ShareStateCreating, http.StatusOK}, + {ShareStateCreated, http.StatusGone}, + }, + }, + false, + }, + { + "request fails", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, http.StatusInternalServerError}, + }, + }, + true, + }, + { + "timeout", + args{}, + fields{ + responses: []response{ + {ShareStateCreating, 0}, + }, + }, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + apiClientMock := apiClientMock{ + responses: tt.fields.responses, + } + ctx := context.Background() + handler := DeleteShareWaitHandler(ctx, &apiClientMock, tt.args.projectId, tt.args.region, testResourcePoolId, testShareId) + handler.SetTimeout(2 * time.Second) + handler.SetSleepBeforeWait(100 * time.Millisecond) + handler.SetThrottle(50 * time.Millisecond) + _, err := handler.WaitWithContext(ctx) + if (err != nil) != tt.wantErr { + t.Fatalf("handler error %s, wantErr %v", err, tt.wantErr) + } + }) + } +}