diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fa0bac70..8aaff7181 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - **Feature:** Add support for regions in `APIClient` - `stackitmarketplace`: [v0.1.0](services/stackitmarketplace/CHANGELOG.md#v010-2025-01-10) - **New**: STACKIT Marketplace module can be used to manage the STACKIT Marketplace. +- `lbapplication` [v0.1.0](services/lbapplication/CHANGELOG.md#v010-2025-01-13) + - **New**: STACKIT Load Balancer Application module can be used to manage the STACKIT Load Balancer Application ## Release (2025-01-07) diff --git a/go.work b/go.work index c20c76e0b..cdc1818fa 100644 --- a/go.work +++ b/go.work @@ -35,6 +35,7 @@ use ( ./services/dns ./services/iaas ./services/iaasalpha + ./services/lbapplication ./services/loadbalancer ./services/logme ./services/mariadb diff --git a/services/lbapplication/.openapi-generator/VERSION b/services/lbapplication/.openapi-generator/VERSION new file mode 100644 index 000000000..cd802a1ec --- /dev/null +++ b/services/lbapplication/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/services/lbapplication/CHANGELOG.md b/services/lbapplication/CHANGELOG.md new file mode 100644 index 000000000..e4d961492 --- /dev/null +++ b/services/lbapplication/CHANGELOG.md @@ -0,0 +1,3 @@ +## v0.1.0 (2025-01-13) + +- **New**: STACKIT Load Balancer Application module can be used to manage the STACKIT Load Balancer Application diff --git a/services/lbapplication/LICENSE.md b/services/lbapplication/LICENSE.md new file mode 100644 index 000000000..7e2f06484 --- /dev/null +++ b/services/lbapplication/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2025 Schwarz IT KG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/lbapplication/NOTICE.txt b/services/lbapplication/NOTICE.txt new file mode 100644 index 000000000..91288b389 --- /dev/null +++ b/services/lbapplication/NOTICE.txt @@ -0,0 +1,2 @@ +STACKIT Load Balancer Application SDK for Go +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/lbapplication/api_default.go b/services/lbapplication/api_default.go new file mode 100644 index 000000000..14ec28807 --- /dev/null +++ b/services/lbapplication/api_default.go @@ -0,0 +1,2385 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiCreateCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + xRequestID *string + createCredentialsPayload *CreateCredentialsPayload +} + +func (r ApiCreateCredentialsRequest) XRequestID(xRequestID string) ApiCreateCredentialsRequest { + r.xRequestID = &xRequestID + return r +} + +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.xRequestID == nil { + return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") + } + if r.createCredentialsPayload == nil { + return localVarReturnValue, fmt.Errorf("createCredentialsPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") + // body params + localVarPostBody = r.createCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateCredentials: Create credentials for observability of the application load balancer + +Creates and stores credentials for use with Application Load Balancer Observability. + + For example, when using ARGUS, credentials must first be created via the ARGUS API + and then stored with this endpoint to be used by the Application Load Balancer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiCreateCredentialsRequest +*/ +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string) (*CreateCredentialsResponse, error) { + r := ApiCreateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiCreateLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + xRequestID *string + createLoadBalancerPayload *CreateLoadBalancerPayload +} + +func (r ApiCreateLoadBalancerRequest) XRequestID(xRequestID string) ApiCreateLoadBalancerRequest { + r.xRequestID = &xRequestID + return r +} + +func (r ApiCreateLoadBalancerRequest) CreateLoadBalancerPayload(createLoadBalancerPayload CreateLoadBalancerPayload) ApiCreateLoadBalancerRequest { + r.createLoadBalancerPayload = &createLoadBalancerPayload + return r +} + +func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LoadBalancer + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.xRequestID == nil { + return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") + } + if r.createLoadBalancerPayload == nil { + return localVarReturnValue, fmt.Errorf("createLoadBalancerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") + // body params + localVarPostBody = r.createLoadBalancerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateLoadBalancer: Create an application load balancer in a project + +Creates an Application Load Balancer. + + The default load balancing algorithm is Maglev, and selecting a different algorithm is currently not supported. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiCreateLoadBalancerRequest +*/ +func (a *APIClient) CreateLoadBalancer(ctx context.Context, projectId string) ApiCreateLoadBalancerRequest { + return ApiCreateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) CreateLoadBalancerExecute(ctx context.Context, projectId string) (*LoadBalancer, error) { + r := ApiCreateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + credentialsRef string +} + +func (r ApiDeleteCredentialsRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(r.credentialsRef, "credentialsRef")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteCredentials: Delete a single credential in a project. + +Deletes the stored Observability credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param credentialsRef + @return ApiDeleteCredentialsRequest +*/ +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, credentialsRef string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } +} + +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, credentialsRef string) (map[string]interface{}, error) { + r := ApiDeleteCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } + return r.Execute() +} + +type ApiDeleteLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string +} + +func (r ApiDeleteLoadBalancerRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteLoadBalancer: Delete a given load balancer in a project. + +Deletes the specified Application Load Balancer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @return ApiDeleteLoadBalancerRequest +*/ +func (a *APIClient) DeleteLoadBalancer(ctx context.Context, projectId string, name string) ApiDeleteLoadBalancerRequest { + return ApiDeleteLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } +} + +func (a *APIClient) DeleteLoadBalancerExecute(ctx context.Context, projectId string, name string) (map[string]interface{}, error) { + r := ApiDeleteLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } + return r.Execute() +} + +type ApiDisableServiceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiDisableServiceRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableService") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DisableService: Disables the functionality of load balancers for the project specified. + +Deprecated: DEPRECATED! Disabling the Application Load Balancer functionality is now automatic. + + This endpoint is kept for compatibility. + Disables the Application Load Balancer functionality for the specified project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiDisableServiceRequest +*/ +func (a *APIClient) DisableService(ctx context.Context, projectId string) ApiDisableServiceRequest { + return ApiDisableServiceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +/* +Deprecated: DEPRECATED! Disabling the Application Load Balancer functionality is now automatic. + + This endpoint is kept for compatibility. + Disables the Application Load Balancer functionality for the specified project. +*/ +func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { + r := ApiDisableServiceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiEnableServiceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + xRequestID *string +} + +func (r ApiEnableServiceRequest) XRequestID(xRequestID string) ApiEnableServiceRequest { + r.xRequestID = &xRequestID + return r +} + +func (r ApiEnableServiceRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EnableService") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.xRequestID == nil { + return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +EnableService: Enables the functionality of application load balancers for the project specified. + +Deprecated: DEPRECATED! Checking the status is now obsolete. The endpoint is kept for compatibility. + + Enables the Application Load Balancer service for the specified project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiEnableServiceRequest +*/ +func (a *APIClient) EnableService(ctx context.Context, projectId string) ApiEnableServiceRequest { + return ApiEnableServiceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +/* +Deprecated: DEPRECATED! Checking the status is now obsolete. The endpoint is kept for compatibility. + + Enables the Application Load Balancer service for the specified project. +*/ +func (a *APIClient) EnableServiceExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { + r := ApiEnableServiceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiGetCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + credentialsRef string +} + +func (r ApiGetCredentialsRequest) Execute() (*GetCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(r.credentialsRef, "credentialsRef")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetCredentials: Get a single credential reference in a project. + +Gets the stored Observability credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param credentialsRef + @return ApiGetCredentialsRequest +*/ +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, credentialsRef string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } +} + +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, credentialsRef string) (*GetCredentialsResponse, error) { + r := ApiGetCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } + return r.Execute() +} + +type ApiGetLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string +} + +func (r ApiGetLoadBalancerRequest) Execute() (*LoadBalancer, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LoadBalancer + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetLoadBalancer: Get a single application load balancer in a project. + +Retrieves details of a specific Application Load Balancer in a project. + + Includes creation and update information, current status, and any error descriptions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @return ApiGetLoadBalancerRequest +*/ +func (a *APIClient) GetLoadBalancer(ctx context.Context, projectId string, name string) ApiGetLoadBalancerRequest { + return ApiGetLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } +} + +func (a *APIClient) GetLoadBalancerExecute(ctx context.Context, projectId string, name string) (*LoadBalancer, error) { + r := ApiGetLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } + return r.Execute() +} + +type ApiGetQuotaRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiGetQuotaRequest) Execute() (*GetQuotaResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetQuotaResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetQuota") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/quota" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetQuota: Get the quota of application load balancers and target pools in a project. + +Retrieves the configured Application Load Balancer quota for the project. + + The default quota is 3. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiGetQuotaRequest +*/ +func (a *APIClient) GetQuota(ctx context.Context, projectId string) ApiGetQuotaRequest { + return ApiGetQuotaRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) GetQuotaExecute(ctx context.Context, projectId string) (*GetQuotaResponse, error) { + r := ApiGetQuotaRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiGetServiceStatusRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiGetServiceStatusRequest) Execute() (*GetServiceStatusResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetServiceStatusResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceStatus") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetServiceStatus: Return the status of application load balancer functionality for the project specified. + +Deprecated: DEPRECATED! Checking the status is now obsolete. The endpoint is kept for compatibility. + + Status will return the Application Load Balancer functionality status for the specified project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiGetServiceStatusRequest +*/ +func (a *APIClient) GetServiceStatus(ctx context.Context, projectId string) ApiGetServiceStatusRequest { + return ApiGetServiceStatusRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +/* +Deprecated: DEPRECATED! Checking the status is now obsolete. The endpoint is kept for compatibility. + + Status will return the Application Load Balancer functionality status for the specified project. +*/ +func (a *APIClient) GetServiceStatusExecute(ctx context.Context, projectId string) (*GetServiceStatusResponse, error) { + r := ApiGetServiceStatusRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiListCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListCredentials: List all credentials in a project. + +Lists the stored Observability credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListCredentialsRequest +*/ +func (a *APIClient) ListCredentials(ctx context.Context, projectId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string) (*ListCredentialsResponse, error) { + r := ApiListCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiListLoadBalancersRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + pageSize *string + pageId *string +} + +// page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000 + +func (r ApiListLoadBalancersRequest) PageSize(pageSize string) ApiListLoadBalancersRequest { + r.pageSize = &pageSize + return r +} + +// page_id is a page identifier returned by the previous response and is used to request the next page + +func (r ApiListLoadBalancersRequest) PageId(pageId string) ApiListLoadBalancersRequest { + r.pageId = &pageId + return r +} + +func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListLoadBalancersResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListLoadBalancers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "") + } + if r.pageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageId", r.pageId, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListLoadBalancers: List load balancers in a project. + +Lists all Application Load Balancers in a project. + + Includes details from creation or updates, along with their status and any error descriptions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListLoadBalancersRequest +*/ +func (a *APIClient) ListLoadBalancers(ctx context.Context, projectId string) ApiListLoadBalancersRequest { + return ApiListLoadBalancersRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) ListLoadBalancersExecute(ctx context.Context, projectId string) (*ListLoadBalancersResponse, error) { + r := ApiListLoadBalancersRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiListPlansRequest struct { + ctx context.Context + apiService *DefaultApiService +} + +func (r ApiListPlansRequest) Execute() (*ListPlansResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListPlansResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPlans") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/plans" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListPlans: List available service plans. + +Lists the configured service plans for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPlansRequest +*/ +func (a *APIClient) ListPlans(ctx context.Context) ApiListPlansRequest { + return ApiListPlansRequest{ + apiService: a.defaultApi, + ctx: ctx, + } +} + +func (a *APIClient) ListPlansExecute(ctx context.Context) (*ListPlansResponse, error) { + r := ApiListPlansRequest{ + apiService: a.defaultApi, + ctx: ctx, + } + return r.Execute() +} + +type ApiUpdateCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + credentialsRef string + updateCredentialsPayload *UpdateCredentialsPayload +} + +func (r ApiUpdateCredentialsRequest) UpdateCredentialsPayload(updateCredentialsPayload UpdateCredentialsPayload) ApiUpdateCredentialsRequest { + r.updateCredentialsPayload = &updateCredentialsPayload + return r +} + +func (r ApiUpdateCredentialsRequest) Execute() (*UpdateCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(r.credentialsRef, "credentialsRef")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateCredentialsPayload == nil { + return localVarReturnValue, fmt.Errorf("updateCredentialsPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +UpdateCredentials: Update credentials for observability in a project. + +Updates the stored Observability credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param credentialsRef + @return ApiUpdateCredentialsRequest +*/ +func (a *APIClient) UpdateCredentials(ctx context.Context, projectId string, credentialsRef string) ApiUpdateCredentialsRequest { + return ApiUpdateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } +} + +func (a *APIClient) UpdateCredentialsExecute(ctx context.Context, projectId string, credentialsRef string) (*UpdateCredentialsResponse, error) { + r := ApiUpdateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } + return r.Execute() +} + +type ApiUpdateLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string + updateLoadBalancerPayload *UpdateLoadBalancerPayload +} + +func (r ApiUpdateLoadBalancerRequest) UpdateLoadBalancerPayload(updateLoadBalancerPayload UpdateLoadBalancerPayload) ApiUpdateLoadBalancerRequest { + r.updateLoadBalancerPayload = &updateLoadBalancerPayload + return r +} + +func (r ApiUpdateLoadBalancerRequest) Execute() (*LoadBalancer, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LoadBalancer + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateLoadBalancerPayload == nil { + return localVarReturnValue, fmt.Errorf("updateLoadBalancerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateLoadBalancerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +UpdateLoadBalancer: Update a load balancer in a project. + +Updates an existing Application Load Balancer by modifying its listeners and target pools. + + Ensure the resource version is current to maintain concurrency safety. + The default load balancing algorithm is Maglev, and selecting a different algorithm is currently not supported. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @return ApiUpdateLoadBalancerRequest +*/ +func (a *APIClient) UpdateLoadBalancer(ctx context.Context, projectId string, name string) ApiUpdateLoadBalancerRequest { + return ApiUpdateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } +} + +func (a *APIClient) UpdateLoadBalancerExecute(ctx context.Context, projectId string, name string) (*LoadBalancer, error) { + r := ApiUpdateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } + return r.Execute() +} + +type ApiUpdateTargetPoolRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string + targetPoolName string + updateTargetPoolPayload *UpdateTargetPoolPayload +} + +func (r ApiUpdateTargetPoolRequest) UpdateTargetPoolPayload(updateTargetPoolPayload UpdateTargetPoolPayload) ApiUpdateTargetPoolRequest { + r.updateTargetPoolPayload = &updateTargetPoolPayload + return r +} + +func (r ApiUpdateTargetPoolRequest) Execute() (*TargetPool, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TargetPool + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateTargetPool") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"targetPoolName"+"}", url.PathEscape(ParameterValueToString(r.targetPoolName, "targetPoolName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateTargetPoolPayload == nil { + return localVarReturnValue, fmt.Errorf("updateTargetPoolPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateTargetPoolPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +UpdateTargetPool: Update a single target pool of a load balancer in a project. + +Replaces the content of a specific target pool in the Application Load Balancer (useful for adding or removing target servers). + + Only updates the specified target pool, leaving others unchanged. + Cannot be used to create or rename target pools. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @param targetPoolName + @return ApiUpdateTargetPoolRequest +*/ +func (a *APIClient) UpdateTargetPool(ctx context.Context, projectId string, name string, targetPoolName string) ApiUpdateTargetPoolRequest { + return ApiUpdateTargetPoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + targetPoolName: targetPoolName, + } +} + +func (a *APIClient) UpdateTargetPoolExecute(ctx context.Context, projectId string, name string, targetPoolName string) (*TargetPool, error) { + r := ApiUpdateTargetPoolRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + targetPoolName: targetPoolName, + } + return r.Execute() +} diff --git a/services/lbapplication/api_default_test.go b/services/lbapplication/api_default_test.go new file mode 100644 index 000000000..679f444ac --- /dev/null +++ b/services/lbapplication/api_default_test.go @@ -0,0 +1,886 @@ +/* +Application Load Balancer API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package lbapplication + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +func Test_lbapplication_DefaultApiService(t *testing.T) { + + t.Run("Test DefaultApiService CreateCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := CreateCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + var xRequestID string + createCredentialsPayload := CreateCredentialsPayload{} + + resp, reqErr := apiClient.CreateCredentials(context.Background(), projectId).XRequestID(xRequestID).CreateCredentialsPayload(createCredentialsPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService CreateLoadBalancer", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := LoadBalancer{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + var xRequestID string + createLoadBalancerPayload := CreateLoadBalancerPayload{} + + resp, reqErr := apiClient.CreateLoadBalancer(context.Background(), projectId).XRequestID(xRequestID).CreateLoadBalancerPayload(createLoadBalancerPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + credentialsRefValue := "credentialsRef" + path = strings.Replace(path, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(credentialsRefValue, "credentialsRef")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + credentialsRef := "credentialsRef" + + resp, reqErr := apiClient.DeleteCredentials(context.Background(), projectId, credentialsRef).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DeleteLoadBalancer", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers/{name}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + + resp, reqErr := apiClient.DeleteLoadBalancer(context.Background(), projectId, name).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService DisableService", func(t *testing.T) { + path := "/v1beta/projects/{projectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.DisableService(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService EnableService", func(t *testing.T) { + path := "/v1beta/projects/{projectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + var xRequestID string + + resp, reqErr := apiClient.EnableService(context.Background(), projectId).XRequestID(xRequestID).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + credentialsRefValue := "credentialsRef" + path = strings.Replace(path, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(credentialsRefValue, "credentialsRef")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + credentialsRef := "credentialsRef" + + resp, reqErr := apiClient.GetCredentials(context.Background(), projectId, credentialsRef).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetLoadBalancer", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers/{name}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := LoadBalancer{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + + resp, reqErr := apiClient.GetLoadBalancer(context.Background(), projectId, name).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetQuota", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/quota" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetQuotaResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.GetQuota(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetServiceStatus", func(t *testing.T) { + path := "/v1beta/projects/{projectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetServiceStatusResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.GetServiceStatus(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.ListCredentials(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListLoadBalancers", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListLoadBalancersResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.ListLoadBalancers(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListPlans", func(t *testing.T) { + path := "/v1beta/plans" + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListPlansResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + resp, reqErr := apiClient.ListPlans(context.Background()).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateCredentials", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/credentials/{credentialsRef}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + credentialsRefValue := "credentialsRef" + path = strings.Replace(path, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(credentialsRefValue, "credentialsRef")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := UpdateCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + credentialsRef := "credentialsRef" + updateCredentialsPayload := UpdateCredentialsPayload{} + + resp, reqErr := apiClient.UpdateCredentials(context.Background(), projectId, credentialsRef).UpdateCredentialsPayload(updateCredentialsPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateLoadBalancer", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers/{name}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := LoadBalancer{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + updateLoadBalancerPayload := UpdateLoadBalancerPayload{} + + resp, reqErr := apiClient.UpdateLoadBalancer(context.Background(), projectId, name).UpdateLoadBalancerPayload(updateLoadBalancerPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateTargetPool", func(t *testing.T) { + path := "/v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + targetPoolNameValue := "targetPoolName" + path = strings.Replace(path, "{"+"targetPoolName"+"}", url.PathEscape(ParameterValueToString(targetPoolNameValue, "targetPoolName")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := TargetPool{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for lbapplication_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + targetPoolName := "targetPoolName" + updateTargetPoolPayload := UpdateTargetPoolPayload{} + + resp, reqErr := apiClient.UpdateTargetPool(context.Background(), projectId, name, targetPoolName).UpdateTargetPoolPayload(updateTargetPoolPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + +} diff --git a/services/lbapplication/client.go b/services/lbapplication/client.go new file mode 100644 index 000000000..79406adb6 --- /dev/null +++ b/services/lbapplication/client.go @@ -0,0 +1,631 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the Application Load Balancer API API v1beta.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + defaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. +// Optionally receives configuration options +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + c.defaultApi = (*DefaultApiService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func ParameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, fmt.Errorf("cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, fmt.Errorf("cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return fmt.Errorf("unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return fmt.Errorf("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} diff --git a/services/lbapplication/configuration.go b/services/lbapplication/configuration.go new file mode 100644 index 000000000..23ba6d090 --- /dev/null +++ b/services/lbapplication/configuration.go @@ -0,0 +1,41 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://lb-application.api.{region}stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/lbapplication/go.mod b/services/lbapplication/go.mod new file mode 100644 index 000000000..f7c8a754f --- /dev/null +++ b/services/lbapplication/go.mod @@ -0,0 +1,10 @@ +module github.com/stackitcloud/stackit-sdk-go/services/lbapplication + +go 1.18 + +require github.com/stackitcloud/stackit-sdk-go/core v0.15.0 + +require ( + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/google/uuid v1.6.0 // indirect +) diff --git a/services/lbapplication/go.sum b/services/lbapplication/go.sum new file mode 100644 index 000000000..318b353d7 --- /dev/null +++ b/services/lbapplication/go.sum @@ -0,0 +1,7 @@ +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/stackitcloud/stackit-sdk-go/core v0.15.0 h1:oMP6L616/bP3b/B1Me7Ptu637dAJKr7NO3Rd3UwqpvE= +github.com/stackitcloud/stackit-sdk-go/core v0.15.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/lbapplication/model_active_health_check.go b/services/lbapplication/model_active_health_check.go new file mode 100644 index 000000000..f77787a4b --- /dev/null +++ b/services/lbapplication/model_active_health_check.go @@ -0,0 +1,303 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ActiveHealthCheck type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActiveHealthCheck{} + +// ActiveHealthCheck struct for ActiveHealthCheck +type ActiveHealthCheck struct { + // Healthy threshold of the health checking + HealthyThreshold *interface{} `json:"healthyThreshold,omitempty"` + HttpHealthChecks *HttpHealthChecks `json:"httpHealthChecks,omitempty"` + // Interval duration of health checking in seconds + Interval *string `json:"interval,omitempty"` + // Interval duration threshold of the health checking in seconds + IntervalJitter *string `json:"intervalJitter,omitempty"` + // Active health checking timeout duration in seconds + Timeout *string `json:"timeout,omitempty"` + // Unhealthy threshold of the health checking + UnhealthyThreshold *interface{} `json:"unhealthyThreshold,omitempty"` +} + +// NewActiveHealthCheck instantiates a new ActiveHealthCheck object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActiveHealthCheck() *ActiveHealthCheck { + this := ActiveHealthCheck{} + return &this +} + +// NewActiveHealthCheckWithDefaults instantiates a new ActiveHealthCheck object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActiveHealthCheckWithDefaults() *ActiveHealthCheck { + this := ActiveHealthCheck{} + return &this +} + +// GetHealthyThreshold returns the HealthyThreshold field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActiveHealthCheck) GetHealthyThreshold() *interface{} { + if o == nil || IsNil(o.HealthyThreshold) { + var ret *interface{} + return ret + } + return o.HealthyThreshold +} + +// GetHealthyThresholdOk returns a tuple with the HealthyThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActiveHealthCheck) GetHealthyThresholdOk() (*interface{}, bool) { + if o == nil || IsNil(o.HealthyThreshold) { + return nil, false + } + return o.HealthyThreshold, true +} + +// HasHealthyThreshold returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasHealthyThreshold() bool { + if o != nil && !IsNil(o.HealthyThreshold) { + return true + } + + return false +} + +// SetHealthyThreshold gets a reference to the given interface{} and assigns it to the HealthyThreshold field. +func (o *ActiveHealthCheck) SetHealthyThreshold(v *interface{}) { + o.HealthyThreshold = v +} + +// GetHttpHealthChecks returns the HttpHealthChecks field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetHttpHealthChecks() *HttpHealthChecks { + if o == nil || IsNil(o.HttpHealthChecks) { + var ret *HttpHealthChecks + return ret + } + return o.HttpHealthChecks +} + +// GetHttpHealthChecksOk returns a tuple with the HttpHealthChecks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetHttpHealthChecksOk() (*HttpHealthChecks, bool) { + if o == nil || IsNil(o.HttpHealthChecks) { + return nil, false + } + return o.HttpHealthChecks, true +} + +// HasHttpHealthChecks returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasHttpHealthChecks() bool { + if o != nil && !IsNil(o.HttpHealthChecks) { + return true + } + + return false +} + +// SetHttpHealthChecks gets a reference to the given HttpHealthChecks and assigns it to the HttpHealthChecks field. +func (o *ActiveHealthCheck) SetHttpHealthChecks(v *HttpHealthChecks) { + o.HttpHealthChecks = v +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetInterval() *string { + if o == nil || IsNil(o.Interval) { + var ret *string + return ret + } + return o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetIntervalOk() (*string, bool) { + if o == nil || IsNil(o.Interval) { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasInterval() bool { + if o != nil && !IsNil(o.Interval) { + return true + } + + return false +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *ActiveHealthCheck) SetInterval(v *string) { + o.Interval = v +} + +// GetIntervalJitter returns the IntervalJitter field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetIntervalJitter() *string { + if o == nil || IsNil(o.IntervalJitter) { + var ret *string + return ret + } + return o.IntervalJitter +} + +// GetIntervalJitterOk returns a tuple with the IntervalJitter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetIntervalJitterOk() (*string, bool) { + if o == nil || IsNil(o.IntervalJitter) { + return nil, false + } + return o.IntervalJitter, true +} + +// HasIntervalJitter returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasIntervalJitter() bool { + if o != nil && !IsNil(o.IntervalJitter) { + return true + } + + return false +} + +// SetIntervalJitter gets a reference to the given string and assigns it to the IntervalJitter field. +func (o *ActiveHealthCheck) SetIntervalJitter(v *string) { + o.IntervalJitter = v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *ActiveHealthCheck) GetTimeout() *string { + if o == nil || IsNil(o.Timeout) { + var ret *string + return ret + } + return o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActiveHealthCheck) GetTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given string and assigns it to the Timeout field. +func (o *ActiveHealthCheck) SetTimeout(v *string) { + o.Timeout = v +} + +// GetUnhealthyThreshold returns the UnhealthyThreshold field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActiveHealthCheck) GetUnhealthyThreshold() *interface{} { + if o == nil || IsNil(o.UnhealthyThreshold) { + var ret *interface{} + return ret + } + return o.UnhealthyThreshold +} + +// GetUnhealthyThresholdOk returns a tuple with the UnhealthyThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActiveHealthCheck) GetUnhealthyThresholdOk() (*interface{}, bool) { + if o == nil || IsNil(o.UnhealthyThreshold) { + return nil, false + } + return o.UnhealthyThreshold, true +} + +// HasUnhealthyThreshold returns a boolean if a field has been set. +func (o *ActiveHealthCheck) HasUnhealthyThreshold() bool { + if o != nil && !IsNil(o.UnhealthyThreshold) { + return true + } + + return false +} + +// SetUnhealthyThreshold gets a reference to the given interface{} and assigns it to the UnhealthyThreshold field. +func (o *ActiveHealthCheck) SetUnhealthyThreshold(v *interface{}) { + o.UnhealthyThreshold = v +} + +func (o ActiveHealthCheck) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.HealthyThreshold != nil { + toSerialize["healthyThreshold"] = o.HealthyThreshold + } + if !IsNil(o.HttpHealthChecks) { + toSerialize["httpHealthChecks"] = o.HttpHealthChecks + } + if !IsNil(o.Interval) { + toSerialize["interval"] = o.Interval + } + if !IsNil(o.IntervalJitter) { + toSerialize["intervalJitter"] = o.IntervalJitter + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if o.UnhealthyThreshold != nil { + toSerialize["unhealthyThreshold"] = o.UnhealthyThreshold + } + return toSerialize, nil +} + +type NullableActiveHealthCheck struct { + value *ActiveHealthCheck + isSet bool +} + +func (v NullableActiveHealthCheck) Get() *ActiveHealthCheck { + return v.value +} + +func (v *NullableActiveHealthCheck) Set(val *ActiveHealthCheck) { + v.value = val + v.isSet = true +} + +func (v NullableActiveHealthCheck) IsSet() bool { + return v.isSet +} + +func (v *NullableActiveHealthCheck) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActiveHealthCheck(val *ActiveHealthCheck) *NullableActiveHealthCheck { + return &NullableActiveHealthCheck{value: val, isSet: true} +} + +func (v NullableActiveHealthCheck) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActiveHealthCheck) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_certificate_config.go b/services/lbapplication/model_certificate_config.go new file mode 100644 index 000000000..347987148 --- /dev/null +++ b/services/lbapplication/model_certificate_config.go @@ -0,0 +1,117 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CertificateConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateConfig{} + +// CertificateConfig struct for CertificateConfig +type CertificateConfig struct { + // Certificate IDs for TLS termination + CertificateIds *[]string `json:"certificateIds,omitempty"` +} + +// NewCertificateConfig instantiates a new CertificateConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCertificateConfig() *CertificateConfig { + this := CertificateConfig{} + return &this +} + +// NewCertificateConfigWithDefaults instantiates a new CertificateConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCertificateConfigWithDefaults() *CertificateConfig { + this := CertificateConfig{} + return &this +} + +// GetCertificateIds returns the CertificateIds field value if set, zero value otherwise. +func (o *CertificateConfig) GetCertificateIds() *[]string { + if o == nil || IsNil(o.CertificateIds) { + var ret *[]string + return ret + } + return o.CertificateIds +} + +// GetCertificateIdsOk returns a tuple with the CertificateIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CertificateConfig) GetCertificateIdsOk() (*[]string, bool) { + if o == nil || IsNil(o.CertificateIds) { + return nil, false + } + return o.CertificateIds, true +} + +// HasCertificateIds returns a boolean if a field has been set. +func (o *CertificateConfig) HasCertificateIds() bool { + if o != nil && !IsNil(o.CertificateIds) { + return true + } + + return false +} + +// SetCertificateIds gets a reference to the given []string and assigns it to the CertificateIds field. +func (o *CertificateConfig) SetCertificateIds(v *[]string) { + o.CertificateIds = v +} + +func (o CertificateConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CertificateIds) { + toSerialize["certificateIds"] = o.CertificateIds + } + return toSerialize, nil +} + +type NullableCertificateConfig struct { + value *CertificateConfig + isSet bool +} + +func (v NullableCertificateConfig) Get() *CertificateConfig { + return v.value +} + +func (v *NullableCertificateConfig) Set(val *CertificateConfig) { + v.value = val + v.isSet = true +} + +func (v NullableCertificateConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableCertificateConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCertificateConfig(val *CertificateConfig) *NullableCertificateConfig { + return &NullableCertificateConfig{value: val, isSet: true} +} + +func (v NullableCertificateConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCertificateConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_cookie_persistence.go b/services/lbapplication/model_cookie_persistence.go new file mode 100644 index 000000000..46fd43257 --- /dev/null +++ b/services/lbapplication/model_cookie_persistence.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CookiePersistence type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CookiePersistence{} + +// CookiePersistence struct for CookiePersistence +type CookiePersistence struct { + // Cookie is the name of the cookie to use. + Name *string `json:"name,omitempty"` + // TTL specifies the time-to-live for the cookie. The default value is 0s, and it acts as a session cookie, expiring when the client session ends. + Ttl *string `json:"ttl,omitempty"` +} + +// NewCookiePersistence instantiates a new CookiePersistence object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCookiePersistence() *CookiePersistence { + this := CookiePersistence{} + return &this +} + +// NewCookiePersistenceWithDefaults instantiates a new CookiePersistence object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCookiePersistenceWithDefaults() *CookiePersistence { + this := CookiePersistence{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CookiePersistence) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CookiePersistence) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CookiePersistence) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CookiePersistence) SetName(v *string) { + o.Name = v +} + +// GetTtl returns the Ttl field value if set, zero value otherwise. +func (o *CookiePersistence) GetTtl() *string { + if o == nil || IsNil(o.Ttl) { + var ret *string + return ret + } + return o.Ttl +} + +// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CookiePersistence) GetTtlOk() (*string, bool) { + if o == nil || IsNil(o.Ttl) { + return nil, false + } + return o.Ttl, true +} + +// HasTtl returns a boolean if a field has been set. +func (o *CookiePersistence) HasTtl() bool { + if o != nil && !IsNil(o.Ttl) { + return true + } + + return false +} + +// SetTtl gets a reference to the given string and assigns it to the Ttl field. +func (o *CookiePersistence) SetTtl(v *string) { + o.Ttl = v +} + +func (o CookiePersistence) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ttl) { + toSerialize["ttl"] = o.Ttl + } + return toSerialize, nil +} + +type NullableCookiePersistence struct { + value *CookiePersistence + isSet bool +} + +func (v NullableCookiePersistence) Get() *CookiePersistence { + return v.value +} + +func (v *NullableCookiePersistence) Set(val *CookiePersistence) { + v.value = val + v.isSet = true +} + +func (v NullableCookiePersistence) IsSet() bool { + return v.isSet +} + +func (v *NullableCookiePersistence) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCookiePersistence(val *CookiePersistence) *NullableCookiePersistence { + return &NullableCookiePersistence{value: val, isSet: true} +} + +func (v NullableCookiePersistence) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCookiePersistence) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_create_credentials_payload.go b/services/lbapplication/model_create_credentials_payload.go new file mode 100644 index 000000000..e1662d4d6 --- /dev/null +++ b/services/lbapplication/model_create_credentials_payload.go @@ -0,0 +1,191 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // A valid password used for an existing ARGUS instance, which is used during basic auth. + Password *string `json:"password,omitempty"` + // A valid username used for an existing ARGUS instance, which is used during basic auth. + Username *string `json:"username,omitempty"` +} + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *CreateCredentialsPayload) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetPassword() *string { + if o == nil || IsNil(o.Password) { + var ret *string + return ret + } + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *CreateCredentialsPayload) SetPassword(v *string) { + o.Password = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetUsername() *string { + if o == nil || IsNil(o.Username) { + var ret *string + return ret + } + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CreateCredentialsPayload) SetUsername(v *string) { + o.Username = v +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_create_credentials_response.go b/services/lbapplication/model_create_credentials_response.go new file mode 100644 index 000000000..e92fd0010 --- /dev/null +++ b/services/lbapplication/model_create_credentials_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsResponse{} + +// CreateCredentialsResponse struct for CreateCredentialsResponse +type CreateCredentialsResponse struct { + Credential *CredentialsResponse `json:"credential,omitempty"` +} + +// NewCreateCredentialsResponse instantiates a new CreateCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsResponse() *CreateCredentialsResponse { + this := CreateCredentialsResponse{} + return &this +} + +// NewCreateCredentialsResponseWithDefaults instantiates a new CreateCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsResponseWithDefaults() *CreateCredentialsResponse { + this := CreateCredentialsResponse{} + return &this +} + +// GetCredential returns the Credential field value if set, zero value otherwise. +func (o *CreateCredentialsResponse) GetCredential() *CredentialsResponse { + if o == nil || IsNil(o.Credential) { + var ret *CredentialsResponse + return ret + } + return o.Credential +} + +// GetCredentialOk returns a tuple with the Credential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsResponse) GetCredentialOk() (*CredentialsResponse, bool) { + if o == nil || IsNil(o.Credential) { + return nil, false + } + return o.Credential, true +} + +// HasCredential returns a boolean if a field has been set. +func (o *CreateCredentialsResponse) HasCredential() bool { + if o != nil && !IsNil(o.Credential) { + return true + } + + return false +} + +// SetCredential gets a reference to the given CredentialsResponse and assigns it to the Credential field. +func (o *CreateCredentialsResponse) SetCredential(v *CredentialsResponse) { + o.Credential = v +} + +func (o CreateCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credential) { + toSerialize["credential"] = o.Credential + } + return toSerialize, nil +} + +type NullableCreateCredentialsResponse struct { + value *CreateCredentialsResponse + isSet bool +} + +func (v NullableCreateCredentialsResponse) Get() *CreateCredentialsResponse { + return v.value +} + +func (v *NullableCreateCredentialsResponse) Set(val *CreateCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsResponse(val *CreateCredentialsResponse) *NullableCreateCredentialsResponse { + return &NullableCreateCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCreateCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_create_load_balancer_payload.go b/services/lbapplication/model_create_load_balancer_payload.go new file mode 100644 index 000000000..e207f09c3 --- /dev/null +++ b/services/lbapplication/model_create_load_balancer_payload.go @@ -0,0 +1,485 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CreateLoadBalancerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateLoadBalancerPayload{} + +// CreateLoadBalancerPayload struct for CreateLoadBalancerPayload +type CreateLoadBalancerPayload struct { + // Reports all errors a application load balancer has. + Errors *[]LoadBalancerError `json:"errors,omitempty"` + // External application load balancer IP address where this application load balancer is exposed. Not changeable after creation. + ExternalAddress *string `json:"externalAddress,omitempty"` + // There is a maximum listener count of 20. + Listeners *[]Listener `json:"listeners,omitempty"` + // Application Load Balancer name. Not changeable after creation. + Name *string `json:"name,omitempty"` + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. + Networks *[]Network `json:"networks,omitempty"` + Options *LoadBalancerOptions `json:"options,omitempty"` + // Service Plan configures the size of the Application Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. + PlanId *string `json:"planId,omitempty"` + // Transient private application load balancer IP address that can change any time. + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *string `json:"status,omitempty"` + // List of all target pools which will be used in the application load balancer. Limited to 20. + TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Application Load Balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this application load balancer resource that changes during updates of the load balancers. On updates this field specified the application load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a application load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of application load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` +} + +// NewCreateLoadBalancerPayload instantiates a new CreateLoadBalancerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateLoadBalancerPayload() *CreateLoadBalancerPayload { + this := CreateLoadBalancerPayload{} + return &this +} + +// NewCreateLoadBalancerPayloadWithDefaults instantiates a new CreateLoadBalancerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateLoadBalancerPayloadWithDefaults() *CreateLoadBalancerPayload { + this := CreateLoadBalancerPayload{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetErrors() *[]LoadBalancerError { + if o == nil || IsNil(o.Errors) { + var ret *[]LoadBalancerError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetErrorsOk() (*[]LoadBalancerError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []LoadBalancerError and assigns it to the Errors field. +func (o *CreateLoadBalancerPayload) SetErrors(v *[]LoadBalancerError) { + o.Errors = v +} + +// GetExternalAddress returns the ExternalAddress field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetExternalAddress() *string { + if o == nil || IsNil(o.ExternalAddress) { + var ret *string + return ret + } + return o.ExternalAddress +} + +// GetExternalAddressOk returns a tuple with the ExternalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetExternalAddressOk() (*string, bool) { + if o == nil || IsNil(o.ExternalAddress) { + return nil, false + } + return o.ExternalAddress, true +} + +// HasExternalAddress returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasExternalAddress() bool { + if o != nil && !IsNil(o.ExternalAddress) { + return true + } + + return false +} + +// SetExternalAddress gets a reference to the given string and assigns it to the ExternalAddress field. +func (o *CreateLoadBalancerPayload) SetExternalAddress(v *string) { + o.ExternalAddress = v +} + +// GetListeners returns the Listeners field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetListeners() *[]Listener { + if o == nil || IsNil(o.Listeners) { + var ret *[]Listener + return ret + } + return o.Listeners +} + +// GetListenersOk returns a tuple with the Listeners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetListenersOk() (*[]Listener, bool) { + if o == nil || IsNil(o.Listeners) { + return nil, false + } + return o.Listeners, true +} + +// HasListeners returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasListeners() bool { + if o != nil && !IsNil(o.Listeners) { + return true + } + + return false +} + +// SetListeners gets a reference to the given []Listener and assigns it to the Listeners field. +func (o *CreateLoadBalancerPayload) SetListeners(v *[]Listener) { + o.Listeners = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateLoadBalancerPayload) SetName(v *string) { + o.Name = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetNetworks() *[]Network { + if o == nil || IsNil(o.Networks) { + var ret *[]Network + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetNetworksOk() (*[]Network, bool) { + if o == nil || IsNil(o.Networks) { + return nil, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given []Network and assigns it to the Networks field. +func (o *CreateLoadBalancerPayload) SetNetworks(v *[]Network) { + o.Networks = v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetOptions() *LoadBalancerOptions { + if o == nil || IsNil(o.Options) { + var ret *LoadBalancerOptions + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetOptionsOk() (*LoadBalancerOptions, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given LoadBalancerOptions and assigns it to the Options field. +func (o *CreateLoadBalancerPayload) SetOptions(v *LoadBalancerOptions) { + o.Options = v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetPlanId() *string { + if o == nil || IsNil(o.PlanId) { + var ret *string + return ret + } + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *CreateLoadBalancerPayload) SetPlanId(v *string) { + o.PlanId = v +} + +// GetPrivateAddress returns the PrivateAddress field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetPrivateAddress() *string { + if o == nil || IsNil(o.PrivateAddress) { + var ret *string + return ret + } + return o.PrivateAddress +} + +// GetPrivateAddressOk returns a tuple with the PrivateAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetPrivateAddressOk() (*string, bool) { + if o == nil || IsNil(o.PrivateAddress) { + return nil, false + } + return o.PrivateAddress, true +} + +// HasPrivateAddress returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasPrivateAddress() bool { + if o != nil && !IsNil(o.PrivateAddress) { + return true + } + + return false +} + +// SetPrivateAddress gets a reference to the given string and assigns it to the PrivateAddress field. +func (o *CreateLoadBalancerPayload) SetPrivateAddress(v *string) { + o.PrivateAddress = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateLoadBalancerPayload) SetStatus(v *string) { + o.Status = v +} + +// GetTargetPools returns the TargetPools field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetTargetPools() *[]TargetPool { + if o == nil || IsNil(o.TargetPools) { + var ret *[]TargetPool + return ret + } + return o.TargetPools +} + +// GetTargetPoolsOk returns a tuple with the TargetPools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetTargetPoolsOk() (*[]TargetPool, bool) { + if o == nil || IsNil(o.TargetPools) { + return nil, false + } + return o.TargetPools, true +} + +// HasTargetPools returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasTargetPools() bool { + if o != nil && !IsNil(o.TargetPools) { + return true + } + + return false +} + +// SetTargetPools gets a reference to the given []TargetPool and assigns it to the TargetPools field. +func (o *CreateLoadBalancerPayload) SetTargetPools(v *[]TargetPool) { + o.TargetPools = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *CreateLoadBalancerPayload) GetVersion() *string { + if o == nil || IsNil(o.Version) { + var ret *string + return ret + } + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLoadBalancerPayload) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *CreateLoadBalancerPayload) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *CreateLoadBalancerPayload) SetVersion(v *string) { + o.Version = v +} + +func (o CreateLoadBalancerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.ExternalAddress) { + toSerialize["externalAddress"] = o.ExternalAddress + } + if !IsNil(o.Listeners) { + toSerialize["listeners"] = o.Listeners + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + if !IsNil(o.PrivateAddress) { + toSerialize["privateAddress"] = o.PrivateAddress + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TargetPools) { + toSerialize["targetPools"] = o.TargetPools + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableCreateLoadBalancerPayload struct { + value *CreateLoadBalancerPayload + isSet bool +} + +func (v NullableCreateLoadBalancerPayload) Get() *CreateLoadBalancerPayload { + return v.value +} + +func (v *NullableCreateLoadBalancerPayload) Set(val *CreateLoadBalancerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateLoadBalancerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateLoadBalancerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateLoadBalancerPayload(val *CreateLoadBalancerPayload) *NullableCreateLoadBalancerPayload { + return &NullableCreateLoadBalancerPayload{value: val, isSet: true} +} + +func (v NullableCreateLoadBalancerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateLoadBalancerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_credentials_response.go b/services/lbapplication/model_credentials_response.go new file mode 100644 index 000000000..180b5344f --- /dev/null +++ b/services/lbapplication/model_credentials_response.go @@ -0,0 +1,191 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the CredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsResponse{} + +// CredentialsResponse struct for CredentialsResponse +type CredentialsResponse struct { + // The credentials reference can be used for observability of the Application Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // The username used for the ARGUS instance + Username *string `json:"username,omitempty"` +} + +// NewCredentialsResponse instantiates a new CredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsResponse() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// NewCredentialsResponseWithDefaults instantiates a new CredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsResponseWithDefaults() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// GetCredentialsRef returns the CredentialsRef field value if set, zero value otherwise. +func (o *CredentialsResponse) GetCredentialsRef() *string { + if o == nil || IsNil(o.CredentialsRef) { + var ret *string + return ret + } + return o.CredentialsRef +} + +// GetCredentialsRefOk returns a tuple with the CredentialsRef field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetCredentialsRefOk() (*string, bool) { + if o == nil || IsNil(o.CredentialsRef) { + return nil, false + } + return o.CredentialsRef, true +} + +// HasCredentialsRef returns a boolean if a field has been set. +func (o *CredentialsResponse) HasCredentialsRef() bool { + if o != nil && !IsNil(o.CredentialsRef) { + return true + } + + return false +} + +// SetCredentialsRef gets a reference to the given string and assigns it to the CredentialsRef field. +func (o *CredentialsResponse) SetCredentialsRef(v *string) { + o.CredentialsRef = v +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *CredentialsResponse) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *CredentialsResponse) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *CredentialsResponse) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *CredentialsResponse) GetUsername() *string { + if o == nil || IsNil(o.Username) { + var ret *string + return ret + } + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *CredentialsResponse) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *CredentialsResponse) SetUsername(v *string) { + o.Username = v +} + +func (o CredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CredentialsRef) { + toSerialize["credentialsRef"] = o.CredentialsRef + } + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableCredentialsResponse struct { + value *CredentialsResponse + isSet bool +} + +func (v NullableCredentialsResponse) Get() *CredentialsResponse { + return v.value +} + +func (v *NullableCredentialsResponse) Set(val *CredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsResponse(val *CredentialsResponse) *NullableCredentialsResponse { + return &NullableCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_get_credentials_response.go b/services/lbapplication/model_get_credentials_response.go new file mode 100644 index 000000000..521163d39 --- /dev/null +++ b/services/lbapplication/model_get_credentials_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the GetCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCredentialsResponse{} + +// GetCredentialsResponse struct for GetCredentialsResponse +type GetCredentialsResponse struct { + Credential *CredentialsResponse `json:"credential,omitempty"` +} + +// NewGetCredentialsResponse instantiates a new GetCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetCredentialsResponse() *GetCredentialsResponse { + this := GetCredentialsResponse{} + return &this +} + +// NewGetCredentialsResponseWithDefaults instantiates a new GetCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetCredentialsResponseWithDefaults() *GetCredentialsResponse { + this := GetCredentialsResponse{} + return &this +} + +// GetCredential returns the Credential field value if set, zero value otherwise. +func (o *GetCredentialsResponse) GetCredential() *CredentialsResponse { + if o == nil || IsNil(o.Credential) { + var ret *CredentialsResponse + return ret + } + return o.Credential +} + +// GetCredentialOk returns a tuple with the Credential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetCredentialsResponse) GetCredentialOk() (*CredentialsResponse, bool) { + if o == nil || IsNil(o.Credential) { + return nil, false + } + return o.Credential, true +} + +// HasCredential returns a boolean if a field has been set. +func (o *GetCredentialsResponse) HasCredential() bool { + if o != nil && !IsNil(o.Credential) { + return true + } + + return false +} + +// SetCredential gets a reference to the given CredentialsResponse and assigns it to the Credential field. +func (o *GetCredentialsResponse) SetCredential(v *CredentialsResponse) { + o.Credential = v +} + +func (o GetCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credential) { + toSerialize["credential"] = o.Credential + } + return toSerialize, nil +} + +type NullableGetCredentialsResponse struct { + value *GetCredentialsResponse + isSet bool +} + +func (v NullableGetCredentialsResponse) Get() *GetCredentialsResponse { + return v.value +} + +func (v *NullableGetCredentialsResponse) Set(val *GetCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCredentialsResponse(val *GetCredentialsResponse) *NullableGetCredentialsResponse { + return &NullableGetCredentialsResponse{value: val, isSet: true} +} + +func (v NullableGetCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_get_quota_response.go b/services/lbapplication/model_get_quota_response.go new file mode 100644 index 000000000..f19c64e0e --- /dev/null +++ b/services/lbapplication/model_get_quota_response.go @@ -0,0 +1,155 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the GetQuotaResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetQuotaResponse{} + +// GetQuotaResponse struct for GetQuotaResponse +type GetQuotaResponse struct { + // The maximum number of load balancing servers in this project. Unlimited if set to -1. + MaxLoadBalancers *interface{} `json:"maxLoadBalancers,omitempty"` + // Project identifier + ProjectId *string `json:"projectId,omitempty"` +} + +// NewGetQuotaResponse instantiates a new GetQuotaResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetQuotaResponse() *GetQuotaResponse { + this := GetQuotaResponse{} + return &this +} + +// NewGetQuotaResponseWithDefaults instantiates a new GetQuotaResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetQuotaResponseWithDefaults() *GetQuotaResponse { + this := GetQuotaResponse{} + return &this +} + +// GetMaxLoadBalancers returns the MaxLoadBalancers field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetQuotaResponse) GetMaxLoadBalancers() *interface{} { + if o == nil || IsNil(o.MaxLoadBalancers) { + var ret *interface{} + return ret + } + return o.MaxLoadBalancers +} + +// GetMaxLoadBalancersOk returns a tuple with the MaxLoadBalancers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetQuotaResponse) GetMaxLoadBalancersOk() (*interface{}, bool) { + if o == nil || IsNil(o.MaxLoadBalancers) { + return nil, false + } + return o.MaxLoadBalancers, true +} + +// HasMaxLoadBalancers returns a boolean if a field has been set. +func (o *GetQuotaResponse) HasMaxLoadBalancers() bool { + if o != nil && !IsNil(o.MaxLoadBalancers) { + return true + } + + return false +} + +// SetMaxLoadBalancers gets a reference to the given interface{} and assigns it to the MaxLoadBalancers field. +func (o *GetQuotaResponse) SetMaxLoadBalancers(v *interface{}) { + o.MaxLoadBalancers = v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GetQuotaResponse) GetProjectId() *string { + if o == nil || IsNil(o.ProjectId) { + var ret *string + return ret + } + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetQuotaResponse) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *GetQuotaResponse) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *GetQuotaResponse) SetProjectId(v *string) { + o.ProjectId = v +} + +func (o GetQuotaResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.MaxLoadBalancers != nil { + toSerialize["maxLoadBalancers"] = o.MaxLoadBalancers + } + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + return toSerialize, nil +} + +type NullableGetQuotaResponse struct { + value *GetQuotaResponse + isSet bool +} + +func (v NullableGetQuotaResponse) Get() *GetQuotaResponse { + return v.value +} + +func (v *NullableGetQuotaResponse) Set(val *GetQuotaResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetQuotaResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetQuotaResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetQuotaResponse(val *GetQuotaResponse) *NullableGetQuotaResponse { + return &NullableGetQuotaResponse{value: val, isSet: true} +} + +func (v NullableGetQuotaResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetQuotaResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_get_service_status_response.go b/services/lbapplication/model_get_service_status_response.go new file mode 100644 index 000000000..06948290a --- /dev/null +++ b/services/lbapplication/model_get_service_status_response.go @@ -0,0 +1,117 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the GetServiceStatusResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetServiceStatusResponse{} + +// GetServiceStatusResponse Response with customer project status. +type GetServiceStatusResponse struct { + // status of the project + Status *string `json:"status,omitempty"` +} + +// NewGetServiceStatusResponse instantiates a new GetServiceStatusResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetServiceStatusResponse() *GetServiceStatusResponse { + this := GetServiceStatusResponse{} + return &this +} + +// NewGetServiceStatusResponseWithDefaults instantiates a new GetServiceStatusResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetServiceStatusResponseWithDefaults() *GetServiceStatusResponse { + this := GetServiceStatusResponse{} + return &this +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GetServiceStatusResponse) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServiceStatusResponse) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GetServiceStatusResponse) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *GetServiceStatusResponse) SetStatus(v *string) { + o.Status = v +} + +func (o GetServiceStatusResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableGetServiceStatusResponse struct { + value *GetServiceStatusResponse + isSet bool +} + +func (v NullableGetServiceStatusResponse) Get() *GetServiceStatusResponse { + return v.value +} + +func (v *NullableGetServiceStatusResponse) Set(val *GetServiceStatusResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetServiceStatusResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServiceStatusResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServiceStatusResponse(val *GetServiceStatusResponse) *NullableGetServiceStatusResponse { + return &NullableGetServiceStatusResponse{value: val, isSet: true} +} + +func (v NullableGetServiceStatusResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServiceStatusResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_google_protobuf_any.go b/services/lbapplication/model_google_protobuf_any.go new file mode 100644 index 000000000..4875ade32 --- /dev/null +++ b/services/lbapplication/model_google_protobuf_any.go @@ -0,0 +1,125 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the GoogleProtobufAny type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleProtobufAny{} + +// GoogleProtobufAny Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +type GoogleProtobufAny struct { + // The type of the serialized message. + Type *string `json:"@type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GoogleProtobufAny GoogleProtobufAny + +// NewGoogleProtobufAny instantiates a new GoogleProtobufAny object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleProtobufAny() *GoogleProtobufAny { + this := GoogleProtobufAny{} + return &this +} + +// NewGoogleProtobufAnyWithDefaults instantiates a new GoogleProtobufAny object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleProtobufAnyWithDefaults() *GoogleProtobufAny { + this := GoogleProtobufAny{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GoogleProtobufAny) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleProtobufAny) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *GoogleProtobufAny) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *GoogleProtobufAny) SetType(v *string) { + o.Type = v +} + +func (o GoogleProtobufAny) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["@type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +type NullableGoogleProtobufAny struct { + value *GoogleProtobufAny + isSet bool +} + +func (v NullableGoogleProtobufAny) Get() *GoogleProtobufAny { + return v.value +} + +func (v *NullableGoogleProtobufAny) Set(val *GoogleProtobufAny) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleProtobufAny) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleProtobufAny) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleProtobufAny(val *GoogleProtobufAny) *NullableGoogleProtobufAny { + return &NullableGoogleProtobufAny{value: val, isSet: true} +} + +func (v NullableGoogleProtobufAny) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleProtobufAny) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_header.go b/services/lbapplication/model_header.go new file mode 100644 index 000000000..bae66c09a --- /dev/null +++ b/services/lbapplication/model_header.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Header type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Header{} + +// Header struct for Header +type Header struct { + // Exact match for the header value. + ExactMatch *string `json:"exactMatch,omitempty"` + // Header name. + Name *string `json:"name,omitempty"` +} + +// NewHeader instantiates a new Header object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHeader() *Header { + this := Header{} + return &this +} + +// NewHeaderWithDefaults instantiates a new Header object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHeaderWithDefaults() *Header { + this := Header{} + return &this +} + +// GetExactMatch returns the ExactMatch field value if set, zero value otherwise. +func (o *Header) GetExactMatch() *string { + if o == nil || IsNil(o.ExactMatch) { + var ret *string + return ret + } + return o.ExactMatch +} + +// GetExactMatchOk returns a tuple with the ExactMatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Header) GetExactMatchOk() (*string, bool) { + if o == nil || IsNil(o.ExactMatch) { + return nil, false + } + return o.ExactMatch, true +} + +// HasExactMatch returns a boolean if a field has been set. +func (o *Header) HasExactMatch() bool { + if o != nil && !IsNil(o.ExactMatch) { + return true + } + + return false +} + +// SetExactMatch gets a reference to the given string and assigns it to the ExactMatch field. +func (o *Header) SetExactMatch(v *string) { + o.ExactMatch = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Header) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Header) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Header) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Header) SetName(v *string) { + o.Name = v +} + +func (o Header) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ExactMatch) { + toSerialize["exactMatch"] = o.ExactMatch + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableHeader struct { + value *Header + isSet bool +} + +func (v NullableHeader) Get() *Header { + return v.value +} + +func (v *NullableHeader) Set(val *Header) { + v.value = val + v.isSet = true +} + +func (v NullableHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHeader(val *Header) *NullableHeader { + return &NullableHeader{value: val, isSet: true} +} + +func (v NullableHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_http_config.go b/services/lbapplication/model_http_config.go new file mode 100644 index 000000000..73e481b65 --- /dev/null +++ b/services/lbapplication/model_http_config.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the HTTPConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HTTPConfig{} + +// HTTPConfig struct for HTTPConfig +type HTTPConfig struct { + Matcher *[]Matcher `json:"matcher,omitempty"` +} + +// NewHTTPConfig instantiates a new HTTPConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHTTPConfig() *HTTPConfig { + this := HTTPConfig{} + return &this +} + +// NewHTTPConfigWithDefaults instantiates a new HTTPConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHTTPConfigWithDefaults() *HTTPConfig { + this := HTTPConfig{} + return &this +} + +// GetMatcher returns the Matcher field value if set, zero value otherwise. +func (o *HTTPConfig) GetMatcher() *[]Matcher { + if o == nil || IsNil(o.Matcher) { + var ret *[]Matcher + return ret + } + return o.Matcher +} + +// GetMatcherOk returns a tuple with the Matcher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HTTPConfig) GetMatcherOk() (*[]Matcher, bool) { + if o == nil || IsNil(o.Matcher) { + return nil, false + } + return o.Matcher, true +} + +// HasMatcher returns a boolean if a field has been set. +func (o *HTTPConfig) HasMatcher() bool { + if o != nil && !IsNil(o.Matcher) { + return true + } + + return false +} + +// SetMatcher gets a reference to the given []Matcher and assigns it to the Matcher field. +func (o *HTTPConfig) SetMatcher(v *[]Matcher) { + o.Matcher = v +} + +func (o HTTPConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Matcher) { + toSerialize["matcher"] = o.Matcher + } + return toSerialize, nil +} + +type NullableHTTPConfig struct { + value *HTTPConfig + isSet bool +} + +func (v NullableHTTPConfig) Get() *HTTPConfig { + return v.value +} + +func (v *NullableHTTPConfig) Set(val *HTTPConfig) { + v.value = val + v.isSet = true +} + +func (v NullableHTTPConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableHTTPConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHTTPConfig(val *HTTPConfig) *NullableHTTPConfig { + return &NullableHTTPConfig{value: val, isSet: true} +} + +func (v NullableHTTPConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHTTPConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_http_health_checks.go b/services/lbapplication/model_http_health_checks.go new file mode 100644 index 000000000..be8b0a257 --- /dev/null +++ b/services/lbapplication/model_http_health_checks.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the HttpHealthChecks type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpHealthChecks{} + +// HttpHealthChecks struct for HttpHealthChecks +type HttpHealthChecks struct { + // List of HTTP status codes that indicate a healthy response + OkStatuses *[]string `json:"okStatuses,omitempty"` + // Path to send the health check request to + Path *string `json:"path,omitempty"` +} + +// NewHttpHealthChecks instantiates a new HttpHealthChecks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHttpHealthChecks() *HttpHealthChecks { + this := HttpHealthChecks{} + return &this +} + +// NewHttpHealthChecksWithDefaults instantiates a new HttpHealthChecks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHttpHealthChecksWithDefaults() *HttpHealthChecks { + this := HttpHealthChecks{} + return &this +} + +// GetOkStatuses returns the OkStatuses field value if set, zero value otherwise. +func (o *HttpHealthChecks) GetOkStatuses() *[]string { + if o == nil || IsNil(o.OkStatuses) { + var ret *[]string + return ret + } + return o.OkStatuses +} + +// GetOkStatusesOk returns a tuple with the OkStatuses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpHealthChecks) GetOkStatusesOk() (*[]string, bool) { + if o == nil || IsNil(o.OkStatuses) { + return nil, false + } + return o.OkStatuses, true +} + +// HasOkStatuses returns a boolean if a field has been set. +func (o *HttpHealthChecks) HasOkStatuses() bool { + if o != nil && !IsNil(o.OkStatuses) { + return true + } + + return false +} + +// SetOkStatuses gets a reference to the given []string and assigns it to the OkStatuses field. +func (o *HttpHealthChecks) SetOkStatuses(v *[]string) { + o.OkStatuses = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *HttpHealthChecks) GetPath() *string { + if o == nil || IsNil(o.Path) { + var ret *string + return ret + } + return o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpHealthChecks) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *HttpHealthChecks) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *HttpHealthChecks) SetPath(v *string) { + o.Path = v +} + +func (o HttpHealthChecks) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.OkStatuses) { + toSerialize["okStatuses"] = o.OkStatuses + } + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + return toSerialize, nil +} + +type NullableHttpHealthChecks struct { + value *HttpHealthChecks + isSet bool +} + +func (v NullableHttpHealthChecks) Get() *HttpHealthChecks { + return v.value +} + +func (v *NullableHttpHealthChecks) Set(val *HttpHealthChecks) { + v.value = val + v.isSet = true +} + +func (v NullableHttpHealthChecks) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpHealthChecks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpHealthChecks(val *HttpHealthChecks) *NullableHttpHealthChecks { + return &NullableHttpHealthChecks{value: val, isSet: true} +} + +func (v NullableHttpHealthChecks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpHealthChecks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_list_credentials_response.go b/services/lbapplication/model_list_credentials_response.go new file mode 100644 index 000000000..fec42f0a7 --- /dev/null +++ b/services/lbapplication/model_list_credentials_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ListCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCredentialsResponse{} + +// ListCredentialsResponse struct for ListCredentialsResponse +type ListCredentialsResponse struct { + Credentials *[]CredentialsResponse `json:"credentials,omitempty"` +} + +// NewListCredentialsResponse instantiates a new ListCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCredentialsResponse() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// NewListCredentialsResponseWithDefaults instantiates a new ListCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCredentialsResponseWithDefaults() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *ListCredentialsResponse) GetCredentials() *[]CredentialsResponse { + if o == nil || IsNil(o.Credentials) { + var ret *[]CredentialsResponse + return ret + } + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCredentialsResponse) GetCredentialsOk() (*[]CredentialsResponse, bool) { + if o == nil || IsNil(o.Credentials) { + return nil, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *ListCredentialsResponse) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given []CredentialsResponse and assigns it to the Credentials field. +func (o *ListCredentialsResponse) SetCredentials(v *[]CredentialsResponse) { + o.Credentials = v +} + +func (o ListCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + return toSerialize, nil +} + +type NullableListCredentialsResponse struct { + value *ListCredentialsResponse + isSet bool +} + +func (v NullableListCredentialsResponse) Get() *ListCredentialsResponse { + return v.value +} + +func (v *NullableListCredentialsResponse) Set(val *ListCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCredentialsResponse(val *ListCredentialsResponse) *NullableListCredentialsResponse { + return &NullableListCredentialsResponse{value: val, isSet: true} +} + +func (v NullableListCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_list_load_balancers_response.go b/services/lbapplication/model_list_load_balancers_response.go new file mode 100644 index 000000000..d599bf13b --- /dev/null +++ b/services/lbapplication/model_list_load_balancers_response.go @@ -0,0 +1,153 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ListLoadBalancersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListLoadBalancersResponse{} + +// ListLoadBalancersResponse struct for ListLoadBalancersResponse +type ListLoadBalancersResponse struct { + LoadBalancers *[]LoadBalancer `json:"loadBalancers,omitempty"` + // Continue token from the ListLoadBalancerResponse with Limit option + NextPageId *string `json:"nextPageId,omitempty"` +} + +// NewListLoadBalancersResponse instantiates a new ListLoadBalancersResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListLoadBalancersResponse() *ListLoadBalancersResponse { + this := ListLoadBalancersResponse{} + return &this +} + +// NewListLoadBalancersResponseWithDefaults instantiates a new ListLoadBalancersResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListLoadBalancersResponseWithDefaults() *ListLoadBalancersResponse { + this := ListLoadBalancersResponse{} + return &this +} + +// GetLoadBalancers returns the LoadBalancers field value if set, zero value otherwise. +func (o *ListLoadBalancersResponse) GetLoadBalancers() *[]LoadBalancer { + if o == nil || IsNil(o.LoadBalancers) { + var ret *[]LoadBalancer + return ret + } + return o.LoadBalancers +} + +// GetLoadBalancersOk returns a tuple with the LoadBalancers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListLoadBalancersResponse) GetLoadBalancersOk() (*[]LoadBalancer, bool) { + if o == nil || IsNil(o.LoadBalancers) { + return nil, false + } + return o.LoadBalancers, true +} + +// HasLoadBalancers returns a boolean if a field has been set. +func (o *ListLoadBalancersResponse) HasLoadBalancers() bool { + if o != nil && !IsNil(o.LoadBalancers) { + return true + } + + return false +} + +// SetLoadBalancers gets a reference to the given []LoadBalancer and assigns it to the LoadBalancers field. +func (o *ListLoadBalancersResponse) SetLoadBalancers(v *[]LoadBalancer) { + o.LoadBalancers = v +} + +// GetNextPageId returns the NextPageId field value if set, zero value otherwise. +func (o *ListLoadBalancersResponse) GetNextPageId() *string { + if o == nil || IsNil(o.NextPageId) { + var ret *string + return ret + } + return o.NextPageId +} + +// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListLoadBalancersResponse) GetNextPageIdOk() (*string, bool) { + if o == nil || IsNil(o.NextPageId) { + return nil, false + } + return o.NextPageId, true +} + +// HasNextPageId returns a boolean if a field has been set. +func (o *ListLoadBalancersResponse) HasNextPageId() bool { + if o != nil && !IsNil(o.NextPageId) { + return true + } + + return false +} + +// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field. +func (o *ListLoadBalancersResponse) SetNextPageId(v *string) { + o.NextPageId = v +} + +func (o ListLoadBalancersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.LoadBalancers) { + toSerialize["loadBalancers"] = o.LoadBalancers + } + if !IsNil(o.NextPageId) { + toSerialize["nextPageId"] = o.NextPageId + } + return toSerialize, nil +} + +type NullableListLoadBalancersResponse struct { + value *ListLoadBalancersResponse + isSet bool +} + +func (v NullableListLoadBalancersResponse) Get() *ListLoadBalancersResponse { + return v.value +} + +func (v *NullableListLoadBalancersResponse) Set(val *ListLoadBalancersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListLoadBalancersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListLoadBalancersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListLoadBalancersResponse(val *ListLoadBalancersResponse) *NullableListLoadBalancersResponse { + return &NullableListLoadBalancersResponse{value: val, isSet: true} +} + +func (v NullableListLoadBalancersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListLoadBalancersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_list_plans_response.go b/services/lbapplication/model_list_plans_response.go new file mode 100644 index 000000000..612dfee7b --- /dev/null +++ b/services/lbapplication/model_list_plans_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ListPlansResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListPlansResponse{} + +// ListPlansResponse struct for ListPlansResponse +type ListPlansResponse struct { + ValidPlans *[]PlanDetails `json:"validPlans,omitempty"` +} + +// NewListPlansResponse instantiates a new ListPlansResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListPlansResponse() *ListPlansResponse { + this := ListPlansResponse{} + return &this +} + +// NewListPlansResponseWithDefaults instantiates a new ListPlansResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListPlansResponseWithDefaults() *ListPlansResponse { + this := ListPlansResponse{} + return &this +} + +// GetValidPlans returns the ValidPlans field value if set, zero value otherwise. +func (o *ListPlansResponse) GetValidPlans() *[]PlanDetails { + if o == nil || IsNil(o.ValidPlans) { + var ret *[]PlanDetails + return ret + } + return o.ValidPlans +} + +// GetValidPlansOk returns a tuple with the ValidPlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListPlansResponse) GetValidPlansOk() (*[]PlanDetails, bool) { + if o == nil || IsNil(o.ValidPlans) { + return nil, false + } + return o.ValidPlans, true +} + +// HasValidPlans returns a boolean if a field has been set. +func (o *ListPlansResponse) HasValidPlans() bool { + if o != nil && !IsNil(o.ValidPlans) { + return true + } + + return false +} + +// SetValidPlans gets a reference to the given []PlanDetails and assigns it to the ValidPlans field. +func (o *ListPlansResponse) SetValidPlans(v *[]PlanDetails) { + o.ValidPlans = v +} + +func (o ListPlansResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ValidPlans) { + toSerialize["validPlans"] = o.ValidPlans + } + return toSerialize, nil +} + +type NullableListPlansResponse struct { + value *ListPlansResponse + isSet bool +} + +func (v NullableListPlansResponse) Get() *ListPlansResponse { + return v.value +} + +func (v *NullableListPlansResponse) Set(val *ListPlansResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListPlansResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListPlansResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListPlansResponse(val *ListPlansResponse) *NullableListPlansResponse { + return &NullableListPlansResponse{value: val, isSet: true} +} + +func (v NullableListPlansResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListPlansResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_listener.go b/services/lbapplication/model_listener.go new file mode 100644 index 000000000..d74ab302a --- /dev/null +++ b/services/lbapplication/model_listener.go @@ -0,0 +1,337 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Listener type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Listener{} + +// Listener struct for Listener +type Listener struct { + DisplayName *string `json:"displayName,omitempty"` + Http *map[string]interface{} `json:"http,omitempty"` + Https *ProtocolOptionsHTTPS `json:"https,omitempty"` + // Will be used to reference a listener and will replace display name in the future. Currently uses - as the name if no display name is given. + Name *string `json:"name,omitempty"` + // Port number where we listen for traffic + Port *interface{} `json:"port,omitempty"` + // Protocol is the highest network protocol we understand to load balance. Currently PROTOCOL_HTTP and PROTOCOL_HTTPS are supported. + Protocol *string `json:"protocol,omitempty"` + // Rules define the routing parameters for the HTTP and HTTPS listeners. + Rules *[]Rule `json:"rules,omitempty"` +} + +// NewListener instantiates a new Listener object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListener() *Listener { + this := Listener{} + return &this +} + +// NewListenerWithDefaults instantiates a new Listener object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListenerWithDefaults() *Listener { + this := Listener{} + return &this +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *Listener) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *Listener) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *Listener) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetHttp returns the Http field value if set, zero value otherwise. +func (o *Listener) GetHttp() *map[string]interface{} { + if o == nil || IsNil(o.Http) { + var ret *map[string]interface{} + return ret + } + return o.Http +} + +// GetHttpOk returns a tuple with the Http field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetHttpOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Http) { + return &map[string]interface{}{}, false + } + return o.Http, true +} + +// HasHttp returns a boolean if a field has been set. +func (o *Listener) HasHttp() bool { + if o != nil && !IsNil(o.Http) { + return true + } + + return false +} + +// SetHttp gets a reference to the given map[string]interface{} and assigns it to the Http field. +func (o *Listener) SetHttp(v *map[string]interface{}) { + o.Http = v +} + +// GetHttps returns the Https field value if set, zero value otherwise. +func (o *Listener) GetHttps() *ProtocolOptionsHTTPS { + if o == nil || IsNil(o.Https) { + var ret *ProtocolOptionsHTTPS + return ret + } + return o.Https +} + +// GetHttpsOk returns a tuple with the Https field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetHttpsOk() (*ProtocolOptionsHTTPS, bool) { + if o == nil || IsNil(o.Https) { + return nil, false + } + return o.Https, true +} + +// HasHttps returns a boolean if a field has been set. +func (o *Listener) HasHttps() bool { + if o != nil && !IsNil(o.Https) { + return true + } + + return false +} + +// SetHttps gets a reference to the given ProtocolOptionsHTTPS and assigns it to the Https field. +func (o *Listener) SetHttps(v *ProtocolOptionsHTTPS) { + o.Https = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Listener) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Listener) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Listener) SetName(v *string) { + o.Name = v +} + +// GetPort returns the Port field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Listener) GetPort() *interface{} { + if o == nil || IsNil(o.Port) { + var ret *interface{} + return ret + } + return o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Listener) GetPortOk() (*interface{}, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *Listener) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given interface{} and assigns it to the Port field. +func (o *Listener) SetPort(v *interface{}) { + o.Port = v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *Listener) GetProtocol() *string { + if o == nil || IsNil(o.Protocol) { + var ret *string + return ret + } + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetProtocolOk() (*string, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *Listener) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given string and assigns it to the Protocol field. +func (o *Listener) SetProtocol(v *string) { + o.Protocol = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *Listener) GetRules() *[]Rule { + if o == nil || IsNil(o.Rules) { + var ret *[]Rule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Listener) GetRulesOk() (*[]Rule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *Listener) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []Rule and assigns it to the Rules field. +func (o *Listener) SetRules(v *[]Rule) { + o.Rules = v +} + +func (o Listener) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Http) { + toSerialize["http"] = o.Http + } + if !IsNil(o.Https) { + toSerialize["https"] = o.Https + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Port != nil { + toSerialize["port"] = o.Port + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + return toSerialize, nil +} + +type NullableListener struct { + value *Listener + isSet bool +} + +func (v NullableListener) Get() *Listener { + return v.value +} + +func (v *NullableListener) Set(val *Listener) { + v.value = val + v.isSet = true +} + +func (v NullableListener) IsSet() bool { + return v.isSet +} + +func (v *NullableListener) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListener(val *Listener) *NullableListener { + return &NullableListener{value: val, isSet: true} +} + +func (v NullableListener) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListener) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_load_balancer.go b/services/lbapplication/model_load_balancer.go new file mode 100644 index 000000000..476d8bd26 --- /dev/null +++ b/services/lbapplication/model_load_balancer.go @@ -0,0 +1,485 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadBalancer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadBalancer{} + +// LoadBalancer struct for LoadBalancer +type LoadBalancer struct { + // Reports all errors a application load balancer has. + Errors *[]LoadBalancerError `json:"errors,omitempty"` + // External application load balancer IP address where this application load balancer is exposed. Not changeable after creation. + ExternalAddress *string `json:"externalAddress,omitempty"` + // There is a maximum listener count of 20. + Listeners *[]Listener `json:"listeners,omitempty"` + // Application Load Balancer name. Not changeable after creation. + Name *string `json:"name,omitempty"` + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. + Networks *[]Network `json:"networks,omitempty"` + Options *LoadBalancerOptions `json:"options,omitempty"` + // Service Plan configures the size of the Application Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. + PlanId *string `json:"planId,omitempty"` + // Transient private application load balancer IP address that can change any time. + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *string `json:"status,omitempty"` + // List of all target pools which will be used in the application load balancer. Limited to 20. + TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Application Load Balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this application load balancer resource that changes during updates of the load balancers. On updates this field specified the application load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a application load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of application load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` +} + +// NewLoadBalancer instantiates a new LoadBalancer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadBalancer() *LoadBalancer { + this := LoadBalancer{} + return &this +} + +// NewLoadBalancerWithDefaults instantiates a new LoadBalancer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadBalancerWithDefaults() *LoadBalancer { + this := LoadBalancer{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *LoadBalancer) GetErrors() *[]LoadBalancerError { + if o == nil || IsNil(o.Errors) { + var ret *[]LoadBalancerError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetErrorsOk() (*[]LoadBalancerError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *LoadBalancer) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []LoadBalancerError and assigns it to the Errors field. +func (o *LoadBalancer) SetErrors(v *[]LoadBalancerError) { + o.Errors = v +} + +// GetExternalAddress returns the ExternalAddress field value if set, zero value otherwise. +func (o *LoadBalancer) GetExternalAddress() *string { + if o == nil || IsNil(o.ExternalAddress) { + var ret *string + return ret + } + return o.ExternalAddress +} + +// GetExternalAddressOk returns a tuple with the ExternalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetExternalAddressOk() (*string, bool) { + if o == nil || IsNil(o.ExternalAddress) { + return nil, false + } + return o.ExternalAddress, true +} + +// HasExternalAddress returns a boolean if a field has been set. +func (o *LoadBalancer) HasExternalAddress() bool { + if o != nil && !IsNil(o.ExternalAddress) { + return true + } + + return false +} + +// SetExternalAddress gets a reference to the given string and assigns it to the ExternalAddress field. +func (o *LoadBalancer) SetExternalAddress(v *string) { + o.ExternalAddress = v +} + +// GetListeners returns the Listeners field value if set, zero value otherwise. +func (o *LoadBalancer) GetListeners() *[]Listener { + if o == nil || IsNil(o.Listeners) { + var ret *[]Listener + return ret + } + return o.Listeners +} + +// GetListenersOk returns a tuple with the Listeners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetListenersOk() (*[]Listener, bool) { + if o == nil || IsNil(o.Listeners) { + return nil, false + } + return o.Listeners, true +} + +// HasListeners returns a boolean if a field has been set. +func (o *LoadBalancer) HasListeners() bool { + if o != nil && !IsNil(o.Listeners) { + return true + } + + return false +} + +// SetListeners gets a reference to the given []Listener and assigns it to the Listeners field. +func (o *LoadBalancer) SetListeners(v *[]Listener) { + o.Listeners = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LoadBalancer) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LoadBalancer) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LoadBalancer) SetName(v *string) { + o.Name = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *LoadBalancer) GetNetworks() *[]Network { + if o == nil || IsNil(o.Networks) { + var ret *[]Network + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetNetworksOk() (*[]Network, bool) { + if o == nil || IsNil(o.Networks) { + return nil, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *LoadBalancer) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given []Network and assigns it to the Networks field. +func (o *LoadBalancer) SetNetworks(v *[]Network) { + o.Networks = v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *LoadBalancer) GetOptions() *LoadBalancerOptions { + if o == nil || IsNil(o.Options) { + var ret *LoadBalancerOptions + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetOptionsOk() (*LoadBalancerOptions, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *LoadBalancer) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given LoadBalancerOptions and assigns it to the Options field. +func (o *LoadBalancer) SetOptions(v *LoadBalancerOptions) { + o.Options = v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *LoadBalancer) GetPlanId() *string { + if o == nil || IsNil(o.PlanId) { + var ret *string + return ret + } + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *LoadBalancer) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *LoadBalancer) SetPlanId(v *string) { + o.PlanId = v +} + +// GetPrivateAddress returns the PrivateAddress field value if set, zero value otherwise. +func (o *LoadBalancer) GetPrivateAddress() *string { + if o == nil || IsNil(o.PrivateAddress) { + var ret *string + return ret + } + return o.PrivateAddress +} + +// GetPrivateAddressOk returns a tuple with the PrivateAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetPrivateAddressOk() (*string, bool) { + if o == nil || IsNil(o.PrivateAddress) { + return nil, false + } + return o.PrivateAddress, true +} + +// HasPrivateAddress returns a boolean if a field has been set. +func (o *LoadBalancer) HasPrivateAddress() bool { + if o != nil && !IsNil(o.PrivateAddress) { + return true + } + + return false +} + +// SetPrivateAddress gets a reference to the given string and assigns it to the PrivateAddress field. +func (o *LoadBalancer) SetPrivateAddress(v *string) { + o.PrivateAddress = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *LoadBalancer) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *LoadBalancer) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *LoadBalancer) SetStatus(v *string) { + o.Status = v +} + +// GetTargetPools returns the TargetPools field value if set, zero value otherwise. +func (o *LoadBalancer) GetTargetPools() *[]TargetPool { + if o == nil || IsNil(o.TargetPools) { + var ret *[]TargetPool + return ret + } + return o.TargetPools +} + +// GetTargetPoolsOk returns a tuple with the TargetPools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetTargetPoolsOk() (*[]TargetPool, bool) { + if o == nil || IsNil(o.TargetPools) { + return nil, false + } + return o.TargetPools, true +} + +// HasTargetPools returns a boolean if a field has been set. +func (o *LoadBalancer) HasTargetPools() bool { + if o != nil && !IsNil(o.TargetPools) { + return true + } + + return false +} + +// SetTargetPools gets a reference to the given []TargetPool and assigns it to the TargetPools field. +func (o *LoadBalancer) SetTargetPools(v *[]TargetPool) { + o.TargetPools = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *LoadBalancer) GetVersion() *string { + if o == nil || IsNil(o.Version) { + var ret *string + return ret + } + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancer) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *LoadBalancer) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *LoadBalancer) SetVersion(v *string) { + o.Version = v +} + +func (o LoadBalancer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.ExternalAddress) { + toSerialize["externalAddress"] = o.ExternalAddress + } + if !IsNil(o.Listeners) { + toSerialize["listeners"] = o.Listeners + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + if !IsNil(o.PrivateAddress) { + toSerialize["privateAddress"] = o.PrivateAddress + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TargetPools) { + toSerialize["targetPools"] = o.TargetPools + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableLoadBalancer struct { + value *LoadBalancer + isSet bool +} + +func (v NullableLoadBalancer) Get() *LoadBalancer { + return v.value +} + +func (v *NullableLoadBalancer) Set(val *LoadBalancer) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancer) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancer(val *LoadBalancer) *NullableLoadBalancer { + return &NullableLoadBalancer{value: val, isSet: true} +} + +func (v NullableLoadBalancer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_load_balancer_error.go b/services/lbapplication/model_load_balancer_error.go new file mode 100644 index 000000000..ffbfdabb2 --- /dev/null +++ b/services/lbapplication/model_load_balancer_error.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadBalancerError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadBalancerError{} + +// LoadBalancerError struct for LoadBalancerError +type LoadBalancerError struct { + // The error description contains additional helpful user information to fix the error state of the application load balancer. For example the IP 45.135.247.139 does not exist in the project, then the description will report: Floating IP \"45.135.247.139\" could not be found. + Description *string `json:"description,omitempty"` + // The error type specifies which part of the application load balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the application load balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error. + Type *string `json:"type,omitempty"` +} + +// NewLoadBalancerError instantiates a new LoadBalancerError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadBalancerError() *LoadBalancerError { + this := LoadBalancerError{} + return &this +} + +// NewLoadBalancerErrorWithDefaults instantiates a new LoadBalancerError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadBalancerErrorWithDefaults() *LoadBalancerError { + this := LoadBalancerError{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LoadBalancerError) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerError) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LoadBalancerError) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LoadBalancerError) SetDescription(v *string) { + o.Description = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LoadBalancerError) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerError) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *LoadBalancerError) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *LoadBalancerError) SetType(v *string) { + o.Type = v +} + +func (o LoadBalancerError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableLoadBalancerError struct { + value *LoadBalancerError + isSet bool +} + +func (v NullableLoadBalancerError) Get() *LoadBalancerError { + return v.value +} + +func (v *NullableLoadBalancerError) Set(val *LoadBalancerError) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerError) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerError(val *LoadBalancerError) *NullableLoadBalancerError { + return &NullableLoadBalancerError{value: val, isSet: true} +} + +func (v NullableLoadBalancerError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_load_balancer_options.go b/services/lbapplication/model_load_balancer_options.go new file mode 100644 index 000000000..58f200228 --- /dev/null +++ b/services/lbapplication/model_load_balancer_options.go @@ -0,0 +1,225 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadBalancerOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadBalancerOptions{} + +// LoadBalancerOptions Defines any optional functionality you want to have enabled on your application load balancer. +type LoadBalancerOptions struct { + AccessControl *LoadbalancerOptionAccessControl `json:"accessControl,omitempty"` + EphemeralAddress *bool `json:"ephemeralAddress,omitempty"` + Observability *LoadbalancerOptionObservability `json:"observability,omitempty"` + // Application Load Balancer is accessible only via a private network ip address. Not changeable after creation. + PrivateNetworkOnly *bool `json:"privateNetworkOnly,omitempty"` +} + +// NewLoadBalancerOptions instantiates a new LoadBalancerOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadBalancerOptions() *LoadBalancerOptions { + this := LoadBalancerOptions{} + return &this +} + +// NewLoadBalancerOptionsWithDefaults instantiates a new LoadBalancerOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadBalancerOptionsWithDefaults() *LoadBalancerOptions { + this := LoadBalancerOptions{} + return &this +} + +// GetAccessControl returns the AccessControl field value if set, zero value otherwise. +func (o *LoadBalancerOptions) GetAccessControl() *LoadbalancerOptionAccessControl { + if o == nil || IsNil(o.AccessControl) { + var ret *LoadbalancerOptionAccessControl + return ret + } + return o.AccessControl +} + +// GetAccessControlOk returns a tuple with the AccessControl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerOptions) GetAccessControlOk() (*LoadbalancerOptionAccessControl, bool) { + if o == nil || IsNil(o.AccessControl) { + return nil, false + } + return o.AccessControl, true +} + +// HasAccessControl returns a boolean if a field has been set. +func (o *LoadBalancerOptions) HasAccessControl() bool { + if o != nil && !IsNil(o.AccessControl) { + return true + } + + return false +} + +// SetAccessControl gets a reference to the given LoadbalancerOptionAccessControl and assigns it to the AccessControl field. +func (o *LoadBalancerOptions) SetAccessControl(v *LoadbalancerOptionAccessControl) { + o.AccessControl = v +} + +// GetEphemeralAddress returns the EphemeralAddress field value if set, zero value otherwise. +func (o *LoadBalancerOptions) GetEphemeralAddress() *bool { + if o == nil || IsNil(o.EphemeralAddress) { + var ret *bool + return ret + } + return o.EphemeralAddress +} + +// GetEphemeralAddressOk returns a tuple with the EphemeralAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerOptions) GetEphemeralAddressOk() (*bool, bool) { + if o == nil || IsNil(o.EphemeralAddress) { + return nil, false + } + return o.EphemeralAddress, true +} + +// HasEphemeralAddress returns a boolean if a field has been set. +func (o *LoadBalancerOptions) HasEphemeralAddress() bool { + if o != nil && !IsNil(o.EphemeralAddress) { + return true + } + + return false +} + +// SetEphemeralAddress gets a reference to the given bool and assigns it to the EphemeralAddress field. +func (o *LoadBalancerOptions) SetEphemeralAddress(v *bool) { + o.EphemeralAddress = v +} + +// GetObservability returns the Observability field value if set, zero value otherwise. +func (o *LoadBalancerOptions) GetObservability() *LoadbalancerOptionObservability { + if o == nil || IsNil(o.Observability) { + var ret *LoadbalancerOptionObservability + return ret + } + return o.Observability +} + +// GetObservabilityOk returns a tuple with the Observability field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerOptions) GetObservabilityOk() (*LoadbalancerOptionObservability, bool) { + if o == nil || IsNil(o.Observability) { + return nil, false + } + return o.Observability, true +} + +// HasObservability returns a boolean if a field has been set. +func (o *LoadBalancerOptions) HasObservability() bool { + if o != nil && !IsNil(o.Observability) { + return true + } + + return false +} + +// SetObservability gets a reference to the given LoadbalancerOptionObservability and assigns it to the Observability field. +func (o *LoadBalancerOptions) SetObservability(v *LoadbalancerOptionObservability) { + o.Observability = v +} + +// GetPrivateNetworkOnly returns the PrivateNetworkOnly field value if set, zero value otherwise. +func (o *LoadBalancerOptions) GetPrivateNetworkOnly() *bool { + if o == nil || IsNil(o.PrivateNetworkOnly) { + var ret *bool + return ret + } + return o.PrivateNetworkOnly +} + +// GetPrivateNetworkOnlyOk returns a tuple with the PrivateNetworkOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadBalancerOptions) GetPrivateNetworkOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.PrivateNetworkOnly) { + return nil, false + } + return o.PrivateNetworkOnly, true +} + +// HasPrivateNetworkOnly returns a boolean if a field has been set. +func (o *LoadBalancerOptions) HasPrivateNetworkOnly() bool { + if o != nil && !IsNil(o.PrivateNetworkOnly) { + return true + } + + return false +} + +// SetPrivateNetworkOnly gets a reference to the given bool and assigns it to the PrivateNetworkOnly field. +func (o *LoadBalancerOptions) SetPrivateNetworkOnly(v *bool) { + o.PrivateNetworkOnly = v +} + +func (o LoadBalancerOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessControl) { + toSerialize["accessControl"] = o.AccessControl + } + if !IsNil(o.EphemeralAddress) { + toSerialize["ephemeralAddress"] = o.EphemeralAddress + } + if !IsNil(o.Observability) { + toSerialize["observability"] = o.Observability + } + if !IsNil(o.PrivateNetworkOnly) { + toSerialize["privateNetworkOnly"] = o.PrivateNetworkOnly + } + return toSerialize, nil +} + +type NullableLoadBalancerOptions struct { + value *LoadBalancerOptions + isSet bool +} + +func (v NullableLoadBalancerOptions) Get() *LoadBalancerOptions { + return v.value +} + +func (v *NullableLoadBalancerOptions) Set(val *LoadBalancerOptions) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerOptions(val *LoadBalancerOptions) *NullableLoadBalancerOptions { + return &NullableLoadBalancerOptions{value: val, isSet: true} +} + +func (v NullableLoadBalancerOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_loadbalancer_option_access_control.go b/services/lbapplication/model_loadbalancer_option_access_control.go new file mode 100644 index 000000000..837d64342 --- /dev/null +++ b/services/lbapplication/model_loadbalancer_option_access_control.go @@ -0,0 +1,117 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadbalancerOptionAccessControl type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadbalancerOptionAccessControl{} + +// LoadbalancerOptionAccessControl Use this option to limit the IP ranges that can use the application load balancer. +type LoadbalancerOptionAccessControl struct { + // Application Load Balancer is accessible only from an IP address in this range + AllowedSourceRanges *[]string `json:"allowedSourceRanges,omitempty"` +} + +// NewLoadbalancerOptionAccessControl instantiates a new LoadbalancerOptionAccessControl object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadbalancerOptionAccessControl() *LoadbalancerOptionAccessControl { + this := LoadbalancerOptionAccessControl{} + return &this +} + +// NewLoadbalancerOptionAccessControlWithDefaults instantiates a new LoadbalancerOptionAccessControl object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadbalancerOptionAccessControlWithDefaults() *LoadbalancerOptionAccessControl { + this := LoadbalancerOptionAccessControl{} + return &this +} + +// GetAllowedSourceRanges returns the AllowedSourceRanges field value if set, zero value otherwise. +func (o *LoadbalancerOptionAccessControl) GetAllowedSourceRanges() *[]string { + if o == nil || IsNil(o.AllowedSourceRanges) { + var ret *[]string + return ret + } + return o.AllowedSourceRanges +} + +// GetAllowedSourceRangesOk returns a tuple with the AllowedSourceRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionAccessControl) GetAllowedSourceRangesOk() (*[]string, bool) { + if o == nil || IsNil(o.AllowedSourceRanges) { + return nil, false + } + return o.AllowedSourceRanges, true +} + +// HasAllowedSourceRanges returns a boolean if a field has been set. +func (o *LoadbalancerOptionAccessControl) HasAllowedSourceRanges() bool { + if o != nil && !IsNil(o.AllowedSourceRanges) { + return true + } + + return false +} + +// SetAllowedSourceRanges gets a reference to the given []string and assigns it to the AllowedSourceRanges field. +func (o *LoadbalancerOptionAccessControl) SetAllowedSourceRanges(v *[]string) { + o.AllowedSourceRanges = v +} + +func (o LoadbalancerOptionAccessControl) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedSourceRanges) { + toSerialize["allowedSourceRanges"] = o.AllowedSourceRanges + } + return toSerialize, nil +} + +type NullableLoadbalancerOptionAccessControl struct { + value *LoadbalancerOptionAccessControl + isSet bool +} + +func (v NullableLoadbalancerOptionAccessControl) Get() *LoadbalancerOptionAccessControl { + return v.value +} + +func (v *NullableLoadbalancerOptionAccessControl) Set(val *LoadbalancerOptionAccessControl) { + v.value = val + v.isSet = true +} + +func (v NullableLoadbalancerOptionAccessControl) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadbalancerOptionAccessControl) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadbalancerOptionAccessControl(val *LoadbalancerOptionAccessControl) *NullableLoadbalancerOptionAccessControl { + return &NullableLoadbalancerOptionAccessControl{value: val, isSet: true} +} + +func (v NullableLoadbalancerOptionAccessControl) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadbalancerOptionAccessControl) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_loadbalancer_option_logs.go b/services/lbapplication/model_loadbalancer_option_logs.go new file mode 100644 index 000000000..341116e32 --- /dev/null +++ b/services/lbapplication/model_loadbalancer_option_logs.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadbalancerOptionLogs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadbalancerOptionLogs{} + +// LoadbalancerOptionLogs struct for LoadbalancerOptionLogs +type LoadbalancerOptionLogs struct { + // Credentials reference for logging. This reference is created via the observability create endpoint and the credential needs to contain the basic auth username and password for the logging solution the push URL points to. Then this enables monitoring via remote write for the Application Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // The ARGUS/Loki remote write Push URL you want the logs to be shipped to. + PushUrl *string `json:"pushUrl,omitempty"` +} + +// NewLoadbalancerOptionLogs instantiates a new LoadbalancerOptionLogs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadbalancerOptionLogs() *LoadbalancerOptionLogs { + this := LoadbalancerOptionLogs{} + return &this +} + +// NewLoadbalancerOptionLogsWithDefaults instantiates a new LoadbalancerOptionLogs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadbalancerOptionLogsWithDefaults() *LoadbalancerOptionLogs { + this := LoadbalancerOptionLogs{} + return &this +} + +// GetCredentialsRef returns the CredentialsRef field value if set, zero value otherwise. +func (o *LoadbalancerOptionLogs) GetCredentialsRef() *string { + if o == nil || IsNil(o.CredentialsRef) { + var ret *string + return ret + } + return o.CredentialsRef +} + +// GetCredentialsRefOk returns a tuple with the CredentialsRef field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionLogs) GetCredentialsRefOk() (*string, bool) { + if o == nil || IsNil(o.CredentialsRef) { + return nil, false + } + return o.CredentialsRef, true +} + +// HasCredentialsRef returns a boolean if a field has been set. +func (o *LoadbalancerOptionLogs) HasCredentialsRef() bool { + if o != nil && !IsNil(o.CredentialsRef) { + return true + } + + return false +} + +// SetCredentialsRef gets a reference to the given string and assigns it to the CredentialsRef field. +func (o *LoadbalancerOptionLogs) SetCredentialsRef(v *string) { + o.CredentialsRef = v +} + +// GetPushUrl returns the PushUrl field value if set, zero value otherwise. +func (o *LoadbalancerOptionLogs) GetPushUrl() *string { + if o == nil || IsNil(o.PushUrl) { + var ret *string + return ret + } + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionLogs) GetPushUrlOk() (*string, bool) { + if o == nil || IsNil(o.PushUrl) { + return nil, false + } + return o.PushUrl, true +} + +// HasPushUrl returns a boolean if a field has been set. +func (o *LoadbalancerOptionLogs) HasPushUrl() bool { + if o != nil && !IsNil(o.PushUrl) { + return true + } + + return false +} + +// SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. +func (o *LoadbalancerOptionLogs) SetPushUrl(v *string) { + o.PushUrl = v +} + +func (o LoadbalancerOptionLogs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CredentialsRef) { + toSerialize["credentialsRef"] = o.CredentialsRef + } + if !IsNil(o.PushUrl) { + toSerialize["pushUrl"] = o.PushUrl + } + return toSerialize, nil +} + +type NullableLoadbalancerOptionLogs struct { + value *LoadbalancerOptionLogs + isSet bool +} + +func (v NullableLoadbalancerOptionLogs) Get() *LoadbalancerOptionLogs { + return v.value +} + +func (v *NullableLoadbalancerOptionLogs) Set(val *LoadbalancerOptionLogs) { + v.value = val + v.isSet = true +} + +func (v NullableLoadbalancerOptionLogs) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadbalancerOptionLogs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadbalancerOptionLogs(val *LoadbalancerOptionLogs) *NullableLoadbalancerOptionLogs { + return &NullableLoadbalancerOptionLogs{value: val, isSet: true} +} + +func (v NullableLoadbalancerOptionLogs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadbalancerOptionLogs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_loadbalancer_option_metrics.go b/services/lbapplication/model_loadbalancer_option_metrics.go new file mode 100644 index 000000000..a79db913b --- /dev/null +++ b/services/lbapplication/model_loadbalancer_option_metrics.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadbalancerOptionMetrics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadbalancerOptionMetrics{} + +// LoadbalancerOptionMetrics struct for LoadbalancerOptionMetrics +type LoadbalancerOptionMetrics struct { + // Credentials reference for metrics. This reference is created via the observability create endpoint and the credential needs to contain the basic auth username and password for the metrics solution the push URL points to. Then this enables monitoring via remote write for the Application Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // The ARGUS/Prometheus remote write Push URL you want the metrics to be shipped to. + PushUrl *string `json:"pushUrl,omitempty"` +} + +// NewLoadbalancerOptionMetrics instantiates a new LoadbalancerOptionMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadbalancerOptionMetrics() *LoadbalancerOptionMetrics { + this := LoadbalancerOptionMetrics{} + return &this +} + +// NewLoadbalancerOptionMetricsWithDefaults instantiates a new LoadbalancerOptionMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadbalancerOptionMetricsWithDefaults() *LoadbalancerOptionMetrics { + this := LoadbalancerOptionMetrics{} + return &this +} + +// GetCredentialsRef returns the CredentialsRef field value if set, zero value otherwise. +func (o *LoadbalancerOptionMetrics) GetCredentialsRef() *string { + if o == nil || IsNil(o.CredentialsRef) { + var ret *string + return ret + } + return o.CredentialsRef +} + +// GetCredentialsRefOk returns a tuple with the CredentialsRef field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionMetrics) GetCredentialsRefOk() (*string, bool) { + if o == nil || IsNil(o.CredentialsRef) { + return nil, false + } + return o.CredentialsRef, true +} + +// HasCredentialsRef returns a boolean if a field has been set. +func (o *LoadbalancerOptionMetrics) HasCredentialsRef() bool { + if o != nil && !IsNil(o.CredentialsRef) { + return true + } + + return false +} + +// SetCredentialsRef gets a reference to the given string and assigns it to the CredentialsRef field. +func (o *LoadbalancerOptionMetrics) SetCredentialsRef(v *string) { + o.CredentialsRef = v +} + +// GetPushUrl returns the PushUrl field value if set, zero value otherwise. +func (o *LoadbalancerOptionMetrics) GetPushUrl() *string { + if o == nil || IsNil(o.PushUrl) { + var ret *string + return ret + } + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionMetrics) GetPushUrlOk() (*string, bool) { + if o == nil || IsNil(o.PushUrl) { + return nil, false + } + return o.PushUrl, true +} + +// HasPushUrl returns a boolean if a field has been set. +func (o *LoadbalancerOptionMetrics) HasPushUrl() bool { + if o != nil && !IsNil(o.PushUrl) { + return true + } + + return false +} + +// SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. +func (o *LoadbalancerOptionMetrics) SetPushUrl(v *string) { + o.PushUrl = v +} + +func (o LoadbalancerOptionMetrics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CredentialsRef) { + toSerialize["credentialsRef"] = o.CredentialsRef + } + if !IsNil(o.PushUrl) { + toSerialize["pushUrl"] = o.PushUrl + } + return toSerialize, nil +} + +type NullableLoadbalancerOptionMetrics struct { + value *LoadbalancerOptionMetrics + isSet bool +} + +func (v NullableLoadbalancerOptionMetrics) Get() *LoadbalancerOptionMetrics { + return v.value +} + +func (v *NullableLoadbalancerOptionMetrics) Set(val *LoadbalancerOptionMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableLoadbalancerOptionMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadbalancerOptionMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadbalancerOptionMetrics(val *LoadbalancerOptionMetrics) *NullableLoadbalancerOptionMetrics { + return &NullableLoadbalancerOptionMetrics{value: val, isSet: true} +} + +func (v NullableLoadbalancerOptionMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadbalancerOptionMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_loadbalancer_option_observability.go b/services/lbapplication/model_loadbalancer_option_observability.go new file mode 100644 index 000000000..9fed6ed40 --- /dev/null +++ b/services/lbapplication/model_loadbalancer_option_observability.go @@ -0,0 +1,152 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the LoadbalancerOptionObservability type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoadbalancerOptionObservability{} + +// LoadbalancerOptionObservability We offer Application Load Balancer metrics observability via ARGUS or external solutions. Not changeable after creation. +type LoadbalancerOptionObservability struct { + Logs *LoadbalancerOptionLogs `json:"logs,omitempty"` + Metrics *LoadbalancerOptionMetrics `json:"metrics,omitempty"` +} + +// NewLoadbalancerOptionObservability instantiates a new LoadbalancerOptionObservability object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadbalancerOptionObservability() *LoadbalancerOptionObservability { + this := LoadbalancerOptionObservability{} + return &this +} + +// NewLoadbalancerOptionObservabilityWithDefaults instantiates a new LoadbalancerOptionObservability object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadbalancerOptionObservabilityWithDefaults() *LoadbalancerOptionObservability { + this := LoadbalancerOptionObservability{} + return &this +} + +// GetLogs returns the Logs field value if set, zero value otherwise. +func (o *LoadbalancerOptionObservability) GetLogs() *LoadbalancerOptionLogs { + if o == nil || IsNil(o.Logs) { + var ret *LoadbalancerOptionLogs + return ret + } + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionObservability) GetLogsOk() (*LoadbalancerOptionLogs, bool) { + if o == nil || IsNil(o.Logs) { + return nil, false + } + return o.Logs, true +} + +// HasLogs returns a boolean if a field has been set. +func (o *LoadbalancerOptionObservability) HasLogs() bool { + if o != nil && !IsNil(o.Logs) { + return true + } + + return false +} + +// SetLogs gets a reference to the given LoadbalancerOptionLogs and assigns it to the Logs field. +func (o *LoadbalancerOptionObservability) SetLogs(v *LoadbalancerOptionLogs) { + o.Logs = v +} + +// GetMetrics returns the Metrics field value if set, zero value otherwise. +func (o *LoadbalancerOptionObservability) GetMetrics() *LoadbalancerOptionMetrics { + if o == nil || IsNil(o.Metrics) { + var ret *LoadbalancerOptionMetrics + return ret + } + return o.Metrics +} + +// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoadbalancerOptionObservability) GetMetricsOk() (*LoadbalancerOptionMetrics, bool) { + if o == nil || IsNil(o.Metrics) { + return nil, false + } + return o.Metrics, true +} + +// HasMetrics returns a boolean if a field has been set. +func (o *LoadbalancerOptionObservability) HasMetrics() bool { + if o != nil && !IsNil(o.Metrics) { + return true + } + + return false +} + +// SetMetrics gets a reference to the given LoadbalancerOptionMetrics and assigns it to the Metrics field. +func (o *LoadbalancerOptionObservability) SetMetrics(v *LoadbalancerOptionMetrics) { + o.Metrics = v +} + +func (o LoadbalancerOptionObservability) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Logs) { + toSerialize["logs"] = o.Logs + } + if !IsNil(o.Metrics) { + toSerialize["metrics"] = o.Metrics + } + return toSerialize, nil +} + +type NullableLoadbalancerOptionObservability struct { + value *LoadbalancerOptionObservability + isSet bool +} + +func (v NullableLoadbalancerOptionObservability) Get() *LoadbalancerOptionObservability { + return v.value +} + +func (v *NullableLoadbalancerOptionObservability) Set(val *LoadbalancerOptionObservability) { + v.value = val + v.isSet = true +} + +func (v NullableLoadbalancerOptionObservability) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadbalancerOptionObservability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadbalancerOptionObservability(val *LoadbalancerOptionObservability) *NullableLoadbalancerOptionObservability { + return &NullableLoadbalancerOptionObservability{value: val, isSet: true} +} + +func (v NullableLoadbalancerOptionObservability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadbalancerOptionObservability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_matcher.go b/services/lbapplication/model_matcher.go new file mode 100644 index 000000000..183945b06 --- /dev/null +++ b/services/lbapplication/model_matcher.go @@ -0,0 +1,301 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Matcher type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Matcher{} + +// Matcher struct for Matcher +type Matcher struct { + CookiePersistence *CookiePersistence `json:"cookiePersistence,omitempty"` + // Headers for the matcher + Headers *[]Header `json:"headers,omitempty"` + // Path prefix for the matcher + PathPrefix *string `json:"pathPrefix,omitempty"` + // Query Parameters for the matcher + QueryParameters *[]QueryParameters `json:"queryParameters,omitempty"` + // Reference target pool by target pool name. + TargetPool *string `json:"targetPool,omitempty"` + // If enabled, when client sends an HTTP request with and Upgrade header, indicating the desire to establish a Websocket connection, if backend server supports WebSocket, it responds with HTTP 101 status code, switching protocols from HTTP to WebSocket. Hence the client and the server can exchange data in real-time using one long-lived TCP connection. + WebSocket *bool `json:"webSocket,omitempty"` +} + +// NewMatcher instantiates a new Matcher object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMatcher() *Matcher { + this := Matcher{} + return &this +} + +// NewMatcherWithDefaults instantiates a new Matcher object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMatcherWithDefaults() *Matcher { + this := Matcher{} + return &this +} + +// GetCookiePersistence returns the CookiePersistence field value if set, zero value otherwise. +func (o *Matcher) GetCookiePersistence() *CookiePersistence { + if o == nil || IsNil(o.CookiePersistence) { + var ret *CookiePersistence + return ret + } + return o.CookiePersistence +} + +// GetCookiePersistenceOk returns a tuple with the CookiePersistence field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetCookiePersistenceOk() (*CookiePersistence, bool) { + if o == nil || IsNil(o.CookiePersistence) { + return nil, false + } + return o.CookiePersistence, true +} + +// HasCookiePersistence returns a boolean if a field has been set. +func (o *Matcher) HasCookiePersistence() bool { + if o != nil && !IsNil(o.CookiePersistence) { + return true + } + + return false +} + +// SetCookiePersistence gets a reference to the given CookiePersistence and assigns it to the CookiePersistence field. +func (o *Matcher) SetCookiePersistence(v *CookiePersistence) { + o.CookiePersistence = v +} + +// GetHeaders returns the Headers field value if set, zero value otherwise. +func (o *Matcher) GetHeaders() *[]Header { + if o == nil || IsNil(o.Headers) { + var ret *[]Header + return ret + } + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetHeadersOk() (*[]Header, bool) { + if o == nil || IsNil(o.Headers) { + return nil, false + } + return o.Headers, true +} + +// HasHeaders returns a boolean if a field has been set. +func (o *Matcher) HasHeaders() bool { + if o != nil && !IsNil(o.Headers) { + return true + } + + return false +} + +// SetHeaders gets a reference to the given []Header and assigns it to the Headers field. +func (o *Matcher) SetHeaders(v *[]Header) { + o.Headers = v +} + +// GetPathPrefix returns the PathPrefix field value if set, zero value otherwise. +func (o *Matcher) GetPathPrefix() *string { + if o == nil || IsNil(o.PathPrefix) { + var ret *string + return ret + } + return o.PathPrefix +} + +// GetPathPrefixOk returns a tuple with the PathPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetPathPrefixOk() (*string, bool) { + if o == nil || IsNil(o.PathPrefix) { + return nil, false + } + return o.PathPrefix, true +} + +// HasPathPrefix returns a boolean if a field has been set. +func (o *Matcher) HasPathPrefix() bool { + if o != nil && !IsNil(o.PathPrefix) { + return true + } + + return false +} + +// SetPathPrefix gets a reference to the given string and assigns it to the PathPrefix field. +func (o *Matcher) SetPathPrefix(v *string) { + o.PathPrefix = v +} + +// GetQueryParameters returns the QueryParameters field value if set, zero value otherwise. +func (o *Matcher) GetQueryParameters() *[]QueryParameters { + if o == nil || IsNil(o.QueryParameters) { + var ret *[]QueryParameters + return ret + } + return o.QueryParameters +} + +// GetQueryParametersOk returns a tuple with the QueryParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetQueryParametersOk() (*[]QueryParameters, bool) { + if o == nil || IsNil(o.QueryParameters) { + return nil, false + } + return o.QueryParameters, true +} + +// HasQueryParameters returns a boolean if a field has been set. +func (o *Matcher) HasQueryParameters() bool { + if o != nil && !IsNil(o.QueryParameters) { + return true + } + + return false +} + +// SetQueryParameters gets a reference to the given []QueryParameters and assigns it to the QueryParameters field. +func (o *Matcher) SetQueryParameters(v *[]QueryParameters) { + o.QueryParameters = v +} + +// GetTargetPool returns the TargetPool field value if set, zero value otherwise. +func (o *Matcher) GetTargetPool() *string { + if o == nil || IsNil(o.TargetPool) { + var ret *string + return ret + } + return o.TargetPool +} + +// GetTargetPoolOk returns a tuple with the TargetPool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetTargetPoolOk() (*string, bool) { + if o == nil || IsNil(o.TargetPool) { + return nil, false + } + return o.TargetPool, true +} + +// HasTargetPool returns a boolean if a field has been set. +func (o *Matcher) HasTargetPool() bool { + if o != nil && !IsNil(o.TargetPool) { + return true + } + + return false +} + +// SetTargetPool gets a reference to the given string and assigns it to the TargetPool field. +func (o *Matcher) SetTargetPool(v *string) { + o.TargetPool = v +} + +// GetWebSocket returns the WebSocket field value if set, zero value otherwise. +func (o *Matcher) GetWebSocket() *bool { + if o == nil || IsNil(o.WebSocket) { + var ret *bool + return ret + } + return o.WebSocket +} + +// GetWebSocketOk returns a tuple with the WebSocket field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetWebSocketOk() (*bool, bool) { + if o == nil || IsNil(o.WebSocket) { + return nil, false + } + return o.WebSocket, true +} + +// HasWebSocket returns a boolean if a field has been set. +func (o *Matcher) HasWebSocket() bool { + if o != nil && !IsNil(o.WebSocket) { + return true + } + + return false +} + +// SetWebSocket gets a reference to the given bool and assigns it to the WebSocket field. +func (o *Matcher) SetWebSocket(v *bool) { + o.WebSocket = v +} + +func (o Matcher) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CookiePersistence) { + toSerialize["cookiePersistence"] = o.CookiePersistence + } + if !IsNil(o.Headers) { + toSerialize["headers"] = o.Headers + } + if !IsNil(o.PathPrefix) { + toSerialize["pathPrefix"] = o.PathPrefix + } + if !IsNil(o.QueryParameters) { + toSerialize["queryParameters"] = o.QueryParameters + } + if !IsNil(o.TargetPool) { + toSerialize["targetPool"] = o.TargetPool + } + if !IsNil(o.WebSocket) { + toSerialize["webSocket"] = o.WebSocket + } + return toSerialize, nil +} + +type NullableMatcher struct { + value *Matcher + isSet bool +} + +func (v NullableMatcher) Get() *Matcher { + return v.value +} + +func (v *NullableMatcher) Set(val *Matcher) { + v.value = val + v.isSet = true +} + +func (v NullableMatcher) IsSet() bool { + return v.isSet +} + +func (v *NullableMatcher) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMatcher(val *Matcher) *NullableMatcher { + return &NullableMatcher{value: val, isSet: true} +} + +func (v NullableMatcher) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMatcher) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_network.go b/services/lbapplication/model_network.go new file mode 100644 index 000000000..075d1df8e --- /dev/null +++ b/services/lbapplication/model_network.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Network type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Network{} + +// Network struct for Network +type Network struct { + // Openstack network ID + NetworkId *string `json:"networkId,omitempty"` + // The role defines how the Application Load Balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. + Role *string `json:"role,omitempty"` +} + +// NewNetwork instantiates a new Network object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetwork() *Network { + this := Network{} + return &this +} + +// NewNetworkWithDefaults instantiates a new Network object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkWithDefaults() *Network { + this := Network{} + return &this +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *Network) GetNetworkId() *string { + if o == nil || IsNil(o.NetworkId) { + var ret *string + return ret + } + return o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *Network) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *Network) SetNetworkId(v *string) { + o.NetworkId = v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *Network) GetRole() *string { + if o == nil || IsNil(o.Role) { + var ret *string + return ret + } + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoleOk() (*string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *Network) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *Network) SetRole(v *string) { + o.Role = v +} + +func (o Network) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + return toSerialize, nil +} + +type NullableNetwork struct { + value *Network + isSet bool +} + +func (v NullableNetwork) Get() *Network { + return v.value +} + +func (v *NullableNetwork) Set(val *Network) { + v.value = val + v.isSet = true +} + +func (v NullableNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetwork(val *Network) *NullableNetwork { + return &NullableNetwork{value: val, isSet: true} +} + +func (v NullableNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_plan_details.go b/services/lbapplication/model_plan_details.go new file mode 100644 index 000000000..1cf0650aa --- /dev/null +++ b/services/lbapplication/model_plan_details.go @@ -0,0 +1,266 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the PlanDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanDetails{} + +// PlanDetails struct for PlanDetails +type PlanDetails struct { + // Description + Description *string `json:"description,omitempty"` + // Flavor Name + FlavorName *string `json:"flavorName,omitempty"` + // Maximum number of concurrent connections per application load balancer VM instance. + MaxConnections *interface{} `json:"maxConnections,omitempty"` + // Service Plan Name + Name *string `json:"name,omitempty"` + // Service Plan Identifier + PlanId *string `json:"planId,omitempty"` +} + +// NewPlanDetails instantiates a new PlanDetails object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanDetails() *PlanDetails { + this := PlanDetails{} + return &this +} + +// NewPlanDetailsWithDefaults instantiates a new PlanDetails object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanDetailsWithDefaults() *PlanDetails { + this := PlanDetails{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PlanDetails) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanDetails) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PlanDetails) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PlanDetails) SetDescription(v *string) { + o.Description = v +} + +// GetFlavorName returns the FlavorName field value if set, zero value otherwise. +func (o *PlanDetails) GetFlavorName() *string { + if o == nil || IsNil(o.FlavorName) { + var ret *string + return ret + } + return o.FlavorName +} + +// GetFlavorNameOk returns a tuple with the FlavorName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanDetails) GetFlavorNameOk() (*string, bool) { + if o == nil || IsNil(o.FlavorName) { + return nil, false + } + return o.FlavorName, true +} + +// HasFlavorName returns a boolean if a field has been set. +func (o *PlanDetails) HasFlavorName() bool { + if o != nil && !IsNil(o.FlavorName) { + return true + } + + return false +} + +// SetFlavorName gets a reference to the given string and assigns it to the FlavorName field. +func (o *PlanDetails) SetFlavorName(v *string) { + o.FlavorName = v +} + +// GetMaxConnections returns the MaxConnections field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlanDetails) GetMaxConnections() *interface{} { + if o == nil || IsNil(o.MaxConnections) { + var ret *interface{} + return ret + } + return o.MaxConnections +} + +// GetMaxConnectionsOk returns a tuple with the MaxConnections field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlanDetails) GetMaxConnectionsOk() (*interface{}, bool) { + if o == nil || IsNil(o.MaxConnections) { + return nil, false + } + return o.MaxConnections, true +} + +// HasMaxConnections returns a boolean if a field has been set. +func (o *PlanDetails) HasMaxConnections() bool { + if o != nil && !IsNil(o.MaxConnections) { + return true + } + + return false +} + +// SetMaxConnections gets a reference to the given interface{} and assigns it to the MaxConnections field. +func (o *PlanDetails) SetMaxConnections(v *interface{}) { + o.MaxConnections = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PlanDetails) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanDetails) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PlanDetails) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PlanDetails) SetName(v *string) { + o.Name = v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *PlanDetails) GetPlanId() *string { + if o == nil || IsNil(o.PlanId) { + var ret *string + return ret + } + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanDetails) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *PlanDetails) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *PlanDetails) SetPlanId(v *string) { + o.PlanId = v +} + +func (o PlanDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.FlavorName) { + toSerialize["flavorName"] = o.FlavorName + } + if o.MaxConnections != nil { + toSerialize["maxConnections"] = o.MaxConnections + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + return toSerialize, nil +} + +type NullablePlanDetails struct { + value *PlanDetails + isSet bool +} + +func (v NullablePlanDetails) Get() *PlanDetails { + return v.value +} + +func (v *NullablePlanDetails) Set(val *PlanDetails) { + v.value = val + v.isSet = true +} + +func (v NullablePlanDetails) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanDetails(val *PlanDetails) *NullablePlanDetails { + return &NullablePlanDetails{value: val, isSet: true} +} + +func (v NullablePlanDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_protocol_options_https.go b/services/lbapplication/model_protocol_options_https.go new file mode 100644 index 000000000..dc841d519 --- /dev/null +++ b/services/lbapplication/model_protocol_options_https.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the ProtocolOptionsHTTPS type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProtocolOptionsHTTPS{} + +// ProtocolOptionsHTTPS struct for ProtocolOptionsHTTPS +type ProtocolOptionsHTTPS struct { + CertificateConfig *CertificateConfig `json:"certificateConfig,omitempty"` +} + +// NewProtocolOptionsHTTPS instantiates a new ProtocolOptionsHTTPS object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProtocolOptionsHTTPS() *ProtocolOptionsHTTPS { + this := ProtocolOptionsHTTPS{} + return &this +} + +// NewProtocolOptionsHTTPSWithDefaults instantiates a new ProtocolOptionsHTTPS object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProtocolOptionsHTTPSWithDefaults() *ProtocolOptionsHTTPS { + this := ProtocolOptionsHTTPS{} + return &this +} + +// GetCertificateConfig returns the CertificateConfig field value if set, zero value otherwise. +func (o *ProtocolOptionsHTTPS) GetCertificateConfig() *CertificateConfig { + if o == nil || IsNil(o.CertificateConfig) { + var ret *CertificateConfig + return ret + } + return o.CertificateConfig +} + +// GetCertificateConfigOk returns a tuple with the CertificateConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolOptionsHTTPS) GetCertificateConfigOk() (*CertificateConfig, bool) { + if o == nil || IsNil(o.CertificateConfig) { + return nil, false + } + return o.CertificateConfig, true +} + +// HasCertificateConfig returns a boolean if a field has been set. +func (o *ProtocolOptionsHTTPS) HasCertificateConfig() bool { + if o != nil && !IsNil(o.CertificateConfig) { + return true + } + + return false +} + +// SetCertificateConfig gets a reference to the given CertificateConfig and assigns it to the CertificateConfig field. +func (o *ProtocolOptionsHTTPS) SetCertificateConfig(v *CertificateConfig) { + o.CertificateConfig = v +} + +func (o ProtocolOptionsHTTPS) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CertificateConfig) { + toSerialize["certificateConfig"] = o.CertificateConfig + } + return toSerialize, nil +} + +type NullableProtocolOptionsHTTPS struct { + value *ProtocolOptionsHTTPS + isSet bool +} + +func (v NullableProtocolOptionsHTTPS) Get() *ProtocolOptionsHTTPS { + return v.value +} + +func (v *NullableProtocolOptionsHTTPS) Set(val *ProtocolOptionsHTTPS) { + v.value = val + v.isSet = true +} + +func (v NullableProtocolOptionsHTTPS) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocolOptionsHTTPS) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocolOptionsHTTPS(val *ProtocolOptionsHTTPS) *NullableProtocolOptionsHTTPS { + return &NullableProtocolOptionsHTTPS{value: val, isSet: true} +} + +func (v NullableProtocolOptionsHTTPS) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocolOptionsHTTPS) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_query_parameters.go b/services/lbapplication/model_query_parameters.go new file mode 100644 index 000000000..69db2ed5d --- /dev/null +++ b/services/lbapplication/model_query_parameters.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the QueryParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QueryParameters{} + +// QueryParameters struct for QueryParameters +type QueryParameters struct { + // Exact match for the parameter value + ExactMatch *string `json:"exactMatch,omitempty"` + // Parameter name + Name *string `json:"name,omitempty"` +} + +// NewQueryParameters instantiates a new QueryParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQueryParameters() *QueryParameters { + this := QueryParameters{} + return &this +} + +// NewQueryParametersWithDefaults instantiates a new QueryParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQueryParametersWithDefaults() *QueryParameters { + this := QueryParameters{} + return &this +} + +// GetExactMatch returns the ExactMatch field value if set, zero value otherwise. +func (o *QueryParameters) GetExactMatch() *string { + if o == nil || IsNil(o.ExactMatch) { + var ret *string + return ret + } + return o.ExactMatch +} + +// GetExactMatchOk returns a tuple with the ExactMatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryParameters) GetExactMatchOk() (*string, bool) { + if o == nil || IsNil(o.ExactMatch) { + return nil, false + } + return o.ExactMatch, true +} + +// HasExactMatch returns a boolean if a field has been set. +func (o *QueryParameters) HasExactMatch() bool { + if o != nil && !IsNil(o.ExactMatch) { + return true + } + + return false +} + +// SetExactMatch gets a reference to the given string and assigns it to the ExactMatch field. +func (o *QueryParameters) SetExactMatch(v *string) { + o.ExactMatch = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *QueryParameters) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryParameters) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *QueryParameters) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *QueryParameters) SetName(v *string) { + o.Name = v +} + +func (o QueryParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ExactMatch) { + toSerialize["exactMatch"] = o.ExactMatch + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableQueryParameters struct { + value *QueryParameters + isSet bool +} + +func (v NullableQueryParameters) Get() *QueryParameters { + return v.value +} + +func (v *NullableQueryParameters) Set(val *QueryParameters) { + v.value = val + v.isSet = true +} + +func (v NullableQueryParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableQueryParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQueryParameters(val *QueryParameters) *NullableQueryParameters { + return &NullableQueryParameters{value: val, isSet: true} +} + +func (v NullableQueryParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQueryParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_rule.go b/services/lbapplication/model_rule.go new file mode 100644 index 000000000..b0237c17e --- /dev/null +++ b/services/lbapplication/model_rule.go @@ -0,0 +1,153 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Rule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Rule{} + +// Rule struct for Rule +type Rule struct { + // Host for the rule + Host *string `json:"host,omitempty"` + Http *HTTPConfig `json:"http,omitempty"` +} + +// NewRule instantiates a new Rule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRule() *Rule { + this := Rule{} + return &this +} + +// NewRuleWithDefaults instantiates a new Rule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRuleWithDefaults() *Rule { + this := Rule{} + return &this +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *Rule) GetHost() *string { + if o == nil || IsNil(o.Host) { + var ret *string + return ret + } + return o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rule) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *Rule) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *Rule) SetHost(v *string) { + o.Host = v +} + +// GetHttp returns the Http field value if set, zero value otherwise. +func (o *Rule) GetHttp() *HTTPConfig { + if o == nil || IsNil(o.Http) { + var ret *HTTPConfig + return ret + } + return o.Http +} + +// GetHttpOk returns a tuple with the Http field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rule) GetHttpOk() (*HTTPConfig, bool) { + if o == nil || IsNil(o.Http) { + return nil, false + } + return o.Http, true +} + +// HasHttp returns a boolean if a field has been set. +func (o *Rule) HasHttp() bool { + if o != nil && !IsNil(o.Http) { + return true + } + + return false +} + +// SetHttp gets a reference to the given HTTPConfig and assigns it to the Http field. +func (o *Rule) SetHttp(v *HTTPConfig) { + o.Http = v +} + +func (o Rule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Http) { + toSerialize["http"] = o.Http + } + return toSerialize, nil +} + +type NullableRule struct { + value *Rule + isSet bool +} + +func (v NullableRule) Get() *Rule { + return v.value +} + +func (v *NullableRule) Set(val *Rule) { + v.value = val + v.isSet = true +} + +func (v NullableRule) IsSet() bool { + return v.isSet +} + +func (v *NullableRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRule(val *Rule) *NullableRule { + return &NullableRule{value: val, isSet: true} +} + +func (v NullableRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_status.go b/services/lbapplication/model_status.go new file mode 100644 index 000000000..9804077ca --- /dev/null +++ b/services/lbapplication/model_status.go @@ -0,0 +1,192 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Status type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Status{} + +// Status The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). +type Status struct { + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + Code *interface{} `json:"code,omitempty"` + // A list of messages that carry the error details. There is a common set of message types for APIs to use. + Details *[]GoogleProtobufAny `json:"details,omitempty"` + // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + Message *string `json:"message,omitempty"` +} + +// NewStatus instantiates a new Status object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStatus() *Status { + this := Status{} + return &this +} + +// NewStatusWithDefaults instantiates a new Status object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStatusWithDefaults() *Status { + this := Status{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Status) GetCode() *interface{} { + if o == nil || IsNil(o.Code) { + var ret *interface{} + return ret + } + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Status) GetCodeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *Status) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given interface{} and assigns it to the Code field. +func (o *Status) SetCode(v *interface{}) { + o.Code = v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Status) GetDetails() *[]GoogleProtobufAny { + if o == nil || IsNil(o.Details) { + var ret *[]GoogleProtobufAny + return ret + } + return o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Status) GetDetailsOk() (*[]GoogleProtobufAny, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *Status) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given []GoogleProtobufAny and assigns it to the Details field. +func (o *Status) SetDetails(v *[]GoogleProtobufAny) { + o.Details = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *Status) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Status) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *Status) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *Status) SetMessage(v *string) { + o.Message = v +} + +func (o Status) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableStatus struct { + value *Status + isSet bool +} + +func (v NullableStatus) Get() *Status { + return v.value +} + +func (v *NullableStatus) Set(val *Status) { + v.value = val + v.isSet = true +} + +func (v NullableStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatus(val *Status) *NullableStatus { + return &NullableStatus{value: val, isSet: true} +} + +func (v NullableStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_target.go b/services/lbapplication/model_target.go new file mode 100644 index 000000000..5b331e368 --- /dev/null +++ b/services/lbapplication/model_target.go @@ -0,0 +1,154 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the Target type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Target{} + +// Target struct for Target +type Target struct { + // Target name + DisplayName *string `json:"displayName,omitempty"` + // Target IP. Must by unique within a target pool. + Ip *string `json:"ip,omitempty"` +} + +// NewTarget instantiates a new Target object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTarget() *Target { + this := Target{} + return &this +} + +// NewTargetWithDefaults instantiates a new Target object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTargetWithDefaults() *Target { + this := Target{} + return &this +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *Target) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Target) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *Target) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *Target) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *Target) GetIp() *string { + if o == nil || IsNil(o.Ip) { + var ret *string + return ret + } + return o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Target) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *Target) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *Target) SetIp(v *string) { + o.Ip = v +} + +func (o Target) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + return toSerialize, nil +} + +type NullableTarget struct { + value *Target + isSet bool +} + +func (v NullableTarget) Get() *Target { + return v.value +} + +func (v *NullableTarget) Set(val *Target) { + v.value = val + v.isSet = true +} + +func (v NullableTarget) IsSet() bool { + return v.isSet +} + +func (v *NullableTarget) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTarget(val *Target) *NullableTarget { + return &NullableTarget{value: val, isSet: true} +} + +func (v NullableTarget) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTarget) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_target_pool.go b/services/lbapplication/model_target_pool.go new file mode 100644 index 000000000..fb331144f --- /dev/null +++ b/services/lbapplication/model_target_pool.go @@ -0,0 +1,228 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the TargetPool type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TargetPool{} + +// TargetPool struct for TargetPool +type TargetPool struct { + ActiveHealthCheck *ActiveHealthCheck `json:"activeHealthCheck,omitempty"` + // Target pool name + Name *string `json:"name,omitempty"` + // The number identifying the port where each target listens for traffic. + TargetPort *interface{} `json:"targetPort,omitempty"` + // List of all targets which will be used in the pool. Limited to 250. + Targets *[]Target `json:"targets,omitempty"` +} + +// NewTargetPool instantiates a new TargetPool object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTargetPool() *TargetPool { + this := TargetPool{} + return &this +} + +// NewTargetPoolWithDefaults instantiates a new TargetPool object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTargetPoolWithDefaults() *TargetPool { + this := TargetPool{} + return &this +} + +// GetActiveHealthCheck returns the ActiveHealthCheck field value if set, zero value otherwise. +func (o *TargetPool) GetActiveHealthCheck() *ActiveHealthCheck { + if o == nil || IsNil(o.ActiveHealthCheck) { + var ret *ActiveHealthCheck + return ret + } + return o.ActiveHealthCheck +} + +// GetActiveHealthCheckOk returns a tuple with the ActiveHealthCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TargetPool) GetActiveHealthCheckOk() (*ActiveHealthCheck, bool) { + if o == nil || IsNil(o.ActiveHealthCheck) { + return nil, false + } + return o.ActiveHealthCheck, true +} + +// HasActiveHealthCheck returns a boolean if a field has been set. +func (o *TargetPool) HasActiveHealthCheck() bool { + if o != nil && !IsNil(o.ActiveHealthCheck) { + return true + } + + return false +} + +// SetActiveHealthCheck gets a reference to the given ActiveHealthCheck and assigns it to the ActiveHealthCheck field. +func (o *TargetPool) SetActiveHealthCheck(v *ActiveHealthCheck) { + o.ActiveHealthCheck = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TargetPool) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TargetPool) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *TargetPool) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *TargetPool) SetName(v *string) { + o.Name = v +} + +// GetTargetPort returns the TargetPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TargetPool) GetTargetPort() *interface{} { + if o == nil || IsNil(o.TargetPort) { + var ret *interface{} + return ret + } + return o.TargetPort +} + +// GetTargetPortOk returns a tuple with the TargetPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TargetPool) GetTargetPortOk() (*interface{}, bool) { + if o == nil || IsNil(o.TargetPort) { + return nil, false + } + return o.TargetPort, true +} + +// HasTargetPort returns a boolean if a field has been set. +func (o *TargetPool) HasTargetPort() bool { + if o != nil && !IsNil(o.TargetPort) { + return true + } + + return false +} + +// SetTargetPort gets a reference to the given interface{} and assigns it to the TargetPort field. +func (o *TargetPool) SetTargetPort(v *interface{}) { + o.TargetPort = v +} + +// GetTargets returns the Targets field value if set, zero value otherwise. +func (o *TargetPool) GetTargets() *[]Target { + if o == nil || IsNil(o.Targets) { + var ret *[]Target + return ret + } + return o.Targets +} + +// GetTargetsOk returns a tuple with the Targets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TargetPool) GetTargetsOk() (*[]Target, bool) { + if o == nil || IsNil(o.Targets) { + return nil, false + } + return o.Targets, true +} + +// HasTargets returns a boolean if a field has been set. +func (o *TargetPool) HasTargets() bool { + if o != nil && !IsNil(o.Targets) { + return true + } + + return false +} + +// SetTargets gets a reference to the given []Target and assigns it to the Targets field. +func (o *TargetPool) SetTargets(v *[]Target) { + o.Targets = v +} + +func (o TargetPool) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ActiveHealthCheck) { + toSerialize["activeHealthCheck"] = o.ActiveHealthCheck + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.TargetPort != nil { + toSerialize["targetPort"] = o.TargetPort + } + if !IsNil(o.Targets) { + toSerialize["targets"] = o.Targets + } + return toSerialize, nil +} + +type NullableTargetPool struct { + value *TargetPool + isSet bool +} + +func (v NullableTargetPool) Get() *TargetPool { + return v.value +} + +func (v *NullableTargetPool) Set(val *TargetPool) { + v.value = val + v.isSet = true +} + +func (v NullableTargetPool) IsSet() bool { + return v.isSet +} + +func (v *NullableTargetPool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTargetPool(val *TargetPool) *NullableTargetPool { + return &NullableTargetPool{value: val, isSet: true} +} + +func (v NullableTargetPool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTargetPool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_update_credentials_payload.go b/services/lbapplication/model_update_credentials_payload.go new file mode 100644 index 000000000..1b209fb71 --- /dev/null +++ b/services/lbapplication/model_update_credentials_payload.go @@ -0,0 +1,191 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the UpdateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateCredentialsPayload{} + +// UpdateCredentialsPayload struct for UpdateCredentialsPayload +type UpdateCredentialsPayload struct { + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // A valid password used for an existing ARGUS instance, which is used during basic auth. + Password *string `json:"password,omitempty"` + // A valid username used for an existing ARGUS instance, which is used during basic auth. + Username *string `json:"username,omitempty"` +} + +// NewUpdateCredentialsPayload instantiates a new UpdateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateCredentialsPayload() *UpdateCredentialsPayload { + this := UpdateCredentialsPayload{} + return &this +} + +// NewUpdateCredentialsPayloadWithDefaults instantiates a new UpdateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateCredentialsPayloadWithDefaults() *UpdateCredentialsPayload { + this := UpdateCredentialsPayload{} + return &this +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *UpdateCredentialsPayload) GetDisplayName() *string { + if o == nil || IsNil(o.DisplayName) { + var ret *string + return ret + } + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCredentialsPayload) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *UpdateCredentialsPayload) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *UpdateCredentialsPayload) SetDisplayName(v *string) { + o.DisplayName = v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *UpdateCredentialsPayload) GetPassword() *string { + if o == nil || IsNil(o.Password) { + var ret *string + return ret + } + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCredentialsPayload) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *UpdateCredentialsPayload) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *UpdateCredentialsPayload) SetPassword(v *string) { + o.Password = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *UpdateCredentialsPayload) GetUsername() *string { + if o == nil || IsNil(o.Username) { + var ret *string + return ret + } + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCredentialsPayload) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *UpdateCredentialsPayload) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *UpdateCredentialsPayload) SetUsername(v *string) { + o.Username = v +} + +func (o UpdateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableUpdateCredentialsPayload struct { + value *UpdateCredentialsPayload + isSet bool +} + +func (v NullableUpdateCredentialsPayload) Get() *UpdateCredentialsPayload { + return v.value +} + +func (v *NullableUpdateCredentialsPayload) Set(val *UpdateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateCredentialsPayload(val *UpdateCredentialsPayload) *NullableUpdateCredentialsPayload { + return &NullableUpdateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableUpdateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_update_credentials_response.go b/services/lbapplication/model_update_credentials_response.go new file mode 100644 index 000000000..835802ab3 --- /dev/null +++ b/services/lbapplication/model_update_credentials_response.go @@ -0,0 +1,116 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the UpdateCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateCredentialsResponse{} + +// UpdateCredentialsResponse struct for UpdateCredentialsResponse +type UpdateCredentialsResponse struct { + Credential *CredentialsResponse `json:"credential,omitempty"` +} + +// NewUpdateCredentialsResponse instantiates a new UpdateCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateCredentialsResponse() *UpdateCredentialsResponse { + this := UpdateCredentialsResponse{} + return &this +} + +// NewUpdateCredentialsResponseWithDefaults instantiates a new UpdateCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateCredentialsResponseWithDefaults() *UpdateCredentialsResponse { + this := UpdateCredentialsResponse{} + return &this +} + +// GetCredential returns the Credential field value if set, zero value otherwise. +func (o *UpdateCredentialsResponse) GetCredential() *CredentialsResponse { + if o == nil || IsNil(o.Credential) { + var ret *CredentialsResponse + return ret + } + return o.Credential +} + +// GetCredentialOk returns a tuple with the Credential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCredentialsResponse) GetCredentialOk() (*CredentialsResponse, bool) { + if o == nil || IsNil(o.Credential) { + return nil, false + } + return o.Credential, true +} + +// HasCredential returns a boolean if a field has been set. +func (o *UpdateCredentialsResponse) HasCredential() bool { + if o != nil && !IsNil(o.Credential) { + return true + } + + return false +} + +// SetCredential gets a reference to the given CredentialsResponse and assigns it to the Credential field. +func (o *UpdateCredentialsResponse) SetCredential(v *CredentialsResponse) { + o.Credential = v +} + +func (o UpdateCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credential) { + toSerialize["credential"] = o.Credential + } + return toSerialize, nil +} + +type NullableUpdateCredentialsResponse struct { + value *UpdateCredentialsResponse + isSet bool +} + +func (v NullableUpdateCredentialsResponse) Get() *UpdateCredentialsResponse { + return v.value +} + +func (v *NullableUpdateCredentialsResponse) Set(val *UpdateCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateCredentialsResponse(val *UpdateCredentialsResponse) *NullableUpdateCredentialsResponse { + return &NullableUpdateCredentialsResponse{value: val, isSet: true} +} + +func (v NullableUpdateCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_update_load_balancer_payload.go b/services/lbapplication/model_update_load_balancer_payload.go new file mode 100644 index 000000000..1b709ce59 --- /dev/null +++ b/services/lbapplication/model_update_load_balancer_payload.go @@ -0,0 +1,485 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the UpdateLoadBalancerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateLoadBalancerPayload{} + +// UpdateLoadBalancerPayload struct for UpdateLoadBalancerPayload +type UpdateLoadBalancerPayload struct { + // Reports all errors a application load balancer has. + Errors *[]LoadBalancerError `json:"errors,omitempty"` + // External application load balancer IP address where this application load balancer is exposed. Not changeable after creation. + ExternalAddress *string `json:"externalAddress,omitempty"` + // There is a maximum listener count of 20. + Listeners *[]Listener `json:"listeners,omitempty"` + // Application Load Balancer name. Not changeable after creation. + Name *string `json:"name,omitempty"` + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. + Networks *[]Network `json:"networks,omitempty"` + Options *LoadBalancerOptions `json:"options,omitempty"` + // Service Plan configures the size of the Application Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. + PlanId *string `json:"planId,omitempty"` + // Transient private application load balancer IP address that can change any time. + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *string `json:"status,omitempty"` + // List of all target pools which will be used in the application load balancer. Limited to 20. + TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Application Load Balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this application load balancer resource that changes during updates of the load balancers. On updates this field specified the application load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a application load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of application load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` +} + +// NewUpdateLoadBalancerPayload instantiates a new UpdateLoadBalancerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateLoadBalancerPayload() *UpdateLoadBalancerPayload { + this := UpdateLoadBalancerPayload{} + return &this +} + +// NewUpdateLoadBalancerPayloadWithDefaults instantiates a new UpdateLoadBalancerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateLoadBalancerPayloadWithDefaults() *UpdateLoadBalancerPayload { + this := UpdateLoadBalancerPayload{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetErrors() *[]LoadBalancerError { + if o == nil || IsNil(o.Errors) { + var ret *[]LoadBalancerError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetErrorsOk() (*[]LoadBalancerError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []LoadBalancerError and assigns it to the Errors field. +func (o *UpdateLoadBalancerPayload) SetErrors(v *[]LoadBalancerError) { + o.Errors = v +} + +// GetExternalAddress returns the ExternalAddress field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetExternalAddress() *string { + if o == nil || IsNil(o.ExternalAddress) { + var ret *string + return ret + } + return o.ExternalAddress +} + +// GetExternalAddressOk returns a tuple with the ExternalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetExternalAddressOk() (*string, bool) { + if o == nil || IsNil(o.ExternalAddress) { + return nil, false + } + return o.ExternalAddress, true +} + +// HasExternalAddress returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasExternalAddress() bool { + if o != nil && !IsNil(o.ExternalAddress) { + return true + } + + return false +} + +// SetExternalAddress gets a reference to the given string and assigns it to the ExternalAddress field. +func (o *UpdateLoadBalancerPayload) SetExternalAddress(v *string) { + o.ExternalAddress = v +} + +// GetListeners returns the Listeners field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetListeners() *[]Listener { + if o == nil || IsNil(o.Listeners) { + var ret *[]Listener + return ret + } + return o.Listeners +} + +// GetListenersOk returns a tuple with the Listeners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetListenersOk() (*[]Listener, bool) { + if o == nil || IsNil(o.Listeners) { + return nil, false + } + return o.Listeners, true +} + +// HasListeners returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasListeners() bool { + if o != nil && !IsNil(o.Listeners) { + return true + } + + return false +} + +// SetListeners gets a reference to the given []Listener and assigns it to the Listeners field. +func (o *UpdateLoadBalancerPayload) SetListeners(v *[]Listener) { + o.Listeners = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateLoadBalancerPayload) SetName(v *string) { + o.Name = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetNetworks() *[]Network { + if o == nil || IsNil(o.Networks) { + var ret *[]Network + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetNetworksOk() (*[]Network, bool) { + if o == nil || IsNil(o.Networks) { + return nil, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given []Network and assigns it to the Networks field. +func (o *UpdateLoadBalancerPayload) SetNetworks(v *[]Network) { + o.Networks = v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetOptions() *LoadBalancerOptions { + if o == nil || IsNil(o.Options) { + var ret *LoadBalancerOptions + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetOptionsOk() (*LoadBalancerOptions, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given LoadBalancerOptions and assigns it to the Options field. +func (o *UpdateLoadBalancerPayload) SetOptions(v *LoadBalancerOptions) { + o.Options = v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetPlanId() *string { + if o == nil || IsNil(o.PlanId) { + var ret *string + return ret + } + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *UpdateLoadBalancerPayload) SetPlanId(v *string) { + o.PlanId = v +} + +// GetPrivateAddress returns the PrivateAddress field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetPrivateAddress() *string { + if o == nil || IsNil(o.PrivateAddress) { + var ret *string + return ret + } + return o.PrivateAddress +} + +// GetPrivateAddressOk returns a tuple with the PrivateAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetPrivateAddressOk() (*string, bool) { + if o == nil || IsNil(o.PrivateAddress) { + return nil, false + } + return o.PrivateAddress, true +} + +// HasPrivateAddress returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasPrivateAddress() bool { + if o != nil && !IsNil(o.PrivateAddress) { + return true + } + + return false +} + +// SetPrivateAddress gets a reference to the given string and assigns it to the PrivateAddress field. +func (o *UpdateLoadBalancerPayload) SetPrivateAddress(v *string) { + o.PrivateAddress = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *UpdateLoadBalancerPayload) SetStatus(v *string) { + o.Status = v +} + +// GetTargetPools returns the TargetPools field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetTargetPools() *[]TargetPool { + if o == nil || IsNil(o.TargetPools) { + var ret *[]TargetPool + return ret + } + return o.TargetPools +} + +// GetTargetPoolsOk returns a tuple with the TargetPools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetTargetPoolsOk() (*[]TargetPool, bool) { + if o == nil || IsNil(o.TargetPools) { + return nil, false + } + return o.TargetPools, true +} + +// HasTargetPools returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasTargetPools() bool { + if o != nil && !IsNil(o.TargetPools) { + return true + } + + return false +} + +// SetTargetPools gets a reference to the given []TargetPool and assigns it to the TargetPools field. +func (o *UpdateLoadBalancerPayload) SetTargetPools(v *[]TargetPool) { + o.TargetPools = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *UpdateLoadBalancerPayload) GetVersion() *string { + if o == nil || IsNil(o.Version) { + var ret *string + return ret + } + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLoadBalancerPayload) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *UpdateLoadBalancerPayload) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *UpdateLoadBalancerPayload) SetVersion(v *string) { + o.Version = v +} + +func (o UpdateLoadBalancerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.ExternalAddress) { + toSerialize["externalAddress"] = o.ExternalAddress + } + if !IsNil(o.Listeners) { + toSerialize["listeners"] = o.Listeners + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + if !IsNil(o.PrivateAddress) { + toSerialize["privateAddress"] = o.PrivateAddress + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TargetPools) { + toSerialize["targetPools"] = o.TargetPools + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableUpdateLoadBalancerPayload struct { + value *UpdateLoadBalancerPayload + isSet bool +} + +func (v NullableUpdateLoadBalancerPayload) Get() *UpdateLoadBalancerPayload { + return v.value +} + +func (v *NullableUpdateLoadBalancerPayload) Set(val *UpdateLoadBalancerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateLoadBalancerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateLoadBalancerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateLoadBalancerPayload(val *UpdateLoadBalancerPayload) *NullableUpdateLoadBalancerPayload { + return &NullableUpdateLoadBalancerPayload{value: val, isSet: true} +} + +func (v NullableUpdateLoadBalancerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateLoadBalancerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/model_update_target_pool_payload.go b/services/lbapplication/model_update_target_pool_payload.go new file mode 100644 index 000000000..9eac793dc --- /dev/null +++ b/services/lbapplication/model_update_target_pool_payload.go @@ -0,0 +1,228 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" +) + +// checks if the UpdateTargetPoolPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateTargetPoolPayload{} + +// UpdateTargetPoolPayload struct for UpdateTargetPoolPayload +type UpdateTargetPoolPayload struct { + ActiveHealthCheck *ActiveHealthCheck `json:"activeHealthCheck,omitempty"` + // Target pool name + Name *string `json:"name,omitempty"` + // The number identifying the port where each target listens for traffic. + TargetPort *interface{} `json:"targetPort,omitempty"` + // List of all targets which will be used in the pool. Limited to 250. + Targets *[]Target `json:"targets,omitempty"` +} + +// NewUpdateTargetPoolPayload instantiates a new UpdateTargetPoolPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateTargetPoolPayload() *UpdateTargetPoolPayload { + this := UpdateTargetPoolPayload{} + return &this +} + +// NewUpdateTargetPoolPayloadWithDefaults instantiates a new UpdateTargetPoolPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateTargetPoolPayloadWithDefaults() *UpdateTargetPoolPayload { + this := UpdateTargetPoolPayload{} + return &this +} + +// GetActiveHealthCheck returns the ActiveHealthCheck field value if set, zero value otherwise. +func (o *UpdateTargetPoolPayload) GetActiveHealthCheck() *ActiveHealthCheck { + if o == nil || IsNil(o.ActiveHealthCheck) { + var ret *ActiveHealthCheck + return ret + } + return o.ActiveHealthCheck +} + +// GetActiveHealthCheckOk returns a tuple with the ActiveHealthCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTargetPoolPayload) GetActiveHealthCheckOk() (*ActiveHealthCheck, bool) { + if o == nil || IsNil(o.ActiveHealthCheck) { + return nil, false + } + return o.ActiveHealthCheck, true +} + +// HasActiveHealthCheck returns a boolean if a field has been set. +func (o *UpdateTargetPoolPayload) HasActiveHealthCheck() bool { + if o != nil && !IsNil(o.ActiveHealthCheck) { + return true + } + + return false +} + +// SetActiveHealthCheck gets a reference to the given ActiveHealthCheck and assigns it to the ActiveHealthCheck field. +func (o *UpdateTargetPoolPayload) SetActiveHealthCheck(v *ActiveHealthCheck) { + o.ActiveHealthCheck = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateTargetPoolPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTargetPoolPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateTargetPoolPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateTargetPoolPayload) SetName(v *string) { + o.Name = v +} + +// GetTargetPort returns the TargetPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateTargetPoolPayload) GetTargetPort() *interface{} { + if o == nil || IsNil(o.TargetPort) { + var ret *interface{} + return ret + } + return o.TargetPort +} + +// GetTargetPortOk returns a tuple with the TargetPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateTargetPoolPayload) GetTargetPortOk() (*interface{}, bool) { + if o == nil || IsNil(o.TargetPort) { + return nil, false + } + return o.TargetPort, true +} + +// HasTargetPort returns a boolean if a field has been set. +func (o *UpdateTargetPoolPayload) HasTargetPort() bool { + if o != nil && !IsNil(o.TargetPort) { + return true + } + + return false +} + +// SetTargetPort gets a reference to the given interface{} and assigns it to the TargetPort field. +func (o *UpdateTargetPoolPayload) SetTargetPort(v *interface{}) { + o.TargetPort = v +} + +// GetTargets returns the Targets field value if set, zero value otherwise. +func (o *UpdateTargetPoolPayload) GetTargets() *[]Target { + if o == nil || IsNil(o.Targets) { + var ret *[]Target + return ret + } + return o.Targets +} + +// GetTargetsOk returns a tuple with the Targets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTargetPoolPayload) GetTargetsOk() (*[]Target, bool) { + if o == nil || IsNil(o.Targets) { + return nil, false + } + return o.Targets, true +} + +// HasTargets returns a boolean if a field has been set. +func (o *UpdateTargetPoolPayload) HasTargets() bool { + if o != nil && !IsNil(o.Targets) { + return true + } + + return false +} + +// SetTargets gets a reference to the given []Target and assigns it to the Targets field. +func (o *UpdateTargetPoolPayload) SetTargets(v *[]Target) { + o.Targets = v +} + +func (o UpdateTargetPoolPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ActiveHealthCheck) { + toSerialize["activeHealthCheck"] = o.ActiveHealthCheck + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.TargetPort != nil { + toSerialize["targetPort"] = o.TargetPort + } + if !IsNil(o.Targets) { + toSerialize["targets"] = o.Targets + } + return toSerialize, nil +} + +type NullableUpdateTargetPoolPayload struct { + value *UpdateTargetPoolPayload + isSet bool +} + +func (v NullableUpdateTargetPoolPayload) Get() *UpdateTargetPoolPayload { + return v.value +} + +func (v *NullableUpdateTargetPoolPayload) Set(val *UpdateTargetPoolPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateTargetPoolPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateTargetPoolPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateTargetPoolPayload(val *UpdateTargetPoolPayload) *NullableUpdateTargetPoolPayload { + return &NullableUpdateTargetPoolPayload{value: val, isSet: true} +} + +func (v NullableUpdateTargetPoolPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateTargetPoolPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/lbapplication/utils.go b/services/lbapplication/utils.go new file mode 100644 index 000000000..5dd8a85d7 --- /dev/null +++ b/services/lbapplication/utils.go @@ -0,0 +1,347 @@ +/* +Application Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package lbapplication + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +}