diff --git a/.generator/schemas/adminapi.yaml b/.generator/schemas/adminapi.yaml index 718a6e88..b80f1925 100644 --- a/.generator/schemas/adminapi.yaml +++ b/.generator/schemas/adminapi.yaml @@ -1042,7 +1042,7 @@ paths: application/json: schema: $ref: '#/components/schemas/cluster' - description: Returned when project is updated successfully. + description: Returned when project is deleted successfully. '401': $ref: '#/components/responses/UnauthorizedResponse' tags: @@ -4892,31 +4892,11 @@ paths: name: orgName schema: type: string - - description: cloud provider of the Environment - in: query - name: cloudProvider - schema: - type: string - - description: cloud region of the Environment - in: query - name: cloudRegion - schema: - type: string - description: type of the Environment in: query name: environmentType schema: $ref: '#/components/schemas/environmentType' - - description: engine name - in: query - name: engine - schema: - type: string - - description: version of the engine - in: query - name: version - schema: - type: string responses: '200': content: @@ -4953,42 +4933,43 @@ paths: tags: - environment x-codegen-request-body-name: body - /admin/v1/environments/{environmentName}/statusHistory: + /admin/v1/organizations/{orgName}/engine/{engineName}/version/{version}/environments: get: - operationId: getEnvironmentStatusHistory - summary: Get environment status history + operationId: filterEnvironment + description: List environments + summary: List environments parameters: - - description: name of the environment + - description: name of the org in: path - name: environmentName + name: orgName required: true schema: type: string - - description: start time of the query range (nano seconds) - in: query - name: startTime - required: false + - description: name of the engine + in: path + name: engineName + required: true schema: type: string - format: date-time - - description: end time of the query range(nano seconds) - in: query - name: endTime - required: false + - description: version of the engine + in: path + name: version + required: true schema: type: string - format: date-time - tags: - - environment responses: '200': - description: Successful operation content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/environmentStatusHistory' + $ref: '#/components/schemas/environmentList' + description: A successful response. + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + tags: + - environment /admin/v1/environments/preflight: post: operationId: preflightEnvironment @@ -5009,44 +4990,6 @@ paths: tags: - environment x-codegen-request-body-name: body - /admin/v1/environments/restorePreflight: - post: - operationId: preflightRestoreEnvironment - summary: Preflight check before restore environment - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/kubeconfig' - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/preflightList' - tags: - - environment - /admin/v1/environments/checkAddRecord: - post: - operationId: checkEnvironmentAddRecord - summary: check if environment added before - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/kubeconfig' - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/environmentAdded' - tags: - - environment /admin/v1/environments/{environmentName}: delete: operationId: deleteEnvironment @@ -5215,30 +5158,6 @@ paths: $ref: '#/components/responses/NotFoundResponse' tags: - resourceStats - /admin/v1/environments/{environmentName}/nodes/monitorStatus: - get: - operationId: getEnvironmentMetricsMonitorStats - summary: Get environment MetricsMonitorStats - parameters: - - description: name of the environment - in: path - name: environmentName - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/jsonBody' - description: A successful response. - '403': - $ref: '#/components/responses/ForbiddenResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' - tags: - - environment /admin/v1/environments/{environmentName}/nodes/{nodeName}/instances/resourceStats: get: description: Returns aggregated resource statistics for the specified node. @@ -6305,73 +6224,6 @@ paths: $ref: '#/components/responses/ForbiddenResponse' '404': $ref: '#/components/responses/NotFoundResponse' - /admin/v1/environments/restore: - post: - operationId: restoreEnvironment - summary: restore environment - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/kubeConfig' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/environment' - description: A successful response. - '403': - $ref: '#/components/responses/ForbiddenResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' - tags: - - environment - /admin/v1/environmentObjectStorage: - post: - operationId: listEnvironmentObjectStorage - description: List environment object storage - summary: List environment object storage - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/kubeConfig' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/environmentObjectStorage' - description: A successful response. - '403': - $ref: '#/components/responses/ForbiddenResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' - tags: - - environment - /admin/v1/environmentBackupRepo: - post: - operationId: getEnvironmentBackupRepo - summary: get environment backup repo - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/kubeConfig' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/environmentBackupRepo' - description: A successful response. - '403': - $ref: '#/components/responses/ForbiddenResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' - tags: - - environment /admin/v1/environments/{environmentName}/backupRepo: get: operationId: listBackupRepos @@ -11234,6 +11086,33 @@ paths: '500': $ref: '#/components/responses/InternalServerErrorResponse' /admin/v1/metadb/restore: + get: + tags: + - metadb + operationId: metadbCheckRestore + summary: Check pods ready after restore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/metadb_restore' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/metadb_restore' + description: A successful response. + '401': + content: {} + description: Unauthorized + '403': + content: {} + description: Forbidden + '404': + content: {} + description: NotFound post: tags: - metadb @@ -12558,9 +12437,6 @@ components: codeShort: description: Cluster main component codeShort type: string - displayName: - description: Display name of cluster. - type: string description: KubeBlocks cluster information clusterUpdate: type: object @@ -12613,9 +12489,6 @@ components: title: Tolerations type: string description: Tolerations of cluster - displayName: - description: Display name of cluster. - type: string description: ClusterUpdate is the payload to update a KubeBlocks cluster instanceStorageItem: description: Instance storage information @@ -14615,12 +14488,6 @@ components: description: The total amount of physical resources available on the node. Unit is GiB for memory and Cores for CPU. format: double type: number - required: - - allocatable - - capacity - - limits - - requests - - usage type: object node: description: node info @@ -14881,7 +14748,6 @@ components: - UNREACHABLE - DELETING - OUTOFSTOCK - - UPDATING environmentRegisterType: type: string description: Configuration for privisoining environment resources @@ -15023,12 +14889,6 @@ components: type: string type: $ref: '#/components/schemas/environmentStorageType' - reusedClusterName: - description: the existed cluster name for creating storage - type: string - reusedClusterNamespace: - description: the existed cluster namespace for creating storage - type: string config: $ref: '#/components/schemas/storageCreate' storageConfig: @@ -15264,32 +15124,6 @@ components: description: Extra info for environment deletePolicy: $ref: '#/components/schemas/environmentDeletePolicy' - overwrite: - type: boolean - description: overwrite a environment if it has been added before - default: false - environmentStatusHistory: - description: EventEnvironmentState contains details for the current and previous state of the environment. - type: object - properties: - CurrentState: - description: The current state of the environment. - type: string - PrevState: - description: The previous state of the environment. - type: string - Reason: - description: The reason for the state transition. - type: string - Timestamp: - description: The timestamp of the state transition. - type: string - format: date-time - required: - - CurrentState - - PrevState - - Reason - - Timestamp preflight: title: Preflight results description: The result of preflight check @@ -15316,44 +15150,13 @@ components: type: array items: $ref: '#/components/schemas/preflight' - environmentAdded: - type: object - properties: - addedBefore: - type: boolean - description: whether the environment has ever been added - stillInUse: - type: boolean - description: whether the environment is still in use - environment: - $ref: '#/components/schemas/environment' - cloudResourceCleanPolicy: - type: string - description: The policy to clean cloud resources, either `Delete` or `Retain` - enum: - - Delete - - Retain - default: Retain environmentDelete: description: Environment deletion option type: object - required: - - backup - - minio - - victoriaMetrics properties: cleanCloudResources: type: boolean description: clean up resources in the cloud (only valid if creation is done by role ARN) - backup: - description: reserve backup when delete environment - $ref: '#/components/schemas/cloudResourceCleanPolicy' - minio: - description: reserve minio cluster when delete environment - $ref: '#/components/schemas/cloudResourceCleanPolicy' - victoriaMetrics: - description: reserve vm cluster when delete environment - $ref: '#/components/schemas/cloudResourceCleanPolicy' environmentUpdate: type: object description: Environment info @@ -15505,11 +15308,6 @@ components: - items - updatedAt type: object - jsonBody: - description: Represents a JSON body. - properties: {} - additionalProperties: true - type: object resourceStatsInstanceType: description: Type of the instance, choose cluster or system enum: @@ -15523,8 +15321,6 @@ components: $ref: '#/components/schemas/resourceStats' memoryStats: $ref: '#/components/schemas/resourceStats' - ephemeralStorageStats: - $ref: '#/components/schemas/resourceStats' name: description: Name of the instance. type: string @@ -15546,6 +15342,11 @@ components: required: - items type: object + jsonBody: + description: Represents a JSON body. + properties: {} + additionalProperties: true + type: object listBody: description: Represents a list of JSON bodies. items: @@ -16076,68 +15877,6 @@ components: items: type: string type: array - kubeConfig: - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - description: The kubeconfig body as raw binary. - format: byte - rawCluster: - type: object - description: cluster info - properties: - kubernetesName: - description: the cluster name in k8s - type: string - namespace: - type: string - description: the namespace of cluster - replicas: - type: integer - description: the replicas of cluster - storage: - type: number - description: Storage size, the unit is Gi - format: double - cpu: - title: CPU - multipleOf: 0.5 - maximum: 64 - minimum: 0.5 - type: number - description: CPU cores. - format: double - memory: - title: Memory(Gi) - maximum: 1000 - minimum: 0.5 - type: number - description: Memory, the unit is Gi. - format: double - environmentObjectStorage: - type: object - properties: - clusters: - type: array - items: - $ref: '#/components/schemas/rawCluster' - rawBackupRepo: - type: object - description: backup repo info - properties: - name: - description: the backup repo name - type: string - default: - type: boolean - description: default backup repo - environmentBackupRepo: - type: object - properties: - items: - description: backup repo list - items: - $ref: '#/components/schemas/rawBackupRepo' - type: array backupRepoAccessMethod: description: the access method for backup repo default: Tool @@ -19694,11 +19433,9 @@ components: type: string completionTimestamp: description: completion time - format: date-time type: string startTimestamp: description: start time - format: date-time type: string cpu: multipleOf: 0.5 @@ -19719,6 +19456,9 @@ components: replicas: type: integer description: the number of postgresql pods + ready: + type: string + description: whether pods are ready required: - clusterName volumeExpand: diff --git a/.generator/schemas/openapi.yaml b/.generator/schemas/openapi.yaml index 77fff399..a65fe388 100644 --- a/.generator/schemas/openapi.yaml +++ b/.generator/schemas/openapi.yaml @@ -776,16 +776,6 @@ paths: required: true schema: type: string - - description: engine name - in: query - name: engine - schema: - type: string - - description: version of the engine - in: query - name: version - schema: - type: string responses: '200': content: @@ -956,6 +946,45 @@ paths: tags: - environment x-codegen-request-body-name: body + /api/v1/organizations/{orgName}/engine/{engineName}/version/{version}/environments: + get: + operationId: filterEnvironment + description: List environments + summary: List environments + parameters: + - description: name of the org + in: path + name: orgName + required: true + schema: + type: string + - description: name of the engine + in: path + name: engineName + required: true + schema: + type: string + - description: version of the engine + in: path + name: version + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/environmentList' + description: A successful response. + '403': + content: {} + description: Returned when the user does not have permission to access the resource. + '404': + content: {} + description: Returned when the resource does not exist. + tags: + - environment /api/v1/organizations/{orgName}/benchmark: get: tags: @@ -1518,7 +1547,7 @@ paths: application/json: schema: $ref: '#/components/schemas/cluster' - description: Returned when project is updated successfully. + description: Returned when project is deleted successfully. '401': $ref: '#/components/responses/UnauthorizedResponse' tags: @@ -9207,9 +9236,7 @@ components: - READY - WARNING - UNREACHABLE - - DELETING - OUTOFSTOCK - - UPDATING environmentType: type: string description: Type of this environment @@ -10519,9 +10546,6 @@ components: codeShort: description: Cluster main component codeShort type: string - displayName: - description: Display name of cluster. - type: string description: KubeBlocks cluster information clusterUpdate: type: object @@ -10574,9 +10598,6 @@ components: title: Tolerations type: string description: Tolerations of cluster - displayName: - description: Display name of cluster. - type: string description: ClusterUpdate is the payload to update a KubeBlocks cluster instanceStorageItem: description: Instance storage information diff --git a/api/common/client.go b/api/common/client.go index 9e7a7c19..f532fbc8 100644 --- a/api/common/client.go +++ b/api/common/client.go @@ -2,13 +2,14 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package common import ( "bytes" - "compress/gzip" - "compress/zlib" "context" + "compress/zlib" + "compress/gzip" "encoding/xml" "errors" "fmt" @@ -26,6 +27,7 @@ import ( "strconv" "strings" "time" + "unicode/utf8" "golang.org/x/oauth2" ) @@ -39,14 +41,14 @@ var ( // APIClient manages communication with the KubeBlocks Cloud API API v1.0.0. // In most cases there should be only one, shared, APIClient. type APIClient struct { - Cfg *Configuration + Cfg *Configuration } // FormFile holds parameters for a file in multipart/form-data request. type FormFile struct { FormFileName string - FileName string - FileBytes []byte + FileName string + FileBytes []byte } // Service holds APIClient @@ -180,7 +182,7 @@ func (c *APIClient) CallAPI(request *http.Request) (*http.Response, error) { } } -// Determine if a request should be retried +// Determine if a request should be retried func (c *APIClient) shouldRetryRequest(response *http.Response, retryCount int) (*time.Duration, bool) { enableRetry := c.Cfg.RetryConfiguration.EnableRetry maxRetries := c.Cfg.RetryConfiguration.MaxRetries @@ -512,9 +514,9 @@ func detectContentType(body interface{}) string { // GenericOpenAPIError Provides access to the body, error and model on returned errors. type GenericOpenAPIError struct { - ErrorBody []byte + ErrorBody []byte ErrorMessage string - ErrorModel interface{} + ErrorModel interface{} } // Error returns non-empty string if there was an error. diff --git a/api/common/configuration.go b/api/common/configuration.go index 4a8afdeb..6a950c4f 100644 --- a/api/common/configuration.go +++ b/api/common/configuration.go @@ -2,6 +2,7 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package common import ( @@ -108,7 +109,6 @@ type RetryConfiguration struct { HTTPRetryTimeout time.Duration MaxRetries int } - // NewConfiguration returns a new Configuration object. func NewConfiguration() *Configuration { cfg := &Configuration{ @@ -116,25 +116,30 @@ func NewConfiguration() *Configuration { UserAgent: getUserAgent(), Debug: false, Compress: true, - Servers: ServerConfigurations{ + Servers: ServerConfigurations{ { URL: "http://127.0.0.1:8080", Description: "local", - Variables: map[string]ServerVariable{}, + Variables: map[string]ServerVariable{ + }, }, { URL: "https://api-dev.apecloud.cn", Description: "dev", - Variables: map[string]ServerVariable{}, + Variables: map[string]ServerVariable{ + }, }, { URL: "https://cloudapi.apecloud.cn", Description: "demo", - Variables: map[string]ServerVariable{}, + Variables: map[string]ServerVariable{ + }, }, }, - OperationServers: map[string]ServerConfigurations{}, - unstableOperations: map[string]bool{}, + OperationServers: map[string]ServerConfigurations{ + }, + unstableOperations: map[string]bool{ + }, RetryConfiguration: RetryConfiguration{ EnableRetry: false, BackOffMultiplier: 2, diff --git a/api/common/encoding_json.go b/api/common/encoding_json.go index 02e81f7b..c2d15fad 100644 --- a/api/common/encoding_json.go +++ b/api/common/encoding_json.go @@ -2,6 +2,7 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + //go:build !goccy_gojson package common @@ -25,4 +26,4 @@ func NewEncoder(w io.Writer) *json.Encoder { func NewDecoder(r io.Reader) *json.Decoder { return json.NewDecoder(r) -} +} \ No newline at end of file diff --git a/api/common/goccy_gojson.go b/api/common/goccy_gojson.go index 165cd53b..4f66ed78 100644 --- a/api/common/goccy_gojson.go +++ b/api/common/goccy_gojson.go @@ -2,6 +2,7 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + //go:build goccy_gojson package common @@ -26,4 +27,4 @@ func NewEncoder(w io.Writer) *json.Encoder { func NewDecoder(r io.Reader) *json.Decoder { return json.NewDecoder(r) -} +} \ No newline at end of file diff --git a/api/common/utils.go b/api/common/utils.go index 8e131331..24013cf0 100644 --- a/api/common/utils.go +++ b/api/common/utils.go @@ -2,6 +2,7 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package common import ( @@ -11,7 +12,6 @@ import ( "reflect" "strings" "time" - "unicode/utf8" ) // PtrBool is a helper routine that returns a pointer to given boolean value. @@ -43,7 +43,7 @@ func Ptr[T any](v T) *T { return &v } // PaginationResult pagination item helper struct type PaginationResult[T any] struct { - Item T + Item T Error error } @@ -513,4 +513,4 @@ func copyRequest(r *http.Request, rawBody *[]byte) *http.Request { } newRequest.Body = io.NopCloser(bytes.NewBuffer(*rawBody)) return &newRequest -} +} \ No newline at end of file diff --git a/api/kbcloud/admin/api_account.go b/api/kbcloud/admin/api_account.go index c2e49c5f..846cbcdf 100644 --- a/api/kbcloud/admin/api_account.go +++ b/api/kbcloud/admin/api_account.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type AccountApi common.Service // create an account in cluster func (a *AccountApi) CreateAccount(ctx _context.Context, orgName string, clusterName string, body Account) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.CreateAccount") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *AccountApi) CreateAccount(ctx _context.Context, orgName string, cluster localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *AccountApi) CreateAccount(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -84,10 +93,12 @@ func (a *AccountApi) CreateAccount(ctx _context.Context, orgName string, cluster // delete an account in cluster func (a *AccountApi) DeleteAccount(ctx _context.Context, orgName string, clusterName string, accountName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.DeleteAccount") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -103,7 +114,8 @@ func (a *AccountApi) DeleteAccount(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -125,10 +137,11 @@ func (a *AccountApi) DeleteAccount(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,7 +165,6 @@ func NewListAccountsOptionalParameters() *ListAccountsOptionalParameters { this := ListAccountsOptionalParameters{} return &this } - // WithIncludeRoot sets the corresponding parameter name and returns the struct. func (r *ListAccountsOptionalParameters) WithIncludeRoot(includeRoot bool) *ListAccountsOptionalParameters { r.IncludeRoot = &includeRoot @@ -163,18 +175,20 @@ func (r *ListAccountsOptionalParameters) WithIncludeRoot(includeRoot bool) *List // list accounts in cluster func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterName string, o ...ListAccountsOptionalParameters) ([]AccountListItem, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []AccountListItem - optionalParams ListAccountsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []AccountListItem + optionalParams ListAccountsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAccountsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAccountsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.ListAccounts") if err != nil { @@ -193,7 +207,8 @@ func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterN } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -215,10 +230,11 @@ func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -232,7 +248,7 @@ func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -245,10 +261,12 @@ func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterN // update an account in cluster func (a *AccountApi) UpdateAccount(ctx _context.Context, orgName string, clusterName string, accountName string, body Account) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.UpdateAccount") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -265,9 +283,11 @@ func (a *AccountApi) UpdateAccount(ctx _context.Context, orgName string, cluster localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -289,10 +309,11 @@ func (a *AccountApi) UpdateAccount(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -310,10 +331,12 @@ func (a *AccountApi) UpdateAccount(ctx _context.Context, orgName string, cluster // update privileges of account func (a *AccountApi) UpdateAccountPrivileges(ctx _context.Context, orgName string, clusterName string, accountName string, body []PrivilegeListItem) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.UpdateAccountPrivileges") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -330,9 +353,11 @@ func (a *AccountApi) UpdateAccountPrivileges(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -354,10 +379,11 @@ func (a *AccountApi) UpdateAccountPrivileges(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/admin/api_admin_user.go b/api/kbcloud/admin/api_admin_user.go index a588998a..8892b4b2 100644 --- a/api/kbcloud/admin/api_admin_user.go +++ b/api/kbcloud/admin/api_admin_user.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type AdminUserApi common.Service // Create a new admin user func (a *AdminUserApi) CreateAdminUser(ctx _context.Context, body AdminUserCreate) (AdminUser, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AdminUser + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AdminUser ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AdminUserApi.CreateAdminUser") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *AdminUserApi) CreateAdminUser(ctx _context.Context, body AdminUserCreat localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *AdminUserApi) CreateAdminUser(ctx _context.Context, body AdminUserCreat if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *AdminUserApi) CreateAdminUser(ctx _context.Context, body AdminUserCreat err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,10 +101,12 @@ func (a *AdminUserApi) CreateAdminUser(ctx _context.Context, body AdminUserCreat // delete admin user func (a *AdminUserApi) DeleteAdminUser(ctx _context.Context, username string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AdminUserApi.DeleteAdminUser") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +120,8 @@ func (a *AdminUserApi) DeleteAdminUser(ctx _context.Context, username string) (* localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +143,11 @@ func (a *AdminUserApi) DeleteAdminUser(ctx _context.Context, username string) (* if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,11 +165,13 @@ func (a *AdminUserApi) DeleteAdminUser(ctx _context.Context, username string) (* // Get all admin users func (a *AdminUserApi) ListAdminUsers(ctx _context.Context) ([]AdminUserList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []AdminUserList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []AdminUserList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AdminUserApi.ListAdminUsers") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -169,7 +184,8 @@ func (a *AdminUserApi) ListAdminUsers(ctx _context.Context) ([]AdminUserList, *_ localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -191,10 +207,11 @@ func (a *AdminUserApi) ListAdminUsers(ctx _context.Context) ([]AdminUserList, *_ if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -208,7 +225,7 @@ func (a *AdminUserApi) ListAdminUsers(ctx _context.Context) ([]AdminUserList, *_ err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -221,11 +238,13 @@ func (a *AdminUserApi) ListAdminUsers(ctx _context.Context) ([]AdminUserList, *_ // Update the current Admin User info func (a *AdminUserApi) PatchAdminUser(ctx _context.Context, body AdminUserUpdate) (AdminUser, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AdminUser + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AdminUser ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AdminUserApi.PatchAdminUser") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -239,9 +258,11 @@ func (a *AdminUserApi) PatchAdminUser(ctx _context.Context, body AdminUserUpdate localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -263,10 +284,11 @@ func (a *AdminUserApi) PatchAdminUser(ctx _context.Context, body AdminUserUpdate if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -280,7 +302,7 @@ func (a *AdminUserApi) PatchAdminUser(ctx _context.Context, body AdminUserUpdate err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -293,11 +315,13 @@ func (a *AdminUserApi) PatchAdminUser(ctx _context.Context, body AdminUserUpdate // Get authenticated login admin user info func (a *AdminUserApi) ReadAdminUser(ctx _context.Context) (AdminUser, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AdminUser + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AdminUser ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AdminUserApi.ReadAdminUser") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -310,7 +334,8 @@ func (a *AdminUserApi) ReadAdminUser(ctx _context.Context) (AdminUser, *_nethttp localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -332,10 +357,11 @@ func (a *AdminUserApi) ReadAdminUser(ctx _context.Context) (AdminUser, *_nethttp if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -349,7 +375,7 @@ func (a *AdminUserApi) ReadAdminUser(ctx _context.Context) (AdminUser, *_nethttp err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_config.go b/api/kbcloud/admin/api_alert_config.go index f90230a8..8abaec3b 100644 --- a/api/kbcloud/admin/api_alert_config.go +++ b/api/kbcloud/admin/api_alert_config.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertConfigApi common.Service // GetAlertConfig Get alert config. func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (AlertConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertConfig + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertConfig ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertConfigApi.GetAlertConfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (A localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (A if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -76,7 +84,7 @@ func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (A err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -88,11 +96,13 @@ func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (A // GetAlertSMSConfig Get alert SMS config. func (a *AlertConfigApi) GetAlertSMSConfig(ctx _context.Context) (AlertSMSConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertSMSConfig + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertSMSConfig ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertConfigApi.GetAlertSMSConfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -105,7 +115,8 @@ func (a *AlertConfigApi) GetAlertSMSConfig(ctx _context.Context) (AlertSMSConfig localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -127,10 +138,11 @@ func (a *AlertConfigApi) GetAlertSMSConfig(ctx _context.Context) (AlertSMSConfig if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -144,7 +156,7 @@ func (a *AlertConfigApi) GetAlertSMSConfig(ctx _context.Context) (AlertSMSConfig err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -163,7 +175,6 @@ func NewSetAlertConfigOptionalParameters() *SetAlertConfigOptionalParameters { this := SetAlertConfigOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *SetAlertConfigOptionalParameters) WithBody(body AlertConfig) *SetAlertConfigOptionalParameters { r.Body = &body @@ -173,18 +184,20 @@ func (r *SetAlertConfigOptionalParameters) WithBody(body AlertConfig) *SetAlertC // SetAlertConfig Set alert config. func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o ...SetAlertConfigOptionalParameters) (AlertConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertConfig - optionalParams SetAlertConfigOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertConfig + optionalParams SetAlertConfigOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type SetAlertConfigOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type SetAlertConfigOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertConfigApi.SetAlertConfig") if err != nil { @@ -200,11 +213,13 @@ func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -226,10 +241,11 @@ func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -243,7 +259,7 @@ func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -255,11 +271,13 @@ func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o // UpdateAlertSMSConfig Update alert SMS config. func (a *AlertConfigApi) UpdateAlertSMSConfig(ctx _context.Context, body AlertSMSConfig) (AlertSMSConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertSMSConfig + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertSMSConfig ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertConfigApi.UpdateAlertSMSConfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -273,9 +291,11 @@ func (a *AlertConfigApi) UpdateAlertSMSConfig(ctx _context.Context, body AlertSM localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -297,10 +317,11 @@ func (a *AlertConfigApi) UpdateAlertSMSConfig(ctx _context.Context, body AlertSM if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -314,7 +335,7 @@ func (a *AlertConfigApi) UpdateAlertSMSConfig(ctx _context.Context, body AlertSM err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_inhibit.go b/api/kbcloud/admin/api_alert_inhibit.go index e73f6abf..36901c01 100644 --- a/api/kbcloud/admin/api_alert_inhibit.go +++ b/api/kbcloud/admin/api_alert_inhibit.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewCreateAlertInhibitOptionalParameters() *CreateAlertInhibitOptionalParame this := CreateAlertInhibitOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *CreateAlertInhibitOptionalParameters) WithBody(body AlertInhibit) *CreateAlertInhibitOptionalParameters { r.Body = &body @@ -36,18 +39,20 @@ func (r *CreateAlertInhibitOptionalParameters) WithBody(body AlertInhibit) *Crea // CreateAlertInhibit Create alert inhibit. func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName string, o ...CreateAlertInhibitOptionalParameters) (AlertInhibit, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertInhibit - optionalParams CreateAlertInhibitOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertInhibit + optionalParams CreateAlertInhibitOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CreateAlertInhibitOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CreateAlertInhibitOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.CreateAlertInhibit") if err != nil { @@ -63,11 +68,13 @@ func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -89,10 +96,11 @@ func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -106,7 +114,7 @@ func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -118,11 +126,13 @@ func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName strin // DeleteAlertInhibit Delete alert inhibit. func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName string, inhibitId string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.DeleteAlertInhibit") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -137,7 +147,8 @@ func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName strin localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -159,10 +170,11 @@ func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -176,7 +188,7 @@ func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -188,11 +200,13 @@ func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName strin // GetAlertInhibit Get alert inhibit. func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, inhibitId string) (AlertInhibit, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertInhibit + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertInhibit ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.GetAlertInhibit") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -207,7 +221,8 @@ func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -229,10 +244,11 @@ func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -246,7 +262,7 @@ func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -265,7 +281,6 @@ func NewListAlertInhibitsOptionalParameters() *ListAlertInhibitsOptionalParamete this := ListAlertInhibitsOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListAlertInhibitsOptionalParameters) WithOrgName(orgName string) *ListAlertInhibitsOptionalParameters { r.OrgName = &orgName @@ -275,18 +290,20 @@ func (r *ListAlertInhibitsOptionalParameters) WithOrgName(orgName string) *ListA // ListAlertInhibits List alert inhibits. func (a *AlertInhibitApi) ListAlertInhibits(ctx _context.Context, o ...ListAlertInhibitsOptionalParameters) (AlertInhibitList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertInhibitList - optionalParams ListAlertInhibitsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertInhibitList + optionalParams ListAlertInhibitsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertInhibitsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertInhibitsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.ListAlertInhibits") if err != nil { @@ -303,7 +320,8 @@ func (a *AlertInhibitApi) ListAlertInhibits(ctx _context.Context, o ...ListAlert } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -325,10 +343,11 @@ func (a *AlertInhibitApi) ListAlertInhibits(ctx _context.Context, o ...ListAlert if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -342,7 +361,7 @@ func (a *AlertInhibitApi) ListAlertInhibits(ctx _context.Context, o ...ListAlert err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -361,7 +380,6 @@ func NewPatchAlertInhibitOptionalParameters() *PatchAlertInhibitOptionalParamete this := PatchAlertInhibitOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *PatchAlertInhibitOptionalParameters) WithBody(body AlertInhibit) *PatchAlertInhibitOptionalParameters { r.Body = &body @@ -371,18 +389,20 @@ func (r *PatchAlertInhibitOptionalParameters) WithBody(body AlertInhibit) *Patch // PatchAlertInhibit Patch alert inhibit. func (a *AlertInhibitApi) PatchAlertInhibit(ctx _context.Context, orgName string, o ...PatchAlertInhibitOptionalParameters) (AlertInhibit, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertInhibit - optionalParams PatchAlertInhibitOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertInhibit + optionalParams PatchAlertInhibitOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type PatchAlertInhibitOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type PatchAlertInhibitOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.PatchAlertInhibit") if err != nil { @@ -398,11 +418,13 @@ func (a *AlertInhibitApi) PatchAlertInhibit(ctx _context.Context, orgName string localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -424,10 +446,11 @@ func (a *AlertInhibitApi) PatchAlertInhibit(ctx _context.Context, orgName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -441,7 +464,7 @@ func (a *AlertInhibitApi) PatchAlertInhibit(ctx _context.Context, orgName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_metrics.go b/api/kbcloud/admin/api_alert_metrics.go index c68c48ae..ccb347f8 100644 --- a/api/kbcloud/admin/api_alert_metrics.go +++ b/api/kbcloud/admin/api_alert_metrics.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListAlertMetricsOptionalParameters() *ListAlertMetricsOptionalParameters this := ListAlertMetricsOptionalParameters{} return &this } - // WithCategory sets the corresponding parameter name and returns the struct. func (r *ListAlertMetricsOptionalParameters) WithCategory(category string) *ListAlertMetricsOptionalParameters { r.Category = &category @@ -36,18 +39,20 @@ func (r *ListAlertMetricsOptionalParameters) WithCategory(category string) *List // ListAlertMetrics List alert metric types. func (a *AlertMetricsApi) ListAlertMetrics(ctx _context.Context, orgName string, o ...ListAlertMetricsOptionalParameters) (AlertMetricList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertMetricList - optionalParams ListAlertMetricsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertMetricList + optionalParams ListAlertMetricsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertMetricsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertMetricsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertMetricsApi.ListAlertMetrics") if err != nil { @@ -65,7 +70,8 @@ func (a *AlertMetricsApi) ListAlertMetrics(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -87,10 +93,11 @@ func (a *AlertMetricsApi) ListAlertMetrics(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -104,7 +111,7 @@ func (a *AlertMetricsApi) ListAlertMetrics(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_object.go b/api/kbcloud/admin/api_alert_object.go index 416bd80e..b6ca00eb 100644 --- a/api/kbcloud/admin/api_alert_object.go +++ b/api/kbcloud/admin/api_alert_object.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListAlertObjectsOptionalParameters() *ListAlertObjectsOptionalParameters this := ListAlertObjectsOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListAlertObjectsOptionalParameters) WithOrgName(orgName string) *ListAlertObjectsOptionalParameters { r.OrgName = &orgName @@ -36,18 +39,20 @@ func (r *ListAlertObjectsOptionalParameters) WithOrgName(orgName string) *ListAl // ListAlertObjects List alert objects. func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, o ...ListAlertObjectsOptionalParameters) (AlertObjectList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertObjectList - optionalParams ListAlertObjectsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertObjectList + optionalParams ListAlertObjectsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertObjectsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertObjectsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertObjectApi.ListAlertObjects") if err != nil { @@ -64,7 +69,8 @@ func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, o ...ListAlertOb } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -86,10 +92,11 @@ func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, o ...ListAlertOb if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -103,7 +110,7 @@ func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, o ...ListAlertOb err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -115,11 +122,13 @@ func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, o ...ListAlertOb // SetAlertObjectStatus Set alert object status. func (a *AlertObjectApi) SetAlertObjectStatus(ctx _context.Context, orgName string, alertId string, status string) (AlertObject, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertObject + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertObject ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertObjectApi.SetAlertObjectStatus") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -135,7 +144,8 @@ func (a *AlertObjectApi) SetAlertObjectStatus(ctx _context.Context, orgName stri localVarQueryParams.Add("status", common.ParameterToString(status, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -157,10 +167,11 @@ func (a *AlertObjectApi) SetAlertObjectStatus(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -174,7 +185,7 @@ func (a *AlertObjectApi) SetAlertObjectStatus(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -193,7 +204,6 @@ func NewSetAlertObjectsStatusOptionalParameters() *SetAlertObjectsStatusOptional this := SetAlertObjectsStatusOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *SetAlertObjectsStatusOptionalParameters) WithBody(body []AlertObject) *SetAlertObjectsStatusOptionalParameters { r.Body = &body @@ -203,18 +213,20 @@ func (r *SetAlertObjectsStatusOptionalParameters) WithBody(body []AlertObject) * // SetAlertObjectsStatus Set alert objects status. func (a *AlertObjectApi) SetAlertObjectsStatus(ctx _context.Context, orgName string, status string, o ...SetAlertObjectsStatusOptionalParameters) (AlertObjectList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertObjectList - optionalParams SetAlertObjectsStatusOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertObjectList + optionalParams SetAlertObjectsStatusOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type SetAlertObjectsStatusOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type SetAlertObjectsStatusOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertObjectApi.SetAlertObjectsStatus") if err != nil { @@ -231,11 +243,13 @@ func (a *AlertObjectApi) SetAlertObjectsStatus(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -257,10 +271,11 @@ func (a *AlertObjectApi) SetAlertObjectsStatus(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -274,7 +289,7 @@ func (a *AlertObjectApi) SetAlertObjectsStatus(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_receiver.go b/api/kbcloud/admin/api_alert_receiver.go index f4f9ad42..1ab73aef 100644 --- a/api/kbcloud/admin/api_alert_receiver.go +++ b/api/kbcloud/admin/api_alert_receiver.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertReceiverApi common.Service // CreateAlertReceiver Create alert receiver. func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName string, category AlertReceiverCategory, body AlertReceiver) (AlertReceiver, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertReceiver + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertReceiver ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.CreateAlertReceiver") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,10 +101,12 @@ func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName str // DeleteAlertReceiver Delete alert receiver. func (a *AlertReceiverApi) DeleteAlertReceiver(ctx _context.Context, orgName string, receiverId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.DeleteAlertReceiver") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,7 +121,8 @@ func (a *AlertReceiverApi) DeleteAlertReceiver(ctx _context.Context, orgName str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *AlertReceiverApi) DeleteAlertReceiver(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,11 +165,13 @@ func (a *AlertReceiverApi) DeleteAlertReceiver(ctx _context.Context, orgName str // GetAlertReceiver Get alert receiver. func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string, receiverId string) (AlertReceiver, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertReceiver + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertReceiver ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.GetAlertReceiver") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -171,7 +186,8 @@ func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -193,10 +209,11 @@ func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -210,7 +227,7 @@ func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -221,7 +238,7 @@ func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string // ListAlertReceiversOptionalParameters holds optional parameters for ListAlertReceivers. type ListAlertReceiversOptionalParameters struct { - OrgName *string + OrgName *string Category *AlertReceiverCategory } @@ -230,13 +247,11 @@ func NewListAlertReceiversOptionalParameters() *ListAlertReceiversOptionalParame this := ListAlertReceiversOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListAlertReceiversOptionalParameters) WithOrgName(orgName string) *ListAlertReceiversOptionalParameters { r.OrgName = &orgName return r } - // WithCategory sets the corresponding parameter name and returns the struct. func (r *ListAlertReceiversOptionalParameters) WithCategory(category AlertReceiverCategory) *ListAlertReceiversOptionalParameters { r.Category = &category @@ -246,18 +261,20 @@ func (r *ListAlertReceiversOptionalParameters) WithCategory(category AlertReceiv // ListAlertReceivers List alert receivers. func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, o ...ListAlertReceiversOptionalParameters) (AlertReceiverList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertReceiverList - optionalParams ListAlertReceiversOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertReceiverList + optionalParams ListAlertReceiversOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertReceiversOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertReceiversOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.ListAlertReceivers") if err != nil { @@ -277,7 +294,8 @@ func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, o ...ListAle } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -299,10 +317,11 @@ func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, o ...ListAle if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -316,7 +335,7 @@ func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, o ...ListAle err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -329,11 +348,13 @@ func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, o ...ListAle // partially update the alert receiver func (a *AlertReceiverApi) PatchAlertReceiver(ctx _context.Context, orgName string, receiverId string, body AlertReceiver) (AlertReceiver, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertReceiver + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertReceiver ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.PatchAlertReceiver") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -346,12 +367,14 @@ func (a *AlertReceiverApi) PatchAlertReceiver(ctx _context.Context, orgName stri localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -373,10 +396,11 @@ func (a *AlertReceiverApi) PatchAlertReceiver(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -390,7 +414,7 @@ func (a *AlertReceiverApi) PatchAlertReceiver(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_rule.go b/api/kbcloud/admin/api_alert_rule.go index c2e30fde..6bd4545a 100644 --- a/api/kbcloud/admin/api_alert_rule.go +++ b/api/kbcloud/admin/api_alert_rule.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertRuleApi common.Service // CreateAlertRule Create alert rule. func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, body AlertRule) (AlertRule, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertRule + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertRule ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.CreateAlertRule") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, bod localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, bod if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, bod err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,11 +100,13 @@ func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, bod // DeleteAlertRule Delete alert rule. func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, alertName string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.DeleteAlertRule") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,7 +121,8 @@ func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, ale localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, ale if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -149,7 +162,7 @@ func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, ale err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -161,11 +174,13 @@ func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, ale // GetAlertRule . func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertName string) (AlertRule, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertRule + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertRule ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.GetAlertRule") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -180,7 +195,8 @@ func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -202,10 +218,11 @@ func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -219,7 +236,7 @@ func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -231,11 +248,13 @@ func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertN // ListAlertRules List alert rules. func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (AlertRuleList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertRuleList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertRuleList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.ListAlertRules") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -249,7 +268,8 @@ func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (Ale localVarQueryParams.Add("orgName", common.ParameterToString(orgName, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -271,10 +291,11 @@ func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (Ale if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -288,7 +309,7 @@ func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (Ale err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -300,11 +321,13 @@ func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (Ale // UpdateAlertRule Update alert rule. func (a *AlertRuleApi) UpdateAlertRule(ctx _context.Context, orgName string, alertName string, body AlertRule) (AlertRule, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertRule + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertRule ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.UpdateAlertRule") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -320,9 +343,11 @@ func (a *AlertRuleApi) UpdateAlertRule(ctx _context.Context, orgName string, ale localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -344,10 +369,11 @@ func (a *AlertRuleApi) UpdateAlertRule(ctx _context.Context, orgName string, ale if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -361,7 +387,7 @@ func (a *AlertRuleApi) UpdateAlertRule(ctx _context.Context, orgName string, ale err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_smtp_config.go b/api/kbcloud/admin/api_alert_smtp_config.go index 0f95bc71..3ecea2fc 100644 --- a/api/kbcloud/admin/api_alert_smtp_config.go +++ b/api/kbcloud/admin/api_alert_smtp_config.go @@ -2,10 +2,15 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -18,11 +23,13 @@ type AlertSMTPConfigApi common.Service // GetAlertSMTPConfig Get alert SMTP config. func (a *AlertSMTPConfigApi) GetAlertSMTPConfig(ctx _context.Context) (AlertSMTPConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertSMTPConfig + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertSMTPConfig ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertSMTPConfigApi.GetAlertSMTPConfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -35,7 +42,8 @@ func (a *AlertSMTPConfigApi) GetAlertSMTPConfig(ctx _context.Context) (AlertSMTP localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -57,10 +65,11 @@ func (a *AlertSMTPConfigApi) GetAlertSMTPConfig(ctx _context.Context) (AlertSMTP if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -74,7 +83,7 @@ func (a *AlertSMTPConfigApi) GetAlertSMTPConfig(ctx _context.Context) (AlertSMTP err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -86,11 +95,13 @@ func (a *AlertSMTPConfigApi) GetAlertSMTPConfig(ctx _context.Context) (AlertSMTP // UpdateAlertSMTPConfig Update alert SMTP config. func (a *AlertSMTPConfigApi) UpdateAlertSMTPConfig(ctx _context.Context, body AlertSMTPConfig) (AlertSMTPConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertSMTPConfig + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertSMTPConfig ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertSMTPConfigApi.UpdateAlertSMTPConfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -104,9 +115,11 @@ func (a *AlertSMTPConfigApi) UpdateAlertSMTPConfig(ctx _context.Context, body Al localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -128,10 +141,11 @@ func (a *AlertSMTPConfigApi) UpdateAlertSMTPConfig(ctx _context.Context, body Al if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -145,7 +159,7 @@ func (a *AlertSMTPConfigApi) UpdateAlertSMTPConfig(ctx _context.Context, body Al err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_strategy.go b/api/kbcloud/admin/api_alert_strategy.go index 30c6aaf4..2bd6af81 100644 --- a/api/kbcloud/admin/api_alert_strategy.go +++ b/api/kbcloud/admin/api_alert_strategy.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertStrategyApi common.Service // CreateAlertStrategy Create alert strategy. func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName string, body AlertStrategy) (AlertStrategy, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertStrategy + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertStrategy ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.CreateAlertStrategy") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,11 +100,13 @@ func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName str // DeleteAlertStrategy Delete alert strategy. func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName string, strategyId string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.DeleteAlertStrategy") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,7 +121,8 @@ func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -149,7 +162,7 @@ func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -168,7 +181,6 @@ func NewListAlertStrategiesOptionalParameters() *ListAlertStrategiesOptionalPara this := ListAlertStrategiesOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListAlertStrategiesOptionalParameters) WithOrgName(orgName string) *ListAlertStrategiesOptionalParameters { r.OrgName = &orgName @@ -178,18 +190,20 @@ func (r *ListAlertStrategiesOptionalParameters) WithOrgName(orgName string) *Lis // ListAlertStrategies List alert strategies. func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, o ...ListAlertStrategiesOptionalParameters) (AlertStrategyList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertStrategyList - optionalParams ListAlertStrategiesOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertStrategyList + optionalParams ListAlertStrategiesOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertStrategiesOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertStrategiesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.ListAlertStrategies") if err != nil { @@ -206,7 +220,8 @@ func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, o ...ListAl } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -228,10 +243,11 @@ func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, o ...ListAl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -245,7 +261,7 @@ func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, o ...ListAl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -257,11 +273,13 @@ func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, o ...ListAl // PatchAlertStrategy Update alert strategy. func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName string, body AlertStrategy) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.PatchAlertStrategy") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -276,9 +294,11 @@ func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName stri localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -300,10 +320,11 @@ func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -317,7 +338,7 @@ func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -329,11 +350,13 @@ func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName stri // UpdateAlertStrategy Update alert strategy. func (a *AlertStrategyApi) UpdateAlertStrategy(ctx _context.Context, orgName string, strategyId string, body AlertStrategy) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.UpdateAlertStrategy") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -349,9 +372,11 @@ func (a *AlertStrategyApi) UpdateAlertStrategy(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -373,10 +398,11 @@ func (a *AlertStrategyApi) UpdateAlertStrategy(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -390,7 +416,7 @@ func (a *AlertStrategyApi) UpdateAlertStrategy(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_alert_template.go b/api/kbcloud/admin/api_alert_template.go index 6787c685..8c8847b6 100644 --- a/api/kbcloud/admin/api_alert_template.go +++ b/api/kbcloud/admin/api_alert_template.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertTemplateApi common.Service // CreateAlertTemplate Create alert template. func (a *AlertTemplateApi) CreateAlertTemplate(ctx _context.Context, body AlertTemplate) (AlertTemplate, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertTemplate + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertTemplate ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertTemplateApi.CreateAlertTemplate") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,9 +43,11 @@ func (a *AlertTemplateApi) CreateAlertTemplate(ctx _context.Context, body AlertT localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +69,11 @@ func (a *AlertTemplateApi) CreateAlertTemplate(ctx _context.Context, body AlertT if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +87,7 @@ func (a *AlertTemplateApi) CreateAlertTemplate(ctx _context.Context, body AlertT err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +99,13 @@ func (a *AlertTemplateApi) CreateAlertTemplate(ctx _context.Context, body AlertT // DeleteAlertTemplate Delete alert template. func (a *AlertTemplateApi) DeleteAlertTemplate(ctx _context.Context, templateId string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertTemplateApi.DeleteAlertTemplate") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -108,7 +119,8 @@ func (a *AlertTemplateApi) DeleteAlertTemplate(ctx _context.Context, templateId localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -130,10 +142,11 @@ func (a *AlertTemplateApi) DeleteAlertTemplate(ctx _context.Context, templateId if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -147,7 +160,7 @@ func (a *AlertTemplateApi) DeleteAlertTemplate(ctx _context.Context, templateId err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -159,11 +172,13 @@ func (a *AlertTemplateApi) DeleteAlertTemplate(ctx _context.Context, templateId // GetAlertTemplate Get alert template. func (a *AlertTemplateApi) GetAlertTemplate(ctx _context.Context, templateId string) (AlertTemplate, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertTemplate + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertTemplate ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertTemplateApi.GetAlertTemplate") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -177,7 +192,8 @@ func (a *AlertTemplateApi) GetAlertTemplate(ctx _context.Context, templateId str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -199,10 +215,11 @@ func (a *AlertTemplateApi) GetAlertTemplate(ctx _context.Context, templateId str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -216,7 +233,7 @@ func (a *AlertTemplateApi) GetAlertTemplate(ctx _context.Context, templateId str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -228,11 +245,13 @@ func (a *AlertTemplateApi) GetAlertTemplate(ctx _context.Context, templateId str // ListAlertTemplates List alert templates. func (a *AlertTemplateApi) ListAlertTemplates(ctx _context.Context) (AlertTemplateList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertTemplateList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertTemplateList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertTemplateApi.ListAlertTemplates") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -245,7 +264,8 @@ func (a *AlertTemplateApi) ListAlertTemplates(ctx _context.Context) (AlertTempla localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -267,10 +287,11 @@ func (a *AlertTemplateApi) ListAlertTemplates(ctx _context.Context) (AlertTempla if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -284,7 +305,7 @@ func (a *AlertTemplateApi) ListAlertTemplates(ctx _context.Context) (AlertTempla err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -297,11 +318,13 @@ func (a *AlertTemplateApi) ListAlertTemplates(ctx _context.Context) (AlertTempla // partially update the alert receiver func (a *AlertTemplateApi) PatchAlertTemplate(ctx _context.Context, templateId string, body AlertTemplate) (AlertTemplate, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertTemplate + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertTemplate ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertTemplateApi.PatchAlertTemplate") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -313,12 +336,14 @@ func (a *AlertTemplateApi) PatchAlertTemplate(ctx _context.Context, templateId s localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json-patch+json" + localVarHeaderParams["Content-Type"] = "application/json-patch+json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -340,10 +365,11 @@ func (a *AlertTemplateApi) PatchAlertTemplate(ctx _context.Context, templateId s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -357,7 +383,7 @@ func (a *AlertTemplateApi) PatchAlertTemplate(ctx _context.Context, templateId s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_analyze.go b/api/kbcloud/admin/api_analyze.go index 784d53f2..ac9950d2 100644 --- a/api/kbcloud/admin/api_analyze.go +++ b/api/kbcloud/admin/api_analyze.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AnalyzeApi common.Service // AnalyzeBackup Analyze backup. func (a *AnalyzeApi) AnalyzeBackup(ctx _context.Context, orgName string, backupId string) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *AnalyzeApi) AnalyzeBackup(ctx _context.Context, orgName string, backupI localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *AnalyzeApi) AnalyzeBackup(ctx _context.Context, orgName string, backupI if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *AnalyzeApi) AnalyzeBackup(ctx _context.Context, orgName string, backupI err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -96,7 +104,6 @@ func NewAnalyzeClusterParamOptionalParameters() *AnalyzeClusterParamOptionalPara this := AnalyzeClusterParamOptionalParameters{} return &this } - // WithParameterValue sets the corresponding parameter name and returns the struct. func (r *AnalyzeClusterParamOptionalParameters) WithParameterValue(parameterValue string) *AnalyzeClusterParamOptionalParameters { r.ParameterValue = ¶meterValue @@ -106,18 +113,20 @@ func (r *AnalyzeClusterParamOptionalParameters) WithParameterValue(parameterValu // AnalyzeClusterParam Analyze cluster parameter. func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, clusterName string, parameterName string, o ...AnalyzeClusterParamOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeClusterParamOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeClusterParamOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeClusterParamOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeClusterParamOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeClusterParam") if err != nil { @@ -137,7 +146,8 @@ func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, c } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -159,10 +169,11 @@ func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -176,7 +187,7 @@ func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -188,11 +199,13 @@ func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, c // AnalyzeClusterRestore Analyze cluster restore tasks. func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, clusterName string) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeClusterRestore") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -207,7 +220,8 @@ func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -229,10 +243,11 @@ func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -246,7 +261,7 @@ func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -258,9 +273,9 @@ func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, // AnalyzeLogsOptionalParameters holds optional parameters for AnalyzeLogs. type AnalyzeLogsOptionalParameters struct { ComponentName *string - InstanceName *string - Limit *string - SortType *SortType + InstanceName *string + Limit *string + SortType *SortType } // NewAnalyzeLogsOptionalParameters creates an empty struct for parameters. @@ -268,25 +283,21 @@ func NewAnalyzeLogsOptionalParameters() *AnalyzeLogsOptionalParameters { this := AnalyzeLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *AnalyzeLogsOptionalParameters) WithComponentName(componentName string) *AnalyzeLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithInstanceName sets the corresponding parameter name and returns the struct. func (r *AnalyzeLogsOptionalParameters) WithInstanceName(instanceName string) *AnalyzeLogsOptionalParameters { r.InstanceName = &instanceName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *AnalyzeLogsOptionalParameters) WithLimit(limit string) *AnalyzeLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *AnalyzeLogsOptionalParameters) WithSortType(sortType SortType) *AnalyzeLogsOptionalParameters { r.SortType = &sortType @@ -297,18 +308,20 @@ func (r *AnalyzeLogsOptionalParameters) WithSortType(sortType SortType) *Analyze // Analyze error logs of a cluster func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...AnalyzeLogsOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeLogs") if err != nil { @@ -338,7 +351,8 @@ func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterNa } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -360,10 +374,11 @@ func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -377,7 +392,7 @@ func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -390,11 +405,13 @@ func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterNa // analyze a OpsRequest func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName string, clusterName string, opsType string) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeOps") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -411,7 +428,8 @@ func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName st localVarQueryParams.Add("opsType", common.ParameterToString(opsType, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -433,10 +451,11 @@ func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -450,7 +469,7 @@ func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -461,7 +480,7 @@ func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName st // AnalyzeParamOptionalParameters holds optional parameters for AnalyzeParam. type AnalyzeParamOptionalParameters struct { - OrgName *string + OrgName *string Partition *ParamTplPartition } @@ -470,13 +489,11 @@ func NewAnalyzeParamOptionalParameters() *AnalyzeParamOptionalParameters { this := AnalyzeParamOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *AnalyzeParamOptionalParameters) WithOrgName(orgName string) *AnalyzeParamOptionalParameters { r.OrgName = &orgName return r } - // WithPartition sets the corresponding parameter name and returns the struct. func (r *AnalyzeParamOptionalParameters) WithPartition(partition ParamTplPartition) *AnalyzeParamOptionalParameters { r.Partition = &partition @@ -486,18 +503,20 @@ func (r *AnalyzeParamOptionalParameters) WithPartition(partition ParamTplPartiti // AnalyzeParam Analyze parameter. func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, parameterName string, o ...AnalyzeParamOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeParamOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeParamOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeParamOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeParamOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeParam") if err != nil { @@ -519,7 +538,8 @@ func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, par } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -541,10 +561,11 @@ func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, par if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -558,7 +579,7 @@ func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, par err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -569,7 +590,7 @@ func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, par // AnalyzeServiceOptionalParameters holds optional parameters for AnalyzeService. type AnalyzeServiceOptionalParameters struct { - PortName *string + PortName *string Endpoints *string } @@ -578,13 +599,11 @@ func NewAnalyzeServiceOptionalParameters() *AnalyzeServiceOptionalParameters { this := AnalyzeServiceOptionalParameters{} return &this } - // WithPortName sets the corresponding parameter name and returns the struct. func (r *AnalyzeServiceOptionalParameters) WithPortName(portName string) *AnalyzeServiceOptionalParameters { r.PortName = &portName return r } - // WithEndpoints sets the corresponding parameter name and returns the struct. func (r *AnalyzeServiceOptionalParameters) WithEndpoints(endpoints string) *AnalyzeServiceOptionalParameters { r.Endpoints = &endpoints @@ -594,18 +613,20 @@ func (r *AnalyzeServiceOptionalParameters) WithEndpoints(endpoints string) *Anal // AnalyzeService Analyze service. func (a *AnalyzeApi) AnalyzeService(ctx _context.Context, orgName string, clusterName string, serviceName string, o ...AnalyzeServiceOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeServiceOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeServiceOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeServiceOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeServiceOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeService") if err != nil { @@ -628,7 +649,8 @@ func (a *AnalyzeApi) AnalyzeService(ctx _context.Context, orgName string, cluste } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -650,10 +672,11 @@ func (a *AnalyzeApi) AnalyzeService(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -667,7 +690,7 @@ func (a *AnalyzeApi) AnalyzeService(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -686,7 +709,6 @@ func NewAnalyzeSlowLogsOptionalParameters() *AnalyzeSlowLogsOptionalParameters { this := AnalyzeSlowLogsOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *AnalyzeSlowLogsOptionalParameters) WithBody(body ClusterExecutionLog) *AnalyzeSlowLogsOptionalParameters { r.Body = &body @@ -697,18 +719,20 @@ func (r *AnalyzeSlowLogsOptionalParameters) WithBody(body ClusterExecutionLog) * // Analyze slow logs of a cluster func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clusterName string, o ...AnalyzeSlowLogsOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeSlowLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeSlowLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeSlowLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeSlowLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeSlowLogs") if err != nil { @@ -725,11 +749,13 @@ func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clust localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -751,10 +777,11 @@ func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -768,7 +795,7 @@ func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clust err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -780,11 +807,13 @@ func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clust // AnalyzeView Analyze cluster view. func (a *AnalyzeApi) AnalyzeView(ctx _context.Context, orgName string, clusterName string) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeView") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -799,7 +828,8 @@ func (a *AnalyzeApi) AnalyzeView(ctx _context.Context, orgName string, clusterNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -821,10 +851,11 @@ func (a *AnalyzeApi) AnalyzeView(ctx _context.Context, orgName string, clusterNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -838,7 +869,7 @@ func (a *AnalyzeApi) AnalyzeView(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_autohealing.go b/api/kbcloud/admin/api_autohealing.go index 7a44a3ca..e2c2f2d4 100644 --- a/api/kbcloud/admin/api_autohealing.go +++ b/api/kbcloud/admin/api_autohealing.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AutohealingApi common.Service // GetAutohealing list autohealing job. func (a *AutohealingApi) GetAutohealing(ctx _context.Context, orgName string, clusterName string) ([]AutohealingListItem, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []AutohealingListItem + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []AutohealingListItem ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AutohealingApi.GetAutohealing") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *AutohealingApi) GetAutohealing(ctx _context.Context, orgName string, cl localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,7 +68,7 @@ func (a *AutohealingApi) GetAutohealing(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_backup.go b/api/kbcloud/admin/api_backup.go index d26254fb..55dde6ec 100644 --- a/api/kbcloud/admin/api_backup.go +++ b/api/kbcloud/admin/api_backup.go @@ -2,14 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +23,13 @@ type BackupApi common.Service // CreateClusterBackup Create backup. func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, clusterName string, body BackupCreate) (Backup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Backup + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Backup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.CreateClusterBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,9 +45,11 @@ func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, cl localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -64,10 +71,11 @@ func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -81,7 +89,7 @@ func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +101,12 @@ func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, cl // DeleteBackup Delete backup. func (a *BackupApi) DeleteBackup(ctx _context.Context, orgName string, backupId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.DeleteBackup") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +121,8 @@ func (a *BackupApi) DeleteBackup(ctx _context.Context, orgName string, backupId localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +144,11 @@ func (a *BackupApi) DeleteBackup(ctx _context.Context, orgName string, backupId if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -153,11 +165,13 @@ func (a *BackupApi) DeleteBackup(ctx _context.Context, orgName string, backupId // DownloadBackup Download full backup. func (a *BackupApi) DownloadBackup(ctx _context.Context, orgName string, backupId string) (_io.Reader, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue _io.Reader + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue _io.Reader ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.DownloadBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -170,9 +184,10 @@ func (a *BackupApi) DownloadBackup(ctx _context.Context, orgName string, backupI localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "application/octet-stream" + localVarHeaderParams["Accept"] = "application/octet-stream" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -194,11 +209,13 @@ func (a *BackupApi) DownloadBackup(ctx _context.Context, orgName string, backupI // DownloadMutipleBackups Download mutiple backup files. func (a *BackupApi) DownloadMutipleBackups(ctx _context.Context, orgName string, backupId string, body BackupDownload) (_io.Reader, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue _io.Reader + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue _io.Reader ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.DownloadMutipleBackups") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -212,11 +229,13 @@ func (a *BackupApi) DownloadMutipleBackups(ctx _context.Context, orgName string, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/octet-stream" + localVarHeaderParams["Accept"] = "application/octet-stream" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -238,11 +257,13 @@ func (a *BackupApi) DownloadMutipleBackups(ctx _context.Context, orgName string, // GetBackup Get backup. func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId string) (Backup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Backup + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Backup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.GetBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -257,7 +278,8 @@ func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -279,10 +301,11 @@ func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -296,7 +319,7 @@ func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -308,11 +331,13 @@ func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId str // GetBackupLog Get backup log. func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId string) (BackupLog, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupLog + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupLog ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.GetBackupLog") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -327,7 +352,8 @@ func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -349,10 +375,11 @@ func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -366,7 +393,7 @@ func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -378,11 +405,13 @@ func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId // GetBackupStats Get backup statistics. func (a *BackupApi) GetBackupStats(ctx _context.Context, orgName string) (BackupStats, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupStats + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupStats ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.GetBackupStats") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -396,7 +425,8 @@ func (a *BackupApi) GetBackupStats(ctx _context.Context, orgName string) (Backup localVarQueryParams.Add("orgName", common.ParameterToString(orgName, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -418,10 +448,11 @@ func (a *BackupApi) GetBackupStats(ctx _context.Context, orgName string) (Backup if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -435,7 +466,7 @@ func (a *BackupApi) GetBackupStats(ctx _context.Context, orgName string) (Backup err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -454,7 +485,6 @@ func NewGetClusterBackupPolicyOptionalParameters() *GetClusterBackupPolicyOption this := GetClusterBackupPolicyOptionalParameters{} return &this } - // WithUseVolumeSnapshot sets the corresponding parameter name and returns the struct. func (r *GetClusterBackupPolicyOptionalParameters) WithUseVolumeSnapshot(useVolumeSnapshot bool) *GetClusterBackupPolicyOptionalParameters { r.UseVolumeSnapshot = &useVolumeSnapshot @@ -464,18 +494,20 @@ func (r *GetClusterBackupPolicyOptionalParameters) WithUseVolumeSnapshot(useVolu // GetClusterBackupPolicy Get backup policy. func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, clusterName string, o ...GetClusterBackupPolicyOptionalParameters) (BackupPolicy, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupPolicy - optionalParams GetClusterBackupPolicyOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupPolicy + optionalParams GetClusterBackupPolicyOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterBackupPolicyOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterBackupPolicyOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.GetClusterBackupPolicy") if err != nil { @@ -494,7 +526,8 @@ func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -516,10 +549,11 @@ func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -533,7 +567,7 @@ func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -544,14 +578,14 @@ func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, // ListBackupsOptionalParameters holds optional parameters for ListBackups. type ListBackupsOptionalParameters struct { - OrgName *string - ClusterName *string - ClusterId *string - BackupRepo *string + OrgName *string + ClusterName *string + ClusterId *string + BackupRepo *string FetchWithDeletedCluster *bool - WithDeletedBackups *bool - BackupType *string - ComponentName *string + WithDeletedBackups *bool + BackupType *string + ComponentName *string } // NewListBackupsOptionalParameters creates an empty struct for parameters. @@ -559,49 +593,41 @@ func NewListBackupsOptionalParameters() *ListBackupsOptionalParameters { this := ListBackupsOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithOrgName(orgName string) *ListBackupsOptionalParameters { r.OrgName = &orgName return r } - // WithClusterName sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithClusterName(clusterName string) *ListBackupsOptionalParameters { r.ClusterName = &clusterName return r } - // WithClusterId sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithClusterId(clusterId string) *ListBackupsOptionalParameters { r.ClusterId = &clusterId return r } - // WithBackupRepo sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithBackupRepo(backupRepo string) *ListBackupsOptionalParameters { r.BackupRepo = &backupRepo return r } - // WithFetchWithDeletedCluster sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithFetchWithDeletedCluster(fetchWithDeletedCluster bool) *ListBackupsOptionalParameters { r.FetchWithDeletedCluster = &fetchWithDeletedCluster return r } - // WithWithDeletedBackups sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithWithDeletedBackups(withDeletedBackups bool) *ListBackupsOptionalParameters { r.WithDeletedBackups = &withDeletedBackups return r } - // WithBackupType sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithBackupType(backupType string) *ListBackupsOptionalParameters { r.BackupType = &backupType return r } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithComponentName(componentName string) *ListBackupsOptionalParameters { r.ComponentName = &componentName @@ -611,18 +637,20 @@ func (r *ListBackupsOptionalParameters) WithComponentName(componentName string) // ListBackups List backups. func (a *BackupApi) ListBackups(ctx _context.Context, o ...ListBackupsOptionalParameters) (BackupList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupList - optionalParams ListBackupsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupList + optionalParams ListBackupsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListBackupsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListBackupsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.ListBackups") if err != nil { @@ -660,7 +688,8 @@ func (a *BackupApi) ListBackups(ctx _context.Context, o ...ListBackupsOptionalPa } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -682,10 +711,11 @@ func (a *BackupApi) ListBackups(ctx _context.Context, o ...ListBackupsOptionalPa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -699,7 +729,7 @@ func (a *BackupApi) ListBackups(ctx _context.Context, o ...ListBackupsOptionalPa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -718,7 +748,6 @@ func NewPatchBackupPolicyOptionalParameters() *PatchBackupPolicyOptionalParamete this := PatchBackupPolicyOptionalParameters{} return &this } - // WithUseVolumeSnapshot sets the corresponding parameter name and returns the struct. func (r *PatchBackupPolicyOptionalParameters) WithUseVolumeSnapshot(useVolumeSnapshot bool) *PatchBackupPolicyOptionalParameters { r.UseVolumeSnapshot = &useVolumeSnapshot @@ -729,18 +758,20 @@ func (r *PatchBackupPolicyOptionalParameters) WithUseVolumeSnapshot(useVolumeSna // partially update the specified Backup Policy func (a *BackupApi) PatchBackupPolicy(ctx _context.Context, orgName string, clusterName string, body BackupPolicy, o ...PatchBackupPolicyOptionalParameters) (BackupPolicy, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue BackupPolicy - optionalParams PatchBackupPolicyOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue BackupPolicy + optionalParams PatchBackupPolicyOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type PatchBackupPolicyOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type PatchBackupPolicyOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.PatchBackupPolicy") if err != nil { @@ -760,9 +791,11 @@ func (a *BackupApi) PatchBackupPolicy(ctx _context.Context, orgName string, clus localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -784,10 +817,11 @@ func (a *BackupApi) PatchBackupPolicy(ctx _context.Context, orgName string, clus if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -801,7 +835,7 @@ func (a *BackupApi) PatchBackupPolicy(ctx _context.Context, orgName string, clus err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -820,7 +854,6 @@ func NewViewBackupOptionalParameters() *ViewBackupOptionalParameters { this := ViewBackupOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *ViewBackupOptionalParameters) WithBody(body BackupView) *ViewBackupOptionalParameters { r.Body = &body @@ -830,18 +863,20 @@ func (r *ViewBackupOptionalParameters) WithBody(body BackupView) *ViewBackupOpti // ViewBackup view backup info. func (a *BackupApi) ViewBackup(ctx _context.Context, orgName string, backupId string, o ...ViewBackupOptionalParameters) (FileEntryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue FileEntryList - optionalParams ViewBackupOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue FileEntryList + optionalParams ViewBackupOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ViewBackupOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ViewBackupOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.ViewBackup") if err != nil { @@ -858,11 +893,13 @@ func (a *BackupApi) ViewBackup(ctx _context.Context, orgName string, backupId st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -884,10 +921,11 @@ func (a *BackupApi) ViewBackup(ctx _context.Context, orgName string, backupId st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -901,7 +939,7 @@ func (a *BackupApi) ViewBackup(ctx _context.Context, orgName string, backupId st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_backup_repo.go b/api/kbcloud/admin/api_backup_repo.go index e86ae0ff..422d89ed 100644 --- a/api/kbcloud/admin/api_backup_repo.go +++ b/api/kbcloud/admin/api_backup_repo.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewCheckBackupRepoOptionalParameters() *CheckBackupRepoOptionalParameters { this := CheckBackupRepoOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *CheckBackupRepoOptionalParameters) WithOrgName(orgName string) *CheckBackupRepoOptionalParameters { r.OrgName = &orgName @@ -36,18 +39,20 @@ func (r *CheckBackupRepoOptionalParameters) WithOrgName(orgName string) *CheckBa // CheckBackupRepo check backup repo. func (a *BackupRepoApi) CheckBackupRepo(ctx _context.Context, environmentName string, backupRepoName string, o ...CheckBackupRepoOptionalParameters) (BackupRepoCheck, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupRepoCheck - optionalParams CheckBackupRepoOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupRepoCheck + optionalParams CheckBackupRepoOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CheckBackupRepoOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CheckBackupRepoOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.CheckBackupRepo") if err != nil { @@ -66,7 +71,8 @@ func (a *BackupRepoApi) CheckBackupRepo(ctx _context.Context, environmentName st } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -88,10 +94,11 @@ func (a *BackupRepoApi) CheckBackupRepo(ctx _context.Context, environmentName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -105,7 +112,7 @@ func (a *BackupRepoApi) CheckBackupRepo(ctx _context.Context, environmentName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -117,11 +124,13 @@ func (a *BackupRepoApi) CheckBackupRepo(ctx _context.Context, environmentName st // CreateBackupRepo Create backup repo. func (a *BackupRepoApi) CreateBackupRepo(ctx _context.Context, environmentName string, body BackupRepoCreate) (BackupRepo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue BackupRepo + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue BackupRepo ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.CreateBackupRepo") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -136,9 +145,11 @@ func (a *BackupRepoApi) CreateBackupRepo(ctx _context.Context, environmentName s localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -160,10 +171,11 @@ func (a *BackupRepoApi) CreateBackupRepo(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -177,7 +189,7 @@ func (a *BackupRepoApi) CreateBackupRepo(ctx _context.Context, environmentName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -189,10 +201,12 @@ func (a *BackupRepoApi) CreateBackupRepo(ctx _context.Context, environmentName s // DeleteBackupRepo Delete backup repo. func (a *BackupRepoApi) DeleteBackupRepo(ctx _context.Context, environmentName string, backupRepoName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.DeleteBackupRepo") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -207,7 +221,8 @@ func (a *BackupRepoApi) DeleteBackupRepo(ctx _context.Context, environmentName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -229,10 +244,11 @@ func (a *BackupRepoApi) DeleteBackupRepo(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -256,7 +272,6 @@ func NewGetBackupRepoOptionalParameters() *GetBackupRepoOptionalParameters { this := GetBackupRepoOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *GetBackupRepoOptionalParameters) WithOrgName(orgName string) *GetBackupRepoOptionalParameters { r.OrgName = &orgName @@ -266,18 +281,20 @@ func (r *GetBackupRepoOptionalParameters) WithOrgName(orgName string) *GetBackup // GetBackupRepo Get backup repo. func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName string, backupRepoName string, o ...GetBackupRepoOptionalParameters) (BackupRepo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupRepo - optionalParams GetBackupRepoOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupRepo + optionalParams GetBackupRepoOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetBackupRepoOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetBackupRepoOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.GetBackupRepo") if err != nil { @@ -296,7 +313,8 @@ func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName stri } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -318,10 +336,11 @@ func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -335,7 +354,7 @@ func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -347,11 +366,13 @@ func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName stri // ListBackupRepos List backup repos. func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, environmentName string) (BackupRepoList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupRepoList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupRepoList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.ListBackupRepos") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -365,7 +386,8 @@ func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, environmentName st localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -387,10 +409,11 @@ func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, environmentName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -404,7 +427,7 @@ func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, environmentName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -416,11 +439,13 @@ func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, environmentName st // ListStorageProvidersArchive List storage providers of backup repo. func (a *BackupRepoApi) ListStorageProvidersArchive(ctx _context.Context, environmentName string) ([]string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []string + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.ListStorageProvidersArchive") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -434,7 +459,8 @@ func (a *BackupRepoApi) ListStorageProvidersArchive(ctx _context.Context, enviro localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -456,10 +482,11 @@ func (a *BackupRepoApi) ListStorageProvidersArchive(ctx _context.Context, enviro if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -473,7 +500,7 @@ func (a *BackupRepoApi) ListStorageProvidersArchive(ctx _context.Context, enviro err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -485,11 +512,13 @@ func (a *BackupRepoApi) ListStorageProvidersArchive(ctx _context.Context, enviro // UpdateBackupRepo Update backup repo. func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName string, backupRepoName string, body BackupRepoUpdate) (BackupRepo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue BackupRepo + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue BackupRepo ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.UpdateBackupRepo") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -505,9 +534,11 @@ func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName s localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -529,10 +560,11 @@ func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -546,7 +578,7 @@ func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -558,11 +590,13 @@ func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName s // ViewBackupRepo view backup repo. func (a *BackupRepoApi) ViewBackupRepo(ctx _context.Context, environmentName string, backupRepoName string, body BackupRepoView) (FileEntryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue FileEntryList + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue FileEntryList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.ViewBackupRepo") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -578,9 +612,11 @@ func (a *BackupRepoApi) ViewBackupRepo(ctx _context.Context, environmentName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -602,10 +638,11 @@ func (a *BackupRepoApi) ViewBackupRepo(ctx _context.Context, environmentName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -619,7 +656,7 @@ func (a *BackupRepoApi) ViewBackupRepo(ctx _context.Context, environmentName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_class.go b/api/kbcloud/admin/api_class.go index 454547ec..add2fa88 100644 --- a/api/kbcloud/admin/api_class.go +++ b/api/kbcloud/admin/api_class.go @@ -2,10 +2,15 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -25,7 +30,6 @@ func NewBatchClassOptionalParameters() *BatchClassOptionalParameters { this := BatchClassOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *BatchClassOptionalParameters) WithBody(body ClassBatch) *BatchClassOptionalParameters { r.Body = &body @@ -35,17 +39,19 @@ func (r *BatchClassOptionalParameters) WithBody(body ClassBatch) *BatchClassOpti // BatchClass batch update class over-commit. func (a *ClassApi) BatchClass(ctx _context.Context, o ...BatchClassOptionalParameters) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - optionalParams BatchClassOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + optionalParams BatchClassOptionalParameters ) - if len(o) > 1 { - return nil, common.ReportError("only one argument of type BatchClassOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return nil, common.ReportError("only one argument of type BatchClassOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.BatchClass") if err != nil { @@ -60,11 +66,13 @@ func (a *ClassApi) BatchClass(ctx _context.Context, o ...BatchClassOptionalParam localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -86,10 +94,11 @@ func (a *ClassApi) BatchClass(ctx _context.Context, o ...BatchClassOptionalParam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -113,7 +122,6 @@ func NewCreateClassOptionalParameters() *CreateClassOptionalParameters { this := CreateClassOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *CreateClassOptionalParameters) WithBody(body Class) *CreateClassOptionalParameters { r.Body = &body @@ -123,18 +131,20 @@ func (r *CreateClassOptionalParameters) WithBody(body Class) *CreateClassOptiona // CreateClass Create class. func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalParameters) (Class, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Class - optionalParams CreateClassOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Class + optionalParams CreateClassOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CreateClassOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CreateClassOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.CreateClass") if err != nil { @@ -149,11 +159,13 @@ func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalPar localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -175,10 +187,11 @@ func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalPar if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -192,7 +205,7 @@ func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalPar err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -204,11 +217,13 @@ func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalPar // DeleteClass Delete class. func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.DeleteClass") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -222,7 +237,8 @@ func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, localVarQueryParams.Add("code", common.ParameterToString(code, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -244,10 +260,11 @@ func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -261,7 +278,7 @@ func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -273,11 +290,13 @@ func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, // ListClasses List classes. func (a *ClassApi) ListClasses(ctx _context.Context) ([]Class, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Class + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Class ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.ListClasses") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -290,7 +309,8 @@ func (a *ClassApi) ListClasses(ctx _context.Context) ([]Class, *_nethttp.Respons localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -312,10 +332,11 @@ func (a *ClassApi) ListClasses(ctx _context.Context) ([]Class, *_nethttp.Respons if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -329,7 +350,7 @@ func (a *ClassApi) ListClasses(ctx _context.Context) ([]Class, *_nethttp.Respons err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -348,7 +369,6 @@ func NewPatchClassOptionalParameters() *PatchClassOptionalParameters { this := PatchClassOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *PatchClassOptionalParameters) WithBody(body Class) *PatchClassOptionalParameters { r.Body = &body @@ -358,18 +378,20 @@ func (r *PatchClassOptionalParameters) WithBody(body Class) *PatchClassOptionalP // PatchClass Patch class. func (a *ClassApi) PatchClass(ctx _context.Context, o ...PatchClassOptionalParameters) (Class, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Class - optionalParams PatchClassOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Class + optionalParams PatchClassOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type PatchClassOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type PatchClassOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.PatchClass") if err != nil { @@ -384,11 +406,13 @@ func (a *ClassApi) PatchClass(ctx _context.Context, o ...PatchClassOptionalParam localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -410,10 +434,11 @@ func (a *ClassApi) PatchClass(ctx _context.Context, o ...PatchClassOptionalParam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -427,7 +452,7 @@ func (a *ClassApi) PatchClass(ctx _context.Context, o ...PatchClassOptionalParam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_cluster.go b/api/kbcloud/admin/api_cluster.go index 4cec00d2..0fb3b957 100644 --- a/api/kbcloud/admin/api_cluster.go +++ b/api/kbcloud/admin/api_cluster.go @@ -2,14 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "reflect" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +23,13 @@ type ClusterApi common.Service // CreateCluster Create new cluster. func (a *ClusterApi) CreateCluster(ctx _context.Context, orgName string, body Cluster) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.CreateCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +44,11 @@ func (a *ClusterApi) CreateCluster(ctx _context.Context, orgName string, body Cl localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +70,11 @@ func (a *ClusterApi) CreateCluster(ctx _context.Context, orgName string, body Cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +88,7 @@ func (a *ClusterApi) CreateCluster(ctx _context.Context, orgName string, body Cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -99,7 +107,6 @@ func NewDeleteClusterOptionalParameters() *DeleteClusterOptionalParameters { this := DeleteClusterOptionalParameters{} return &this } - // WithForce sets the corresponding parameter name and returns the struct. func (r *DeleteClusterOptionalParameters) WithForce(force bool) *DeleteClusterOptionalParameters { r.Force = &force @@ -109,18 +116,20 @@ func (r *DeleteClusterOptionalParameters) WithForce(force bool) *DeleteClusterOp // DeleteCluster Delete cluster. func (a *ClusterApi) DeleteCluster(ctx _context.Context, orgName string, clusterName string, o ...DeleteClusterOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams DeleteClusterOptionalParameters + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams DeleteClusterOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type DeleteClusterOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type DeleteClusterOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.DeleteCluster") if err != nil { @@ -139,7 +148,8 @@ func (a *ClusterApi) DeleteCluster(ctx _context.Context, orgName string, cluster } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -161,10 +171,11 @@ func (a *ClusterApi) DeleteCluster(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -178,7 +189,7 @@ func (a *ClusterApi) DeleteCluster(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -197,7 +208,6 @@ func NewDescribeClusterHaHistoryOptionalParameters() *DescribeClusterHaHistoryOp this := DescribeClusterHaHistoryOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *DescribeClusterHaHistoryOptionalParameters) WithComponentName(componentName string) *DescribeClusterHaHistoryOptionalParameters { r.ComponentName = &componentName @@ -207,18 +217,20 @@ func (r *DescribeClusterHaHistoryOptionalParameters) WithComponentName(component // DescribeClusterHaHistory describe cluster HA history. func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName string, clusterName string, o ...DescribeClusterHaHistoryOptionalParameters) (HaHistoryResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue HaHistoryResponse - optionalParams DescribeClusterHaHistoryOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue HaHistoryResponse + optionalParams DescribeClusterHaHistoryOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type DescribeClusterHaHistoryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type DescribeClusterHaHistoryOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.DescribeClusterHaHistory") if err != nil { @@ -237,7 +249,8 @@ func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName stri } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -259,10 +272,11 @@ func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -276,7 +290,7 @@ func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -288,11 +302,13 @@ func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName stri // GetCluster Get cluster details. func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterName string) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -307,7 +323,8 @@ func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -329,10 +346,11 @@ func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -346,7 +364,7 @@ func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -358,11 +376,13 @@ func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterNam // GetClusterByID Get cluster details by ID. func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, clusterId int32) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetClusterByID") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -377,7 +397,8 @@ func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, cluste localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -399,10 +420,11 @@ func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -416,7 +438,7 @@ func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -428,9 +450,9 @@ func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, cluste // GetClusterInstanceLogOptionalParameters holds optional parameters for GetClusterInstanceLog. type GetClusterInstanceLogOptionalParameters struct { WorkloadType *string - Previous *bool + Previous *bool SinceSeconds *int32 - TailLines *int32 + TailLines *int32 } // NewGetClusterInstanceLogOptionalParameters creates an empty struct for parameters. @@ -438,25 +460,21 @@ func NewGetClusterInstanceLogOptionalParameters() *GetClusterInstanceLogOptional this := GetClusterInstanceLogOptionalParameters{} return &this } - // WithWorkloadType sets the corresponding parameter name and returns the struct. func (r *GetClusterInstanceLogOptionalParameters) WithWorkloadType(workloadType string) *GetClusterInstanceLogOptionalParameters { r.WorkloadType = &workloadType return r } - // WithPrevious sets the corresponding parameter name and returns the struct. func (r *GetClusterInstanceLogOptionalParameters) WithPrevious(previous bool) *GetClusterInstanceLogOptionalParameters { r.Previous = &previous return r } - // WithSinceSeconds sets the corresponding parameter name and returns the struct. func (r *GetClusterInstanceLogOptionalParameters) WithSinceSeconds(sinceSeconds int32) *GetClusterInstanceLogOptionalParameters { r.SinceSeconds = &sinceSeconds return r } - // WithTailLines sets the corresponding parameter name and returns the struct. func (r *GetClusterInstanceLogOptionalParameters) WithTailLines(tailLines int32) *GetClusterInstanceLogOptionalParameters { r.TailLines = &tailLines @@ -467,18 +485,20 @@ func (r *GetClusterInstanceLogOptionalParameters) WithTailLines(tailLines int32) // read log of the specified cluster instance func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, clusterName string, workloadName string, o ...GetClusterInstanceLogOptionalParameters) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue string - optionalParams GetClusterInstanceLogOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue string + optionalParams GetClusterInstanceLogOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterInstanceLogOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterInstanceLogOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetClusterInstanceLog") if err != nil { @@ -507,7 +527,8 @@ func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -529,10 +550,11 @@ func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -546,7 +568,7 @@ func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -557,7 +579,7 @@ func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, // GetClusterManifestOptionalParameters holds optional parameters for GetClusterManifest. type GetClusterManifestOptionalParameters struct { - OpsType *OpsType + OpsType *OpsType Component *string } @@ -566,13 +588,11 @@ func NewGetClusterManifestOptionalParameters() *GetClusterManifestOptionalParame this := GetClusterManifestOptionalParameters{} return &this } - // WithOpsType sets the corresponding parameter name and returns the struct. func (r *GetClusterManifestOptionalParameters) WithOpsType(opsType OpsType) *GetClusterManifestOptionalParameters { r.OpsType = &opsType return r } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *GetClusterManifestOptionalParameters) WithComponent(component string) *GetClusterManifestOptionalParameters { r.Component = &component @@ -582,18 +602,20 @@ func (r *GetClusterManifestOptionalParameters) WithComponent(component string) * // GetClusterManifest Get cluster manifests of kubernetes. func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, clusterName string, manifestType ManifestType, o ...GetClusterManifestOptionalParameters) (KubernetesManifestList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue KubernetesManifestList - optionalParams GetClusterManifestOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue KubernetesManifestList + optionalParams GetClusterManifestOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterManifestOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterManifestOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetClusterManifest") if err != nil { @@ -616,7 +638,8 @@ func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, cl } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -638,10 +661,11 @@ func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -655,7 +679,7 @@ func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -667,11 +691,13 @@ func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, cl // GetInstacesMetrics Get instaces metrics in cluster. func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, clusterName string) (InstanceMetricsList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue InstanceMetricsList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue InstanceMetricsList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetInstacesMetrics") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -686,7 +712,8 @@ func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, cl localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -708,10 +735,11 @@ func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -725,7 +753,7 @@ func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -737,13 +765,13 @@ func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, cl // ListClusterOptionalParameters holds optional parameters for ListCluster. type ListClusterOptionalParameters struct { ClusterDefinition *string - EnvironmentName *string - EnvironmentType *EnvironmentType - TagKey *string - TagValue *string - TagKeys *[]string - TagValues *[]string - LicenseId *int32 + EnvironmentName *string + EnvironmentType *EnvironmentType + TagKey *string + TagValue *string + TagKeys *[]string + TagValues *[]string + LicenseId *int32 } // NewListClusterOptionalParameters creates an empty struct for parameters. @@ -751,49 +779,41 @@ func NewListClusterOptionalParameters() *ListClusterOptionalParameters { this := ListClusterOptionalParameters{} return &this } - // WithClusterDefinition sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithClusterDefinition(clusterDefinition string) *ListClusterOptionalParameters { r.ClusterDefinition = &clusterDefinition return r } - // WithEnvironmentName sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithEnvironmentName(environmentName string) *ListClusterOptionalParameters { r.EnvironmentName = &environmentName return r } - // WithEnvironmentType sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithEnvironmentType(environmentType EnvironmentType) *ListClusterOptionalParameters { r.EnvironmentType = &environmentType return r } - // WithTagKey sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithTagKey(tagKey string) *ListClusterOptionalParameters { r.TagKey = &tagKey return r } - // WithTagValue sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithTagValue(tagValue string) *ListClusterOptionalParameters { r.TagValue = &tagValue return r } - // WithTagKeys sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithTagKeys(tagKeys []string) *ListClusterOptionalParameters { r.TagKeys = &tagKeys return r } - // WithTagValues sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithTagValues(tagValues []string) *ListClusterOptionalParameters { r.TagValues = &tagValues return r } - // WithLicenseId sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithLicenseId(licenseId int32) *ListClusterOptionalParameters { r.LicenseId = &licenseId @@ -803,18 +823,20 @@ func (r *ListClusterOptionalParameters) WithLicenseId(licenseId int32) *ListClus // ListCluster List clusters in the Org. func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...ListClusterOptionalParameters) (ClusterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ClusterList - optionalParams ListClusterOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ClusterList + optionalParams ListClusterOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListClusterOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListClusterOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.ListCluster") if err != nil { @@ -869,7 +891,8 @@ func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...List } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -891,10 +914,11 @@ func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...List if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -908,7 +932,7 @@ func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...List err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -928,13 +952,11 @@ func NewListClustersOptionalParameters() *ListClustersOptionalParameters { this := ListClustersOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListClustersOptionalParameters) WithOrgName(orgName string) *ListClustersOptionalParameters { r.OrgName = &orgName return r } - // WithEnvName sets the corresponding parameter name and returns the struct. func (r *ListClustersOptionalParameters) WithEnvName(envName string) *ListClustersOptionalParameters { r.EnvName = &envName @@ -945,18 +967,20 @@ func (r *ListClustersOptionalParameters) WithEnvName(envName string) *ListCluste // Get cluster list func (a *ClusterApi) ListClusters(ctx _context.Context, o ...ListClustersOptionalParameters) (ClusterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ClusterList - optionalParams ListClustersOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ClusterList + optionalParams ListClustersOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListClustersOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListClustersOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.ListClusters") if err != nil { @@ -976,7 +1000,8 @@ func (a *ClusterApi) ListClusters(ctx _context.Context, o ...ListClustersOptiona } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -998,10 +1023,11 @@ func (a *ClusterApi) ListClusters(ctx _context.Context, o ...ListClustersOptiona if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1015,7 +1041,7 @@ func (a *ClusterApi) ListClusters(ctx _context.Context, o ...ListClustersOptiona err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1027,7 +1053,7 @@ func (a *ClusterApi) ListClusters(ctx _context.Context, o ...ListClustersOptiona // ListEndpointsOptionalParameters holds optional parameters for ListEndpoints. type ListEndpointsOptionalParameters struct { NodePortHostCount *int32 - IncludeClusterIp *bool + IncludeClusterIp *bool } // NewListEndpointsOptionalParameters creates an empty struct for parameters. @@ -1035,13 +1061,11 @@ func NewListEndpointsOptionalParameters() *ListEndpointsOptionalParameters { this := ListEndpointsOptionalParameters{} return &this } - // WithNodePortHostCount sets the corresponding parameter name and returns the struct. func (r *ListEndpointsOptionalParameters) WithNodePortHostCount(nodePortHostCount int32) *ListEndpointsOptionalParameters { r.NodePortHostCount = &nodePortHostCount return r } - // WithIncludeClusterIp sets the corresponding parameter name and returns the struct. func (r *ListEndpointsOptionalParameters) WithIncludeClusterIp(includeClusterIp bool) *ListEndpointsOptionalParameters { r.IncludeClusterIp = &includeClusterIp @@ -1051,18 +1075,20 @@ func (r *ListEndpointsOptionalParameters) WithIncludeClusterIp(includeClusterIp // ListEndpoints List cluster endpoints. func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, clusterName string, o ...ListEndpointsOptionalParameters) (EndpointList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EndpointList - optionalParams ListEndpointsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EndpointList + optionalParams ListEndpointsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEndpointsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEndpointsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.ListEndpoints") if err != nil { @@ -1084,7 +1110,8 @@ func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, cluster } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1106,10 +1133,11 @@ func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1123,7 +1151,7 @@ func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1135,11 +1163,13 @@ func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, cluster // ListInstance List cluster instances. func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterName string) (InstanceList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue InstanceList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue InstanceList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.ListInstance") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1154,7 +1184,8 @@ func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1176,10 +1207,11 @@ func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1193,7 +1225,7 @@ func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1206,11 +1238,13 @@ func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterN // Update the specified Cluster func (a *ClusterApi) PatchCluster(ctx _context.Context, orgName string, clusterName string, body ClusterUpdate) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.PatchCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1223,12 +1257,14 @@ func (a *ClusterApi) PatchCluster(ctx _context.Context, orgName string, clusterN localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1250,10 +1286,11 @@ func (a *ClusterApi) PatchCluster(ctx _context.Context, orgName string, clusterN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1267,7 +1304,7 @@ func (a *ClusterApi) PatchCluster(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_cluster_alert_switch.go b/api/kbcloud/admin/api_cluster_alert_switch.go index 8da7d1bc..fd726e44 100644 --- a/api/kbcloud/admin/api_cluster_alert_switch.go +++ b/api/kbcloud/admin/api_cluster_alert_switch.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type ClusterAlertSwitchApi common.Service // GetClusterAlertDisabled Check if cluster alert is disabled. func (a *ClusterAlertSwitchApi) GetClusterAlertDisabled(ctx _context.Context, orgName string, clusterName string) (AlertCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertCluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertCluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterAlertSwitchApi.GetClusterAlertDisabled") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *ClusterAlertSwitchApi) GetClusterAlertDisabled(ctx _context.Context, or localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *ClusterAlertSwitchApi) GetClusterAlertDisabled(ctx _context.Context, or if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *ClusterAlertSwitchApi) GetClusterAlertDisabled(ctx _context.Context, or err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -96,7 +104,6 @@ func NewSetClusterAlertDisabledOptionalParameters() *SetClusterAlertDisabledOpti this := SetClusterAlertDisabledOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *SetClusterAlertDisabledOptionalParameters) WithBody(body AlertCluster) *SetClusterAlertDisabledOptionalParameters { r.Body = &body @@ -106,18 +113,20 @@ func (r *SetClusterAlertDisabledOptionalParameters) WithBody(body AlertCluster) // SetClusterAlertDisabled Set cluster alert disabled or enabled. func (a *ClusterAlertSwitchApi) SetClusterAlertDisabled(ctx _context.Context, orgName string, clusterName string, o ...SetClusterAlertDisabledOptionalParameters) (AlertCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertCluster - optionalParams SetClusterAlertDisabledOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertCluster + optionalParams SetClusterAlertDisabledOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type SetClusterAlertDisabledOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type SetClusterAlertDisabledOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterAlertSwitchApi.SetClusterAlertDisabled") if err != nil { @@ -134,11 +143,13 @@ func (a *ClusterAlertSwitchApi) SetClusterAlertDisabled(ctx _context.Context, or localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -160,10 +171,11 @@ func (a *ClusterAlertSwitchApi) SetClusterAlertDisabled(ctx _context.Context, or if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -177,7 +189,7 @@ func (a *ClusterAlertSwitchApi) SetClusterAlertDisabled(ctx _context.Context, or err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_cluster_log.go b/api/kbcloud/admin/api_cluster_log.go index b915a90b..ae1a5274 100644 --- a/api/kbcloud/admin/api_cluster_log.go +++ b/api/kbcloud/admin/api_cluster_log.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -18,9 +22,9 @@ type ClusterLogApi common.Service // QueryAuditLogsOptionalParameters holds optional parameters for QueryAuditLogs. type QueryAuditLogsOptionalParameters struct { - Limit *string + Limit *string ComponentName *string - SortType *SortType + SortType *SortType } // NewQueryAuditLogsOptionalParameters creates an empty struct for parameters. @@ -28,19 +32,16 @@ func NewQueryAuditLogsOptionalParameters() *QueryAuditLogsOptionalParameters { this := QueryAuditLogsOptionalParameters{} return &this } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QueryAuditLogsOptionalParameters) WithLimit(limit string) *QueryAuditLogsOptionalParameters { r.Limit = &limit return r } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QueryAuditLogsOptionalParameters) WithComponentName(componentName string) *QueryAuditLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QueryAuditLogsOptionalParameters) WithSortType(sortType SortType) *QueryAuditLogsOptionalParameters { r.SortType = &sortType @@ -51,18 +52,20 @@ func (r *QueryAuditLogsOptionalParameters) WithSortType(sortType SortType) *Quer // Query audit logs of a cluster func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QueryAuditLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QueryAuditLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QueryAuditLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryAuditLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryAuditLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QueryAuditLogs") if err != nil { @@ -89,7 +92,8 @@ func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clu } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -111,10 +115,11 @@ func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -128,7 +133,7 @@ func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -140,9 +145,9 @@ func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clu // QueryErrorLogsOptionalParameters holds optional parameters for QueryErrorLogs. type QueryErrorLogsOptionalParameters struct { ComponentName *string - InstanceName *string - Limit *string - SortType *SortType + InstanceName *string + Limit *string + SortType *SortType } // NewQueryErrorLogsOptionalParameters creates an empty struct for parameters. @@ -150,25 +155,21 @@ func NewQueryErrorLogsOptionalParameters() *QueryErrorLogsOptionalParameters { this := QueryErrorLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QueryErrorLogsOptionalParameters) WithComponentName(componentName string) *QueryErrorLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithInstanceName sets the corresponding parameter name and returns the struct. func (r *QueryErrorLogsOptionalParameters) WithInstanceName(instanceName string) *QueryErrorLogsOptionalParameters { r.InstanceName = &instanceName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QueryErrorLogsOptionalParameters) WithLimit(limit string) *QueryErrorLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QueryErrorLogsOptionalParameters) WithSortType(sortType SortType) *QueryErrorLogsOptionalParameters { r.SortType = &sortType @@ -179,18 +180,20 @@ func (r *QueryErrorLogsOptionalParameters) WithSortType(sortType SortType) *Quer // Query error logs of a cluster func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QueryErrorLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QueryErrorLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QueryErrorLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryErrorLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryErrorLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QueryErrorLogs") if err != nil { @@ -220,7 +223,8 @@ func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clu } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -242,10 +246,11 @@ func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -259,7 +264,7 @@ func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -271,9 +276,9 @@ func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clu // QueryRunningLogsOptionalParameters holds optional parameters for QueryRunningLogs. type QueryRunningLogsOptionalParameters struct { ComponentName *string - InstanceName *string - Limit *string - SortType *SortType + InstanceName *string + Limit *string + SortType *SortType } // NewQueryRunningLogsOptionalParameters creates an empty struct for parameters. @@ -281,25 +286,21 @@ func NewQueryRunningLogsOptionalParameters() *QueryRunningLogsOptionalParameters this := QueryRunningLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QueryRunningLogsOptionalParameters) WithComponentName(componentName string) *QueryRunningLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithInstanceName sets the corresponding parameter name and returns the struct. func (r *QueryRunningLogsOptionalParameters) WithInstanceName(instanceName string) *QueryRunningLogsOptionalParameters { r.InstanceName = &instanceName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QueryRunningLogsOptionalParameters) WithLimit(limit string) *QueryRunningLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QueryRunningLogsOptionalParameters) WithSortType(sortType SortType) *QueryRunningLogsOptionalParameters { r.SortType = &sortType @@ -310,18 +311,20 @@ func (r *QueryRunningLogsOptionalParameters) WithSortType(sortType SortType) *Qu // Query running logs of a cluster func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QueryRunningLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QueryRunningLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QueryRunningLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryRunningLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryRunningLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QueryRunningLogs") if err != nil { @@ -351,7 +354,8 @@ func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, c } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -373,10 +377,11 @@ func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -390,7 +395,7 @@ func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -402,8 +407,8 @@ func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, c // QuerySlowLogsOptionalParameters holds optional parameters for QuerySlowLogs. type QuerySlowLogsOptionalParameters struct { ComponentName *string - Limit *string - SortType *SortType + Limit *string + SortType *SortType } // NewQuerySlowLogsOptionalParameters creates an empty struct for parameters. @@ -411,19 +416,16 @@ func NewQuerySlowLogsOptionalParameters() *QuerySlowLogsOptionalParameters { this := QuerySlowLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QuerySlowLogsOptionalParameters) WithComponentName(componentName string) *QuerySlowLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QuerySlowLogsOptionalParameters) WithLimit(limit string) *QuerySlowLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QuerySlowLogsOptionalParameters) WithSortType(sortType SortType) *QuerySlowLogsOptionalParameters { r.SortType = &sortType @@ -434,18 +436,20 @@ func (r *QuerySlowLogsOptionalParameters) WithSortType(sortType SortType) *Query // Query slow logs of a cluster func (a *ClusterLogApi) QuerySlowLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QuerySlowLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QuerySlowLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QuerySlowLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QuerySlowLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QuerySlowLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QuerySlowLogs") if err != nil { @@ -472,7 +476,8 @@ func (a *ClusterLogApi) QuerySlowLogs(ctx _context.Context, orgName string, clus } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -494,10 +499,11 @@ func (a *ClusterLogApi) QuerySlowLogs(ctx _context.Context, orgName string, clus if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -511,7 +517,7 @@ func (a *ClusterLogApi) QuerySlowLogs(ctx _context.Context, orgName string, clus err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_database.go b/api/kbcloud/admin/api_database.go index e35c183e..e9c4f7fb 100644 --- a/api/kbcloud/admin/api_database.go +++ b/api/kbcloud/admin/api_database.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type DatabaseApi common.Service // create a database in cluster func (a *DatabaseApi) CreateDatabase(ctx _context.Context, orgName string, clusterName string, body Database) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DatabaseApi.CreateDatabase") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *DatabaseApi) CreateDatabase(ctx _context.Context, orgName string, clust localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *DatabaseApi) CreateDatabase(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -84,10 +93,12 @@ func (a *DatabaseApi) CreateDatabase(ctx _context.Context, orgName string, clust // delete a database in cluster func (a *DatabaseApi) DeleteDatabase(ctx _context.Context, orgName string, clusterName string, databaseName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DatabaseApi.DeleteDatabase") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -103,7 +114,8 @@ func (a *DatabaseApi) DeleteDatabase(ctx _context.Context, orgName string, clust localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -125,10 +137,11 @@ func (a *DatabaseApi) DeleteDatabase(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -146,11 +159,13 @@ func (a *DatabaseApi) DeleteDatabase(ctx _context.Context, orgName string, clust // list databases in cluster func (a *DatabaseApi) ListDatabases(ctx _context.Context, orgName string, clusterName string) (DatabaseList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue DatabaseList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue DatabaseList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DatabaseApi.ListDatabases") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -165,7 +180,8 @@ func (a *DatabaseApi) ListDatabases(ctx _context.Context, orgName string, cluste localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -187,10 +203,11 @@ func (a *DatabaseApi) ListDatabases(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -204,7 +221,7 @@ func (a *DatabaseApi) ListDatabases(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_dms.go b/api/kbcloud/admin/api_dms.go index ee72414a..942c685a 100644 --- a/api/kbcloud/admin/api_dms.go +++ b/api/kbcloud/admin/api_dms.go @@ -2,14 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -27,7 +30,6 @@ func NewDataExportOptionalParameters() *DataExportOptionalParameters { this := DataExportOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *DataExportOptionalParameters) WithBody(body interface{}) *DataExportOptionalParameters { r.Body = &body @@ -37,17 +39,19 @@ func (r *DataExportOptionalParameters) WithBody(body interface{}) *DataExportOpt // DataExport Data Export. func (a *DmsApi) DataExport(ctx _context.Context, orgName string, clusterName string, id string, o ...DataExportOptionalParameters) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - optionalParams DataExportOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + optionalParams DataExportOptionalParameters ) - if len(o) > 1 { - return nil, common.ReportError("only one argument of type DataExportOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return nil, common.ReportError("only one argument of type DataExportOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.DataExport") if err != nil { @@ -63,13 +67,15 @@ func (a *DmsApi) DataExport(ctx _context.Context, orgName string, clusterName st localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -91,10 +97,11 @@ func (a *DmsApi) DataExport(ctx _context.Context, orgName string, clusterName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -111,11 +118,13 @@ func (a *DmsApi) DataExport(ctx _context.Context, orgName string, clusterName st // DataImport Data Import. func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName string, id string, file _io.Reader) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.DataImport") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -132,14 +141,15 @@ func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" - formFile := common.FormFile{} + + formFile := common.FormFile{} formFile.FormFileName = "file" localVarFile := file if localVarFile != nil { fbs, _ := _io.ReadAll(localVarFile) formFile.FileBytes = fbs } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -161,10 +171,11 @@ func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -178,7 +189,7 @@ func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -190,11 +201,13 @@ func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName st // GetObjectInfo get the detail object info. func (a *DmsApi) GetObjectInfo(ctx _context.Context, orgName string, clusterName string, id string, schema string, typeVar string, objectName string) (ObjectResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ObjectResponse + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ObjectResponse ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetObjectInfo") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -213,7 +226,8 @@ func (a *DmsApi) GetObjectInfo(ctx _context.Context, orgName string, clusterName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -236,7 +250,7 @@ func (a *DmsApi) GetObjectInfo(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -248,11 +262,13 @@ func (a *DmsApi) GetObjectInfo(ctx _context.Context, orgName string, clusterName // GetTaskList Get the task list. func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName string, id string) (DmsTaskList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue DmsTaskList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue DmsTaskList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetTaskList") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -268,7 +284,8 @@ func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -290,10 +307,11 @@ func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -307,7 +325,7 @@ func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -319,11 +337,13 @@ func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName s // GetTaskProgress Get the task progress. func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterName string, id string, taskId string) (DmsTaskInfo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue DmsTaskInfo + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue DmsTaskInfo ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetTaskProgress") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -340,7 +360,8 @@ func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterNa localVarQueryParams.Add("taskId", common.ParameterToString(taskId, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -362,10 +383,11 @@ func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -379,7 +401,7 @@ func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -391,11 +413,13 @@ func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterNa // ListObjectNamesByType list the all name for the specified object type. func (a *DmsApi) ListObjectNamesByType(ctx _context.Context, orgName string, clusterName string, id string, schema string, typeVar string) ([]string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []string + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListObjectNamesByType") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -413,7 +437,8 @@ func (a *DmsApi) ListObjectNamesByType(ctx _context.Context, orgName string, clu localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -436,7 +461,7 @@ func (a *DmsApi) ListObjectNamesByType(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -448,11 +473,13 @@ func (a *DmsApi) ListObjectNamesByType(ctx _context.Context, orgName string, clu // ListObjectTypesInSchema list the type and number of database objects in the specified database or schema. func (a *DmsApi) ListObjectTypesInSchema(ctx _context.Context, orgName string, clusterName string, id string, schema string) ([]Object, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Object + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Object ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListObjectTypesInSchema") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -469,7 +496,8 @@ func (a *DmsApi) ListObjectTypesInSchema(ctx _context.Context, orgName string, c localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -492,7 +520,7 @@ func (a *DmsApi) ListObjectTypesInSchema(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -504,11 +532,13 @@ func (a *DmsApi) ListObjectTypesInSchema(ctx _context.Context, orgName string, c // AlterParameter alter cluster parameter. func (a *DmsApi) AlterParameter(ctx _context.Context, orgName string, clusterName string, tenantId string, body interface{}) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue string + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.AlterParameter") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -525,9 +555,11 @@ func (a *DmsApi) AlterParameter(ctx _context.Context, orgName string, clusterNam localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -549,10 +581,11 @@ func (a *DmsApi) AlterParameter(ctx _context.Context, orgName string, clusterNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -566,7 +599,7 @@ func (a *DmsApi) AlterParameter(ctx _context.Context, orgName string, clusterNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -585,7 +618,6 @@ func NewCloseSessionsOptionalParameters() *CloseSessionsOptionalParameters { this := CloseSessionsOptionalParameters{} return &this } - // WithKeep sets the corresponding parameter name and returns the struct. func (r *CloseSessionsOptionalParameters) WithKeep(keep string) *CloseSessionsOptionalParameters { r.Keep = &keep @@ -595,18 +627,20 @@ func (r *CloseSessionsOptionalParameters) WithKeep(keep string) *CloseSessionsOp // CloseSessions close the session for the cluster. func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName string, session string, o ...CloseSessionsOptionalParameters) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue string - optionalParams CloseSessionsOptionalParameters + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue string + optionalParams CloseSessionsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CloseSessionsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CloseSessionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.CloseSessions") if err != nil { @@ -626,7 +660,8 @@ func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -648,10 +683,11 @@ func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -665,7 +701,7 @@ func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -677,11 +713,13 @@ func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName // CreateDataSourceV2 create the datasource. func (a *DmsApi) CreateDataSourceV2(ctx _context.Context, orgName string, clusterName string, body Datasource) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.CreateDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -697,9 +735,11 @@ func (a *DmsApi) CreateDataSourceV2(ctx _context.Context, orgName string, cluste localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -722,7 +762,7 @@ func (a *DmsApi) CreateDataSourceV2(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -734,10 +774,12 @@ func (a *DmsApi) CreateDataSourceV2(ctx _context.Context, orgName string, cluste // DeleteDataSourceV2 delete the datasource. func (a *DmsApi) DeleteDataSourceV2(ctx _context.Context, orgName string, clusterName string, id string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.DeleteDataSourceV2") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -753,7 +795,8 @@ func (a *DmsApi) DeleteDataSourceV2(ctx _context.Context, orgName string, cluste localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -775,10 +818,11 @@ func (a *DmsApi) DeleteDataSourceV2(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -802,7 +846,6 @@ func NewGenerateDDLOptionalParameters() *GenerateDDLOptionalParameters { this := GenerateDDLOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *GenerateDDLOptionalParameters) WithBody(body interface{}) *GenerateDDLOptionalParameters { r.Body = &body @@ -812,18 +855,20 @@ func (r *GenerateDDLOptionalParameters) WithBody(body interface{}) *GenerateDDLO // GenerateDDL support ddl and dml operations. func (a *DmsApi) GenerateDDL(ctx _context.Context, orgName string, clusterName string, id string, o ...GenerateDDLOptionalParameters) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue string - optionalParams GenerateDDLOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue string + optionalParams GenerateDDLOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GenerateDDLOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GenerateDDLOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GenerateDDL") if err != nil { @@ -841,11 +886,13 @@ func (a *DmsApi) GenerateDDL(ctx _context.Context, orgName string, clusterName s localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -868,7 +915,7 @@ func (a *DmsApi) GenerateDDL(ctx _context.Context, orgName string, clusterName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -880,11 +927,13 @@ func (a *DmsApi) GenerateDDL(ctx _context.Context, orgName string, clusterName s // GetDataSourceV2 get the datasource. func (a *DmsApi) GetDataSourceV2(ctx _context.Context, orgName string, clusterName string, id string) (Datasource, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Datasource + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Datasource ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -900,7 +949,8 @@ func (a *DmsApi) GetDataSourceV2(ctx _context.Context, orgName string, clusterNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -923,7 +973,7 @@ func (a *DmsApi) GetDataSourceV2(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -935,11 +985,13 @@ func (a *DmsApi) GetDataSourceV2(ctx _context.Context, orgName string, clusterNa // GetSchemaList list all databases or schema of the cluster. func (a *DmsApi) GetSchemaList(ctx _context.Context, orgName string, clusterName string, id string) ([]string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []string + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetSchemaList") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -955,7 +1007,8 @@ func (a *DmsApi) GetSchemaList(ctx _context.Context, orgName string, clusterName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -978,7 +1031,7 @@ func (a *DmsApi) GetSchemaList(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -990,11 +1043,13 @@ func (a *DmsApi) GetSchemaList(ctx _context.Context, orgName string, clusterName // ListDataSourceV2 list the datasource of a cluster. func (a *DmsApi) ListDataSourceV2(ctx _context.Context, orgName string, clusterName string) ([]Datasource, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Datasource + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Datasource ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1009,7 +1064,8 @@ func (a *DmsApi) ListDataSourceV2(ctx _context.Context, orgName string, clusterN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1032,7 +1088,7 @@ func (a *DmsApi) ListDataSourceV2(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1044,11 +1100,13 @@ func (a *DmsApi) ListDataSourceV2(ctx _context.Context, orgName string, clusterN // ListParameters list cluster parameters. func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterName string, tenantId string, mode string) ([]ObParameter, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []ObParameter + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []ObParameter ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListParameters") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1065,7 +1123,8 @@ func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterNam localVarQueryParams.Add("mode", common.ParameterToString(mode, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1087,10 +1146,11 @@ func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1104,7 +1164,7 @@ func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1116,11 +1176,13 @@ func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterNam // ListQueryHistory list the query History. func (a *DmsApi) ListQueryHistory(ctx _context.Context, orgName string, clusterName string, id string) (QueryHistory, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue QueryHistory + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue QueryHistory ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListQueryHistory") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1136,7 +1198,8 @@ func (a *DmsApi) ListQueryHistory(ctx _context.Context, orgName string, clusterN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1159,7 +1222,7 @@ func (a *DmsApi) ListQueryHistory(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1178,7 +1241,6 @@ func NewListSessionsOptionalParameters() *ListSessionsOptionalParameters { this := ListSessionsOptionalParameters{} return &this } - // WithAll sets the corresponding parameter name and returns the struct. func (r *ListSessionsOptionalParameters) WithAll(all string) *ListSessionsOptionalParameters { r.All = &all @@ -1188,18 +1250,20 @@ func (r *ListSessionsOptionalParameters) WithAll(all string) *ListSessionsOption // ListSessions list all session for the cluster. func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName string, o ...ListSessionsOptionalParameters) ([]ObSession, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []ObSession - optionalParams ListSessionsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []ObSession + optionalParams ListSessionsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListSessionsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListSessionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListSessions") if err != nil { @@ -1218,7 +1282,8 @@ func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1240,10 +1305,11 @@ func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1257,7 +1323,7 @@ func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1269,11 +1335,13 @@ func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName // Query create a SQL query. func (a *DmsApi) Query(ctx _context.Context, orgName string, clusterName string, id string, body interface{}) (QueryResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue QueryResponse + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue QueryResponse ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.Query") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1290,9 +1358,11 @@ func (a *DmsApi) Query(ctx _context.Context, orgName string, clusterName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1315,7 +1385,7 @@ func (a *DmsApi) Query(ctx _context.Context, orgName string, clusterName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1327,11 +1397,13 @@ func (a *DmsApi) Query(ctx _context.Context, orgName string, clusterName string, // ShowData read data of table or view. func (a *DmsApi) ShowData(ctx _context.Context, orgName string, clusterName string, id string, body interface{}) (Result, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Result + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Result ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ShowData") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1348,9 +1420,11 @@ func (a *DmsApi) ShowData(ctx _context.Context, orgName string, clusterName stri localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1373,7 +1447,7 @@ func (a *DmsApi) ShowData(ctx _context.Context, orgName string, clusterName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1385,11 +1459,13 @@ func (a *DmsApi) ShowData(ctx _context.Context, orgName string, clusterName stri // SqlExplain explain a SQL. func (a *DmsApi) SqlExplain(ctx _context.Context, orgName string, clusterName string, id string, body interface{}) (QueryResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue QueryResponse + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue QueryResponse ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.SqlExplain") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1406,9 +1482,11 @@ func (a *DmsApi) SqlExplain(ctx _context.Context, orgName string, clusterName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1431,7 +1509,7 @@ func (a *DmsApi) SqlExplain(ctx _context.Context, orgName string, clusterName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1450,7 +1528,6 @@ func NewTenantParameterHistoryOptionalParameters() *TenantParameterHistoryOption this := TenantParameterHistoryOptionalParameters{} return &this } - // WithParameterName sets the corresponding parameter name and returns the struct. func (r *TenantParameterHistoryOptionalParameters) WithParameterName(parameterName string) *TenantParameterHistoryOptionalParameters { r.ParameterName = ¶meterName @@ -1460,18 +1537,20 @@ func (r *TenantParameterHistoryOptionalParameters) WithParameterName(parameterNa // TenantParameterHistory List parameters history of the Oceanbase tenant. func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, clusterName string, tenantId string, o ...TenantParameterHistoryOptionalParameters) (ParameterHistoryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParameterHistoryList - optionalParams TenantParameterHistoryOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParameterHistoryList + optionalParams TenantParameterHistoryOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type TenantParameterHistoryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type TenantParameterHistoryOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.TenantParameterHistory") if err != nil { @@ -1491,7 +1570,8 @@ func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, cl } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1513,10 +1593,11 @@ func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1530,7 +1611,7 @@ func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1542,11 +1623,13 @@ func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, cl // TestDataSourceV2 test the datasource. func (a *DmsApi) TestDataSourceV2(ctx _context.Context, orgName string, clusterName string, body Datasource) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.TestDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1562,9 +1645,11 @@ func (a *DmsApi) TestDataSourceV2(ctx _context.Context, orgName string, clusterN localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1587,7 +1672,7 @@ func (a *DmsApi) TestDataSourceV2(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1599,11 +1684,13 @@ func (a *DmsApi) TestDataSourceV2(ctx _context.Context, orgName string, clusterN // UpdateDataSourceV2 update the datasource. func (a *DmsApi) UpdateDataSourceV2(ctx _context.Context, orgName string, clusterName string, body Datasource) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.UpdateDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1619,9 +1706,11 @@ func (a *DmsApi) UpdateDataSourceV2(ctx _context.Context, orgName string, cluste localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1644,7 +1733,7 @@ func (a *DmsApi) UpdateDataSourceV2(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_engine.go b/api/kbcloud/admin/api_engine.go index f1f21e84..ead5632d 100644 --- a/api/kbcloud/admin/api_engine.go +++ b/api/kbcloud/admin/api_engine.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type EngineApi common.Service // EngineAction Manage engine in environment. func (a *EngineApi) EngineAction(ctx _context.Context, environmentName string, engineName string, actionInfo interface{}) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineApi.EngineAction") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *EngineApi) EngineAction(ctx _context.Context, environmentName string, e localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &actionInfo - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *EngineApi) EngineAction(ctx _context.Context, environmentName string, e if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *EngineApi) EngineAction(ctx _context.Context, environmentName string, e err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,11 +101,13 @@ func (a *EngineApi) EngineAction(ctx _context.Context, environmentName string, e // EngineActionInOrg Manage engine in organization. func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, actionInfo interface{}) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineApi.EngineActionInOrg") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,9 +122,11 @@ func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, acti localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &actionInfo - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -135,10 +148,11 @@ func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, acti if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,7 +166,7 @@ func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, acti err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -164,11 +178,13 @@ func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, acti // GetEngineByNameInEnv Get engine in environment. func (a *EngineApi) GetEngineByNameInEnv(ctx _context.Context, environmentName string, engineName string, version string) (Engine, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Engine + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Engine ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineApi.GetEngineByNameInEnv") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -184,7 +200,8 @@ func (a *EngineApi) GetEngineByNameInEnv(ctx _context.Context, environmentName s localVarQueryParams.Add("version", common.ParameterToString(version, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -206,10 +223,11 @@ func (a *EngineApi) GetEngineByNameInEnv(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -223,7 +241,7 @@ func (a *EngineApi) GetEngineByNameInEnv(ctx _context.Context, environmentName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -234,11 +252,11 @@ func (a *EngineApi) GetEngineByNameInEnv(ctx _context.Context, environmentName s // ListEnginesInEnvOptionalParameters holds optional parameters for ListEnginesInEnv. type ListEnginesInEnvOptionalParameters struct { - Name *string - Type *EngineType - Version *string + Name *string + Type *EngineType + Version *string Provider *string - All *bool + All *bool } // NewListEnginesInEnvOptionalParameters creates an empty struct for parameters. @@ -246,31 +264,26 @@ func NewListEnginesInEnvOptionalParameters() *ListEnginesInEnvOptionalParameters this := ListEnginesInEnvOptionalParameters{} return &this } - // WithName sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithName(name string) *ListEnginesInEnvOptionalParameters { r.Name = &name return r } - // WithType sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithType(typeVar EngineType) *ListEnginesInEnvOptionalParameters { r.Type = &typeVar return r } - // WithVersion sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithVersion(version string) *ListEnginesInEnvOptionalParameters { r.Version = &version return r } - // WithProvider sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithProvider(provider string) *ListEnginesInEnvOptionalParameters { r.Provider = &provider return r } - // WithAll sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithAll(all bool) *ListEnginesInEnvOptionalParameters { r.All = &all @@ -280,18 +293,20 @@ func (r *ListEnginesInEnvOptionalParameters) WithAll(all bool) *ListEnginesInEnv // ListEnginesInEnv List engines in environment. func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName string, o ...ListEnginesInEnvOptionalParameters) ([]Engine, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Engine - optionalParams ListEnginesInEnvOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Engine + optionalParams ListEnginesInEnvOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnginesInEnvOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnginesInEnvOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineApi.ListEnginesInEnv") if err != nil { @@ -321,7 +336,8 @@ func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName strin } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -343,10 +359,11 @@ func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -360,7 +377,7 @@ func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -372,10 +389,10 @@ func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName strin // ListEnginesInOrgOptionalParameters holds optional parameters for ListEnginesInOrg. type ListEnginesInOrgOptionalParameters struct { EnvironmentName *string - Name *string - Type *EngineType - Version *string - Provider *string + Name *string + Type *EngineType + Version *string + Provider *string } // NewListEnginesInOrgOptionalParameters creates an empty struct for parameters. @@ -383,31 +400,26 @@ func NewListEnginesInOrgOptionalParameters() *ListEnginesInOrgOptionalParameters this := ListEnginesInOrgOptionalParameters{} return &this } - // WithEnvironmentName sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithEnvironmentName(environmentName string) *ListEnginesInOrgOptionalParameters { r.EnvironmentName = &environmentName return r } - // WithName sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithName(name string) *ListEnginesInOrgOptionalParameters { r.Name = &name return r } - // WithType sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithType(typeVar EngineType) *ListEnginesInOrgOptionalParameters { r.Type = &typeVar return r } - // WithVersion sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithVersion(version string) *ListEnginesInOrgOptionalParameters { r.Version = &version return r } - // WithProvider sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithProvider(provider string) *ListEnginesInOrgOptionalParameters { r.Provider = &provider @@ -417,18 +429,20 @@ func (r *ListEnginesInOrgOptionalParameters) WithProvider(provider string) *List // ListEnginesInOrg List engines in organization. func (a *EngineApi) ListEnginesInOrg(ctx _context.Context, orgName string, o ...ListEnginesInOrgOptionalParameters) ([]Engine, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Engine - optionalParams ListEnginesInOrgOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Engine + optionalParams ListEnginesInOrgOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnginesInOrgOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnginesInOrgOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineApi.ListEnginesInOrg") if err != nil { @@ -458,7 +472,8 @@ func (a *EngineApi) ListEnginesInOrg(ctx _context.Context, orgName string, o ... } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -480,10 +495,11 @@ func (a *EngineApi) ListEnginesInOrg(ctx _context.Context, orgName string, o ... if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -497,7 +513,7 @@ func (a *EngineApi) ListEnginesInOrg(ctx _context.Context, orgName string, o ... err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_engine_license.go b/api/kbcloud/admin/api_engine_license.go index 5e58c566..7dc17340 100644 --- a/api/kbcloud/admin/api_engine_license.go +++ b/api/kbcloud/admin/api_engine_license.go @@ -2,11 +2,15 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -20,11 +24,13 @@ type EngineLicenseApi common.Service // Create a new engineLicense func (a *EngineLicenseApi) CreateEngineLicense(ctx _context.Context, licenseFile _io.Reader) (EngineLicense, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue EngineLicense + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue EngineLicense ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineLicenseApi.CreateEngineLicense") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,14 +44,15 @@ func (a *EngineLicenseApi) CreateEngineLicense(ctx _context.Context, licenseFile localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" - formFile := common.FormFile{} + + formFile := common.FormFile{} formFile.FormFileName = "licenseFile" localVarFile := licenseFile if localVarFile != nil { fbs, _ := _io.ReadAll(localVarFile) formFile.FileBytes = fbs } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -67,10 +74,11 @@ func (a *EngineLicenseApi) CreateEngineLicense(ctx _context.Context, licenseFile if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -84,7 +92,7 @@ func (a *EngineLicenseApi) CreateEngineLicense(ctx _context.Context, licenseFile err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -97,10 +105,12 @@ func (a *EngineLicenseApi) CreateEngineLicense(ctx _context.Context, licenseFile // delete an engine license func (a *EngineLicenseApi) DeleteEngineLicense(ctx _context.Context, licenseId int32) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineLicenseApi.DeleteEngineLicense") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -114,7 +124,8 @@ func (a *EngineLicenseApi) DeleteEngineLicense(ctx _context.Context, licenseId i localVarQueryParams.Add("licenseId", common.ParameterToString(licenseId, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -136,10 +147,11 @@ func (a *EngineLicenseApi) DeleteEngineLicense(ctx _context.Context, licenseId i if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -157,11 +169,13 @@ func (a *EngineLicenseApi) DeleteEngineLicense(ctx _context.Context, licenseId i // Get a engineLicense detail func (a *EngineLicenseApi) EngineLicense(ctx _context.Context, licenseId int32) (EngineLicense, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineLicense + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineLicense ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineLicenseApi.EngineLicense") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -175,7 +189,8 @@ func (a *EngineLicenseApi) EngineLicense(ctx _context.Context, licenseId int32) localVarQueryParams.Add("licenseId", common.ParameterToString(licenseId, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -197,10 +212,11 @@ func (a *EngineLicenseApi) EngineLicense(ctx _context.Context, licenseId int32) if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -214,7 +230,7 @@ func (a *EngineLicenseApi) EngineLicense(ctx _context.Context, licenseId int32) err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -233,7 +249,6 @@ func NewListEngineLicensesOptionalParameters() *ListEngineLicensesOptionalParame this := ListEngineLicensesOptionalParameters{} return &this } - // WithEngineName sets the corresponding parameter name and returns the struct. func (r *ListEngineLicensesOptionalParameters) WithEngineName(engineName string) *ListEngineLicensesOptionalParameters { r.EngineName = &engineName @@ -244,18 +259,20 @@ func (r *ListEngineLicensesOptionalParameters) WithEngineName(engineName string) // list all engineLicenses func (a *EngineLicenseApi) ListEngineLicenses(ctx _context.Context, o ...ListEngineLicensesOptionalParameters) (EngineLicenseList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineLicenseList - optionalParams ListEngineLicensesOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineLicenseList + optionalParams ListEngineLicensesOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEngineLicensesOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEngineLicensesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineLicenseApi.ListEngineLicenses") if err != nil { @@ -272,7 +289,8 @@ func (a *EngineLicenseApi) ListEngineLicenses(ctx _context.Context, o ...ListEng } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -294,10 +312,11 @@ func (a *EngineLicenseApi) ListEngineLicenses(ctx _context.Context, o ...ListEng if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -311,7 +330,7 @@ func (a *EngineLicenseApi) ListEngineLicenses(ctx _context.Context, o ...ListEng err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_engine_option.go b/api/kbcloud/admin/api_engine_option.go index d89e2433..ea358355 100644 --- a/api/kbcloud/admin/api_engine_option.go +++ b/api/kbcloud/admin/api_engine_option.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type EngineOptionApi common.Service // list upgraded service version of the component func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, clusterName string, orgName string, component string) (EngineServiceVersions, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineServiceVersions + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineServiceVersions ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.ListUpgradeableServiceVersion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,7 +46,8 @@ func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, cl localVarQueryParams.Add("component", common.ParameterToString(component, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +69,11 @@ func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +87,7 @@ func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,11 +100,13 @@ func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, cl // Create a new engineOption func (a *EngineOptionApi) CreateEngineOption(ctx _context.Context, body EngineOption) (EngineOption, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue EngineOption + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue EngineOption ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.CreateEngineOption") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,9 +120,11 @@ func (a *EngineOptionApi) CreateEngineOption(ctx _context.Context, body EngineOp localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -134,10 +146,11 @@ func (a *EngineOptionApi) CreateEngineOption(ctx _context.Context, body EngineOp if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -151,7 +164,7 @@ func (a *EngineOptionApi) CreateEngineOption(ctx _context.Context, body EngineOp err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -170,7 +183,6 @@ func NewGetEngineOptionOptionalParameters() *GetEngineOptionOptionalParameters { this := GetEngineOptionOptionalParameters{} return &this } - // WithVersion sets the corresponding parameter name and returns the struct. func (r *GetEngineOptionOptionalParameters) WithVersion(version EngineOptionVersion) *GetEngineOptionOptionalParameters { r.Version = &version @@ -181,18 +193,20 @@ func (r *GetEngineOptionOptionalParameters) WithVersion(version EngineOptionVers // Get a engineOption detail func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName string, o ...GetEngineOptionOptionalParameters) (EngineOption, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineOption - optionalParams GetEngineOptionOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineOption + optionalParams GetEngineOptionOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetEngineOptionOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetEngineOptionOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.GetEngineOption") if err != nil { @@ -210,7 +224,8 @@ func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName strin } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -232,10 +247,11 @@ func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -249,7 +265,7 @@ func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -262,11 +278,13 @@ func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName strin // List a engineOption histories of a engine func (a *EngineOptionApi) ListEngineOptionHistory(ctx _context.Context, engineName string) (EngineOptionHistoryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineOptionHistoryList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineOptionHistoryList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.ListEngineOptionHistory") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -280,7 +298,8 @@ func (a *EngineOptionApi) ListEngineOptionHistory(ctx _context.Context, engineNa localVarQueryParams.Add("engineName", common.ParameterToString(engineName, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -302,10 +321,11 @@ func (a *EngineOptionApi) ListEngineOptionHistory(ctx _context.Context, engineNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -319,7 +339,7 @@ func (a *EngineOptionApi) ListEngineOptionHistory(ctx _context.Context, engineNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -338,7 +358,6 @@ func NewListEngineOptionsOptionalParameters() *ListEngineOptionsOptionalParamete this := ListEngineOptionsOptionalParameters{} return &this } - // WithVersion sets the corresponding parameter name and returns the struct. func (r *ListEngineOptionsOptionalParameters) WithVersion(version EngineOptionVersion) *ListEngineOptionsOptionalParameters { r.Version = &version @@ -349,18 +368,20 @@ func (r *ListEngineOptionsOptionalParameters) WithVersion(version EngineOptionVe // list all engineOptions func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context, o ...ListEngineOptionsOptionalParameters) (EngineOptionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineOptionList - optionalParams ListEngineOptionsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineOptionList + optionalParams ListEngineOptionsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEngineOptionsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEngineOptionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.ListEngineOptions") if err != nil { @@ -377,7 +398,8 @@ func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context, o ...ListEngin } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -399,10 +421,11 @@ func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context, o ...ListEngin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -416,7 +439,7 @@ func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context, o ...ListEngin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -429,11 +452,13 @@ func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context, o ...ListEngin // Update a engineOption func (a *EngineOptionApi) UpdateEngineOption(ctx _context.Context, engineName string, body EngineOption) (EngineOption, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarReturnValue EngineOption + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarReturnValue EngineOption ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.UpdateEngineOption") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -448,9 +473,11 @@ func (a *EngineOptionApi) UpdateEngineOption(ctx _context.Context, engineName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -472,10 +499,11 @@ func (a *EngineOptionApi) UpdateEngineOption(ctx _context.Context, engineName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -489,7 +517,7 @@ func (a *EngineOptionApi) UpdateEngineOption(ctx _context.Context, engineName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_engine_version.go b/api/kbcloud/admin/api_engine_version.go index d32735bb..fa1269b2 100644 --- a/api/kbcloud/admin/api_engine_version.go +++ b/api/kbcloud/admin/api_engine_version.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type EngineVersionApi common.Service // Create engine version func (a *EngineVersionApi) CreateEngineVersion(ctx _context.Context, body EngineVersionCreate) (EngineVersion, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue EngineVersion + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue EngineVersion ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineVersionApi.CreateEngineVersion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *EngineVersionApi) CreateEngineVersion(ctx _context.Context, body Engine localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *EngineVersionApi) CreateEngineVersion(ctx _context.Context, body Engine if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *EngineVersionApi) CreateEngineVersion(ctx _context.Context, body Engine err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -98,7 +107,6 @@ func NewDeleteEngineVersionOptionalParameters() *DeleteEngineVersionOptionalPara this := DeleteEngineVersionOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *DeleteEngineVersionOptionalParameters) WithBody(body EngineVersionDelete) *DeleteEngineVersionOptionalParameters { r.Body = &body @@ -108,17 +116,19 @@ func (r *DeleteEngineVersionOptionalParameters) WithBody(body EngineVersionDelet // DeleteEngineVersion Delete engine version. func (a *EngineVersionApi) DeleteEngineVersion(ctx _context.Context, o ...DeleteEngineVersionOptionalParameters) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - optionalParams DeleteEngineVersionOptionalParameters + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + optionalParams DeleteEngineVersionOptionalParameters ) - if len(o) > 1 { - return nil, common.ReportError("only one argument of type DeleteEngineVersionOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return nil, common.ReportError("only one argument of type DeleteEngineVersionOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineVersionApi.DeleteEngineVersion") if err != nil { @@ -131,13 +141,15 @@ func (a *EngineVersionApi) DeleteEngineVersion(ctx _context.Context, o ...Delete localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -159,10 +171,11 @@ func (a *EngineVersionApi) DeleteEngineVersion(ctx _context.Context, o ...Delete if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -180,11 +193,13 @@ func (a *EngineVersionApi) DeleteEngineVersion(ctx _context.Context, o ...Delete // Get engine version list func (a *EngineVersionApi) ListEngineVersions(ctx _context.Context, engineName string) (EngineVersionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineVersionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineVersionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineVersionApi.ListEngineVersions") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -198,7 +213,8 @@ func (a *EngineVersionApi) ListEngineVersions(ctx _context.Context, engineName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -220,10 +236,11 @@ func (a *EngineVersionApi) ListEngineVersions(ctx _context.Context, engineName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -237,7 +254,7 @@ func (a *EngineVersionApi) ListEngineVersions(ctx _context.Context, engineName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -250,11 +267,13 @@ func (a *EngineVersionApi) ListEngineVersions(ctx _context.Context, engineName s // Update the specified engine version func (a *EngineVersionApi) PatchEngineVersion(ctx _context.Context, body EngineVersionUpdate) (EngineVersion, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue EngineVersion + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue EngineVersion ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineVersionApi.PatchEngineVersion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -268,9 +287,11 @@ func (a *EngineVersionApi) PatchEngineVersion(ctx _context.Context, body EngineV localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -292,10 +313,11 @@ func (a *EngineVersionApi) PatchEngineVersion(ctx _context.Context, body EngineV if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -309,7 +331,7 @@ func (a *EngineVersionApi) PatchEngineVersion(ctx _context.Context, body EngineV err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_environment.go b/api/kbcloud/admin/api_environment.go index 0009bef7..c9086b8c 100644 --- a/api/kbcloud/admin/api_environment.go +++ b/api/kbcloud/admin/api_environment.go @@ -2,14 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" - "time" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -21,11 +24,13 @@ type EnvironmentApi common.Service // Add nodes to environment func (a *EnvironmentApi) AddNodes(ctx _context.Context, environmentName string, body []NodePoolNode) ([]NodePoolNode, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue []NodePoolNode + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue []NodePoolNode ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.AddNodes") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,9 +45,11 @@ func (a *EnvironmentApi) AddNodes(ctx _context.Context, environmentName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -64,10 +71,11 @@ func (a *EnvironmentApi) AddNodes(ctx _context.Context, environmentName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -81,62 +89,7 @@ func (a *EnvironmentApi) AddNodes(ctx _context.Context, environmentName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// CheckEnvironmentAddRecord check if environment added before. -func (a *EnvironmentApi) CheckEnvironmentAddRecord(ctx _context.Context, body Kubeconfig) (EnvironmentAdded, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue EnvironmentAdded - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.CheckEnvironmentAddRecord") - if err != nil { - return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/admin/v1/environments/checkAddRecord" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/json" - - // body params - localVarPostBody = &body - common.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"BearerToken", "authorization"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := common.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -149,10 +102,12 @@ func (a *EnvironmentApi) CheckEnvironmentAddRecord(ctx _context.Context, body Ku // cordon the specified Environment node func (a *EnvironmentApi) CordonEnvironmentNode(ctx _context.Context, environmentName string, nodeName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.CordonEnvironmentNode") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -167,7 +122,8 @@ func (a *EnvironmentApi) CordonEnvironmentNode(ctx _context.Context, environment localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -189,10 +145,11 @@ func (a *EnvironmentApi) CordonEnvironmentNode(ctx _context.Context, environment if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -209,11 +166,13 @@ func (a *EnvironmentApi) CordonEnvironmentNode(ctx _context.Context, environment // CreateEnvironment Create environment. func (a *EnvironmentApi) CreateEnvironment(ctx _context.Context, body EnvironmentCreate) (Environment, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Environment + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Environment ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.CreateEnvironment") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -227,9 +186,11 @@ func (a *EnvironmentApi) CreateEnvironment(ctx _context.Context, body Environmen localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -251,10 +212,11 @@ func (a *EnvironmentApi) CreateEnvironment(ctx _context.Context, body Environmen if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -268,7 +230,7 @@ func (a *EnvironmentApi) CreateEnvironment(ctx _context.Context, body Environmen err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -280,11 +242,13 @@ func (a *EnvironmentApi) CreateEnvironment(ctx _context.Context, body Environmen // CreateNodeGroup Create environment node group. func (a *EnvironmentApi) CreateNodeGroup(ctx _context.Context, environmentName string, body NodeGroup) (NodeGroup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue NodeGroup + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue NodeGroup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.CreateNodeGroup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -299,9 +263,11 @@ func (a *EnvironmentApi) CreateNodeGroup(ctx _context.Context, environmentName s localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -323,10 +289,11 @@ func (a *EnvironmentApi) CreateNodeGroup(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -340,7 +307,7 @@ func (a *EnvironmentApi) CreateNodeGroup(ctx _context.Context, environmentName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -359,7 +326,6 @@ func NewCreateWorkflowOptionalParameters() *CreateWorkflowOptionalParameters { this := CreateWorkflowOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *CreateWorkflowOptionalParameters) WithBody(body WorkflowCreate) *CreateWorkflowOptionalParameters { r.Body = &body @@ -369,18 +335,20 @@ func (r *CreateWorkflowOptionalParameters) WithBody(body WorkflowCreate) *Create // CreateWorkflow create component management workflow, used to upgrade kubeblocks/gemini. func (a *EnvironmentApi) CreateWorkflow(ctx _context.Context, environmentName string, o ...CreateWorkflowOptionalParameters) (Workflow, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Workflow - optionalParams CreateWorkflowOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Workflow + optionalParams CreateWorkflowOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CreateWorkflowOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CreateWorkflowOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.CreateWorkflow") if err != nil { @@ -396,11 +364,13 @@ func (a *EnvironmentApi) CreateWorkflow(ctx _context.Context, environmentName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -423,7 +393,7 @@ func (a *EnvironmentApi) CreateWorkflow(ctx _context.Context, environmentName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -442,7 +412,6 @@ func NewDeleteEnvironmentOptionalParameters() *DeleteEnvironmentOptionalParamete this := DeleteEnvironmentOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *DeleteEnvironmentOptionalParameters) WithBody(body EnvironmentDelete) *DeleteEnvironmentOptionalParameters { r.Body = &body @@ -452,17 +421,19 @@ func (r *DeleteEnvironmentOptionalParameters) WithBody(body EnvironmentDelete) * // DeleteEnvironment Delete environment. func (a *EnvironmentApi) DeleteEnvironment(ctx _context.Context, environmentName string, o ...DeleteEnvironmentOptionalParameters) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - optionalParams DeleteEnvironmentOptionalParameters + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + optionalParams DeleteEnvironmentOptionalParameters ) - if len(o) > 1 { - return nil, common.ReportError("only one argument of type DeleteEnvironmentOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return nil, common.ReportError("only one argument of type DeleteEnvironmentOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.DeleteEnvironment") if err != nil { @@ -478,11 +449,13 @@ func (a *EnvironmentApi) DeleteEnvironment(ctx _context.Context, environmentName localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -504,10 +477,11 @@ func (a *EnvironmentApi) DeleteEnvironment(ctx _context.Context, environmentName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -524,10 +498,12 @@ func (a *EnvironmentApi) DeleteEnvironment(ctx _context.Context, environmentName // DeleteNodeGroup Delete environment node group. func (a *EnvironmentApi) DeleteNodeGroup(ctx _context.Context, environmentName string, nodeGroupName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.DeleteNodeGroup") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -542,7 +518,8 @@ func (a *EnvironmentApi) DeleteNodeGroup(ctx _context.Context, environmentName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -564,10 +541,11 @@ func (a *EnvironmentApi) DeleteNodeGroup(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -581,28 +559,34 @@ func (a *EnvironmentApi) DeleteNodeGroup(ctx _context.Context, environmentName s return localVarHTTPResponse, nil } -// GetEnvironment Get environment. -func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, environmentName string) (Environment, *_nethttp.Response, error) { +// FilterEnvironment List environments. +// List environments +func (a *EnvironmentApi) FilterEnvironment(ctx _context.Context, orgName string, engineName string, version string) (EnvironmentList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Environment + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EnvironmentList ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironment") + + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.FilterEnvironment") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/admin/v1/environments/{environmentName}" - localVarPath = strings.Replace(localVarPath, "{"+"environmentName"+"}", _neturl.PathEscape(common.ParameterToString(environmentName, "")), -1) + localVarPath := localBasePath + "/admin/v1/organizations/{orgName}/engine/{engineName}/version/{version}/environments" + localVarPath = strings.Replace(localVarPath, "{"+"orgName"+"}", _neturl.PathEscape(common.ParameterToString(orgName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"engineName"+"}", _neturl.PathEscape(common.ParameterToString(engineName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"version"+"}", _neturl.PathEscape(common.ParameterToString(version, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -624,10 +608,11 @@ func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, environmentName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -641,7 +626,7 @@ func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, environmentName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -650,57 +635,31 @@ func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, environmentName st return localVarReturnValue, localVarHTTPResponse, nil } -// GetEnvironmentBackupRepoOptionalParameters holds optional parameters for GetEnvironmentBackupRepo. -type GetEnvironmentBackupRepoOptionalParameters struct { - Body *string -} - -// NewGetEnvironmentBackupRepoOptionalParameters creates an empty struct for parameters. -func NewGetEnvironmentBackupRepoOptionalParameters() *GetEnvironmentBackupRepoOptionalParameters { - this := GetEnvironmentBackupRepoOptionalParameters{} - return &this -} - -// WithBody sets the corresponding parameter name and returns the struct. -func (r *GetEnvironmentBackupRepoOptionalParameters) WithBody(body string) *GetEnvironmentBackupRepoOptionalParameters { - r.Body = &body - return r -} - -// GetEnvironmentBackupRepo get environment backup repo. -func (a *EnvironmentApi) GetEnvironmentBackupRepo(ctx _context.Context, o ...GetEnvironmentBackupRepoOptionalParameters) (EnvironmentBackupRepo, *_nethttp.Response, error) { +// GetEnvironment Get environment. +func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, environmentName string) (Environment, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue EnvironmentBackupRepo - optionalParams GetEnvironmentBackupRepoOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Environment ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetEnvironmentBackupRepoOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironmentBackupRepo") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironment") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/admin/v1/environmentBackupRepo" + localVarPath := localBasePath + "/admin/v1/environments/{environmentName}" + localVarPath = strings.Replace(localVarPath, "{"+"environmentName"+"}", _neturl.PathEscape(common.ParameterToString(environmentName, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" - // body params - if optionalParams.Body != nil { - localVarPostBody = &optionalParams.Body - } - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -722,10 +681,11 @@ func (a *EnvironmentApi) GetEnvironmentBackupRepo(ctx _context.Context, o ...Get if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -739,7 +699,7 @@ func (a *EnvironmentApi) GetEnvironmentBackupRepo(ctx _context.Context, o ...Get err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -751,11 +711,13 @@ func (a *EnvironmentApi) GetEnvironmentBackupRepo(ctx _context.Context, o ...Get // GetEnvironmentBootstrapManifests Get bootstrap manifests of an environment. func (a *EnvironmentApi) GetEnvironmentBootstrapManifests(ctx _context.Context, environmentName string) (HttpBody, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue HttpBody + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue HttpBody ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironmentBootstrapManifests") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -769,7 +731,8 @@ func (a *EnvironmentApi) GetEnvironmentBootstrapManifests(ctx _context.Context, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -791,10 +754,11 @@ func (a *EnvironmentApi) GetEnvironmentBootstrapManifests(ctx _context.Context, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -808,7 +772,7 @@ func (a *EnvironmentApi) GetEnvironmentBootstrapManifests(ctx _context.Context, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -820,11 +784,13 @@ func (a *EnvironmentApi) GetEnvironmentBootstrapManifests(ctx _context.Context, // GetEnvironmentKubeconfig Get environment kubeconfig. func (a *EnvironmentApi) GetEnvironmentKubeconfig(ctx _context.Context, environmentName string) (HttpBody, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue HttpBody + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue HttpBody ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironmentKubeconfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -838,7 +804,8 @@ func (a *EnvironmentApi) GetEnvironmentKubeconfig(ctx _context.Context, environm localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -860,10 +827,11 @@ func (a *EnvironmentApi) GetEnvironmentKubeconfig(ctx _context.Context, environm if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -877,76 +845,7 @@ func (a *EnvironmentApi) GetEnvironmentKubeconfig(ctx _context.Context, environm err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// GetEnvironmentMetricsMonitorStats Get environment MetricsMonitorStats. -func (a *EnvironmentApi) GetEnvironmentMetricsMonitorStats(ctx _context.Context, environmentName string) (map[string]interface{}, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironmentMetricsMonitorStats") - if err != nil { - return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/admin/v1/environments/{environmentName}/nodes/monitorStatus" - localVarPath = strings.Replace(localVarPath, "{"+"environmentName"+"}", _neturl.PathEscape(common.ParameterToString(environmentName, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "application/json" - - common.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"BearerToken", "authorization"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := common.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -959,11 +858,13 @@ func (a *EnvironmentApi) GetEnvironmentMetricsMonitorStats(ctx _context.Context, // Provides a summary of cluster statistics, aggregated and organized by namespace, for a given environment.. func (a *EnvironmentApi) GetEnvironmentNamespaceStats(ctx _context.Context, environmentName string) (NamespaceStatList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue NamespaceStatList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue NamespaceStatList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironmentNamespaceStats") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -975,9 +876,10 @@ func (a *EnvironmentApi) GetEnvironmentNamespaceStats(ctx _context.Context, envi localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -999,10 +901,11 @@ func (a *EnvironmentApi) GetEnvironmentNamespaceStats(ctx _context.Context, envi if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1011,7 +914,8 @@ func (a *EnvironmentApi) GetEnvironmentNamespaceStats(ctx _context.Context, envi newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1025,7 +929,7 @@ func (a *EnvironmentApi) GetEnvironmentNamespaceStats(ctx _context.Context, envi err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1037,11 +941,13 @@ func (a *EnvironmentApi) GetEnvironmentNamespaceStats(ctx _context.Context, envi // GetEnvironmentProvisioningProgress Get environment provisioning progress. func (a *EnvironmentApi) GetEnvironmentProvisioningProgress(ctx _context.Context, environmentName string) (map[string]interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue map[string]interface{} + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue map[string]interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironmentProvisioningProgress") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1055,7 +961,8 @@ func (a *EnvironmentApi) GetEnvironmentProvisioningProgress(ctx _context.Context localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1077,10 +984,11 @@ func (a *EnvironmentApi) GetEnvironmentProvisioningProgress(ctx _context.Context if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1094,7 +1002,7 @@ func (a *EnvironmentApi) GetEnvironmentProvisioningProgress(ctx _context.Context err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1106,11 +1014,13 @@ func (a *EnvironmentApi) GetEnvironmentProvisioningProgress(ctx _context.Context // GetEnvironmentStatus Get environment status. func (a *EnvironmentApi) GetEnvironmentStatus(ctx _context.Context, environmentName string) (EnvironmentStatus, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EnvironmentStatus + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EnvironmentStatus ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironmentStatus") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1124,7 +1034,8 @@ func (a *EnvironmentApi) GetEnvironmentStatus(ctx _context.Context, environmentN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1146,10 +1057,11 @@ func (a *EnvironmentApi) GetEnvironmentStatus(ctx _context.Context, environmentN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1163,98 +1075,7 @@ func (a *EnvironmentApi) GetEnvironmentStatus(ctx _context.Context, environmentN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// GetEnvironmentStatusHistoryOptionalParameters holds optional parameters for GetEnvironmentStatusHistory. -type GetEnvironmentStatusHistoryOptionalParameters struct { - StartTime *time.Time - EndTime *time.Time -} - -// NewGetEnvironmentStatusHistoryOptionalParameters creates an empty struct for parameters. -func NewGetEnvironmentStatusHistoryOptionalParameters() *GetEnvironmentStatusHistoryOptionalParameters { - this := GetEnvironmentStatusHistoryOptionalParameters{} - return &this -} - -// WithStartTime sets the corresponding parameter name and returns the struct. -func (r *GetEnvironmentStatusHistoryOptionalParameters) WithStartTime(startTime time.Time) *GetEnvironmentStatusHistoryOptionalParameters { - r.StartTime = &startTime - return r -} - -// WithEndTime sets the corresponding parameter name and returns the struct. -func (r *GetEnvironmentStatusHistoryOptionalParameters) WithEndTime(endTime time.Time) *GetEnvironmentStatusHistoryOptionalParameters { - r.EndTime = &endTime - return r -} - -// GetEnvironmentStatusHistory Get environment status history. -func (a *EnvironmentApi) GetEnvironmentStatusHistory(ctx _context.Context, environmentName string, o ...GetEnvironmentStatusHistoryOptionalParameters) ([]EnvironmentStatusHistory, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []EnvironmentStatusHistory - optionalParams GetEnvironmentStatusHistoryOptionalParameters - ) - - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetEnvironmentStatusHistoryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironmentStatusHistory") - if err != nil { - return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/admin/v1/environments/{environmentName}/statusHistory" - localVarPath = strings.Replace(localVarPath, "{"+"environmentName"+"}", _neturl.PathEscape(common.ParameterToString(environmentName, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if optionalParams.StartTime != nil { - localVarQueryParams.Add("startTime", common.ParameterToString(*optionalParams.StartTime, "")) - } - if optionalParams.EndTime != nil { - localVarQueryParams.Add("endTime", common.ParameterToString(*optionalParams.EndTime, "")) - } - localVarHeaderParams["Accept"] = "application/json" - - common.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"BearerToken", "authorization"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := common.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1266,11 +1087,13 @@ func (a *EnvironmentApi) GetEnvironmentStatusHistory(ctx _context.Context, envir // GetLatestComponentVersion Get component latest version. func (a *EnvironmentApi) GetLatestComponentVersion(ctx _context.Context) (ComponentVersion, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ComponentVersion + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ComponentVersion ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetLatestComponentVersion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1283,7 +1106,8 @@ func (a *EnvironmentApi) GetLatestComponentVersion(ctx _context.Context) (Compon localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1306,7 +1130,7 @@ func (a *EnvironmentApi) GetLatestComponentVersion(ctx _context.Context) (Compon err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1319,11 +1143,13 @@ func (a *EnvironmentApi) GetLatestComponentVersion(ctx _context.Context) (Compon // Get specified node info for environment func (a *EnvironmentApi) GetNode(ctx _context.Context, environmentName string, nodeName string) (map[string]interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue map[string]interface{} + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue map[string]interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetNode") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1338,7 +1164,8 @@ func (a *EnvironmentApi) GetNode(ctx _context.Context, environmentName string, n localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1360,10 +1187,11 @@ func (a *EnvironmentApi) GetNode(ctx _context.Context, environmentName string, n if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1377,7 +1205,7 @@ func (a *EnvironmentApi) GetNode(ctx _context.Context, environmentName string, n err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1389,11 +1217,13 @@ func (a *EnvironmentApi) GetNode(ctx _context.Context, environmentName string, n // GetWorkflow Get component management workflows. func (a *EnvironmentApi) GetWorkflow(ctx _context.Context, environmentName string, workflowName string) (Workflow, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Workflow + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Workflow ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetWorkflow") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1408,7 +1238,8 @@ func (a *EnvironmentApi) GetWorkflow(ctx _context.Context, environmentName strin localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1431,7 +1262,7 @@ func (a *EnvironmentApi) GetWorkflow(ctx _context.Context, environmentName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1443,11 +1274,13 @@ func (a *EnvironmentApi) GetWorkflow(ctx _context.Context, environmentName strin // GetWorkflowList Get component management workflow list. func (a *EnvironmentApi) GetWorkflowList(ctx _context.Context, environmentName string) (WorkflowList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue WorkflowList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue WorkflowList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetWorkflowList") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1461,7 +1294,8 @@ func (a *EnvironmentApi) GetWorkflowList(ctx _context.Context, environmentName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1484,7 +1318,7 @@ func (a *EnvironmentApi) GetWorkflowList(ctx _context.Context, environmentName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1496,11 +1330,13 @@ func (a *EnvironmentApi) GetWorkflowList(ctx _context.Context, environmentName s // GetWorkflowLog Get component management workflow log. func (a *EnvironmentApi) GetWorkflowLog(ctx _context.Context, environmentName string, workflowName string) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue string + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetWorkflowLog") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1513,9 +1349,10 @@ func (a *EnvironmentApi) GetWorkflowLog(ctx _context.Context, environmentName st localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "text/plain" + localVarHeaderParams["Accept"] = "text/plain" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1538,7 +1375,7 @@ func (a *EnvironmentApi) GetWorkflowLog(ctx _context.Context, environmentName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1551,11 +1388,13 @@ func (a *EnvironmentApi) GetWorkflowLog(ctx _context.Context, environmentName st // List available zones of an environment func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, environmentName string) ([]string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []string + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListEnvNodeZone") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1569,7 +1408,8 @@ func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, environmentName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1591,10 +1431,11 @@ func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1608,7 +1449,7 @@ func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, environmentName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1619,12 +1460,8 @@ func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, environmentName s // ListEnvironmentOptionalParameters holds optional parameters for ListEnvironment. type ListEnvironmentOptionalParameters struct { - OrgName *string - CloudProvider *string - CloudRegion *string + OrgName *string EnvironmentType *EnvironmentType - Engine *string - Version *string } // NewListEnvironmentOptionalParameters creates an empty struct for parameters. @@ -1632,59 +1469,35 @@ func NewListEnvironmentOptionalParameters() *ListEnvironmentOptionalParameters { this := ListEnvironmentOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListEnvironmentOptionalParameters) WithOrgName(orgName string) *ListEnvironmentOptionalParameters { r.OrgName = &orgName return r } - -// WithCloudProvider sets the corresponding parameter name and returns the struct. -func (r *ListEnvironmentOptionalParameters) WithCloudProvider(cloudProvider string) *ListEnvironmentOptionalParameters { - r.CloudProvider = &cloudProvider - return r -} - -// WithCloudRegion sets the corresponding parameter name and returns the struct. -func (r *ListEnvironmentOptionalParameters) WithCloudRegion(cloudRegion string) *ListEnvironmentOptionalParameters { - r.CloudRegion = &cloudRegion - return r -} - // WithEnvironmentType sets the corresponding parameter name and returns the struct. func (r *ListEnvironmentOptionalParameters) WithEnvironmentType(environmentType EnvironmentType) *ListEnvironmentOptionalParameters { r.EnvironmentType = &environmentType return r } -// WithEngine sets the corresponding parameter name and returns the struct. -func (r *ListEnvironmentOptionalParameters) WithEngine(engine string) *ListEnvironmentOptionalParameters { - r.Engine = &engine - return r -} - -// WithVersion sets the corresponding parameter name and returns the struct. -func (r *ListEnvironmentOptionalParameters) WithVersion(version string) *ListEnvironmentOptionalParameters { - r.Version = &version - return r -} - // ListEnvironment List environments. // List environments func (a *EnvironmentApi) ListEnvironment(ctx _context.Context, o ...ListEnvironmentOptionalParameters) (EnvironmentList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EnvironmentList - optionalParams ListEnvironmentOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EnvironmentList + optionalParams ListEnvironmentOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnvironmentOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnvironmentOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListEnvironment") if err != nil { @@ -1699,123 +1512,13 @@ func (a *EnvironmentApi) ListEnvironment(ctx _context.Context, o ...ListEnvironm if optionalParams.OrgName != nil { localVarQueryParams.Add("orgName", common.ParameterToString(*optionalParams.OrgName, "")) } - if optionalParams.CloudProvider != nil { - localVarQueryParams.Add("cloudProvider", common.ParameterToString(*optionalParams.CloudProvider, "")) - } - if optionalParams.CloudRegion != nil { - localVarQueryParams.Add("cloudRegion", common.ParameterToString(*optionalParams.CloudRegion, "")) - } if optionalParams.EnvironmentType != nil { localVarQueryParams.Add("environmentType", common.ParameterToString(*optionalParams.EnvironmentType, "")) } - if optionalParams.Engine != nil { - localVarQueryParams.Add("engine", common.ParameterToString(*optionalParams.Engine, "")) - } - if optionalParams.Version != nil { - localVarQueryParams.Add("version", common.ParameterToString(*optionalParams.Version, "")) - } - localVarHeaderParams["Accept"] = "application/json" - - common.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"BearerToken", "authorization"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := common.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// ListEnvironmentObjectStorageOptionalParameters holds optional parameters for ListEnvironmentObjectStorage. -type ListEnvironmentObjectStorageOptionalParameters struct { - Body *string -} - -// NewListEnvironmentObjectStorageOptionalParameters creates an empty struct for parameters. -func NewListEnvironmentObjectStorageOptionalParameters() *ListEnvironmentObjectStorageOptionalParameters { - this := ListEnvironmentObjectStorageOptionalParameters{} - return &this -} - -// WithBody sets the corresponding parameter name and returns the struct. -func (r *ListEnvironmentObjectStorageOptionalParameters) WithBody(body string) *ListEnvironmentObjectStorageOptionalParameters { - r.Body = &body - return r -} - -// ListEnvironmentObjectStorage List environment object storage. -// List environment object storage -func (a *EnvironmentApi) ListEnvironmentObjectStorage(ctx _context.Context, o ...ListEnvironmentObjectStorageOptionalParameters) (EnvironmentObjectStorage, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue EnvironmentObjectStorage - optionalParams ListEnvironmentObjectStorageOptionalParameters - ) - - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnvironmentObjectStorageOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListEnvironmentObjectStorage") - if err != nil { - return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/admin/v1/environmentObjectStorage" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" - // body params - if optionalParams.Body != nil { - localVarPostBody = &optionalParams.Body - } - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1837,10 +1540,11 @@ func (a *EnvironmentApi) ListEnvironmentObjectStorage(ctx _context.Context, o .. if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1854,7 +1558,7 @@ func (a *EnvironmentApi) ListEnvironmentObjectStorage(ctx _context.Context, o .. err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1866,8 +1570,8 @@ func (a *EnvironmentApi) ListEnvironmentObjectStorage(ctx _context.Context, o .. // ListKubernetesNodeOptionalParameters holds optional parameters for ListKubernetesNode. type ListKubernetesNodeOptionalParameters struct { Region *string - Zone *string - Op *ListKubernetesNodeOpType + Zone *string + Op *ListKubernetesNodeOpType } // NewListKubernetesNodeOptionalParameters creates an empty struct for parameters. @@ -1875,19 +1579,16 @@ func NewListKubernetesNodeOptionalParameters() *ListKubernetesNodeOptionalParame this := ListKubernetesNodeOptionalParameters{} return &this } - // WithRegion sets the corresponding parameter name and returns the struct. func (r *ListKubernetesNodeOptionalParameters) WithRegion(region string) *ListKubernetesNodeOptionalParameters { r.Region = ®ion return r } - // WithZone sets the corresponding parameter name and returns the struct. func (r *ListKubernetesNodeOptionalParameters) WithZone(zone string) *ListKubernetesNodeOptionalParameters { r.Zone = &zone return r } - // WithOp sets the corresponding parameter name and returns the struct. func (r *ListKubernetesNodeOptionalParameters) WithOp(op ListKubernetesNodeOpType) *ListKubernetesNodeOptionalParameters { r.Op = &op @@ -1898,18 +1599,20 @@ func (r *ListKubernetesNodeOptionalParameters) WithOp(op ListKubernetesNodeOpTyp // List Kubernetes nodes before registered as environment func (a *EnvironmentApi) ListKubernetesNode(ctx _context.Context, body Kubeconfig, o ...ListKubernetesNodeOptionalParameters) (NodeList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue NodeList - optionalParams ListKubernetesNodeOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue NodeList + optionalParams ListKubernetesNodeOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListKubernetesNodeOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListKubernetesNodeOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListKubernetesNode") if err != nil { @@ -1933,9 +1636,11 @@ func (a *EnvironmentApi) ListKubernetesNode(ctx _context.Context, body Kubeconfi localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1957,10 +1662,11 @@ func (a *EnvironmentApi) ListKubernetesNode(ctx _context.Context, body Kubeconfi if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1974,7 +1680,7 @@ func (a *EnvironmentApi) ListKubernetesNode(ctx _context.Context, body Kubeconfi err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1987,11 +1693,13 @@ func (a *EnvironmentApi) ListKubernetesNode(ctx _context.Context, body Kubeconfi // List Kubernetes storageclass before registered as environment func (a *EnvironmentApi) ListKubernetesStorageClass(ctx _context.Context, body Kubeconfig) (StorageClassList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue StorageClassList + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue StorageClassList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListKubernetesStorageClass") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -2005,9 +1713,11 @@ func (a *EnvironmentApi) ListKubernetesStorageClass(ctx _context.Context, body K localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2029,10 +1739,11 @@ func (a *EnvironmentApi) ListKubernetesStorageClass(ctx _context.Context, body K if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2046,7 +1757,7 @@ func (a *EnvironmentApi) ListKubernetesStorageClass(ctx _context.Context, body K err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -2058,11 +1769,13 @@ func (a *EnvironmentApi) ListKubernetesStorageClass(ctx _context.Context, body K // ListNodeGroup Create environment node group. func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName string) (NodeGroup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue NodeGroup + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue NodeGroup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListNodeGroup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -2076,7 +1789,8 @@ func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2098,10 +1812,11 @@ func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2115,7 +1830,7 @@ func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -2128,11 +1843,13 @@ func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName str // List Pod in the environment node func (a *EnvironmentApi) ListNodePod(ctx _context.Context, environmentName string, nodeName string, typeVar string) ([]map[string]interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []map[string]interface{} + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []map[string]interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListNodePod") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -2148,7 +1865,8 @@ func (a *EnvironmentApi) ListNodePod(ctx _context.Context, environmentName strin localVarQueryParams.Add("type", common.ParameterToString(typeVar, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2170,10 +1888,11 @@ func (a *EnvironmentApi) ListNodePod(ctx _context.Context, environmentName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2187,7 +1906,7 @@ func (a *EnvironmentApi) ListNodePod(ctx _context.Context, environmentName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -2198,9 +1917,9 @@ func (a *EnvironmentApi) ListNodePod(ctx _context.Context, environmentName strin // ListNodesOptionalParameters holds optional parameters for ListNodes. type ListNodesOptionalParameters struct { - HostName *string + HostName *string OutOfTopologyRange *bool - LabelKey *string + LabelKey *string } // NewListNodesOptionalParameters creates an empty struct for parameters. @@ -2208,19 +1927,16 @@ func NewListNodesOptionalParameters() *ListNodesOptionalParameters { this := ListNodesOptionalParameters{} return &this } - // WithHostName sets the corresponding parameter name and returns the struct. func (r *ListNodesOptionalParameters) WithHostName(hostName string) *ListNodesOptionalParameters { r.HostName = &hostName return r } - // WithOutOfTopologyRange sets the corresponding parameter name and returns the struct. func (r *ListNodesOptionalParameters) WithOutOfTopologyRange(outOfTopologyRange bool) *ListNodesOptionalParameters { r.OutOfTopologyRange = &outOfTopologyRange return r } - // WithLabelKey sets the corresponding parameter name and returns the struct. func (r *ListNodesOptionalParameters) WithLabelKey(labelKey string) *ListNodesOptionalParameters { r.LabelKey = &labelKey @@ -2231,18 +1947,20 @@ func (r *ListNodesOptionalParameters) WithLabelKey(labelKey string) *ListNodesOp // List Kubernetes nodes in an environment func (a *EnvironmentApi) ListNodes(ctx _context.Context, environmentName string, o ...ListNodesOptionalParameters) (NodeList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue NodeList - optionalParams ListNodesOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue NodeList + optionalParams ListNodesOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListNodesOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListNodesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListNodes") if err != nil { @@ -2266,7 +1984,8 @@ func (a *EnvironmentApi) ListNodes(ctx _context.Context, environmentName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2288,10 +2007,11 @@ func (a *EnvironmentApi) ListNodes(ctx _context.Context, environmentName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2305,7 +2025,7 @@ func (a *EnvironmentApi) ListNodes(ctx _context.Context, environmentName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -2318,11 +2038,13 @@ func (a *EnvironmentApi) ListNodes(ctx _context.Context, environmentName string, // partially update the specified Environment func (a *EnvironmentApi) PatchEnvironment(ctx _context.Context, environmentName string, body EnvironmentUpdate) (Environment, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Environment + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Environment ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.PatchEnvironment") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -2337,9 +2059,11 @@ func (a *EnvironmentApi) PatchEnvironment(ctx _context.Context, environmentName localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2361,10 +2085,11 @@ func (a *EnvironmentApi) PatchEnvironment(ctx _context.Context, environmentName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2378,7 +2103,7 @@ func (a *EnvironmentApi) PatchEnvironment(ctx _context.Context, environmentName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -2391,11 +2116,13 @@ func (a *EnvironmentApi) PatchEnvironment(ctx _context.Context, environmentName // partially update the specified NodeGroup func (a *EnvironmentApi) PatchNodeGroup(ctx _context.Context, environmentName string, nodeGroupName string, body NodeGroupUpdate) (NodeGroup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue NodeGroup + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue NodeGroup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.PatchNodeGroup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -2411,9 +2138,11 @@ func (a *EnvironmentApi) PatchNodeGroup(ctx _context.Context, environmentName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2435,10 +2164,11 @@ func (a *EnvironmentApi) PatchNodeGroup(ctx _context.Context, environmentName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2452,7 +2182,7 @@ func (a *EnvironmentApi) PatchNodeGroup(ctx _context.Context, environmentName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -2464,11 +2194,13 @@ func (a *EnvironmentApi) PatchNodeGroup(ctx _context.Context, environmentName st // PreflightEnvironment Preflight check before create Environment. func (a *EnvironmentApi) PreflightEnvironment(ctx _context.Context, body Kubeconfig) (PreflightList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue PreflightList + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue PreflightList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.PreflightEnvironment") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -2482,146 +2214,11 @@ func (a *EnvironmentApi) PreflightEnvironment(ctx _context.Context, body Kubecon localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" - // body params - localVarPostBody = &body - common.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"BearerToken", "authorization"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := common.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// PreflightRestoreEnvironment Preflight check before restore environment. -func (a *EnvironmentApi) PreflightRestoreEnvironment(ctx _context.Context, body Kubeconfig) (PreflightList, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue PreflightList - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.PreflightRestoreEnvironment") - if err != nil { - return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/admin/v1/environments/restorePreflight" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/json" + // body params localVarPostBody = &body - common.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"BearerToken", "authorization"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := common.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// RestoreEnvironmentOptionalParameters holds optional parameters for RestoreEnvironment. -type RestoreEnvironmentOptionalParameters struct { - Body *string -} - -// NewRestoreEnvironmentOptionalParameters creates an empty struct for parameters. -func NewRestoreEnvironmentOptionalParameters() *RestoreEnvironmentOptionalParameters { - this := RestoreEnvironmentOptionalParameters{} - return &this -} - -// WithBody sets the corresponding parameter name and returns the struct. -func (r *RestoreEnvironmentOptionalParameters) WithBody(body string) *RestoreEnvironmentOptionalParameters { - r.Body = &body - return r -} - -// RestoreEnvironment restore environment. -func (a *EnvironmentApi) RestoreEnvironment(ctx _context.Context, o ...RestoreEnvironmentOptionalParameters) (Environment, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Environment - optionalParams RestoreEnvironmentOptionalParameters - ) - - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type RestoreEnvironmentOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.RestoreEnvironment") - if err != nil { - return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/admin/v1/environments/restore" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/json" - - // body params - if optionalParams.Body != nil { - localVarPostBody = &optionalParams.Body - } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2641,26 +2238,10 @@ func (a *EnvironmentApi) RestoreEnvironment(ctx _context.Context, o ...RestoreEn return localVarReturnValue, localVarHTTPResponse, err } - if localVarHTTPResponse.StatusCode >= 300 { - newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -2673,10 +2254,12 @@ func (a *EnvironmentApi) RestoreEnvironment(ctx _context.Context, o ...RestoreEn // cordon the specified Environment node func (a *EnvironmentApi) UncordonEnvironmentNode(ctx _context.Context, environmentName string, nodeName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.UncordonEnvironmentNode") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -2691,7 +2274,8 @@ func (a *EnvironmentApi) UncordonEnvironmentNode(ctx _context.Context, environme localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2713,10 +2297,11 @@ func (a *EnvironmentApi) UncordonEnvironmentNode(ctx _context.Context, environme if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/admin/api_event.go b/api/kbcloud/admin/api_event.go index eb779275..37c0ebfa 100644 --- a/api/kbcloud/admin/api_event.go +++ b/api/kbcloud/admin/api_event.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -18,12 +22,12 @@ type EventApi common.Service // QueryClusterEventsOptionalParameters holds optional parameters for QueryClusterEvents. type QueryClusterEventsOptionalParameters struct { - ResourceId *int32 + ResourceId *int32 ResourceType *string - EventName *string - OperatorId *int32 - Start *int64 - End *int64 + EventName *string + OperatorId *int32 + Start *int64 + End *int64 } // NewQueryClusterEventsOptionalParameters creates an empty struct for parameters. @@ -31,37 +35,31 @@ func NewQueryClusterEventsOptionalParameters() *QueryClusterEventsOptionalParame this := QueryClusterEventsOptionalParameters{} return &this } - // WithResourceId sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithResourceId(resourceId int32) *QueryClusterEventsOptionalParameters { r.ResourceId = &resourceId return r } - // WithResourceType sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithResourceType(resourceType string) *QueryClusterEventsOptionalParameters { r.ResourceType = &resourceType return r } - // WithEventName sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithEventName(eventName string) *QueryClusterEventsOptionalParameters { r.EventName = &eventName return r } - // WithOperatorId sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithOperatorId(operatorId int32) *QueryClusterEventsOptionalParameters { r.OperatorId = &operatorId return r } - // WithStart sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithStart(start int64) *QueryClusterEventsOptionalParameters { r.Start = &start return r } - // WithEnd sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithEnd(end int64) *QueryClusterEventsOptionalParameters { r.End = &end @@ -72,18 +70,20 @@ func (r *QueryClusterEventsOptionalParameters) WithEnd(end int64) *QueryClusterE // Query events of clusters func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, o ...QueryClusterEventsOptionalParameters) (EventList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EventList - optionalParams QueryClusterEventsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EventList + optionalParams QueryClusterEventsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryClusterEventsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryClusterEventsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EventApi.QueryClusterEvents") if err != nil { @@ -116,7 +116,8 @@ func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, o .. } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -138,10 +139,11 @@ func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, o .. if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -155,7 +157,7 @@ func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, o .. err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_fault.go b/api/kbcloud/admin/api_fault.go index f0591ee2..354311fd 100644 --- a/api/kbcloud/admin/api_fault.go +++ b/api/kbcloud/admin/api_fault.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type FaultApi common.Service // CreateClusterNetworkChaos Create a network chaos for cluster. func (a *FaultApi) CreateClusterNetworkChaos(ctx _context.Context, body NetworkChaos) (Fault, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Fault + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Fault ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FaultApi.CreateClusterNetworkChaos") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,9 +43,11 @@ func (a *FaultApi) CreateClusterNetworkChaos(ctx _context.Context, body NetworkC localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +69,11 @@ func (a *FaultApi) CreateClusterNetworkChaos(ctx _context.Context, body NetworkC if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +87,7 @@ func (a *FaultApi) CreateClusterNetworkChaos(ctx _context.Context, body NetworkC err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +99,13 @@ func (a *FaultApi) CreateClusterNetworkChaos(ctx _context.Context, body NetworkC // CreateClusterPodChaos Create a pod chaos for cluster. func (a *FaultApi) CreateClusterPodChaos(ctx _context.Context, body PodChaos) (Fault, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Fault + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Fault ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FaultApi.CreateClusterPodChaos") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -108,9 +119,11 @@ func (a *FaultApi) CreateClusterPodChaos(ctx _context.Context, body PodChaos) (F localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +145,11 @@ func (a *FaultApi) CreateClusterPodChaos(ctx _context.Context, body PodChaos) (F if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -149,7 +163,7 @@ func (a *FaultApi) CreateClusterPodChaos(ctx _context.Context, body PodChaos) (F err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -161,11 +175,13 @@ func (a *FaultApi) CreateClusterPodChaos(ctx _context.Context, body PodChaos) (F // DeleteFault Delete faults. func (a *FaultApi) DeleteFault(ctx _context.Context, body []string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FaultApi.DeleteFault") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -179,9 +195,11 @@ func (a *FaultApi) DeleteFault(ctx _context.Context, body []string) (interface{} localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -203,10 +221,11 @@ func (a *FaultApi) DeleteFault(ctx _context.Context, body []string) (interface{} if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -220,7 +239,7 @@ func (a *FaultApi) DeleteFault(ctx _context.Context, body []string) (interface{} err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -232,11 +251,13 @@ func (a *FaultApi) DeleteFault(ctx _context.Context, body []string) (interface{} // GetChaos Get chaos. func (a *FaultApi) GetChaos(ctx _context.Context, faultId int32) (Fault, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Fault + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Fault ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FaultApi.GetChaos") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -250,7 +271,8 @@ func (a *FaultApi) GetChaos(ctx _context.Context, faultId int32) (Fault, *_netht localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -273,7 +295,7 @@ func (a *FaultApi) GetChaos(ctx _context.Context, faultId int32) (Fault, *_netht err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -285,7 +307,7 @@ func (a *FaultApi) GetChaos(ctx _context.Context, faultId int32) (Fault, *_netht // ListFaultOptionalParameters holds optional parameters for ListFault. type ListFaultOptionalParameters struct { Cluster *string - Type *FaultType + Type *FaultType } // NewListFaultOptionalParameters creates an empty struct for parameters. @@ -293,13 +315,11 @@ func NewListFaultOptionalParameters() *ListFaultOptionalParameters { this := ListFaultOptionalParameters{} return &this } - // WithCluster sets the corresponding parameter name and returns the struct. func (r *ListFaultOptionalParameters) WithCluster(cluster string) *ListFaultOptionalParameters { r.Cluster = &cluster return r } - // WithType sets the corresponding parameter name and returns the struct. func (r *ListFaultOptionalParameters) WithType(typeVar FaultType) *ListFaultOptionalParameters { r.Type = &typeVar @@ -309,18 +329,20 @@ func (r *ListFaultOptionalParameters) WithType(typeVar FaultType) *ListFaultOpti // ListFault List faults. func (a *FaultApi) ListFault(ctx _context.Context, o ...ListFaultOptionalParameters) (FaultList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue FaultList - optionalParams ListFaultOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue FaultList + optionalParams ListFaultOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListFaultOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListFaultOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FaultApi.ListFault") if err != nil { @@ -340,7 +362,8 @@ func (a *FaultApi) ListFault(ctx _context.Context, o ...ListFaultOptionalParamet } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -362,10 +385,11 @@ func (a *FaultApi) ListFault(ctx _context.Context, o ...ListFaultOptionalParamet if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -379,7 +403,7 @@ func (a *FaultApi) ListFault(ctx _context.Context, o ...ListFaultOptionalParamet err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_feature.go b/api/kbcloud/admin/api_feature.go index d3f04bae..7cffcc97 100644 --- a/api/kbcloud/admin/api_feature.go +++ b/api/kbcloud/admin/api_feature.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListFeatureOptionalParameters() *ListFeatureOptionalParameters { this := ListFeatureOptionalParameters{} return &this } - // WithGroup sets the corresponding parameter name and returns the struct. func (r *ListFeatureOptionalParameters) WithGroup(group string) *ListFeatureOptionalParameters { r.Group = &group @@ -37,18 +40,20 @@ func (r *ListFeatureOptionalParameters) WithGroup(group string) *ListFeatureOpti // Get feature list func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalParameters) (FeatureList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue FeatureList - optionalParams ListFeatureOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue FeatureList + optionalParams ListFeatureOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListFeatureOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListFeatureOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FeatureApi.ListFeature") if err != nil { @@ -65,7 +70,8 @@ func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalP } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -87,10 +93,11 @@ func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalP if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -104,7 +111,7 @@ func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalP err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -117,11 +124,13 @@ func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalP // Get feature func (a *FeatureApi) ReadFeature(ctx _context.Context, featureName string) (Feature, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Feature + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Feature ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FeatureApi.ReadFeature") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -135,7 +144,8 @@ func (a *FeatureApi) ReadFeature(ctx _context.Context, featureName string) (Feat localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -157,10 +167,11 @@ func (a *FeatureApi) ReadFeature(ctx _context.Context, featureName string) (Feat if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -174,7 +185,7 @@ func (a *FeatureApi) ReadFeature(ctx _context.Context, featureName string) (Feat err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_image_registry.go b/api/kbcloud/admin/api_image_registry.go index 55ae9b5b..43852935 100644 --- a/api/kbcloud/admin/api_image_registry.go +++ b/api/kbcloud/admin/api_image_registry.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type ImageRegistryApi common.Service // CreateImageRegistry Create image registry. func (a *ImageRegistryApi) CreateImageRegistry(ctx _context.Context, body ImageRegistry) (ImageRegistry, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue ImageRegistry + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue ImageRegistry ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ImageRegistryApi.CreateImageRegistry") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,9 +43,11 @@ func (a *ImageRegistryApi) CreateImageRegistry(ctx _context.Context, body ImageR localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,7 +70,7 @@ func (a *ImageRegistryApi) CreateImageRegistry(ctx _context.Context, body ImageR err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -81,7 +89,6 @@ func NewDeleteImageRegistryOptionalParameters() *DeleteImageRegistryOptionalPara this := DeleteImageRegistryOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *DeleteImageRegistryOptionalParameters) WithBody(body ImageRegistry) *DeleteImageRegistryOptionalParameters { r.Body = &body @@ -91,17 +98,19 @@ func (r *DeleteImageRegistryOptionalParameters) WithBody(body ImageRegistry) *De // DeleteImageRegistry Delete image registry. func (a *ImageRegistryApi) DeleteImageRegistry(ctx _context.Context, imageRegistryName string, o ...DeleteImageRegistryOptionalParameters) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - optionalParams DeleteImageRegistryOptionalParameters + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + optionalParams DeleteImageRegistryOptionalParameters ) - if len(o) > 1 { - return nil, common.ReportError("only one argument of type DeleteImageRegistryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return nil, common.ReportError("only one argument of type DeleteImageRegistryOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ImageRegistryApi.DeleteImageRegistry") if err != nil { @@ -117,11 +126,13 @@ func (a *ImageRegistryApi) DeleteImageRegistry(ctx _context.Context, imageRegist localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -143,10 +154,11 @@ func (a *ImageRegistryApi) DeleteImageRegistry(ctx _context.Context, imageRegist if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -163,11 +175,13 @@ func (a *ImageRegistryApi) DeleteImageRegistry(ctx _context.Context, imageRegist // GetImageRegistry Get image registry. func (a *ImageRegistryApi) GetImageRegistry(ctx _context.Context, imageRegistryName string) (ImageRegistry, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ImageRegistry + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ImageRegistry ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ImageRegistryApi.GetImageRegistry") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -181,7 +195,8 @@ func (a *ImageRegistryApi) GetImageRegistry(ctx _context.Context, imageRegistryN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -203,10 +218,11 @@ func (a *ImageRegistryApi) GetImageRegistry(ctx _context.Context, imageRegistryN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -220,7 +236,7 @@ func (a *ImageRegistryApi) GetImageRegistry(ctx _context.Context, imageRegistryN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -233,11 +249,13 @@ func (a *ImageRegistryApi) GetImageRegistry(ctx _context.Context, imageRegistryN // List image registries func (a *ImageRegistryApi) ListImageRegistries(ctx _context.Context) (ImageRegistryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ImageRegistryList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ImageRegistryList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ImageRegistryApi.ListImageRegistries") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -250,7 +268,8 @@ func (a *ImageRegistryApi) ListImageRegistries(ctx _context.Context) (ImageRegis localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -273,7 +292,7 @@ func (a *ImageRegistryApi) ListImageRegistries(ctx _context.Context) (ImageRegis err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -286,11 +305,13 @@ func (a *ImageRegistryApi) ListImageRegistries(ctx _context.Context) (ImageRegis // partially update the specified image registry func (a *ImageRegistryApi) PatchImageRegistry(ctx _context.Context, imageRegistryName string, body ImageRegistry) (ImageRegistry, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue ImageRegistry + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue ImageRegistry ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ImageRegistryApi.PatchImageRegistry") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -305,9 +326,11 @@ func (a *ImageRegistryApi) PatchImageRegistry(ctx _context.Context, imageRegistr localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -329,10 +352,11 @@ func (a *ImageRegistryApi) PatchImageRegistry(ctx _context.Context, imageRegistr if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -346,7 +370,7 @@ func (a *ImageRegistryApi) PatchImageRegistry(ctx _context.Context, imageRegistr err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_inspection.go b/api/kbcloud/admin/api_inspection.go index ee20ea55..dc43dd3d 100644 --- a/api/kbcloud/admin/api_inspection.go +++ b/api/kbcloud/admin/api_inspection.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type InspectionApi common.Service // CreateAutoInspection Create auto inspection. func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName string, body AutoInspection) (AutoInspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AutoInspection + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AutoInspection ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.CreateAutoInspection") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,11 +100,13 @@ func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName strin // CreateInspectionScript Create inspection script. func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName string, body InspectionScript) (InspectionScript, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue InspectionScript + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue InspectionScript ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.CreateInspectionScript") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,9 +121,11 @@ func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -134,10 +147,11 @@ func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -151,7 +165,7 @@ func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -163,11 +177,13 @@ func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName str // DeleteInspectionScript Delete inspection script. func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName string, body InspectionScript) (InspectionScript, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue InspectionScript + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue InspectionScript ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.DeleteInspectionScript") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -182,9 +198,11 @@ func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -206,10 +224,11 @@ func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -223,7 +242,7 @@ func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -235,11 +254,13 @@ func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName str // ListAutoInspection list auto inspection. func (a *InspectionApi) ListAutoInspection(ctx _context.Context, orgName string) (AutoInspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AutoInspection + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AutoInspection ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.ListAutoInspection") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -253,7 +274,8 @@ func (a *InspectionApi) ListAutoInspection(ctx _context.Context, orgName string) localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -275,10 +297,11 @@ func (a *InspectionApi) ListAutoInspection(ctx _context.Context, orgName string) if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -292,7 +315,7 @@ func (a *InspectionApi) ListAutoInspection(ctx _context.Context, orgName string) err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -311,7 +334,6 @@ func NewListInspectionScriptsOptionalParameters() *ListInspectionScriptsOptional this := ListInspectionScriptsOptionalParameters{} return &this } - // WithEngine sets the corresponding parameter name and returns the struct. func (r *ListInspectionScriptsOptionalParameters) WithEngine(engine string) *ListInspectionScriptsOptionalParameters { r.Engine = &engine @@ -321,18 +343,20 @@ func (r *ListInspectionScriptsOptionalParameters) WithEngine(engine string) *Lis // ListInspectionScripts list inspection scripts. func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName string, o ...ListInspectionScriptsOptionalParameters) ([]InspectionScript, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []InspectionScript - optionalParams ListInspectionScriptsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []InspectionScript + optionalParams ListInspectionScriptsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListInspectionScriptsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListInspectionScriptsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.ListInspectionScripts") if err != nil { @@ -350,7 +374,8 @@ func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName stri } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -372,10 +397,11 @@ func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -389,7 +415,7 @@ func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -401,7 +427,7 @@ func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName stri // ListInspectionsOptionalParameters holds optional parameters for ListInspections. type ListInspectionsOptionalParameters struct { ClusterId *string - TaskId *string + TaskId *string } // NewListInspectionsOptionalParameters creates an empty struct for parameters. @@ -409,13 +435,11 @@ func NewListInspectionsOptionalParameters() *ListInspectionsOptionalParameters { this := ListInspectionsOptionalParameters{} return &this } - // WithClusterId sets the corresponding parameter name and returns the struct. func (r *ListInspectionsOptionalParameters) WithClusterId(clusterId string) *ListInspectionsOptionalParameters { r.ClusterId = &clusterId return r } - // WithTaskId sets the corresponding parameter name and returns the struct. func (r *ListInspectionsOptionalParameters) WithTaskId(taskId string) *ListInspectionsOptionalParameters { r.TaskId = &taskId @@ -425,18 +449,20 @@ func (r *ListInspectionsOptionalParameters) WithTaskId(taskId string) *ListInspe // ListInspections list inspections. func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o ...ListInspectionsOptionalParameters) ([]Inspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Inspection - optionalParams ListInspectionsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Inspection + optionalParams ListInspectionsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListInspectionsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListInspectionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.ListInspections") if err != nil { @@ -457,7 +483,8 @@ func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -479,10 +506,11 @@ func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -496,7 +524,7 @@ func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -508,11 +536,13 @@ func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o // UpdateAutoInspection Update auto inspection. func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName string, body AutoInspection) (AutoInspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AutoInspection + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AutoInspection ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.UpdateAutoInspection") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -527,9 +557,11 @@ func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -551,10 +583,11 @@ func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -568,7 +601,7 @@ func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -580,11 +613,13 @@ func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName strin // UpdateInspection Update inspection. func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, body Inspection) (Inspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Inspection + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Inspection ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.UpdateInspection") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -599,9 +634,11 @@ func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, b localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -623,10 +660,11 @@ func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, b if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -640,7 +678,7 @@ func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, b err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -652,11 +690,13 @@ func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, b // UpdateInspectionScript Update inspection script. func (a *InspectionApi) UpdateInspectionScript(ctx _context.Context, orgName string, body InspectionScript) (InspectionScript, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue InspectionScript + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue InspectionScript ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.UpdateInspectionScript") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -671,9 +711,11 @@ func (a *InspectionApi) UpdateInspectionScript(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -695,10 +737,11 @@ func (a *InspectionApi) UpdateInspectionScript(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -712,7 +755,7 @@ func (a *InspectionApi) UpdateInspectionScript(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_invitation.go b/api/kbcloud/admin/api_invitation.go index 303576b3..74011c55 100644 --- a/api/kbcloud/admin/api_invitation.go +++ b/api/kbcloud/admin/api_invitation.go @@ -2,10 +2,15 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -18,7 +23,7 @@ type InvitationApi common.Service // ListInvitationOptionalParameters holds optional parameters for ListInvitation. type ListInvitationOptionalParameters struct { OrgName *string - UserId *string + UserId *string } // NewListInvitationOptionalParameters creates an empty struct for parameters. @@ -26,13 +31,11 @@ func NewListInvitationOptionalParameters() *ListInvitationOptionalParameters { this := ListInvitationOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListInvitationOptionalParameters) WithOrgName(orgName string) *ListInvitationOptionalParameters { r.OrgName = &orgName return r } - // WithUserId sets the corresponding parameter name and returns the struct. func (r *ListInvitationOptionalParameters) WithUserId(userId string) *ListInvitationOptionalParameters { r.UserId = &userId @@ -43,18 +46,20 @@ func (r *ListInvitationOptionalParameters) WithUserId(userId string) *ListInvita // list the Invitation of specified Org or User func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitationOptionalParameters) (InvitationList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue InvitationList - optionalParams ListInvitationOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue InvitationList + optionalParams ListInvitationOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListInvitationOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListInvitationOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InvitationApi.ListInvitation") if err != nil { @@ -74,7 +79,8 @@ func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitation } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -96,10 +102,11 @@ func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitation if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -113,7 +120,7 @@ func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitation err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_ip_whitelist.go b/api/kbcloud/admin/api_ip_whitelist.go index 713257f5..7321974f 100644 --- a/api/kbcloud/admin/api_ip_whitelist.go +++ b/api/kbcloud/admin/api_ip_whitelist.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type IpWhitelistApi common.Service // CreateIPWhitelist Create IP whitelist. func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, clusterName string, body interface{}) (IpWhitelist, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue IpWhitelist + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue IpWhitelist ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".IpWhitelistApi.CreateIPWhitelist") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,11 +101,13 @@ func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, // ListIPWhitelist List IP whitelists. func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, clusterName string) (IpWhitelistList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue IpWhitelistList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue IpWhitelistList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".IpWhitelistApi.ListIPWhitelist") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +122,8 @@ func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, c localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -150,7 +163,7 @@ func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -162,11 +175,13 @@ func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, c // UpdateIPWhitelist Update IP whitelist. func (a *IpWhitelistApi) UpdateIPWhitelist(ctx _context.Context, orgName string, clusterName string, ipWhitelistId string, body interface{}) (IpWhitelist, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue IpWhitelist + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue IpWhitelist ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".IpWhitelistApi.UpdateIPWhitelist") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -183,9 +198,11 @@ func (a *IpWhitelistApi) UpdateIPWhitelist(ctx _context.Context, orgName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -207,10 +224,11 @@ func (a *IpWhitelistApi) UpdateIPWhitelist(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -224,7 +242,7 @@ func (a *IpWhitelistApi) UpdateIPWhitelist(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_license.go b/api/kbcloud/admin/api_license.go index 06cd881d..7b111720 100644 --- a/api/kbcloud/admin/api_license.go +++ b/api/kbcloud/admin/api_license.go @@ -2,10 +2,15 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -19,11 +24,13 @@ type LicenseApi common.Service // Get license func (a *LicenseApi) GetLicense(ctx _context.Context) (License, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue License + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue License ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LicenseApi.GetLicense") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -36,7 +43,8 @@ func (a *LicenseApi) GetLicense(ctx _context.Context) (License, *_nethttp.Respon localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -58,10 +66,11 @@ func (a *LicenseApi) GetLicense(ctx _context.Context) (License, *_nethttp.Respon if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -75,7 +84,7 @@ func (a *LicenseApi) GetLicense(ctx _context.Context) (License, *_nethttp.Respon err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -88,11 +97,13 @@ func (a *LicenseApi) GetLicense(ctx _context.Context) (License, *_nethttp.Respon // Update license func (a *LicenseApi) UpdateLicense(ctx _context.Context, body LicenseRequest) (License, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue License + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue License ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LicenseApi.UpdateLicense") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -106,9 +117,11 @@ func (a *LicenseApi) UpdateLicense(ctx _context.Context, body LicenseRequest) (L localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -130,10 +143,11 @@ func (a *LicenseApi) UpdateLicense(ctx _context.Context, body LicenseRequest) (L if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -147,7 +161,7 @@ func (a *LicenseApi) UpdateLicense(ctx _context.Context, body LicenseRequest) (L err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_llm.go b/api/kbcloud/admin/api_llm.go index c79c5b1d..c9599ef1 100644 --- a/api/kbcloud/admin/api_llm.go +++ b/api/kbcloud/admin/api_llm.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type LlmApi common.Service // CreateLLM Create LLM. func (a *LlmApi) CreateLLM(ctx _context.Context, body interface{}) (Llm, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Llm + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Llm ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LlmApi.CreateLLM") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,9 +43,11 @@ func (a *LlmApi) CreateLLM(ctx _context.Context, body interface{}) (Llm, *_netht localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +69,11 @@ func (a *LlmApi) CreateLLM(ctx _context.Context, body interface{}) (Llm, *_netht if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +87,7 @@ func (a *LlmApi) CreateLLM(ctx _context.Context, body interface{}) (Llm, *_netht err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,10 +99,12 @@ func (a *LlmApi) CreateLLM(ctx _context.Context, body interface{}) (Llm, *_netht // DeleteLLM Delete LLM. func (a *LlmApi) DeleteLLM(ctx _context.Context, id string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LlmApi.DeleteLLM") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -107,7 +118,8 @@ func (a *LlmApi) DeleteLLM(ctx _context.Context, id string) (*_nethttp.Response, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -129,10 +141,11 @@ func (a *LlmApi) DeleteLLM(ctx _context.Context, id string) (*_nethttp.Response, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -149,11 +162,13 @@ func (a *LlmApi) DeleteLLM(ctx _context.Context, id string) (*_nethttp.Response, // ListLLM List LLM. func (a *LlmApi) ListLLM(ctx _context.Context) (LlmList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue LlmList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue LlmList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LlmApi.ListLLM") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -166,7 +181,8 @@ func (a *LlmApi) ListLLM(ctx _context.Context) (LlmList, *_nethttp.Response, err localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -188,10 +204,11 @@ func (a *LlmApi) ListLLM(ctx _context.Context) (LlmList, *_nethttp.Response, err if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -205,7 +222,7 @@ func (a *LlmApi) ListLLM(ctx _context.Context) (LlmList, *_nethttp.Response, err err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -217,11 +234,13 @@ func (a *LlmApi) ListLLM(ctx _context.Context) (LlmList, *_nethttp.Response, err // UpdateLLM Update LLM. func (a *LlmApi) UpdateLLM(ctx _context.Context, id string, body interface{}) (Llm, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Llm + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Llm ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LlmApi.UpdateLLM") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -236,9 +255,11 @@ func (a *LlmApi) UpdateLLM(ctx _context.Context, id string, body interface{}) (L localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -260,10 +281,11 @@ func (a *LlmApi) UpdateLLM(ctx _context.Context, id string, body interface{}) (L if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -277,7 +299,7 @@ func (a *LlmApi) UpdateLLM(ctx _context.Context, id string, body interface{}) (L err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_load_balancer.go b/api/kbcloud/admin/api_load_balancer.go index 1650fc98..ca3c750f 100644 --- a/api/kbcloud/admin/api_load_balancer.go +++ b/api/kbcloud/admin/api_load_balancer.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,10 +23,12 @@ type LoadBalancerApi common.Service // CheckLoadBalancer Check if the load balancer is available. func (a *LoadBalancerApi) CheckLoadBalancer(ctx _context.Context, environmentName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LoadBalancerApi.CheckLoadBalancer") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -36,7 +42,8 @@ func (a *LoadBalancerApi) CheckLoadBalancer(ctx _context.Context, environmentNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -58,10 +65,11 @@ func (a *LoadBalancerApi) CheckLoadBalancer(ctx _context.Context, environmentNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,11 +86,13 @@ func (a *LoadBalancerApi) CheckLoadBalancer(ctx _context.Context, environmentNam // GetLoadBalancer Get the load balancer info in the environment. func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, environmentName string) (LoadBalancer, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue LoadBalancer + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue LoadBalancer ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LoadBalancerApi.GetLoadBalancer") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -96,7 +106,8 @@ func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, environmentName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -118,10 +129,11 @@ func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, environmentName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -135,7 +147,7 @@ func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, environmentName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -147,10 +159,12 @@ func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, environmentName // InstallLoadBalancer Install load balancer in the environment. func (a *LoadBalancerApi) InstallLoadBalancer(ctx _context.Context, environmentName string, body LoadBalancerInstall) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LoadBalancerApi.InstallLoadBalancer") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -165,9 +179,11 @@ func (a *LoadBalancerApi) InstallLoadBalancer(ctx _context.Context, environmentN localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -189,10 +205,11 @@ func (a *LoadBalancerApi) InstallLoadBalancer(ctx _context.Context, environmentN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -209,10 +226,12 @@ func (a *LoadBalancerApi) InstallLoadBalancer(ctx _context.Context, environmentN // UninstallLoadBalancer Uninstall load balancer in the environment. func (a *LoadBalancerApi) UninstallLoadBalancer(ctx _context.Context, environmentName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LoadBalancerApi.UninstallLoadBalancer") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -226,7 +245,8 @@ func (a *LoadBalancerApi) UninstallLoadBalancer(ctx _context.Context, environmen localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -248,10 +268,11 @@ func (a *LoadBalancerApi) UninstallLoadBalancer(ctx _context.Context, environmen if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/admin/api_mark_cluster.go b/api/kbcloud/admin/api_mark_cluster.go index 9d796710..e5496906 100644 --- a/api/kbcloud/admin/api_mark_cluster.go +++ b/api/kbcloud/admin/api_mark_cluster.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,10 +23,12 @@ type MarkClusterApi common.Service // MarkClusterRestoreCompleted mark cluster to restore completed, usually used when manually repairing or recovering issues. func (a *MarkClusterApi) MarkClusterRestoreCompleted(ctx _context.Context, orgName string, clusterName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MarkClusterApi.MarkClusterRestoreCompleted") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *MarkClusterApi) MarkClusterRestoreCompleted(ctx _context.Context, orgNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *MarkClusterApi) MarkClusterRestoreCompleted(ctx _context.Context, orgNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/admin/api_member.go b/api/kbcloud/admin/api_member.go index cef2f400..ab8eeb5a 100644 --- a/api/kbcloud/admin/api_member.go +++ b/api/kbcloud/admin/api_member.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type MemberApi common.Service // Add organization with specific role func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgMemberAdd) (OrgMember, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OrgMember + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OrgMember ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.AddOrgMember") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgM localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgM if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgM err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +102,12 @@ func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgM // delete a Org Member func (a *MemberApi) DeleteOrgMember(ctx _context.Context, orgName string, memberId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.DeleteOrgMember") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +122,8 @@ func (a *MemberApi) DeleteOrgMember(ctx _context.Context, orgName string, member localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *MemberApi) DeleteOrgMember(ctx _context.Context, orgName string, member if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -153,7 +166,7 @@ func (a *MemberApi) DeleteOrgMember(ctx _context.Context, orgName string, member // ListOrgMemberOptionalParameters holds optional parameters for ListOrgMember. type ListOrgMemberOptionalParameters struct { PageToken *string - PageSize *string + PageSize *string } // NewListOrgMemberOptionalParameters creates an empty struct for parameters. @@ -161,13 +174,11 @@ func NewListOrgMemberOptionalParameters() *ListOrgMemberOptionalParameters { this := ListOrgMemberOptionalParameters{} return &this } - // WithPageToken sets the corresponding parameter name and returns the struct. func (r *ListOrgMemberOptionalParameters) WithPageToken(pageToken string) *ListOrgMemberOptionalParameters { r.PageToken = &pageToken return r } - // WithPageSize sets the corresponding parameter name and returns the struct. func (r *ListOrgMemberOptionalParameters) WithPageSize(pageSize string) *ListOrgMemberOptionalParameters { r.PageSize = &pageSize @@ -178,18 +189,20 @@ func (r *ListOrgMemberOptionalParameters) WithPageSize(pageSize string) *ListOrg // list members of the specified Org func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...ListOrgMemberOptionalParameters) (OrgMemberList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue OrgMemberList - optionalParams ListOrgMemberOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgMemberList + optionalParams ListOrgMemberOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListOrgMemberOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListOrgMemberOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.ListOrgMember") if err != nil { @@ -210,7 +223,8 @@ func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...Lis } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -232,10 +246,11 @@ func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...Lis if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -249,7 +264,7 @@ func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...Lis err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -262,11 +277,13 @@ func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...Lis // Only authenticated organization admins can update the member's role func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberId string, body OrgMemberUpdate) (OrgMember, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue OrgMember + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue OrgMember ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.PatchOrgMember") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -279,12 +296,14 @@ func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberI localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -306,10 +325,11 @@ func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberI if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -323,7 +343,7 @@ func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberI err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -336,11 +356,13 @@ func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberI // read the specified OrgMember func (a *MemberApi) ReadOrgMember(ctx _context.Context, orgName string, memberId string) (OrgMember, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue OrgMember + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgMember ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.ReadOrgMember") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -355,7 +377,8 @@ func (a *MemberApi) ReadOrgMember(ctx _context.Context, orgName string, memberId localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -377,10 +400,11 @@ func (a *MemberApi) ReadOrgMember(ctx _context.Context, orgName string, memberId if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -394,7 +418,7 @@ func (a *MemberApi) ReadOrgMember(ctx _context.Context, orgName string, memberId err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_metadb.go b/api/kbcloud/admin/api_metadb.go index 4cbd5a85..e4ad605f 100644 --- a/api/kbcloud/admin/api_metadb.go +++ b/api/kbcloud/admin/api_metadb.go @@ -2,10 +2,15 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -18,11 +23,13 @@ type MetadbApi common.Service // GetMetadbInstancesMetrics Get instances metrics in metadb. func (a *MetadbApi) GetMetadbInstancesMetrics(ctx _context.Context) (Metadb_instanceMetricsList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Metadb_instanceMetricsList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Metadb_instanceMetricsList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.GetMetadbInstancesMetrics") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -35,7 +42,8 @@ func (a *MetadbApi) GetMetadbInstancesMetrics(ctx _context.Context) (Metadb_inst localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -57,10 +65,11 @@ func (a *MetadbApi) GetMetadbInstancesMetrics(ctx _context.Context) (Metadb_inst if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -74,7 +83,7 @@ func (a *MetadbApi) GetMetadbInstancesMetrics(ctx _context.Context) (Metadb_inst err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -86,7 +95,7 @@ func (a *MetadbApi) GetMetadbInstancesMetrics(ctx _context.Context) (Metadb_inst // GetPostgresClusterInfoOptionalParameters holds optional parameters for GetPostgresClusterInfo. type GetPostgresClusterInfoOptionalParameters struct { ClusterName *string - Namespace *string + Namespace *string } // NewGetPostgresClusterInfoOptionalParameters creates an empty struct for parameters. @@ -94,13 +103,11 @@ func NewGetPostgresClusterInfoOptionalParameters() *GetPostgresClusterInfoOption this := GetPostgresClusterInfoOptionalParameters{} return &this } - // WithClusterName sets the corresponding parameter name and returns the struct. func (r *GetPostgresClusterInfoOptionalParameters) WithClusterName(clusterName string) *GetPostgresClusterInfoOptionalParameters { r.ClusterName = &clusterName return r } - // WithNamespace sets the corresponding parameter name and returns the struct. func (r *GetPostgresClusterInfoOptionalParameters) WithNamespace(namespace string) *GetPostgresClusterInfoOptionalParameters { r.Namespace = &namespace @@ -110,18 +117,20 @@ func (r *GetPostgresClusterInfoOptionalParameters) WithNamespace(namespace strin // GetPostgresClusterInfo Get summary of postgresql cluster.. func (a *MetadbApi) GetPostgresClusterInfo(ctx _context.Context, o ...GetPostgresClusterInfoOptionalParameters) (Summary, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Summary - optionalParams GetPostgresClusterInfoOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Summary + optionalParams GetPostgresClusterInfoOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetPostgresClusterInfoOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetPostgresClusterInfoOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.GetPostgresClusterInfo") if err != nil { @@ -141,7 +150,8 @@ func (a *MetadbApi) GetPostgresClusterInfo(ctx _context.Context, o ...GetPostgre } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -163,10 +173,11 @@ func (a *MetadbApi) GetPostgresClusterInfo(ctx _context.Context, o ...GetPostgre if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -180,7 +191,7 @@ func (a *MetadbApi) GetPostgresClusterInfo(ctx _context.Context, o ...GetPostgre err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -192,11 +203,13 @@ func (a *MetadbApi) GetPostgresClusterInfo(ctx _context.Context, o ...GetPostgre // ListMetadbBackups List all names of backups in S3.. func (a *MetadbApi) ListMetadbBackups(ctx _context.Context) (Metadb_backupList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Metadb_backupList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Metadb_backupList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.ListMetadbBackups") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -209,7 +222,8 @@ func (a *MetadbApi) ListMetadbBackups(ctx _context.Context) (Metadb_backupList, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -231,10 +245,11 @@ func (a *MetadbApi) ListMetadbBackups(ctx _context.Context) (Metadb_backupList, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -248,7 +263,7 @@ func (a *MetadbApi) ListMetadbBackups(ctx _context.Context) (Metadb_backupList, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -260,11 +275,13 @@ func (a *MetadbApi) ListMetadbBackups(ctx _context.Context) (Metadb_backupList, // MetadbBackup Backup metadb to S3(AWS S3 or minio). func (a *MetadbApi) MetadbBackup(ctx _context.Context) (Metadb_backup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Metadb_backup + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Metadb_backup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.MetadbBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -277,7 +294,8 @@ func (a *MetadbApi) MetadbBackup(ctx _context.Context) (Metadb_backup, *_nethttp localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -299,10 +317,11 @@ func (a *MetadbApi) MetadbBackup(ctx _context.Context) (Metadb_backup, *_nethttp if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -316,7 +335,7 @@ func (a *MetadbApi) MetadbBackup(ctx _context.Context) (Metadb_backup, *_nethttp err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -328,11 +347,13 @@ func (a *MetadbApi) MetadbBackup(ctx _context.Context) (Metadb_backup, *_nethttp // MetadbBackupConfig set backup config. func (a *MetadbApi) MetadbBackupConfig(ctx _context.Context, body BackupConfig) (BackupConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue BackupConfig + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue BackupConfig ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.MetadbBackupConfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -346,9 +367,11 @@ func (a *MetadbApi) MetadbBackupConfig(ctx _context.Context, body BackupConfig) localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -370,10 +393,11 @@ func (a *MetadbApi) MetadbBackupConfig(ctx _context.Context, body BackupConfig) if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -387,7 +411,7 @@ func (a *MetadbApi) MetadbBackupConfig(ctx _context.Context, body BackupConfig) err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -399,11 +423,13 @@ func (a *MetadbApi) MetadbBackupConfig(ctx _context.Context, body BackupConfig) // MetadbBackupGetConfig get backup config. func (a *MetadbApi) MetadbBackupGetConfig(ctx _context.Context) (BackupConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupConfig + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupConfig ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.MetadbBackupGetConfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -416,7 +442,8 @@ func (a *MetadbApi) MetadbBackupGetConfig(ctx _context.Context) (BackupConfig, * localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -438,10 +465,11 @@ func (a *MetadbApi) MetadbBackupGetConfig(ctx _context.Context) (BackupConfig, * if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -455,7 +483,83 @@ func (a *MetadbApi) MetadbBackupGetConfig(ctx _context.Context) (BackupConfig, * err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// MetadbCheckRestore Check pods ready after restore. +func (a *MetadbApi) MetadbCheckRestore(ctx _context.Context, body Metadb_restore) (Metadb_restore, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Metadb_restore + ) + + + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.MetadbCheckRestore") + if err != nil { + return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/admin/v1/metadb/restore" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + + + // body params + localVarPostBody = &body + common.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"BearerToken", "authorization"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := common.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := common.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ + var v None + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := common.GenericOpenAPIError{ + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -467,11 +571,13 @@ func (a *MetadbApi) MetadbBackupGetConfig(ctx _context.Context) (BackupConfig, * // MetadbListInstances List metadb cluster instances. func (a *MetadbApi) MetadbListInstances(ctx _context.Context) (Metadb_instanceList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Metadb_instanceList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Metadb_instanceList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.MetadbListInstances") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -484,7 +590,8 @@ func (a *MetadbApi) MetadbListInstances(ctx _context.Context) (Metadb_instanceLi localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -506,10 +613,11 @@ func (a *MetadbApi) MetadbListInstances(ctx _context.Context) (Metadb_instanceLi if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -523,7 +631,7 @@ func (a *MetadbApi) MetadbListInstances(ctx _context.Context) (Metadb_instanceLi err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -535,11 +643,13 @@ func (a *MetadbApi) MetadbListInstances(ctx _context.Context) (Metadb_instanceLi // MetadbRestore Restore metadb. func (a *MetadbApi) MetadbRestore(ctx _context.Context, body Metadb_restore) (Metadb_restore, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Metadb_restore + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Metadb_restore ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.MetadbRestore") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -553,9 +663,11 @@ func (a *MetadbApi) MetadbRestore(ctx _context.Context, body Metadb_restore) (Me localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -577,10 +689,11 @@ func (a *MetadbApi) MetadbRestore(ctx _context.Context, body Metadb_restore) (Me if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -594,7 +707,7 @@ func (a *MetadbApi) MetadbRestore(ctx _context.Context, body Metadb_restore) (Me err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -606,11 +719,13 @@ func (a *MetadbApi) MetadbRestore(ctx _context.Context, body Metadb_restore) (Me // MetadbVerticalScale vertical scale. func (a *MetadbApi) MetadbVerticalScale(ctx _context.Context, body Vscale) (Vscale, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Vscale + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Vscale ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.MetadbVerticalScale") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -624,9 +739,11 @@ func (a *MetadbApi) MetadbVerticalScale(ctx _context.Context, body Vscale) (Vsca localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -648,10 +765,11 @@ func (a *MetadbApi) MetadbVerticalScale(ctx _context.Context, body Vscale) (Vsca if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -665,7 +783,7 @@ func (a *MetadbApi) MetadbVerticalScale(ctx _context.Context, body Vscale) (Vsca err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -677,11 +795,13 @@ func (a *MetadbApi) MetadbVerticalScale(ctx _context.Context, body Vscale) (Vsca // MetadbVolumeExpand Expand cluster volume size. func (a *MetadbApi) MetadbVolumeExpand(ctx _context.Context, body VolumeExpand) (VolumeExpand, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue VolumeExpand + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue VolumeExpand ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetadbApi.MetadbVolumeExpand") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -695,9 +815,11 @@ func (a *MetadbApi) MetadbVolumeExpand(ctx _context.Context, body VolumeExpand) localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -719,10 +841,11 @@ func (a *MetadbApi) MetadbVolumeExpand(ctx _context.Context, body VolumeExpand) if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -736,7 +859,7 @@ func (a *MetadbApi) MetadbVolumeExpand(ctx _context.Context, body VolumeExpand) err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_metrics.go b/api/kbcloud/admin/api_metrics.go index d1687c8d..a75af517 100644 --- a/api/kbcloud/admin/api_metrics.go +++ b/api/kbcloud/admin/api_metrics.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,7 +23,7 @@ type MetricsApi common.Service // GetAggregateMetaDataOptionalParameters holds optional parameters for GetAggregateMetaData. type GetAggregateMetaDataOptionalParameters struct { Start *int64 - End *int64 + End *int64 } // NewGetAggregateMetaDataOptionalParameters creates an empty struct for parameters. @@ -27,13 +31,11 @@ func NewGetAggregateMetaDataOptionalParameters() *GetAggregateMetaDataOptionalPa this := GetAggregateMetaDataOptionalParameters{} return &this } - // WithStart sets the corresponding parameter name and returns the struct. func (r *GetAggregateMetaDataOptionalParameters) WithStart(start int64) *GetAggregateMetaDataOptionalParameters { r.Start = &start return r } - // WithEnd sets the corresponding parameter name and returns the struct. func (r *GetAggregateMetaDataOptionalParameters) WithEnd(end int64) *GetAggregateMetaDataOptionalParameters { r.End = &end @@ -44,18 +46,20 @@ func (r *GetAggregateMetaDataOptionalParameters) WithEnd(end int64) *GetAggregat // Get aggregate meta data including total count and time series func (a *MetricsApi) GetAggregateMetaData(ctx _context.Context, metaData AggregateMetaDataType, o ...GetAggregateMetaDataOptionalParameters) (AggregateMetaData, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AggregateMetaData - optionalParams GetAggregateMetaDataOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AggregateMetaData + optionalParams GetAggregateMetaDataOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetAggregateMetaDataOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetAggregateMetaDataOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetricsApi.GetAggregateMetaData") if err != nil { @@ -76,7 +80,8 @@ func (a *MetricsApi) GetAggregateMetaData(ctx _context.Context, metaData Aggrega } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -98,10 +103,11 @@ func (a *MetricsApi) GetAggregateMetaData(ctx _context.Context, metaData Aggrega if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -115,7 +121,7 @@ func (a *MetricsApi) GetAggregateMetaData(ctx _context.Context, metaData Aggrega err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -128,11 +134,13 @@ func (a *MetricsApi) GetAggregateMetaData(ctx _context.Context, metaData Aggrega // Get environment current stats func (a *MetricsApi) GetEnvironmentStats(ctx _context.Context) (EnvironmentStats, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EnvironmentStats + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EnvironmentStats ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetricsApi.GetEnvironmentStats") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -145,7 +153,8 @@ func (a *MetricsApi) GetEnvironmentStats(ctx _context.Context) (EnvironmentStats localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -167,10 +176,11 @@ func (a *MetricsApi) GetEnvironmentStats(ctx _context.Context) (EnvironmentStats if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -184,7 +194,7 @@ func (a *MetricsApi) GetEnvironmentStats(ctx _context.Context) (EnvironmentStats err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -196,7 +206,7 @@ func (a *MetricsApi) GetEnvironmentStats(ctx _context.Context) (EnvironmentStats // QueryClusterMetricsOptionalParameters holds optional parameters for QueryClusterMetrics. type QueryClusterMetricsOptionalParameters struct { Start *int64 - End *int64 + End *int64 } // NewQueryClusterMetricsOptionalParameters creates an empty struct for parameters. @@ -204,13 +214,11 @@ func NewQueryClusterMetricsOptionalParameters() *QueryClusterMetricsOptionalPara this := QueryClusterMetricsOptionalParameters{} return &this } - // WithStart sets the corresponding parameter name and returns the struct. func (r *QueryClusterMetricsOptionalParameters) WithStart(start int64) *QueryClusterMetricsOptionalParameters { r.Start = &start return r } - // WithEnd sets the corresponding parameter name and returns the struct. func (r *QueryClusterMetricsOptionalParameters) WithEnd(end int64) *QueryClusterMetricsOptionalParameters { r.End = &end @@ -221,18 +229,20 @@ func (r *QueryClusterMetricsOptionalParameters) WithEnd(end int64) *QueryCluster // Query cluster metrics by specified metric name and instance name, support instant and range query func (a *MetricsApi) QueryClusterMetrics(ctx _context.Context, orgName string, clusterName string, query string, queryType MetricsQueryType, o ...QueryClusterMetricsOptionalParameters) (ClusterMetrics, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ClusterMetrics - optionalParams QueryClusterMetricsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ClusterMetrics + optionalParams QueryClusterMetricsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryClusterMetricsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryClusterMetricsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetricsApi.QueryClusterMetrics") if err != nil { @@ -256,7 +266,8 @@ func (a *MetricsApi) QueryClusterMetrics(ctx _context.Context, orgName string, c } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -278,10 +289,11 @@ func (a *MetricsApi) QueryClusterMetrics(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -295,7 +307,7 @@ func (a *MetricsApi) QueryClusterMetrics(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_monitor_data_sink.go b/api/kbcloud/admin/api_monitor_data_sink.go index 50c7ae1d..9456622b 100644 --- a/api/kbcloud/admin/api_monitor_data_sink.go +++ b/api/kbcloud/admin/api_monitor_data_sink.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type MonitorDataSinkApi common.Service // Create monitor data sink func (a *MonitorDataSinkApi) CreateMonitorDataSink(ctx _context.Context, body MonitorDataSinkCreate) (MonitorDataSink, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue MonitorDataSink + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue MonitorDataSink ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MonitorDataSinkApi.CreateMonitorDataSink") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *MonitorDataSinkApi) CreateMonitorDataSink(ctx _context.Context, body Mo localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *MonitorDataSinkApi) CreateMonitorDataSink(ctx _context.Context, body Mo if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *MonitorDataSinkApi) CreateMonitorDataSink(ctx _context.Context, body Mo err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,10 +100,12 @@ func (a *MonitorDataSinkApi) CreateMonitorDataSink(ctx _context.Context, body Mo // DeleteMonitorDataSink Delete monitor data sink. func (a *MonitorDataSinkApi) DeleteMonitorDataSink(ctx _context.Context, monitorDataSinkId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MonitorDataSinkApi.DeleteMonitorDataSink") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -106,9 +117,10 @@ func (a *MonitorDataSinkApi) DeleteMonitorDataSink(ctx _context.Context, monitor localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -130,10 +142,11 @@ func (a *MonitorDataSinkApi) DeleteMonitorDataSink(ctx _context.Context, monitor if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -151,11 +164,13 @@ func (a *MonitorDataSinkApi) DeleteMonitorDataSink(ctx _context.Context, monitor // Get monitor data sink list func (a *MonitorDataSinkApi) ListMonitorDataSinks(ctx _context.Context, environmentName string) (MonitorDataSinkList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue MonitorDataSinkList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue MonitorDataSinkList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MonitorDataSinkApi.ListMonitorDataSinks") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -169,7 +184,8 @@ func (a *MonitorDataSinkApi) ListMonitorDataSinks(ctx _context.Context, environm localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -191,10 +207,11 @@ func (a *MonitorDataSinkApi) ListMonitorDataSinks(ctx _context.Context, environm if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -208,7 +225,7 @@ func (a *MonitorDataSinkApi) ListMonitorDataSinks(ctx _context.Context, environm err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -221,11 +238,13 @@ func (a *MonitorDataSinkApi) ListMonitorDataSinks(ctx _context.Context, environm // Update the specified monitor data sink func (a *MonitorDataSinkApi) PatchMonitorDataSink(ctx _context.Context, monitorDataSinkId string, body MonitorDataSinkUpdate) (MonitorDataSink, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue MonitorDataSink + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue MonitorDataSink ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MonitorDataSinkApi.PatchMonitorDataSink") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -240,9 +259,11 @@ func (a *MonitorDataSinkApi) PatchMonitorDataSink(ctx _context.Context, monitorD localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -264,10 +285,11 @@ func (a *MonitorDataSinkApi) PatchMonitorDataSink(ctx _context.Context, monitorD if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -281,7 +303,7 @@ func (a *MonitorDataSinkApi) PatchMonitorDataSink(ctx _context.Context, monitorD err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_oceanbase.go b/api/kbcloud/admin/api_oceanbase.go index 01ff3bf3..b045e673 100644 --- a/api/kbcloud/admin/api_oceanbase.go +++ b/api/kbcloud/admin/api_oceanbase.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type OceanbaseApi common.Service // GetTenant get tenants detail information of the oceanbase cluster. func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterName string, tenantId string) (Tenant, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Tenant + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Tenant ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OceanbaseApi.GetTenant") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,7 +45,8 @@ func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +68,11 @@ func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +86,7 @@ func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +98,13 @@ func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterNa // ListTenants list all tenants for the oceanbase cluster. func (a *OceanbaseApi) ListTenants(ctx _context.Context, orgName string, clusterName string) ([]Tenant, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Tenant + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Tenant ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OceanbaseApi.ListTenants") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +119,8 @@ func (a *OceanbaseApi) ListTenants(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +142,11 @@ func (a *OceanbaseApi) ListTenants(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -148,7 +160,7 @@ func (a *OceanbaseApi) ListTenants(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_opsrequest.go b/api/kbcloud/admin/api_opsrequest.go index f942f895..e78081d5 100644 --- a/api/kbcloud/admin/api_opsrequest.go +++ b/api/kbcloud/admin/api_opsrequest.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type OpsrequestApi common.Service // cancel a OpsRequest func (a *OpsrequestApi) CancelOps(ctx _context.Context, orgName string, opsName string, clusterName string, opsType string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.CancelOps") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,7 +46,8 @@ func (a *OpsrequestApi) CancelOps(ctx _context.Context, orgName string, opsName localVarQueryParams.Add("opsType", common.ParameterToString(opsType, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +69,11 @@ func (a *OpsrequestApi) CancelOps(ctx _context.Context, orgName string, opsName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -82,11 +90,13 @@ func (a *OpsrequestApi) CancelOps(ctx _context.Context, orgName string, opsName // ClusterVolumeExpand Expand cluster volume size. func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string, clusterName string, body OpsVolumeExpand) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.ClusterVolumeExpand") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -102,9 +112,11 @@ func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -126,10 +138,11 @@ func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -143,7 +156,7 @@ func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -155,11 +168,13 @@ func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string // CustomOps Create custom OpsRequest. func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterName string, body interface{}) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.CustomOps") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -175,9 +190,11 @@ func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterN localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -199,10 +216,11 @@ func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -216,7 +234,7 @@ func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -229,10 +247,12 @@ func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterN // delete a OpsRequest func (a *OpsrequestApi) DeleteOps(ctx _context.Context, orgName string, opsName string, clusterName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.DeleteOps") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -248,7 +268,8 @@ func (a *OpsrequestApi) DeleteOps(ctx _context.Context, orgName string, opsName localVarQueryParams.Add("clusterName", common.ParameterToString(clusterName, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -270,10 +291,11 @@ func (a *OpsrequestApi) DeleteOps(ctx _context.Context, orgName string, opsName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -290,11 +312,13 @@ func (a *OpsrequestApi) DeleteOps(ctx _context.Context, orgName string, opsName // ExposeCluster Expose cluster loadbalancer endpoint. func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clusterName string, body OpsExpose) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.ExposeCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -310,9 +334,11 @@ func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clus localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -334,10 +360,11 @@ func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clus if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -351,7 +378,7 @@ func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clus err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -363,11 +390,13 @@ func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clus // HorizontalScaleCluster Horizontal scale cluster. func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName string, clusterName string, body OpsHScale) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.HorizontalScaleCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -383,9 +412,11 @@ func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -407,10 +438,11 @@ func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -424,7 +456,7 @@ func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -436,11 +468,13 @@ func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName str // PromoteCluster Promote cluster intance to primary. func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clusterName string, body OpsPromote) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.PromoteCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -456,9 +490,11 @@ func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clu localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -480,10 +516,11 @@ func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -497,7 +534,7 @@ func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -509,11 +546,13 @@ func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clu // RebuildInstance rebuild the instance. func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, clusterName string, body OpsRebuildInstance) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.RebuildInstance") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -529,9 +568,11 @@ func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, cl localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -553,10 +594,11 @@ func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -570,7 +612,7 @@ func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -582,11 +624,13 @@ func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, cl // ReconfigureCluster Update cluster configuration. func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, clusterName string, body ReconfigureCreate) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.ReconfigureCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -602,9 +646,11 @@ func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -626,10 +672,11 @@ func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -643,7 +690,7 @@ func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -655,11 +702,13 @@ func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, // RestartCluster Restart cluster. func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clusterName string, body OpsRestart) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.RestartCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -675,9 +724,11 @@ func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clu localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -699,10 +750,11 @@ func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -716,7 +768,7 @@ func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -728,11 +780,13 @@ func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clu // StartCluster Start cluster. func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clusterName string) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.StartCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -747,7 +801,8 @@ func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clust localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -769,10 +824,11 @@ func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -786,7 +842,7 @@ func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clust err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -798,11 +854,13 @@ func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clust // StopCluster Stop cluster. func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, clusterName string) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.StopCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -817,7 +875,8 @@ func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, cluste localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -839,10 +898,11 @@ func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -856,7 +916,7 @@ func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -868,11 +928,13 @@ func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, cluste // UpdateClusterLicense Update the cluster license. func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName string, clusterName string, body OpsLicense) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.UpdateClusterLicense") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -888,9 +950,11 @@ func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -912,10 +976,11 @@ func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -929,7 +994,7 @@ func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -941,11 +1006,13 @@ func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName strin // UpgradeCluster Upgrade cluster version. func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clusterName string, body OpsUpgrade) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.UpgradeCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -961,9 +1028,11 @@ func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clu localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -985,10 +1054,11 @@ func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1002,7 +1072,7 @@ func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1014,11 +1084,13 @@ func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clu // VerticalScaleCluster Vertical scale cluster. func (a *OpsrequestApi) VerticalScaleCluster(ctx _context.Context, orgName string, clusterName string, body OpsVScale) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.VerticalScaleCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1034,9 +1106,11 @@ func (a *OpsrequestApi) VerticalScaleCluster(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1058,10 +1132,11 @@ func (a *OpsrequestApi) VerticalScaleCluster(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1075,7 +1150,7 @@ func (a *OpsrequestApi) VerticalScaleCluster(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_organization.go b/api/kbcloud/admin/api_organization.go index 3bea9a4f..7bb5a386 100644 --- a/api/kbcloud/admin/api_organization.go +++ b/api/kbcloud/admin/api_organization.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type OrganizationApi common.Service // disable the organization func (a *OrganizationApi) DisableOrg(ctx _context.Context, orgName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.DisableOrg") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *OrganizationApi) DisableOrg(ctx _context.Context, orgName string) (*_ne localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *OrganizationApi) DisableOrg(ctx _context.Context, orgName string) (*_ne if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,10 +88,12 @@ func (a *OrganizationApi) DisableOrg(ctx _context.Context, orgName string) (*_ne // enable the organization func (a *OrganizationApi) EnableOrg(ctx _context.Context, orgName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.EnableOrg") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -97,7 +107,8 @@ func (a *OrganizationApi) EnableOrg(ctx _context.Context, orgName string) (*_net localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -119,10 +130,11 @@ func (a *OrganizationApi) EnableOrg(ctx _context.Context, orgName string) (*_net if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -140,11 +152,13 @@ func (a *OrganizationApi) EnableOrg(ctx _context.Context, orgName string) (*_net // Get organization list func (a *OrganizationApi) ListOrganizations(ctx _context.Context) (OrganizationList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue OrganizationList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrganizationList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.ListOrganizations") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -157,7 +171,8 @@ func (a *OrganizationApi) ListOrganizations(ctx _context.Context) (OrganizationL localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -179,10 +194,11 @@ func (a *OrganizationApi) ListOrganizations(ctx _context.Context) (OrganizationL if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -196,7 +212,7 @@ func (a *OrganizationApi) ListOrganizations(ctx _context.Context) (OrganizationL err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -209,11 +225,13 @@ func (a *OrganizationApi) ListOrganizations(ctx _context.Context) (OrganizationL // partially update the specified Org func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body OrgUpdate) (Org, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Org + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Org ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.PatchOrg") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -225,12 +243,14 @@ func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body Or localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -252,10 +272,11 @@ func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body Or if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -269,7 +290,7 @@ func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body Or err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -282,11 +303,13 @@ func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body Or // read the specified Org func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Org + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Org ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.ReadOrg") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -300,7 +323,8 @@ func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_ localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -322,10 +346,11 @@ func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_ if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -339,7 +364,7 @@ func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_ err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_param_tpl.go b/api/kbcloud/admin/api_param_tpl.go index cfcc785a..f98b49fe 100644 --- a/api/kbcloud/admin/api_param_tpl.go +++ b/api/kbcloud/admin/api_param_tpl.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type ParamTplApi common.Service // CreateParamTpl Create parameter template. func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body ParamTplCreate) (ParamTplListItem, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue ParamTplListItem + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue ParamTplListItem ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.CreateParamTpl") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,10 +100,12 @@ func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body // CreateParamTplFromCluster Export configuration template from cluster. func (a *ParamTplApi) CreateParamTplFromCluster(ctx _context.Context, orgName string, clusterName string, body ParamTplCreateFromCluster) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.CreateParamTplFromCluster") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,9 +121,11 @@ func (a *ParamTplApi) CreateParamTplFromCluster(ctx _context.Context, orgName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -134,10 +147,11 @@ func (a *ParamTplApi) CreateParamTplFromCluster(ctx _context.Context, orgName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -154,10 +168,12 @@ func (a *ParamTplApi) CreateParamTplFromCluster(ctx _context.Context, orgName st // DeleteParamTpl Delete configuration template. func (a *ParamTplApi) DeleteParamTpl(ctx _context.Context, orgName string, paramTplName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.DeleteParamTpl") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -172,7 +188,8 @@ func (a *ParamTplApi) DeleteParamTpl(ctx _context.Context, orgName string, param localVarQueryParams.Add("orgName", common.ParameterToString(orgName, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -194,10 +211,11 @@ func (a *ParamTplApi) DeleteParamTpl(ctx _context.Context, orgName string, param if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -213,7 +231,7 @@ func (a *ParamTplApi) DeleteParamTpl(ctx _context.Context, orgName string, param // GetClusterParamTplsOptionalParameters holds optional parameters for GetClusterParamTpls. type GetClusterParamTplsOptionalParameters struct { - Component *string + Component *string EngineName *string } @@ -222,13 +240,11 @@ func NewGetClusterParamTplsOptionalParameters() *GetClusterParamTplsOptionalPara this := GetClusterParamTplsOptionalParameters{} return &this } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *GetClusterParamTplsOptionalParameters) WithComponent(component string) *GetClusterParamTplsOptionalParameters { r.Component = &component return r } - // WithEngineName sets the corresponding parameter name and returns the struct. func (r *GetClusterParamTplsOptionalParameters) WithEngineName(engineName string) *GetClusterParamTplsOptionalParameters { r.EngineName = &engineName @@ -238,18 +254,20 @@ func (r *GetClusterParamTplsOptionalParameters) WithEngineName(engineName string // GetClusterParamTpls Get cluster configuration templates. func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, clusterName string, o ...GetClusterParamTplsOptionalParameters) (ParamTplApplToClusterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParamTplApplToClusterList - optionalParams GetClusterParamTplsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParamTplApplToClusterList + optionalParams GetClusterParamTplsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterParamTplsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterParamTplsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.GetClusterParamTpls") if err != nil { @@ -271,7 +289,8 @@ func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -293,10 +312,11 @@ func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -310,7 +330,7 @@ func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -321,10 +341,10 @@ func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, // ListParamTplsOptionalParameters holds optional parameters for ListParamTpls. type ListParamTplsOptionalParameters struct { - OrgName *string - Partition *ParamTplPartition - Version *string - Component *string + OrgName *string + Partition *ParamTplPartition + Version *string + Component *string EngineName *string } @@ -333,31 +353,26 @@ func NewListParamTplsOptionalParameters() *ListParamTplsOptionalParameters { this := ListParamTplsOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListParamTplsOptionalParameters) WithOrgName(orgName string) *ListParamTplsOptionalParameters { r.OrgName = &orgName return r } - // WithPartition sets the corresponding parameter name and returns the struct. func (r *ListParamTplsOptionalParameters) WithPartition(partition ParamTplPartition) *ListParamTplsOptionalParameters { r.Partition = &partition return r } - // WithVersion sets the corresponding parameter name and returns the struct. func (r *ListParamTplsOptionalParameters) WithVersion(version string) *ListParamTplsOptionalParameters { r.Version = &version return r } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *ListParamTplsOptionalParameters) WithComponent(component string) *ListParamTplsOptionalParameters { r.Component = &component return r } - // WithEngineName sets the corresponding parameter name and returns the struct. func (r *ListParamTplsOptionalParameters) WithEngineName(engineName string) *ListParamTplsOptionalParameters { r.EngineName = &engineName @@ -367,18 +382,20 @@ func (r *ListParamTplsOptionalParameters) WithEngineName(engineName string) *Lis // ListParamTpls List parameter templates. func (a *ParamTplApi) ListParamTpls(ctx _context.Context, o ...ListParamTplsOptionalParameters) (ParamTplList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParamTplList - optionalParams ListParamTplsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParamTplList + optionalParams ListParamTplsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListParamTplsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListParamTplsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.ListParamTpls") if err != nil { @@ -407,7 +424,8 @@ func (a *ParamTplApi) ListParamTpls(ctx _context.Context, o ...ListParamTplsOpti } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -429,10 +447,11 @@ func (a *ParamTplApi) ListParamTpls(ctx _context.Context, o ...ListParamTplsOpti if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -446,7 +465,7 @@ func (a *ParamTplApi) ListParamTpls(ctx _context.Context, o ...ListParamTplsOpti err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -459,11 +478,13 @@ func (a *ParamTplApi) ListParamTpls(ctx _context.Context, o ...ListParamTplsOpti // partially update the parameter template func (a *ParamTplApi) PatchParamTpl(ctx _context.Context, orgName string, paramTplName string, body ParamTplUpdate) (ParamTplListItem, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue ParamTplListItem + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue ParamTplListItem ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.PatchParamTpl") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -476,12 +497,14 @@ func (a *ParamTplApi) PatchParamTpl(ctx _context.Context, orgName string, paramT localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarQueryParams.Add("orgName", common.ParameterToString(orgName, "")) - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -503,10 +526,11 @@ func (a *ParamTplApi) PatchParamTpl(ctx _context.Context, orgName string, paramT if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -520,7 +544,7 @@ func (a *ParamTplApi) PatchParamTpl(ctx _context.Context, orgName string, paramT err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -539,7 +563,6 @@ func NewReadParamTplOptionalParameters() *ReadParamTplOptionalParameters { this := ReadParamTplOptionalParameters{} return &this } - // WithPartition sets the corresponding parameter name and returns the struct. func (r *ReadParamTplOptionalParameters) WithPartition(partition ParamTplPartition) *ReadParamTplOptionalParameters { r.Partition = &partition @@ -549,18 +572,20 @@ func (r *ReadParamTplOptionalParameters) WithPartition(partition ParamTplPartiti // ReadParamTpl Get parameter template details. func (a *ParamTplApi) ReadParamTpl(ctx _context.Context, orgName string, paramTplName string, o ...ReadParamTplOptionalParameters) (ParamTplGet, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParamTplGet - optionalParams ReadParamTplOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParamTplGet + optionalParams ReadParamTplOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ReadParamTplOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ReadParamTplOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.ReadParamTpl") if err != nil { @@ -579,7 +604,8 @@ func (a *ParamTplApi) ReadParamTpl(ctx _context.Context, orgName string, paramTp } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -601,10 +627,11 @@ func (a *ParamTplApi) ReadParamTpl(ctx _context.Context, orgName string, paramTp if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -618,7 +645,7 @@ func (a *ParamTplApi) ReadParamTpl(ctx _context.Context, orgName string, paramTp err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_parameter.go b/api/kbcloud/admin/api_parameter.go index d6c50d9f..4861d012 100644 --- a/api/kbcloud/admin/api_parameter.go +++ b/api/kbcloud/admin/api_parameter.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListConfigurationsOptionalParameters() *ListConfigurationsOptionalParame this := ListConfigurationsOptionalParameters{} return &this } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *ListConfigurationsOptionalParameters) WithComponent(component string) *ListConfigurationsOptionalParameters { r.Component = &component @@ -36,18 +39,20 @@ func (r *ListConfigurationsOptionalParameters) WithComponent(component string) * // ListConfigurations List configurations of the cluster. func (a *ParameterApi) ListConfigurations(ctx _context.Context, orgName string, clusterName string, o ...ListConfigurationsOptionalParameters) (ConfigurationList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ConfigurationList - optionalParams ListConfigurationsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ConfigurationList + optionalParams ListConfigurationsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListConfigurationsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListConfigurationsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParameterApi.ListConfigurations") if err != nil { @@ -66,7 +71,8 @@ func (a *ParameterApi) ListConfigurations(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -88,10 +94,11 @@ func (a *ParameterApi) ListConfigurations(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -105,7 +112,7 @@ func (a *ParameterApi) ListConfigurations(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -124,7 +131,6 @@ func NewListParameterSpecsOptionalParameters() *ListParameterSpecsOptionalParame this := ListParameterSpecsOptionalParameters{} return &this } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *ListParameterSpecsOptionalParameters) WithComponent(component string) *ListParameterSpecsOptionalParameters { r.Component = &component @@ -134,18 +140,20 @@ func (r *ListParameterSpecsOptionalParameters) WithComponent(component string) * // ListParameterSpecs List parameter specs of the cluster. func (a *ParameterApi) ListParameterSpecs(ctx _context.Context, orgName string, clusterName string, o ...ListParameterSpecsOptionalParameters) (ParameterSpecList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParameterSpecList - optionalParams ListParameterSpecsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParameterSpecList + optionalParams ListParameterSpecsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListParameterSpecsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListParameterSpecsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParameterApi.ListParameterSpecs") if err != nil { @@ -164,7 +172,8 @@ func (a *ParameterApi) ListParameterSpecs(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -186,10 +195,11 @@ func (a *ParameterApi) ListParameterSpecs(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -203,7 +213,7 @@ func (a *ParameterApi) ListParameterSpecs(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -222,7 +232,6 @@ func NewListParametersHistoryOptionalParameters() *ListParametersHistoryOptional this := ListParametersHistoryOptionalParameters{} return &this } - // WithParameterName sets the corresponding parameter name and returns the struct. func (r *ListParametersHistoryOptionalParameters) WithParameterName(parameterName string) *ListParametersHistoryOptionalParameters { r.ParameterName = ¶meterName @@ -232,18 +241,20 @@ func (r *ListParametersHistoryOptionalParameters) WithParameterName(parameterNam // ListParametersHistory List parameters history of the cluster. func (a *ParameterApi) ListParametersHistory(ctx _context.Context, orgName string, clusterName string, o ...ListParametersHistoryOptionalParameters) (ParameterHistoryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParameterHistoryList - optionalParams ListParametersHistoryOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParameterHistoryList + optionalParams ListParametersHistoryOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListParametersHistoryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListParametersHistoryOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParameterApi.ListParametersHistory") if err != nil { @@ -262,7 +273,8 @@ func (a *ParameterApi) ListParametersHistory(ctx _context.Context, orgName strin } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -284,10 +296,11 @@ func (a *ParameterApi) ListParametersHistory(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -301,7 +314,7 @@ func (a *ParameterApi) ListParametersHistory(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_platform_parameter.go b/api/kbcloud/admin/api_platform_parameter.go index e28a73bf..e4b8faa2 100644 --- a/api/kbcloud/admin/api_platform_parameter.go +++ b/api/kbcloud/admin/api_platform_parameter.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type PlatformParameterApi common.Service // GetPlatformParameter get platformParameter by name. func (a *PlatformParameterApi) GetPlatformParameter(ctx _context.Context, platformParameterName string) (PlatformParameter, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue PlatformParameter + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue PlatformParameter ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".PlatformParameterApi.GetPlatformParameter") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *PlatformParameterApi) GetPlatformParameter(ctx _context.Context, platfo localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *PlatformParameterApi) GetPlatformParameter(ctx _context.Context, platfo if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -76,7 +84,7 @@ func (a *PlatformParameterApi) GetPlatformParameter(ctx _context.Context, platfo err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -88,11 +96,13 @@ func (a *PlatformParameterApi) GetPlatformParameter(ctx _context.Context, platfo // ListPlatformParameters list platformParameters. func (a *PlatformParameterApi) ListPlatformParameters(ctx _context.Context) (PlatformParameterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue PlatformParameterList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue PlatformParameterList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".PlatformParameterApi.ListPlatformParameters") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -105,7 +115,8 @@ func (a *PlatformParameterApi) ListPlatformParameters(ctx _context.Context) (Pla localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -127,10 +138,11 @@ func (a *PlatformParameterApi) ListPlatformParameters(ctx _context.Context) (Pla if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -144,7 +156,7 @@ func (a *PlatformParameterApi) ListPlatformParameters(ctx _context.Context) (Pla err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -163,7 +175,6 @@ func NewUpdatePlatformParametersOptionalParameters() *UpdatePlatformParametersOp this := UpdatePlatformParametersOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *UpdatePlatformParametersOptionalParameters) WithBody(body []PlatformParameterUpdate) *UpdatePlatformParametersOptionalParameters { r.Body = &body @@ -173,18 +184,20 @@ func (r *UpdatePlatformParametersOptionalParameters) WithBody(body []PlatformPar // UpdatePlatformParameters update platformParameters. func (a *PlatformParameterApi) UpdatePlatformParameters(ctx _context.Context, o ...UpdatePlatformParametersOptionalParameters) ([]PlatformParameter, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue []PlatformParameter - optionalParams UpdatePlatformParametersOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue []PlatformParameter + optionalParams UpdatePlatformParametersOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type UpdatePlatformParametersOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type UpdatePlatformParametersOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".PlatformParameterApi.UpdatePlatformParameters") if err != nil { @@ -199,11 +212,13 @@ func (a *PlatformParameterApi) UpdatePlatformParameters(ctx _context.Context, o localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -225,10 +240,11 @@ func (a *PlatformParameterApi) UpdatePlatformParameters(ctx _context.Context, o if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -242,7 +258,7 @@ func (a *PlatformParameterApi) UpdatePlatformParameters(ctx _context.Context, o err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_provider.go b/api/kbcloud/admin/api_provider.go index 9e890fdd..e816f227 100644 --- a/api/kbcloud/admin/api_provider.go +++ b/api/kbcloud/admin/api_provider.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type ProviderApi common.Service // Create a cloud provider func (a *ProviderApi) CreateCloudProvider(ctx _context.Context, body ProviderCreate) (Provider, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Provider + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Provider ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ProviderApi.CreateCloudProvider") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *ProviderApi) CreateCloudProvider(ctx _context.Context, body ProviderCre localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *ProviderApi) CreateCloudProvider(ctx _context.Context, body ProviderCre if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *ProviderApi) CreateCloudProvider(ctx _context.Context, body ProviderCre err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,10 +101,12 @@ func (a *ProviderApi) CreateCloudProvider(ctx _context.Context, body ProviderCre // Delete a cloud provider func (a *ProviderApi) DeleteCloudProvider(ctx _context.Context, providerName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ProviderApi.DeleteCloudProvider") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -107,9 +118,10 @@ func (a *ProviderApi) DeleteCloudProvider(ctx _context.Context, providerName str localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +143,11 @@ func (a *ProviderApi) DeleteCloudProvider(ctx _context.Context, providerName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,11 +165,13 @@ func (a *ProviderApi) DeleteCloudProvider(ctx _context.Context, providerName str // Get cloud provider func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string) (Provider, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Provider + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Provider ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ProviderApi.GetCloudProvider") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -170,7 +185,8 @@ func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -192,10 +208,11 @@ func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -209,7 +226,7 @@ func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -222,11 +239,13 @@ func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string // Get cloud provider list func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ProviderList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ProviderList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ProviderApi.ListCloudProviders") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -239,7 +258,8 @@ func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_ localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -261,10 +281,11 @@ func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_ if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -278,7 +299,7 @@ func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_ err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -291,11 +312,13 @@ func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_ // Update a cloud provider func (a *ProviderApi) UpdateCloudProvider(ctx _context.Context, providerName string, body ProviderUpdate) (Provider, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Provider + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Provider ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ProviderApi.UpdateCloudProvider") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -310,9 +333,11 @@ func (a *ProviderApi) UpdateCloudProvider(ctx _context.Context, providerName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -334,10 +359,11 @@ func (a *ProviderApi) UpdateCloudProvider(ctx _context.Context, providerName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -351,7 +377,7 @@ func (a *ProviderApi) UpdateCloudProvider(ctx _context.Context, providerName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_recycle_bin_cluster.go b/api/kbcloud/admin/api_recycle_bin_cluster.go index 6fe46910..cad47300 100644 --- a/api/kbcloud/admin/api_recycle_bin_cluster.go +++ b/api/kbcloud/admin/api_recycle_bin_cluster.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,10 +23,12 @@ type RecycleBinClusterApi common.Service // DeleteRecycleBinCluster Delete cluster from the Recycle Bin of the Org. func (a *RecycleBinClusterApi) DeleteRecycleBinCluster(ctx _context.Context, orgName string, clusterName string, isDeleteBackup bool) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.DeleteRecycleBinCluster") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *RecycleBinClusterApi) DeleteRecycleBinCluster(ctx _context.Context, org localVarQueryParams.Add("isDeleteBackup", common.ParameterToString(isDeleteBackup, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *RecycleBinClusterApi) DeleteRecycleBinCluster(ctx _context.Context, org if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,11 +88,13 @@ func (a *RecycleBinClusterApi) DeleteRecycleBinCluster(ctx _context.Context, org // GetRecycleBinCluster Get cluster in the Recycle Bin of the Org. func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgName string, clusterName string) (RecycleBinCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RecycleBinCluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RecycleBinCluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.GetRecycleBinCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -99,7 +109,8 @@ func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -121,10 +132,11 @@ func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -138,7 +150,7 @@ func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -150,11 +162,13 @@ func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgNam // ListRecycleBinCluster List clusters in the Recycle Bin of the Org. func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgName string) (RecycleBinClusterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RecycleBinClusterList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RecycleBinClusterList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.ListRecycleBinCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -168,7 +182,8 @@ func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -190,10 +205,11 @@ func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -207,7 +223,7 @@ func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -219,11 +235,13 @@ func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgNa // ListRecycleBinClusters List all clusters in the Recycle Bin. func (a *RecycleBinClusterApi) ListRecycleBinClusters(ctx _context.Context) (RecycleBinClusterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RecycleBinClusterList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RecycleBinClusterList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.ListRecycleBinClusters") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -236,7 +254,8 @@ func (a *RecycleBinClusterApi) ListRecycleBinClusters(ctx _context.Context) (Rec localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -258,10 +277,11 @@ func (a *RecycleBinClusterApi) ListRecycleBinClusters(ctx _context.Context) (Rec if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -275,7 +295,7 @@ func (a *RecycleBinClusterApi) ListRecycleBinClusters(ctx _context.Context) (Rec err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -287,11 +307,13 @@ func (a *RecycleBinClusterApi) ListRecycleBinClusters(ctx _context.Context) (Rec // RestoreRecycleBinCluster Restore cluster from the Recycle Bin of the Org. func (a *RecycleBinClusterApi) RestoreRecycleBinCluster(ctx _context.Context, orgName string, clusterName string) (RecycleBinCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue RecycleBinCluster + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue RecycleBinCluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.RestoreRecycleBinCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -306,7 +328,8 @@ func (a *RecycleBinClusterApi) RestoreRecycleBinCluster(ctx _context.Context, or localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -328,10 +351,11 @@ func (a *RecycleBinClusterApi) RestoreRecycleBinCluster(ctx _context.Context, or if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -345,7 +369,7 @@ func (a *RecycleBinClusterApi) RestoreRecycleBinCluster(ctx _context.Context, or err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_region.go b/api/kbcloud/admin/api_region.go index d543ebf1..8e011d57 100644 --- a/api/kbcloud/admin/api_region.go +++ b/api/kbcloud/admin/api_region.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type RegionApi common.Service // Create a region func (a *RegionApi) CreateRegion(ctx _context.Context, providerName string, body RegionCreate) (Region, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Region + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Region ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionApi.CreateRegion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *RegionApi) CreateRegion(ctx _context.Context, providerName string, body localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *RegionApi) CreateRegion(ctx _context.Context, providerName string, body if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *RegionApi) CreateRegion(ctx _context.Context, providerName string, body err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +102,12 @@ func (a *RegionApi) CreateRegion(ctx _context.Context, providerName string, body // Delete a region func (a *RegionApi) DeleteRegion(ctx _context.Context, providerName string, regionName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionApi.DeleteRegion") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,9 +120,10 @@ func (a *RegionApi) DeleteRegion(ctx _context.Context, providerName string, regi localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *RegionApi) DeleteRegion(ctx _context.Context, providerName string, regi if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -154,11 +167,13 @@ func (a *RegionApi) DeleteRegion(ctx _context.Context, providerName string, regi // Get region func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionName string) (Region, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Region + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Region ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionApi.GetRegion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -173,7 +188,8 @@ func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -195,10 +211,11 @@ func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -212,7 +229,7 @@ func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -225,11 +242,13 @@ func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionN // Get region list func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (RegionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RegionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RegionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionApi.ListRegions") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -243,7 +262,8 @@ func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (Regi localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -265,10 +285,11 @@ func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (Regi if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -282,7 +303,7 @@ func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (Regi err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -295,11 +316,13 @@ func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (Regi // Update a region func (a *RegionApi) UpdateRegion(ctx _context.Context, providerName string, regionName string, body RegionUpdate) (Region, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Region + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Region ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionApi.UpdateRegion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -315,9 +338,11 @@ func (a *RegionApi) UpdateRegion(ctx _context.Context, providerName string, regi localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -339,10 +364,11 @@ func (a *RegionApi) UpdateRegion(ctx _context.Context, providerName string, regi if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -356,7 +382,7 @@ func (a *RegionApi) UpdateRegion(ctx _context.Context, providerName string, regi err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_region_group.go b/api/kbcloud/admin/api_region_group.go index dc93e7e6..0f1f0d02 100644 --- a/api/kbcloud/admin/api_region_group.go +++ b/api/kbcloud/admin/api_region_group.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type RegionGroupApi common.Service // Create a region group func (a *RegionGroupApi) CreateRegionGroup(ctx _context.Context, providerName string, body RegionGroupCreate) (RegionGroup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue RegionGroup + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue RegionGroup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionGroupApi.CreateRegionGroup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *RegionGroupApi) CreateRegionGroup(ctx _context.Context, providerName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *RegionGroupApi) CreateRegionGroup(ctx _context.Context, providerName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *RegionGroupApi) CreateRegionGroup(ctx _context.Context, providerName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +102,12 @@ func (a *RegionGroupApi) CreateRegionGroup(ctx _context.Context, providerName st // Delete a region func (a *RegionGroupApi) DeleteRegionGroup(ctx _context.Context, providerName string, regionGroupName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionGroupApi.DeleteRegionGroup") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,9 +120,10 @@ func (a *RegionGroupApi) DeleteRegionGroup(ctx _context.Context, providerName st localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *RegionGroupApi) DeleteRegionGroup(ctx _context.Context, providerName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -154,11 +167,13 @@ func (a *RegionGroupApi) DeleteRegionGroup(ctx _context.Context, providerName st // Get region group list func (a *RegionGroupApi) ListRegionGroups(ctx _context.Context, providerName string) (RegionGroupList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RegionGroupList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RegionGroupList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionGroupApi.ListRegionGroups") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -172,7 +187,8 @@ func (a *RegionGroupApi) ListRegionGroups(ctx _context.Context, providerName str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -194,10 +210,11 @@ func (a *RegionGroupApi) ListRegionGroups(ctx _context.Context, providerName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -211,7 +228,7 @@ func (a *RegionGroupApi) ListRegionGroups(ctx _context.Context, providerName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -224,11 +241,13 @@ func (a *RegionGroupApi) ListRegionGroups(ctx _context.Context, providerName str // Update a region group func (a *RegionGroupApi) UpdateRegionGroup(ctx _context.Context, providerName string, regionGroupName string, body RegionGroupUpdate) (RegionGroup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue RegionGroup + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue RegionGroup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionGroupApi.UpdateRegionGroup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -244,9 +263,11 @@ func (a *RegionGroupApi) UpdateRegionGroup(ctx _context.Context, providerName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -268,10 +289,11 @@ func (a *RegionGroupApi) UpdateRegionGroup(ctx _context.Context, providerName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -285,7 +307,7 @@ func (a *RegionGroupApi) UpdateRegionGroup(ctx _context.Context, providerName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_resource_stats.go b/api/kbcloud/admin/api_resource_stats.go index 546cbd16..c076d699 100644 --- a/api/kbcloud/admin/api_resource_stats.go +++ b/api/kbcloud/admin/api_resource_stats.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type ResourceStatsApi common.Service // Returns aggregated resource statistics for the specified environment within an organization. func (a *ResourceStatsApi) GetResourceStats(ctx _context.Context, environmentName string) (EnvironmentResourceStats, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EnvironmentResourceStats + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EnvironmentResourceStats ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ResourceStatsApi.GetResourceStats") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *ResourceStatsApi) GetResourceStats(ctx _context.Context, environmentNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *ResourceStatsApi) GetResourceStats(ctx _context.Context, environmentNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *ResourceStatsApi) GetResourceStats(ctx _context.Context, environmentNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +98,13 @@ func (a *ResourceStatsApi) GetResourceStats(ctx _context.Context, environmentNam // Returns aggregated resource statistics for the specified node. func (a *ResourceStatsApi) ListInstancesResourceStats(ctx _context.Context, environmentName string, nodeName string) (InstanceResourceStatsList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue InstanceResourceStatsList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue InstanceResourceStatsList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ResourceStatsApi.ListInstancesResourceStats") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +119,8 @@ func (a *ResourceStatsApi) ListInstancesResourceStats(ctx _context.Context, envi localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +142,11 @@ func (a *ResourceStatsApi) ListInstancesResourceStats(ctx _context.Context, envi if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -148,7 +160,7 @@ func (a *ResourceStatsApi) ListInstancesResourceStats(ctx _context.Context, envi err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -161,11 +173,13 @@ func (a *ResourceStatsApi) ListInstancesResourceStats(ctx _context.Context, envi // Returns aggregated resource statistics for the specified environment within an organization. func (a *ResourceStatsApi) ListNodesResourceStats(ctx _context.Context, environmentName string) (NodeResourceStatsList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue NodeResourceStatsList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue NodeResourceStatsList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ResourceStatsApi.ListNodesResourceStats") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -179,7 +193,8 @@ func (a *ResourceStatsApi) ListNodesResourceStats(ctx _context.Context, environm localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -201,10 +216,11 @@ func (a *ResourceStatsApi) ListNodesResourceStats(ctx _context.Context, environm if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -218,7 +234,7 @@ func (a *ResourceStatsApi) ListNodesResourceStats(ctx _context.Context, environm err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_restore.go b/api/kbcloud/admin/api_restore.go index ba031822..280864f2 100644 --- a/api/kbcloud/admin/api_restore.go +++ b/api/kbcloud/admin/api_restore.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type RestoreApi common.Service // GetRestoreLog get restore workload logs of the cluster. func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, clusterName string, restoreId string) (RestoreLog, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RestoreLog + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RestoreLog ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.GetRestoreLog") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,7 +45,8 @@ func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +68,11 @@ func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +86,7 @@ func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,10 +98,12 @@ func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, cluster // DeleteRestoreObject Delete restore task. func (a *RestoreApi) DeleteRestoreObject(ctx _context.Context, orgName string, clusterName string, restoreName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.DeleteRestoreObject") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +119,8 @@ func (a *RestoreApi) DeleteRestoreObject(ctx _context.Context, orgName string, c localVarQueryParams.Add("restoreName", common.ParameterToString(restoreName, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +142,11 @@ func (a *RestoreApi) DeleteRestoreObject(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -151,11 +163,13 @@ func (a *RestoreApi) DeleteRestoreObject(ctx _context.Context, orgName string, c // DoRestore Restore current cluster or instance. func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName string, body Restore) (Restore, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Restore + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Restore ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.DoRestore") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -171,9 +185,11 @@ func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -195,10 +211,11 @@ func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -212,7 +229,7 @@ func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -224,11 +241,13 @@ func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName // GetRestoreTimeRange Get cluster restore time ragne. func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, clusterId string) (Backup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Backup + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Backup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.GetRestoreTimeRange") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -243,7 +262,8 @@ func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, c localVarQueryParams.Add("clusterID", common.ParameterToString(clusterId, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -265,10 +285,11 @@ func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -282,7 +303,7 @@ func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -294,11 +315,13 @@ func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, c // ListClusterRestore List restore tasks. func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, clusterName string) (RestoreList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RestoreList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RestoreList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.ListClusterRestore") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -313,7 +336,8 @@ func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, cl localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -335,10 +359,11 @@ func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -352,7 +377,7 @@ func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -371,7 +396,6 @@ func NewListRestoresOptionalParameters() *ListRestoresOptionalParameters { this := ListRestoresOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListRestoresOptionalParameters) WithOrgName(orgName string) *ListRestoresOptionalParameters { r.OrgName = &orgName @@ -381,18 +405,20 @@ func (r *ListRestoresOptionalParameters) WithOrgName(orgName string) *ListRestor // ListRestores List restore tasks. func (a *RestoreApi) ListRestores(ctx _context.Context, o ...ListRestoresOptionalParameters) (RestoreList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RestoreList - optionalParams ListRestoresOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RestoreList + optionalParams ListRestoresOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListRestoresOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListRestoresOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.ListRestores") if err != nil { @@ -409,7 +435,8 @@ func (a *RestoreApi) ListRestores(ctx _context.Context, o ...ListRestoresOptiona } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -431,10 +458,11 @@ func (a *RestoreApi) ListRestores(ctx _context.Context, o ...ListRestoresOptiona if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -448,7 +476,7 @@ func (a *RestoreApi) ListRestores(ctx _context.Context, o ...ListRestoresOptiona err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -460,11 +488,13 @@ func (a *RestoreApi) ListRestores(ctx _context.Context, o ...ListRestoresOptiona // RestoreCluster Restore new cluster. func (a *RestoreApi) RestoreCluster(ctx _context.Context, orgName string, body RestoreCreate) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.RestoreCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -479,9 +509,11 @@ func (a *RestoreApi) RestoreCluster(ctx _context.Context, orgName string, body R localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -503,10 +535,11 @@ func (a *RestoreApi) RestoreCluster(ctx _context.Context, orgName string, body R if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -520,7 +553,7 @@ func (a *RestoreApi) RestoreCluster(ctx _context.Context, orgName string, body R err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_role.go b/api/kbcloud/admin/api_role.go index b046e838..5545d894 100644 --- a/api/kbcloud/admin/api_role.go +++ b/api/kbcloud/admin/api_role.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type RoleApi common.Service // Create role func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCreate) (Role, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Role + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Role ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.CreateRole") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCrea localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCrea if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCrea err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +102,12 @@ func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCrea // Delete role by name func (a *RoleApi) DeleteRoleByName(ctx _context.Context, orgName string, roleName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.DeleteRoleByName") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +122,8 @@ func (a *RoleApi) DeleteRoleByName(ctx _context.Context, orgName string, roleNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *RoleApi) DeleteRoleByName(ctx _context.Context, orgName string, roleNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -154,11 +167,13 @@ func (a *RoleApi) DeleteRoleByName(ctx _context.Context, orgName string, roleNam // Get role by name func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName string) (Role, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Role + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Role ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.GetRoleByName") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -173,7 +188,8 @@ func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -195,10 +211,11 @@ func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -212,7 +229,7 @@ func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -225,11 +242,13 @@ func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName s // List all permissions func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue PermissionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue PermissionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.ListPermissions") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -242,7 +261,8 @@ func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_netht localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -264,10 +284,11 @@ func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_netht if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -281,7 +302,7 @@ func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_netht err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -294,11 +315,13 @@ func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_netht // List permissions of a role func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, roleName string) (PermissionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue PermissionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue PermissionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.ListRolePermissions") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -313,7 +336,8 @@ func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, role localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -335,10 +359,11 @@ func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, role if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -352,7 +377,7 @@ func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, role err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -365,11 +390,13 @@ func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, role // List roles of a organization func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RoleList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RoleList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.ListRoles") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -383,7 +410,8 @@ func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_n localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -405,10 +433,11 @@ func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_n if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -422,7 +451,7 @@ func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_n err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -435,11 +464,13 @@ func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_n // Update role by name func (a *RoleApi) UpdateRoleByName(ctx _context.Context, orgName string, roleName string, body RoleUpdate) (Role, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Role + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Role ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.UpdateRoleByName") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -455,9 +486,11 @@ func (a *RoleApi) UpdateRoleByName(ctx _context.Context, orgName string, roleNam localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -479,10 +512,11 @@ func (a *RoleApi) UpdateRoleByName(ctx _context.Context, orgName string, roleNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -496,7 +530,7 @@ func (a *RoleApi) UpdateRoleByName(ctx _context.Context, orgName string, roleNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_service_version.go b/api/kbcloud/admin/api_service_version.go index d5bf56f6..8aafdafa 100644 --- a/api/kbcloud/admin/api_service_version.go +++ b/api/kbcloud/admin/api_service_version.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListServiceVersionOptionalParameters() *ListServiceVersionOptionalParame this := ListServiceVersionOptionalParameters{} return &this } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *ListServiceVersionOptionalParameters) WithComponent(component string) *ListServiceVersionOptionalParameters { r.Component = &component @@ -37,18 +40,20 @@ func (r *ListServiceVersionOptionalParameters) WithComponent(component string) * // list the service version of the engine func (a *ServiceVersionApi) ListServiceVersion(ctx _context.Context, environmentName string, engineName string, engineMode string, o ...ListServiceVersionOptionalParameters) (EngineServiceVersions, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineServiceVersions - optionalParams ListServiceVersionOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineServiceVersions + optionalParams ListServiceVersionOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListServiceVersionOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListServiceVersionOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ServiceVersionApi.ListServiceVersion") if err != nil { @@ -68,7 +73,8 @@ func (a *ServiceVersionApi) ListServiceVersion(ctx _context.Context, environment } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -90,10 +96,11 @@ func (a *ServiceVersionApi) ListServiceVersion(ctx _context.Context, environment if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -107,7 +114,7 @@ func (a *ServiceVersionApi) ListServiceVersion(ctx _context.Context, environment err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_storage.go b/api/kbcloud/admin/api_storage.go index c0e90ae5..99a714ec 100644 --- a/api/kbcloud/admin/api_storage.go +++ b/api/kbcloud/admin/api_storage.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type StorageApi common.Service // CheckStorage Check if storage can be accessed. func (a *StorageApi) CheckStorage(ctx _context.Context, body StorageCreate) (StorageCheckResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue StorageCheckResult + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue StorageCheckResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageApi.CheckStorage") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,9 +43,11 @@ func (a *StorageApi) CheckStorage(ctx _context.Context, body StorageCreate) (Sto localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +69,11 @@ func (a *StorageApi) CheckStorage(ctx _context.Context, body StorageCreate) (Sto if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +87,7 @@ func (a *StorageApi) CheckStorage(ctx _context.Context, body StorageCreate) (Sto err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +99,13 @@ func (a *StorageApi) CheckStorage(ctx _context.Context, body StorageCreate) (Sto // CreateStorage Create a storage. func (a *StorageApi) CreateStorage(ctx _context.Context, environmentName string, body StorageCreate) (Storage, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Storage + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Storage ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageApi.CreateStorage") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,9 +120,11 @@ func (a *StorageApi) CreateStorage(ctx _context.Context, environmentName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +146,11 @@ func (a *StorageApi) CreateStorage(ctx _context.Context, environmentName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -150,7 +164,7 @@ func (a *StorageApi) CreateStorage(ctx _context.Context, environmentName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -162,10 +176,12 @@ func (a *StorageApi) CreateStorage(ctx _context.Context, environmentName string, // DeleteStorage Delete a storage. func (a *StorageApi) DeleteStorage(ctx _context.Context, environmentName string, storageName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageApi.DeleteStorage") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -180,7 +196,8 @@ func (a *StorageApi) DeleteStorage(ctx _context.Context, environmentName string, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -202,10 +219,11 @@ func (a *StorageApi) DeleteStorage(ctx _context.Context, environmentName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -222,11 +240,13 @@ func (a *StorageApi) DeleteStorage(ctx _context.Context, environmentName string, // GetStorage Get a storage. func (a *StorageApi) GetStorage(ctx _context.Context, environmentName string, storageName string) (Storage, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Storage + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Storage ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageApi.GetStorage") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -241,7 +261,8 @@ func (a *StorageApi) GetStorage(ctx _context.Context, environmentName string, st localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -263,10 +284,11 @@ func (a *StorageApi) GetStorage(ctx _context.Context, environmentName string, st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -280,7 +302,7 @@ func (a *StorageApi) GetStorage(ctx _context.Context, environmentName string, st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -292,11 +314,13 @@ func (a *StorageApi) GetStorage(ctx _context.Context, environmentName string, st // ListStorageProviders List storage providers for storage. func (a *StorageApi) ListStorageProviders(ctx _context.Context) ([]StorageProvider, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []StorageProvider + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []StorageProvider ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageApi.ListStorageProviders") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -309,7 +333,8 @@ func (a *StorageApi) ListStorageProviders(ctx _context.Context) ([]StorageProvid localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -331,10 +356,11 @@ func (a *StorageApi) ListStorageProviders(ctx _context.Context) ([]StorageProvid if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -348,7 +374,7 @@ func (a *StorageApi) ListStorageProviders(ctx _context.Context) ([]StorageProvid err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -359,8 +385,8 @@ func (a *StorageApi) ListStorageProviders(ctx _context.Context) ([]StorageProvid // ListStoragesOptionalParameters holds optional parameters for ListStorages. type ListStoragesOptionalParameters struct { - Name *string - Key *string + Name *string + Key *string Value *string } @@ -369,19 +395,16 @@ func NewListStoragesOptionalParameters() *ListStoragesOptionalParameters { this := ListStoragesOptionalParameters{} return &this } - // WithName sets the corresponding parameter name and returns the struct. func (r *ListStoragesOptionalParameters) WithName(name string) *ListStoragesOptionalParameters { r.Name = &name return r } - // WithKey sets the corresponding parameter name and returns the struct. func (r *ListStoragesOptionalParameters) WithKey(key string) *ListStoragesOptionalParameters { r.Key = &key return r } - // WithValue sets the corresponding parameter name and returns the struct. func (r *ListStoragesOptionalParameters) WithValue(value string) *ListStoragesOptionalParameters { r.Value = &value @@ -391,18 +414,20 @@ func (r *ListStoragesOptionalParameters) WithValue(value string) *ListStoragesOp // ListStorages List storages. func (a *StorageApi) ListStorages(ctx _context.Context, environmentName string, o ...ListStoragesOptionalParameters) ([]Storage, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Storage - optionalParams ListStoragesOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Storage + optionalParams ListStoragesOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListStoragesOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListStoragesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageApi.ListStorages") if err != nil { @@ -426,7 +451,8 @@ func (a *StorageApi) ListStorages(ctx _context.Context, environmentName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -448,10 +474,11 @@ func (a *StorageApi) ListStorages(ctx _context.Context, environmentName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -465,7 +492,7 @@ func (a *StorageApi) ListStorages(ctx _context.Context, environmentName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -477,11 +504,13 @@ func (a *StorageApi) ListStorages(ctx _context.Context, environmentName string, // UpdateStorage Update a storage. func (a *StorageApi) UpdateStorage(ctx _context.Context, environmentName string, storageName string, body StorageUpdate) (Storage, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Storage + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Storage ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageApi.UpdateStorage") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -497,9 +526,11 @@ func (a *StorageApi) UpdateStorage(ctx _context.Context, environmentName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -521,10 +552,11 @@ func (a *StorageApi) UpdateStorage(ctx _context.Context, environmentName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -538,7 +570,7 @@ func (a *StorageApi) UpdateStorage(ctx _context.Context, environmentName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_storage_class.go b/api/kbcloud/admin/api_storage_class.go index b16cc3c7..eb235a0b 100644 --- a/api/kbcloud/admin/api_storage_class.go +++ b/api/kbcloud/admin/api_storage_class.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type StorageClassApi common.Service // Create storage class for the specified environment. func (a *StorageClassApi) CreateStorageClass(ctx _context.Context, environmentName string, body StorageClassCreate) (StorageClassInfo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue StorageClassInfo + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue StorageClassInfo ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageClassApi.CreateStorageClass") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,11 +43,13 @@ func (a *StorageClassApi) CreateStorageClass(ctx _context.Context, environmentNa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *StorageClassApi) CreateStorageClass(ctx _context.Context, environmentNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -75,7 +84,8 @@ func (a *StorageClassApi) CreateStorageClass(ctx _context.Context, environmentNa newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -89,7 +99,7 @@ func (a *StorageClassApi) CreateStorageClass(ctx _context.Context, environmentNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -102,11 +112,13 @@ func (a *StorageClassApi) CreateStorageClass(ctx _context.Context, environmentNa // Delete the storage class for the specified environment. func (a *StorageClassApi) DeleteStorageClass(ctx _context.Context, environmentName string, storageClassName string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageClassApi.DeleteStorageClass") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -119,9 +131,10 @@ func (a *StorageClassApi) DeleteStorageClass(ctx _context.Context, environmentNa localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -143,10 +156,11 @@ func (a *StorageClassApi) DeleteStorageClass(ctx _context.Context, environmentNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -155,7 +169,8 @@ func (a *StorageClassApi) DeleteStorageClass(ctx _context.Context, environmentNa newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -169,7 +184,7 @@ func (a *StorageClassApi) DeleteStorageClass(ctx _context.Context, environmentNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -188,7 +203,6 @@ func NewGetStorageClassOptionalParameters() *GetStorageClassOptionalParameters { this := GetStorageClassOptionalParameters{} return &this } - // WithWithStatsByNode sets the corresponding parameter name and returns the struct. func (r *GetStorageClassOptionalParameters) WithWithStatsByNode(withStatsByNode bool) *GetStorageClassOptionalParameters { r.WithStatsByNode = &withStatsByNode @@ -199,18 +213,20 @@ func (r *GetStorageClassOptionalParameters) WithWithStatsByNode(withStatsByNode // get the storage class for the specified environment. func (a *StorageClassApi) GetStorageClass(ctx _context.Context, environmentName string, storageClassName string, o ...GetStorageClassOptionalParameters) (StorageClassInfo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue StorageClassInfo - optionalParams GetStorageClassOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue StorageClassInfo + optionalParams GetStorageClassOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetStorageClassOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetStorageClassOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageClassApi.GetStorageClass") if err != nil { @@ -227,9 +243,10 @@ func (a *StorageClassApi) GetStorageClass(ctx _context.Context, environmentName if optionalParams.WithStatsByNode != nil { localVarQueryParams.Add("withStatsByNode", common.ParameterToString(*optionalParams.WithStatsByNode, "")) } - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -251,10 +268,11 @@ func (a *StorageClassApi) GetStorageClass(ctx _context.Context, environmentName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -263,7 +281,8 @@ func (a *StorageClassApi) GetStorageClass(ctx _context.Context, environmentName newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -277,7 +296,7 @@ func (a *StorageClassApi) GetStorageClass(ctx _context.Context, environmentName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -290,11 +309,13 @@ func (a *StorageClassApi) GetStorageClass(ctx _context.Context, environmentName // get the persistentvolumeclaim list related to the specified storage class for the specified environment. func (a *StorageClassApi) ListStorageClassPvcs(ctx _context.Context, environmentName string, storageClassName string, pageId int64, pageSize int64) (PersistentVolumeClaimList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue PersistentVolumeClaimList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue PersistentVolumeClaimList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageClassApi.ListStorageClassPvcs") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -309,9 +330,10 @@ func (a *StorageClassApi) ListStorageClassPvcs(ctx _context.Context, environment localVarFormParams := _neturl.Values{} localVarQueryParams.Add("pageId", common.ParameterToString(pageId, "")) localVarQueryParams.Add("pageSize", common.ParameterToString(pageSize, "")) - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -333,10 +355,11 @@ func (a *StorageClassApi) ListStorageClassPvcs(ctx _context.Context, environment if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -345,7 +368,8 @@ func (a *StorageClassApi) ListStorageClassPvcs(ctx _context.Context, environment newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -359,7 +383,7 @@ func (a *StorageClassApi) ListStorageClassPvcs(ctx _context.Context, environment err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -372,11 +396,13 @@ func (a *StorageClassApi) ListStorageClassPvcs(ctx _context.Context, environment // Provides a summary of storage class statistics. func (a *StorageClassApi) ListStorageClasses(ctx _context.Context, environmentName string) (StorageClassList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue StorageClassList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue StorageClassList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageClassApi.ListStorageClasses") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -388,9 +414,10 @@ func (a *StorageClassApi) ListStorageClasses(ctx _context.Context, environmentNa localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -412,10 +439,11 @@ func (a *StorageClassApi) ListStorageClasses(ctx _context.Context, environmentNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -424,7 +452,8 @@ func (a *StorageClassApi) ListStorageClasses(ctx _context.Context, environmentNa newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -438,7 +467,7 @@ func (a *StorageClassApi) ListStorageClasses(ctx _context.Context, environmentNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -451,11 +480,13 @@ func (a *StorageClassApi) ListStorageClasses(ctx _context.Context, environmentNa // Provides a summary of storage provisioners statistics. func (a *StorageClassApi) ListStorageProvisioners(ctx _context.Context, environmentName string) (StorageProvisionerList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue StorageProvisionerList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue StorageProvisionerList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageClassApi.ListStorageProvisioners") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -467,9 +498,10 @@ func (a *StorageClassApi) ListStorageProvisioners(ctx _context.Context, environm localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -491,10 +523,11 @@ func (a *StorageClassApi) ListStorageProvisioners(ctx _context.Context, environm if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -503,7 +536,8 @@ func (a *StorageClassApi) ListStorageProvisioners(ctx _context.Context, environm newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -517,7 +551,7 @@ func (a *StorageClassApi) ListStorageProvisioners(ctx _context.Context, environm err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -530,11 +564,13 @@ func (a *StorageClassApi) ListStorageProvisioners(ctx _context.Context, environm // Updates the storage class for the specified environment. func (a *StorageClassApi) UpdateStorageClass(ctx _context.Context, environmentName string, storageClassName string, body StorageClassUpdate) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageClassApi.UpdateStorageClass") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -548,11 +584,13 @@ func (a *StorageClassApi) UpdateStorageClass(ctx _context.Context, environmentNa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -574,10 +612,11 @@ func (a *StorageClassApi) UpdateStorageClass(ctx _context.Context, environmentNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -586,7 +625,8 @@ func (a *StorageClassApi) UpdateStorageClass(ctx _context.Context, environmentNa newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -600,7 +640,7 @@ func (a *StorageClassApi) UpdateStorageClass(ctx _context.Context, environmentNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_tag.go b/api/kbcloud/admin/api_tag.go index fe4aa933..f81fc45b 100644 --- a/api/kbcloud/admin/api_tag.go +++ b/api/kbcloud/admin/api_tag.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type TagApi common.Service // create tag func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{}) (TagCreate, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue TagCreate + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue TagCreate ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.CreateTag") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{ localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{ if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{ err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +102,12 @@ func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{ // delete tag func (a *TagApi) DeleteTags(ctx _context.Context, orgName string, tagId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.DeleteTags") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +122,8 @@ func (a *TagApi) DeleteTags(ctx _context.Context, orgName string, tagId string) localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *TagApi) DeleteTags(ctx _context.Context, orgName string, tagId string) if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -153,11 +166,13 @@ func (a *TagApi) DeleteTags(ctx _context.Context, orgName string, tagId string) // GetTags Get cluster tags. func (a *TagApi) GetTags(ctx _context.Context, orgName string, clusterIds string) ([]TagCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []TagCluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []TagCluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.GetTags") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -172,7 +187,8 @@ func (a *TagApi) GetTags(ctx _context.Context, orgName string, clusterIds string localVarQueryParams.Add("clusterIds", common.ParameterToString(clusterIds, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -195,7 +211,7 @@ func (a *TagApi) GetTags(ctx _context.Context, orgName string, clusterIds string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -208,11 +224,13 @@ func (a *TagApi) GetTags(ctx _context.Context, orgName string, clusterIds string // List tags by organization name. func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue OrgTagsList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgTagsList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.ListOrgTags") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -226,7 +244,8 @@ func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -248,10 +267,11 @@ func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -265,7 +285,7 @@ func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -278,11 +298,13 @@ func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, // Update tags func (a *TagApi) UpdateTag(ctx _context.Context, orgName string, tagId string, tagUpdate TagUpdate) (Tag, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Tag + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Tag ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.UpdateTag") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -298,9 +320,11 @@ func (a *TagApi) UpdateTag(ctx _context.Context, orgName string, tagId string, t localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &tagUpdate - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -322,10 +346,11 @@ func (a *TagApi) UpdateTag(ctx _context.Context, orgName string, tagId string, t if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -339,7 +364,7 @@ func (a *TagApi) UpdateTag(ctx _context.Context, orgName string, tagId string, t err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_tls.go b/api/kbcloud/admin/api_tls.go index 78481444..98a28af4 100644 --- a/api/kbcloud/admin/api_tls.go +++ b/api/kbcloud/admin/api_tls.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type TlsApi common.Service // GetTLSCertificate Get cluster TLS certificate. func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, clusterName string) ([]TlsCert, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []TlsCert + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []TlsCert ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TlsApi.GetTLSCertificate") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -89,10 +97,12 @@ func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, cluster // TlsSwitcher Enable or disable cluster TLS. func (a *TlsApi) TlsSwitcher(ctx _context.Context, orgName string, clusterName string, body TlsRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TlsApi.TlsSwitcher") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -108,9 +118,11 @@ func (a *TlsApi) TlsSwitcher(ctx _context.Context, orgName string, clusterName s localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *TlsApi) TlsSwitcher(ctx _context.Context, orgName string, clusterName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/admin/api_user.go b/api/kbcloud/admin/api_user.go index b10758f8..becb886d 100644 --- a/api/kbcloud/admin/api_user.go +++ b/api/kbcloud/admin/api_user.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type UserApi common.Service // Create apikey of the authenticated user func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (ApikeyWithSK, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue ApikeyWithSK + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue ApikeyWithSK ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.CreateUserApikey") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (Api localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (Api if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (Api err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,10 +101,12 @@ func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (Api // delete apikey func (a *UserApi) DeleteApikey(ctx _context.Context, keyName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.DeleteApikey") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +120,8 @@ func (a *UserApi) DeleteApikey(ctx _context.Context, keyName string) (*_nethttp. localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +143,11 @@ func (a *UserApi) DeleteApikey(ctx _context.Context, keyName string) (*_nethttp. if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,11 +165,13 @@ func (a *UserApi) DeleteApikey(ctx _context.Context, keyName string) (*_nethttp. // partially update the specified apikey func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyCreate) (Apikey, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Apikey + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Apikey ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.PatchAPIkey") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -168,12 +183,14 @@ func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyC localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json-patch+json" + localVarHeaderParams["Content-Type"] = "application/json-patch+json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -195,10 +212,11 @@ func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyC if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -212,7 +230,7 @@ func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyC err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -225,11 +243,13 @@ func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyC // Get apikeys of the authenticated user func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ApikeyList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ApikeyList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.ReadUserApikeys") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -242,7 +262,8 @@ func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.R localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -264,10 +285,11 @@ func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.R if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -281,7 +303,7 @@ func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.R err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_view.go b/api/kbcloud/admin/api_view.go index 1acf3cff..2be2c7ef 100644 --- a/api/kbcloud/admin/api_view.go +++ b/api/kbcloud/admin/api_view.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type ViewApi common.Service // GetTreeView Get tree view by cluster. func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName string) (TreeNode, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue TreeNode + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue TreeNode ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ViewApi.GetTreeView") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -89,11 +97,13 @@ func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName // GetViewByCluster Get view details by cluster. func (a *ViewApi) GetViewByCluster(ctx _context.Context, orgName string, clusterName string) (View, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue View + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue View ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ViewApi.GetViewByCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -108,7 +118,8 @@ func (a *ViewApi) GetViewByCluster(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -130,10 +141,11 @@ func (a *ViewApi) GetViewByCluster(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -147,7 +159,7 @@ func (a *ViewApi) GetViewByCluster(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_vip_pool.go b/api/kbcloud/admin/api_vip_pool.go index 15c6803a..d5d9eaf8 100644 --- a/api/kbcloud/admin/api_vip_pool.go +++ b/api/kbcloud/admin/api_vip_pool.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type VipPoolApi common.Service // CreateVIPPool Create environment VIP Pool. func (a *VipPoolApi) CreateVIPPool(ctx _context.Context, environmentName string, body VipPoolCreate) (VipPool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue VipPool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue VipPool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".VipPoolApi.CreateVIPPool") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *VipPoolApi) CreateVIPPool(ctx _context.Context, environmentName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *VipPoolApi) CreateVIPPool(ctx _context.Context, environmentName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *VipPoolApi) CreateVIPPool(ctx _context.Context, environmentName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,10 +100,12 @@ func (a *VipPoolApi) CreateVIPPool(ctx _context.Context, environmentName string, // DeleteVIPPool Delete environment VIP Pool. func (a *VipPoolApi) DeleteVIPPool(ctx _context.Context, environmentName string, poolId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".VipPoolApi.DeleteVIPPool") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +120,8 @@ func (a *VipPoolApi) DeleteVIPPool(ctx _context.Context, environmentName string, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +143,11 @@ func (a *VipPoolApi) DeleteVIPPool(ctx _context.Context, environmentName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -151,11 +164,13 @@ func (a *VipPoolApi) DeleteVIPPool(ctx _context.Context, environmentName string, // ListVIPPool List environment VIP Pools. func (a *VipPoolApi) ListVIPPool(ctx _context.Context, environmentName string) (VipPoolList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue VipPoolList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue VipPoolList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".VipPoolApi.ListVIPPool") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -169,7 +184,8 @@ func (a *VipPoolApi) ListVIPPool(ctx _context.Context, environmentName string) ( localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -191,10 +207,11 @@ func (a *VipPoolApi) ListVIPPool(ctx _context.Context, environmentName string) ( if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -208,7 +225,7 @@ func (a *VipPoolApi) ListVIPPool(ctx _context.Context, environmentName string) ( err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/api_whitelist.go b/api/kbcloud/admin/api_whitelist.go index b43a91c3..e878de31 100644 --- a/api/kbcloud/admin/api_whitelist.go +++ b/api/kbcloud/admin/api_whitelist.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,10 +23,12 @@ type WhitelistApi common.Service // DeleteIPWhiteList Delete IP whitelist. func (a *WhitelistApi) DeleteIPWhiteList(ctx _context.Context, orgName string, clusterName string, ipWhitelistId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".WhitelistApi.DeleteIPWhiteList") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *WhitelistApi) DeleteIPWhiteList(ctx _context.Context, orgName string, c localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *WhitelistApi) DeleteIPWhiteList(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/admin/api_zone.go b/api/kbcloud/admin/api_zone.go index fbf10fea..f7d095c9 100644 --- a/api/kbcloud/admin/api_zone.go +++ b/api/kbcloud/admin/api_zone.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type ZoneApi common.Service // Create a zone func (a *ZoneApi) CreateZone(ctx _context.Context, providerName string, regionName string, body ZoneCreate) (Zone, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Zone + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Zone ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ZoneApi.CreateZone") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,9 +46,11 @@ func (a *ZoneApi) CreateZone(ctx _context.Context, providerName string, regionNa localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -64,10 +72,11 @@ func (a *ZoneApi) CreateZone(ctx _context.Context, providerName string, regionNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -81,7 +90,7 @@ func (a *ZoneApi) CreateZone(ctx _context.Context, providerName string, regionNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -94,10 +103,12 @@ func (a *ZoneApi) CreateZone(ctx _context.Context, providerName string, regionNa // Delete a zone func (a *ZoneApi) DeleteZone(ctx _context.Context, providerName string, regionName string, zoneName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ZoneApi.DeleteZone") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,9 +122,10 @@ func (a *ZoneApi) DeleteZone(ctx _context.Context, providerName string, regionNa localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -135,10 +147,11 @@ func (a *ZoneApi) DeleteZone(ctx _context.Context, providerName string, regionNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -156,11 +169,13 @@ func (a *ZoneApi) DeleteZone(ctx _context.Context, providerName string, regionNa // Get zone func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName string, zoneName string) (Zone, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Zone + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Zone ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ZoneApi.GetZones") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -176,7 +191,8 @@ func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -198,10 +214,11 @@ func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -215,7 +232,7 @@ func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -228,11 +245,13 @@ func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName // Get zone list func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionName string) (ZoneList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ZoneList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ZoneList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ZoneApi.ListZones") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -247,7 +266,8 @@ func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -269,10 +289,11 @@ func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -286,7 +307,7 @@ func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -299,11 +320,13 @@ func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionNam // Update a zone func (a *ZoneApi) UpdateZone(ctx _context.Context, providerName string, regionName string, zoneName string, body ZoneUpdate) (Zone, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Zone + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Zone ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ZoneApi.UpdateZone") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -320,9 +343,11 @@ func (a *ZoneApi) UpdateZone(ctx _context.Context, providerName string, regionNa localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -344,10 +369,11 @@ func (a *ZoneApi) UpdateZone(ctx _context.Context, providerName string, regionNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -361,7 +387,7 @@ func (a *ZoneApi) UpdateZone(ctx _context.Context, providerName string, regionNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/admin/doc.go b/api/kbcloud/admin/doc.go index e5630cab..aa66db3e 100644 --- a/api/kbcloud/admin/doc.go +++ b/api/kbcloud/admin/doc.go @@ -2,352 +2,349 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + + // List of APIs: -// - [accountApi.createAccount] -// - [accountApi.deleteAccount] -// - [accountApi.listAccounts] -// - [accountApi.updateAccount] -// - [accountApi.updateAccountPrivileges] -// - [adminUserApi.createAdminUser] -// - [adminUserApi.deleteAdminUser] -// - [adminUserApi.listAdminUsers] -// - [adminUserApi.patchAdminUser] -// - [adminUserApi.readAdminUser] -// - [alertConfigApi.getAlertConfig] -// - [alertConfigApi.getAlertSMSConfig] -// - [alertConfigApi.setAlertConfig] -// - [alertConfigApi.updateAlertSMSConfig] -// - [alertInhibitApi.createAlertInhibit] -// - [alertInhibitApi.deleteAlertInhibit] -// - [alertInhibitApi.getAlertInhibit] -// - [alertInhibitApi.listAlertInhibits] -// - [alertInhibitApi.patchAlertInhibit] -// - [alertMetricsApi.listAlertMetrics] -// - [alertObjectApi.listAlertObjects] -// - [alertObjectApi.setAlertObjectStatus] -// - [alertObjectApi.setAlertObjectsStatus] -// - [alertReceiverApi.createAlertReceiver] -// - [alertReceiverApi.deleteAlertReceiver] -// - [alertReceiverApi.getAlertReceiver] -// - [alertReceiverApi.listAlertReceivers] -// - [alertReceiverApi.patchAlertReceiver] -// - [alertRuleApi.createAlertRule] -// - [alertRuleApi.deleteAlertRule] -// - [alertRuleApi.getAlertRule] -// - [alertRuleApi.listAlertRules] -// - [alertRuleApi.updateAlertRule] -// - [alertSMTPConfigApi.getAlertSMTPConfig] -// - [alertSMTPConfigApi.updateAlertSMTPConfig] -// - [alertStrategyApi.createAlertStrategy] -// - [alertStrategyApi.deleteAlertStrategy] -// - [alertStrategyApi.listAlertStrategies] -// - [alertStrategyApi.patchAlertStrategy] -// - [alertStrategyApi.updateAlertStrategy] -// - [alertTemplateApi.createAlertTemplate] -// - [alertTemplateApi.deleteAlertTemplate] -// - [alertTemplateApi.getAlertTemplate] -// - [alertTemplateApi.listAlertTemplates] -// - [alertTemplateApi.patchAlertTemplate] -// - [analyzeApi.analyzeBackup] -// - [analyzeApi.analyzeClusterParam] -// - [analyzeApi.analyzeClusterRestore] -// - [analyzeApi.analyzeLogs] -// - [analyzeApi.analyzeOps] -// - [analyzeApi.analyzeParam] -// - [analyzeApi.analyzeService] -// - [analyzeApi.analyzeSlowLogs] -// - [analyzeApi.analyzeView] -// - [autohealingApi.getAutohealing] -// - [backupApi.createClusterBackup] -// - [backupApi.deleteBackup] -// - [backupApi.downloadBackup] -// - [backupApi.downloadMutipleBackups] -// - [backupApi.getBackup] -// - [backupApi.getBackupLog] -// - [backupApi.getBackupStats] -// - [backupApi.getClusterBackupPolicy] -// - [backupApi.listBackups] -// - [backupApi.patchBackupPolicy] -// - [backupApi.viewBackup] -// - [backupRepoApi.checkBackupRepo] -// - [backupRepoApi.createBackupRepo] -// - [backupRepoApi.deleteBackupRepo] -// - [backupRepoApi.getBackupRepo] -// - [backupRepoApi.listBackupRepos] -// - [backupRepoApi.listStorageProvidersArchive] -// - [backupRepoApi.updateBackupRepo] -// - [backupRepoApi.viewBackupRepo] -// - [classApi.batchClass] -// - [classApi.createClass] -// - [classApi.deleteClass] -// - [classApi.listClasses] -// - [classApi.patchClass] -// - [clusterApi.createCluster] -// - [clusterApi.deleteCluster] -// - [clusterApi.describeClusterHaHistory] -// - [clusterApi.getCluster] -// - [clusterApi.getClusterByID] -// - [clusterApi.getClusterInstanceLog] -// - [clusterApi.getClusterManifest] -// - [clusterApi.getInstacesMetrics] -// - [clusterApi.listCluster] -// - [clusterApi.listClusters] -// - [clusterApi.listEndpoints] -// - [clusterApi.listInstance] -// - [clusterApi.patchCluster] -// - [clusterAlertSwitchApi.getClusterAlertDisabled] -// - [clusterAlertSwitchApi.setClusterAlertDisabled] -// - [clusterLogApi.queryAuditLogs] -// - [clusterLogApi.queryErrorLogs] -// - [clusterLogApi.queryRunningLogs] -// - [clusterLogApi.querySlowLogs] -// - [databaseApi.createDatabase] -// - [databaseApi.deleteDatabase] -// - [databaseApi.listDatabases] -// - [dmsApi.DataExport] -// - [dmsApi.DataImport] -// - [dmsApi.GetObjectInfo] -// - [dmsApi.GetTaskList] -// - [dmsApi.GetTaskProgress] -// - [dmsApi.ListObjectNamesByType] -// - [dmsApi.ListObjectTypesInSchema] -// - [dmsApi.alterParameter] -// - [dmsApi.closeSessions] -// - [dmsApi.createDataSourceV2] -// - [dmsApi.deleteDataSourceV2] -// - [dmsApi.generateDDL] -// - [dmsApi.getDataSourceV2] -// - [dmsApi.getSchemaList] -// - [dmsApi.listDataSourceV2] -// - [dmsApi.listParameters] -// - [dmsApi.listQueryHistory] -// - [dmsApi.listSessions] -// - [dmsApi.query] -// - [dmsApi.showData] -// - [dmsApi.sqlExplain] -// - [dmsApi.tenantParameterHistory] -// - [dmsApi.testDataSourceV2] -// - [dmsApi.updateDataSourceV2] -// - [engineApi.engineAction] -// - [engineApi.engineActionInOrg] -// - [engineApi.getEngineByNameInEnv] -// - [engineApi.listEnginesInEnv] -// - [engineApi.listEnginesInOrg] -// - [engineLicenseApi.createEngineLicense] -// - [engineLicenseApi.deleteEngineLicense] -// - [engineLicenseApi.engineLicense] -// - [engineLicenseApi.listEngineLicenses] -// - [engineOptionApi.ListUpgradeableServiceVersion] -// - [engineOptionApi.createEngineOption] -// - [engineOptionApi.getEngineOption] -// - [engineOptionApi.listEngineOptionHistory] -// - [engineOptionApi.listEngineOptions] -// - [engineOptionApi.updateEngineOption] -// - [engineVersionApi.createEngineVersion] -// - [engineVersionApi.deleteEngineVersion] -// - [engineVersionApi.listEngineVersions] -// - [engineVersionApi.patchEngineVersion] -// - [environmentApi.addNodes] -// - [environmentApi.checkEnvironmentAddRecord] -// - [environmentApi.cordonEnvironmentNode] -// - [environmentApi.createEnvironment] -// - [environmentApi.createNodeGroup] -// - [environmentApi.createWorkflow] -// - [environmentApi.deleteEnvironment] -// - [environmentApi.deleteNodeGroup] -// - [environmentApi.getEnvironment] -// - [environmentApi.getEnvironmentBackupRepo] -// - [environmentApi.getEnvironmentBootstrapManifests] -// - [environmentApi.getEnvironmentKubeconfig] -// - [environmentApi.getEnvironmentMetricsMonitorStats] -// - [environmentApi.getEnvironmentNamespaceStats] -// - [environmentApi.getEnvironmentProvisioningProgress] -// - [environmentApi.getEnvironmentStatus] -// - [environmentApi.getEnvironmentStatusHistory] -// - [environmentApi.getLatestComponentVersion] -// - [environmentApi.getNode] -// - [environmentApi.getWorkflow] -// - [environmentApi.getWorkflowList] -// - [environmentApi.getWorkflowLog] -// - [environmentApi.listEnvNodeZone] -// - [environmentApi.listEnvironment] -// - [environmentApi.listEnvironmentObjectStorage] -// - [environmentApi.listKubernetesNode] -// - [environmentApi.listKubernetesStorageClass] -// - [environmentApi.listNodeGroup] -// - [environmentApi.listNodePod] -// - [environmentApi.listNodes] -// - [environmentApi.patchEnvironment] -// - [environmentApi.patchNodeGroup] -// - [environmentApi.preflightEnvironment] -// - [environmentApi.preflightRestoreEnvironment] -// - [environmentApi.restoreEnvironment] -// - [environmentApi.uncordonEnvironmentNode] -// - [eventApi.queryClusterEvents] -// - [faultApi.createClusterNetworkChaos] -// - [faultApi.createClusterPodChaos] -// - [faultApi.deleteFault] -// - [faultApi.getChaos] -// - [faultApi.listFault] -// - [featureApi.listFeature] -// - [featureApi.readFeature] -// - [imageRegistryApi.createImageRegistry] -// - [imageRegistryApi.deleteImageRegistry] -// - [imageRegistryApi.getImageRegistry] -// - [imageRegistryApi.listImageRegistries] -// - [imageRegistryApi.patchImageRegistry] -// - [inspectionApi.createAutoInspection] -// - [inspectionApi.createInspectionScript] -// - [inspectionApi.deleteInspectionScript] -// - [inspectionApi.listAutoInspection] -// - [inspectionApi.listInspectionScripts] -// - [inspectionApi.listInspections] -// - [inspectionApi.updateAutoInspection] -// - [inspectionApi.updateInspection] -// - [inspectionApi.updateInspectionScript] -// - [invitationApi.listInvitation] -// - [ipWhitelistApi.createIPWhitelist] -// - [ipWhitelistApi.listIPWhitelist] -// - [ipWhitelistApi.updateIPWhitelist] -// - [licenseApi.getLicense] -// - [licenseApi.updateLicense] -// - [llmApi.createLLM] -// - [llmApi.deleteLLM] -// - [llmApi.listLLM] -// - [llmApi.updateLLM] -// - [loadBalancerApi.checkLoadBalancer] -// - [loadBalancerApi.getLoadBalancer] -// - [loadBalancerApi.installLoadBalancer] -// - [loadBalancerApi.uninstallLoadBalancer] -// - [markClusterApi.markClusterRestoreCompleted] -// - [memberApi.addOrgMember] -// - [memberApi.deleteOrgMember] -// - [memberApi.listOrgMember] -// - [memberApi.patchOrgMember] -// - [memberApi.readOrgMember] -// - [metadbApi.getMetadbInstancesMetrics] -// - [metadbApi.getPostgresClusterInfo] -// - [metadbApi.listMetadbBackups] -// - [metadbApi.metadbBackup] -// - [metadbApi.metadbBackupConfig] -// - [metadbApi.metadbBackupGetConfig] -// - [metadbApi.metadbListInstances] -// - [metadbApi.metadbRestore] -// - [metadbApi.metadbVerticalScale] -// - [metadbApi.metadbVolumeExpand] -// - [metricsApi.getAggregateMetaData] -// - [metricsApi.getEnvironmentStats] -// - [metricsApi.queryClusterMetrics] -// - [monitorDataSinkApi.createMonitorDataSink] -// - [monitorDataSinkApi.deleteMonitorDataSink] -// - [monitorDataSinkApi.listMonitorDataSinks] -// - [monitorDataSinkApi.patchMonitorDataSink] -// - [oceanbaseApi.getTenant] -// - [oceanbaseApi.listTenants] -// - [opsrequestApi.cancelOps] -// - [opsrequestApi.clusterVolumeExpand] -// - [opsrequestApi.customOps] -// - [opsrequestApi.deleteOps] -// - [opsrequestApi.exposeCluster] -// - [opsrequestApi.horizontalScaleCluster] -// - [opsrequestApi.promoteCluster] -// - [opsrequestApi.rebuildInstance] -// - [opsrequestApi.reconfigureCluster] -// - [opsrequestApi.restartCluster] -// - [opsrequestApi.startCluster] -// - [opsrequestApi.stopCluster] -// - [opsrequestApi.updateClusterLicense] -// - [opsrequestApi.upgradeCluster] -// - [opsrequestApi.verticalScaleCluster] -// - [organizationApi.disableOrg] -// - [organizationApi.enableOrg] -// - [organizationApi.listOrganizations] -// - [organizationApi.patchOrg] -// - [organizationApi.readOrg] -// - [paramTplApi.createParamTpl] -// - [paramTplApi.createParamTplFromCluster] -// - [paramTplApi.deleteParamTpl] -// - [paramTplApi.getClusterParamTpls] -// - [paramTplApi.listParamTpls] -// - [paramTplApi.patchParamTpl] -// - [paramTplApi.readParamTpl] -// - [parameterApi.listConfigurations] -// - [parameterApi.listParameterSpecs] -// - [parameterApi.listParametersHistory] -// - [platformParameterApi.getPlatformParameter] -// - [platformParameterApi.listPlatformParameters] -// - [platformParameterApi.updatePlatformParameters] -// - [providerApi.createCloudProvider] -// - [providerApi.deleteCloudProvider] -// - [providerApi.getCloudProvider] -// - [providerApi.listCloudProviders] -// - [providerApi.updateCloudProvider] -// - [recycleBinClusterApi.deleteRecycleBinCluster] -// - [recycleBinClusterApi.getRecycleBinCluster] -// - [recycleBinClusterApi.listRecycleBinCluster] -// - [recycleBinClusterApi.listRecycleBinClusters] -// - [recycleBinClusterApi.restoreRecycleBinCluster] -// - [regionApi.createRegion] -// - [regionApi.deleteRegion] -// - [regionApi.getRegion] -// - [regionApi.listRegions] -// - [regionApi.updateRegion] -// - [regionGroupApi.createRegionGroup] -// - [regionGroupApi.deleteRegionGroup] -// - [regionGroupApi.listRegionGroups] -// - [regionGroupApi.updateRegionGroup] -// - [resourceStatsApi.getResourceStats] -// - [resourceStatsApi.listInstancesResourceStats] -// - [resourceStatsApi.listNodesResourceStats] -// - [restoreApi.GetRestoreLog] -// - [restoreApi.deleteRestoreObject] -// - [restoreApi.doRestore] -// - [restoreApi.getRestoreTimeRange] -// - [restoreApi.listClusterRestore] -// - [restoreApi.listRestores] -// - [restoreApi.restoreCluster] -// - [roleApi.createRole] -// - [roleApi.deleteRoleByName] -// - [roleApi.getRoleByName] -// - [roleApi.listPermissions] -// - [roleApi.listRolePermissions] -// - [roleApi.listRoles] -// - [roleApi.updateRoleByName] -// - [serviceVersionApi.ListServiceVersion] -// - [storageApi.checkStorage] -// - [storageApi.createStorage] -// - [storageApi.deleteStorage] -// - [storageApi.getStorage] -// - [storageApi.listStorageProviders] -// - [storageApi.listStorages] -// - [storageApi.updateStorage] -// - [storageClassApi.createStorageClass] -// - [storageClassApi.deleteStorageClass] -// - [storageClassApi.getStorageClass] -// - [storageClassApi.listStorageClassPvcs] -// - [storageClassApi.listStorageClasses] -// - [storageClassApi.listStorageProvisioners] -// - [storageClassApi.updateStorageClass] -// - [tagApi.createTag] -// - [tagApi.deleteTags] -// - [tagApi.getTags] -// - [tagApi.listOrgTags] -// - [tagApi.updateTag] -// - [tlsApi.getTLSCertificate] -// - [tlsApi.tlsSwitcher] -// - [userApi.createUserApikey] -// - [userApi.deleteApikey] -// - [userApi.patchAPIkey] -// - [userApi.readUserApikeys] -// - [viewApi.getTreeView] -// - [viewApi.getViewByCluster] -// - [vipPoolApi.createVIPPool] -// - [vipPoolApi.deleteVIPPool] -// - [vipPoolApi.listVIPPool] -// - [whitelistApi.deleteIPWhiteList] -// - [zoneApi.createZone] -// - [zoneApi.deleteZone] -// - [zoneApi.getZones] -// - [zoneApi.listZones] -// - [zoneApi.updateZone] -package admin +// - [accountApi.createAccount] +// - [accountApi.deleteAccount] +// - [accountApi.listAccounts] +// - [accountApi.updateAccount] +// - [accountApi.updateAccountPrivileges] +// - [adminUserApi.createAdminUser] +// - [adminUserApi.deleteAdminUser] +// - [adminUserApi.listAdminUsers] +// - [adminUserApi.patchAdminUser] +// - [adminUserApi.readAdminUser] +// - [alertConfigApi.getAlertConfig] +// - [alertConfigApi.getAlertSMSConfig] +// - [alertConfigApi.setAlertConfig] +// - [alertConfigApi.updateAlertSMSConfig] +// - [alertInhibitApi.createAlertInhibit] +// - [alertInhibitApi.deleteAlertInhibit] +// - [alertInhibitApi.getAlertInhibit] +// - [alertInhibitApi.listAlertInhibits] +// - [alertInhibitApi.patchAlertInhibit] +// - [alertMetricsApi.listAlertMetrics] +// - [alertObjectApi.listAlertObjects] +// - [alertObjectApi.setAlertObjectStatus] +// - [alertObjectApi.setAlertObjectsStatus] +// - [alertReceiverApi.createAlertReceiver] +// - [alertReceiverApi.deleteAlertReceiver] +// - [alertReceiverApi.getAlertReceiver] +// - [alertReceiverApi.listAlertReceivers] +// - [alertReceiverApi.patchAlertReceiver] +// - [alertRuleApi.createAlertRule] +// - [alertRuleApi.deleteAlertRule] +// - [alertRuleApi.getAlertRule] +// - [alertRuleApi.listAlertRules] +// - [alertRuleApi.updateAlertRule] +// - [alertSMTPConfigApi.getAlertSMTPConfig] +// - [alertSMTPConfigApi.updateAlertSMTPConfig] +// - [alertStrategyApi.createAlertStrategy] +// - [alertStrategyApi.deleteAlertStrategy] +// - [alertStrategyApi.listAlertStrategies] +// - [alertStrategyApi.patchAlertStrategy] +// - [alertStrategyApi.updateAlertStrategy] +// - [alertTemplateApi.createAlertTemplate] +// - [alertTemplateApi.deleteAlertTemplate] +// - [alertTemplateApi.getAlertTemplate] +// - [alertTemplateApi.listAlertTemplates] +// - [alertTemplateApi.patchAlertTemplate] +// - [analyzeApi.analyzeBackup] +// - [analyzeApi.analyzeClusterParam] +// - [analyzeApi.analyzeClusterRestore] +// - [analyzeApi.analyzeLogs] +// - [analyzeApi.analyzeOps] +// - [analyzeApi.analyzeParam] +// - [analyzeApi.analyzeService] +// - [analyzeApi.analyzeSlowLogs] +// - [analyzeApi.analyzeView] +// - [autohealingApi.getAutohealing] +// - [backupApi.createClusterBackup] +// - [backupApi.deleteBackup] +// - [backupApi.downloadBackup] +// - [backupApi.downloadMutipleBackups] +// - [backupApi.getBackup] +// - [backupApi.getBackupLog] +// - [backupApi.getBackupStats] +// - [backupApi.getClusterBackupPolicy] +// - [backupApi.listBackups] +// - [backupApi.patchBackupPolicy] +// - [backupApi.viewBackup] +// - [backupRepoApi.checkBackupRepo] +// - [backupRepoApi.createBackupRepo] +// - [backupRepoApi.deleteBackupRepo] +// - [backupRepoApi.getBackupRepo] +// - [backupRepoApi.listBackupRepos] +// - [backupRepoApi.listStorageProvidersArchive] +// - [backupRepoApi.updateBackupRepo] +// - [backupRepoApi.viewBackupRepo] +// - [classApi.batchClass] +// - [classApi.createClass] +// - [classApi.deleteClass] +// - [classApi.listClasses] +// - [classApi.patchClass] +// - [clusterApi.createCluster] +// - [clusterApi.deleteCluster] +// - [clusterApi.describeClusterHaHistory] +// - [clusterApi.getCluster] +// - [clusterApi.getClusterByID] +// - [clusterApi.getClusterInstanceLog] +// - [clusterApi.getClusterManifest] +// - [clusterApi.getInstacesMetrics] +// - [clusterApi.listCluster] +// - [clusterApi.listClusters] +// - [clusterApi.listEndpoints] +// - [clusterApi.listInstance] +// - [clusterApi.patchCluster] +// - [clusterAlertSwitchApi.getClusterAlertDisabled] +// - [clusterAlertSwitchApi.setClusterAlertDisabled] +// - [clusterLogApi.queryAuditLogs] +// - [clusterLogApi.queryErrorLogs] +// - [clusterLogApi.queryRunningLogs] +// - [clusterLogApi.querySlowLogs] +// - [databaseApi.createDatabase] +// - [databaseApi.deleteDatabase] +// - [databaseApi.listDatabases] +// - [dmsApi.DataExport] +// - [dmsApi.DataImport] +// - [dmsApi.GetObjectInfo] +// - [dmsApi.GetTaskList] +// - [dmsApi.GetTaskProgress] +// - [dmsApi.ListObjectNamesByType] +// - [dmsApi.ListObjectTypesInSchema] +// - [dmsApi.alterParameter] +// - [dmsApi.closeSessions] +// - [dmsApi.createDataSourceV2] +// - [dmsApi.deleteDataSourceV2] +// - [dmsApi.generateDDL] +// - [dmsApi.getDataSourceV2] +// - [dmsApi.getSchemaList] +// - [dmsApi.listDataSourceV2] +// - [dmsApi.listParameters] +// - [dmsApi.listQueryHistory] +// - [dmsApi.listSessions] +// - [dmsApi.query] +// - [dmsApi.showData] +// - [dmsApi.sqlExplain] +// - [dmsApi.tenantParameterHistory] +// - [dmsApi.testDataSourceV2] +// - [dmsApi.updateDataSourceV2] +// - [engineApi.engineAction] +// - [engineApi.engineActionInOrg] +// - [engineApi.getEngineByNameInEnv] +// - [engineApi.listEnginesInEnv] +// - [engineApi.listEnginesInOrg] +// - [engineLicenseApi.createEngineLicense] +// - [engineLicenseApi.deleteEngineLicense] +// - [engineLicenseApi.engineLicense] +// - [engineLicenseApi.listEngineLicenses] +// - [engineOptionApi.ListUpgradeableServiceVersion] +// - [engineOptionApi.createEngineOption] +// - [engineOptionApi.getEngineOption] +// - [engineOptionApi.listEngineOptionHistory] +// - [engineOptionApi.listEngineOptions] +// - [engineOptionApi.updateEngineOption] +// - [engineVersionApi.createEngineVersion] +// - [engineVersionApi.deleteEngineVersion] +// - [engineVersionApi.listEngineVersions] +// - [engineVersionApi.patchEngineVersion] +// - [environmentApi.addNodes] +// - [environmentApi.cordonEnvironmentNode] +// - [environmentApi.createEnvironment] +// - [environmentApi.createNodeGroup] +// - [environmentApi.createWorkflow] +// - [environmentApi.deleteEnvironment] +// - [environmentApi.deleteNodeGroup] +// - [environmentApi.filterEnvironment] +// - [environmentApi.getEnvironment] +// - [environmentApi.getEnvironmentBootstrapManifests] +// - [environmentApi.getEnvironmentKubeconfig] +// - [environmentApi.getEnvironmentNamespaceStats] +// - [environmentApi.getEnvironmentProvisioningProgress] +// - [environmentApi.getEnvironmentStatus] +// - [environmentApi.getLatestComponentVersion] +// - [environmentApi.getNode] +// - [environmentApi.getWorkflow] +// - [environmentApi.getWorkflowList] +// - [environmentApi.getWorkflowLog] +// - [environmentApi.listEnvNodeZone] +// - [environmentApi.listEnvironment] +// - [environmentApi.listKubernetesNode] +// - [environmentApi.listKubernetesStorageClass] +// - [environmentApi.listNodeGroup] +// - [environmentApi.listNodePod] +// - [environmentApi.listNodes] +// - [environmentApi.patchEnvironment] +// - [environmentApi.patchNodeGroup] +// - [environmentApi.preflightEnvironment] +// - [environmentApi.uncordonEnvironmentNode] +// - [eventApi.queryClusterEvents] +// - [faultApi.createClusterNetworkChaos] +// - [faultApi.createClusterPodChaos] +// - [faultApi.deleteFault] +// - [faultApi.getChaos] +// - [faultApi.listFault] +// - [featureApi.listFeature] +// - [featureApi.readFeature] +// - [imageRegistryApi.createImageRegistry] +// - [imageRegistryApi.deleteImageRegistry] +// - [imageRegistryApi.getImageRegistry] +// - [imageRegistryApi.listImageRegistries] +// - [imageRegistryApi.patchImageRegistry] +// - [inspectionApi.createAutoInspection] +// - [inspectionApi.createInspectionScript] +// - [inspectionApi.deleteInspectionScript] +// - [inspectionApi.listAutoInspection] +// - [inspectionApi.listInspectionScripts] +// - [inspectionApi.listInspections] +// - [inspectionApi.updateAutoInspection] +// - [inspectionApi.updateInspection] +// - [inspectionApi.updateInspectionScript] +// - [invitationApi.listInvitation] +// - [ipWhitelistApi.createIPWhitelist] +// - [ipWhitelistApi.listIPWhitelist] +// - [ipWhitelistApi.updateIPWhitelist] +// - [licenseApi.getLicense] +// - [licenseApi.updateLicense] +// - [llmApi.createLLM] +// - [llmApi.deleteLLM] +// - [llmApi.listLLM] +// - [llmApi.updateLLM] +// - [loadBalancerApi.checkLoadBalancer] +// - [loadBalancerApi.getLoadBalancer] +// - [loadBalancerApi.installLoadBalancer] +// - [loadBalancerApi.uninstallLoadBalancer] +// - [markClusterApi.markClusterRestoreCompleted] +// - [memberApi.addOrgMember] +// - [memberApi.deleteOrgMember] +// - [memberApi.listOrgMember] +// - [memberApi.patchOrgMember] +// - [memberApi.readOrgMember] +// - [metadbApi.getMetadbInstancesMetrics] +// - [metadbApi.getPostgresClusterInfo] +// - [metadbApi.listMetadbBackups] +// - [metadbApi.metadbBackup] +// - [metadbApi.metadbBackupConfig] +// - [metadbApi.metadbBackupGetConfig] +// - [metadbApi.metadbCheckRestore] +// - [metadbApi.metadbListInstances] +// - [metadbApi.metadbRestore] +// - [metadbApi.metadbVerticalScale] +// - [metadbApi.metadbVolumeExpand] +// - [metricsApi.getAggregateMetaData] +// - [metricsApi.getEnvironmentStats] +// - [metricsApi.queryClusterMetrics] +// - [monitorDataSinkApi.createMonitorDataSink] +// - [monitorDataSinkApi.deleteMonitorDataSink] +// - [monitorDataSinkApi.listMonitorDataSinks] +// - [monitorDataSinkApi.patchMonitorDataSink] +// - [oceanbaseApi.getTenant] +// - [oceanbaseApi.listTenants] +// - [opsrequestApi.cancelOps] +// - [opsrequestApi.clusterVolumeExpand] +// - [opsrequestApi.customOps] +// - [opsrequestApi.deleteOps] +// - [opsrequestApi.exposeCluster] +// - [opsrequestApi.horizontalScaleCluster] +// - [opsrequestApi.promoteCluster] +// - [opsrequestApi.rebuildInstance] +// - [opsrequestApi.reconfigureCluster] +// - [opsrequestApi.restartCluster] +// - [opsrequestApi.startCluster] +// - [opsrequestApi.stopCluster] +// - [opsrequestApi.updateClusterLicense] +// - [opsrequestApi.upgradeCluster] +// - [opsrequestApi.verticalScaleCluster] +// - [organizationApi.disableOrg] +// - [organizationApi.enableOrg] +// - [organizationApi.listOrganizations] +// - [organizationApi.patchOrg] +// - [organizationApi.readOrg] +// - [paramTplApi.createParamTpl] +// - [paramTplApi.createParamTplFromCluster] +// - [paramTplApi.deleteParamTpl] +// - [paramTplApi.getClusterParamTpls] +// - [paramTplApi.listParamTpls] +// - [paramTplApi.patchParamTpl] +// - [paramTplApi.readParamTpl] +// - [parameterApi.listConfigurations] +// - [parameterApi.listParameterSpecs] +// - [parameterApi.listParametersHistory] +// - [platformParameterApi.getPlatformParameter] +// - [platformParameterApi.listPlatformParameters] +// - [platformParameterApi.updatePlatformParameters] +// - [providerApi.createCloudProvider] +// - [providerApi.deleteCloudProvider] +// - [providerApi.getCloudProvider] +// - [providerApi.listCloudProviders] +// - [providerApi.updateCloudProvider] +// - [recycleBinClusterApi.deleteRecycleBinCluster] +// - [recycleBinClusterApi.getRecycleBinCluster] +// - [recycleBinClusterApi.listRecycleBinCluster] +// - [recycleBinClusterApi.listRecycleBinClusters] +// - [recycleBinClusterApi.restoreRecycleBinCluster] +// - [regionApi.createRegion] +// - [regionApi.deleteRegion] +// - [regionApi.getRegion] +// - [regionApi.listRegions] +// - [regionApi.updateRegion] +// - [regionGroupApi.createRegionGroup] +// - [regionGroupApi.deleteRegionGroup] +// - [regionGroupApi.listRegionGroups] +// - [regionGroupApi.updateRegionGroup] +// - [resourceStatsApi.getResourceStats] +// - [resourceStatsApi.listInstancesResourceStats] +// - [resourceStatsApi.listNodesResourceStats] +// - [restoreApi.GetRestoreLog] +// - [restoreApi.deleteRestoreObject] +// - [restoreApi.doRestore] +// - [restoreApi.getRestoreTimeRange] +// - [restoreApi.listClusterRestore] +// - [restoreApi.listRestores] +// - [restoreApi.restoreCluster] +// - [roleApi.createRole] +// - [roleApi.deleteRoleByName] +// - [roleApi.getRoleByName] +// - [roleApi.listPermissions] +// - [roleApi.listRolePermissions] +// - [roleApi.listRoles] +// - [roleApi.updateRoleByName] +// - [serviceVersionApi.ListServiceVersion] +// - [storageApi.checkStorage] +// - [storageApi.createStorage] +// - [storageApi.deleteStorage] +// - [storageApi.getStorage] +// - [storageApi.listStorageProviders] +// - [storageApi.listStorages] +// - [storageApi.updateStorage] +// - [storageClassApi.createStorageClass] +// - [storageClassApi.deleteStorageClass] +// - [storageClassApi.getStorageClass] +// - [storageClassApi.listStorageClassPvcs] +// - [storageClassApi.listStorageClasses] +// - [storageClassApi.listStorageProvisioners] +// - [storageClassApi.updateStorageClass] +// - [tagApi.createTag] +// - [tagApi.deleteTags] +// - [tagApi.getTags] +// - [tagApi.listOrgTags] +// - [tagApi.updateTag] +// - [tlsApi.getTLSCertificate] +// - [tlsApi.tlsSwitcher] +// - [userApi.createUserApikey] +// - [userApi.deleteApikey] +// - [userApi.patchAPIkey] +// - [userApi.readUserApikeys] +// - [viewApi.getTreeView] +// - [viewApi.getViewByCluster] +// - [vipPoolApi.createVIPPool] +// - [vipPoolApi.deleteVIPPool] +// - [vipPoolApi.listVIPPool] +// - [whitelistApi.deleteIPWhiteList] +// - [zoneApi.createZone] +// - [zoneApi.deleteZone] +// - [zoneApi.getZones] +// - [zoneApi.listZones] +// - [zoneApi.updateZone] +package admin \ No newline at end of file diff --git a/api/kbcloud/admin/model_account.go b/api/kbcloud/admin/model_account.go index d834c2c6..0b377769 100644 --- a/api/kbcloud/admin/model_account.go +++ b/api/kbcloud/admin/model_account.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Account Cluster account information + + +// Account Cluster account information type Account struct { // A list of privileges and their databases. PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` @@ -25,10 +30,11 @@ type Account struct { // Role name should be one of [SUPERUSER, BASICUSER]. Role AccountRoleType `json:"role"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAccount instantiates a new Account object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -49,7 +55,6 @@ func NewAccountWithDefaults() *Account { this.Role = role return &this } - // GetPrivilegesList returns the PrivilegesList field value if set, zero value otherwise. func (o *Account) GetPrivilegesList() []PrivilegeListItem { if o == nil || o.PrivilegesList == nil { @@ -78,6 +83,7 @@ func (o *Account) SetPrivilegesList(v []PrivilegeListItem) { o.PrivilegesList = v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *Account) GetComponent() string { if o == nil || o.Component == nil { @@ -106,6 +112,7 @@ func (o *Account) SetComponent(v string) { o.Component = &v } + // GetInstance returns the Instance field value if set, zero value otherwise. func (o *Account) GetInstance() string { if o == nil || o.Instance == nil { @@ -134,6 +141,7 @@ func (o *Account) SetInstance(v string) { o.Instance = &v } + // GetName returns the Name field value. func (o *Account) GetName() string { if o == nil { @@ -157,6 +165,7 @@ func (o *Account) SetName(v string) { o.Name = v } + // GetPassword returns the Password field value if set, zero value otherwise. func (o *Account) GetPassword() string { if o == nil || o.Password == nil { @@ -185,6 +194,7 @@ func (o *Account) SetPassword(v string) { o.Password = &v } + // GetRole returns the Role field value. func (o *Account) GetRole() AccountRoleType { if o == nil { @@ -208,6 +218,8 @@ func (o *Account) SetRole(v AccountRoleType) { o.Role = v } + + // MarshalJSON serializes the struct using spec logic. func (o Account) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -239,11 +251,11 @@ func (o Account) MarshalJSON() ([]byte, error) { func (o *Account) UnmarshalJSON(bytes []byte) (err error) { all := struct { PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` - Component *string `json:"component,omitempty"` - Instance *string `json:"instance,omitempty"` - Name *string `json:"name"` - Password *string `json:"password,omitempty"` - Role *AccountRoleType `json:"role"` + Component *string `json:"component,omitempty"` + Instance *string `json:"instance,omitempty"` + Name *string `json:"name"` + Password *string `json:"password,omitempty"` + Role *AccountRoleType `json:"role"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -256,7 +268,7 @@ func (o *Account) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"privilegesList", "component", "instance", "name", "password", "role"}) + common.DeleteKeys(additionalProperties, &[]string{ "privilegesList", "component", "instance", "name", "password", "role", }) } else { return err } diff --git a/api/kbcloud/admin/model_account_list_item.go b/api/kbcloud/admin/model_account_list_item.go index 1c7da04b..ac36e739 100644 --- a/api/kbcloud/admin/model_account_list_item.go +++ b/api/kbcloud/admin/model_account_list_item.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AccountListItem Cluster account information. + + +// AccountListItem Cluster account information. type AccountListItem struct { // Component type. Component *string `json:"component,omitempty"` @@ -23,10 +28,11 @@ type AccountListItem struct { // A list of privileges and their databases. PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAccountListItem instantiates a new AccountListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewAccountListItemWithDefaults() *AccountListItem { this := AccountListItem{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *AccountListItem) GetComponent() string { if o == nil || o.Component == nil { @@ -73,6 +78,7 @@ func (o *AccountListItem) SetComponent(v string) { o.Component = &v } + // GetName returns the Name field value. func (o *AccountListItem) GetName() string { if o == nil { @@ -96,6 +102,7 @@ func (o *AccountListItem) SetName(v string) { o.Name = v } + // GetPassword returns the Password field value if set, zero value otherwise. func (o *AccountListItem) GetPassword() string { if o == nil || o.Password == nil { @@ -124,6 +131,7 @@ func (o *AccountListItem) SetPassword(v string) { o.Password = &v } + // GetRole returns the Role field value if set, zero value otherwise. func (o *AccountListItem) GetRole() AccountListRoleType { if o == nil || o.Role == nil { @@ -152,6 +160,7 @@ func (o *AccountListItem) SetRole(v AccountListRoleType) { o.Role = &v } + // GetPrivilegesList returns the PrivilegesList field value if set, zero value otherwise. func (o *AccountListItem) GetPrivilegesList() []PrivilegeListItem { if o == nil || o.PrivilegesList == nil { @@ -180,6 +189,8 @@ func (o *AccountListItem) SetPrivilegesList(v []PrivilegeListItem) { o.PrivilegesList = v } + + // MarshalJSON serializes the struct using spec logic. func (o AccountListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -209,11 +220,11 @@ func (o AccountListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AccountListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - Name *string `json:"name"` - Password *string `json:"password,omitempty"` - Role *AccountListRoleType `json:"role,omitempty"` - PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` + Component *string `json:"component,omitempty"` + Name *string `json:"name"` + Password *string `json:"password,omitempty"` + Role *AccountListRoleType `json:"role,omitempty"` + PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -223,7 +234,7 @@ func (o *AccountListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "name", "password", "role", "privilegesList"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "name", "password", "role", "privilegesList", }) } else { return err } @@ -232,7 +243,7 @@ func (o *AccountListItem) UnmarshalJSON(bytes []byte) (err error) { o.Component = all.Component o.Name = *all.Name o.Password = all.Password - if all.Role != nil && !all.Role.IsValid() { + if all.Role != nil &&!all.Role.IsValid() { hasInvalidField = true } else { o.Role = all.Role diff --git a/api/kbcloud/admin/model_account_list_role_type.go b/api/kbcloud/admin/model_account_list_role_type.go index d694bbf3..45b0ced9 100644 --- a/api/kbcloud/admin/model_account_list_role_type.go +++ b/api/kbcloud/admin/model_account_list_role_type.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // AccountListRoleType The user role name, should be one of [ROOT, SUPERUSER, BASICUSER]. type AccountListRoleType string @@ -17,7 +22,7 @@ type AccountListRoleType string const ( AccountListRoleTypeSuperuser AccountListRoleType = "SUPERUSER" AccountListRoleTypeBasicuser AccountListRoleType = "BASICUSER" - AccountListRoleTypeRoot AccountListRoleType = "ROOT" + AccountListRoleTypeRoot AccountListRoleType = "ROOT" ) var allowedAccountListRoleTypeEnumValues = []AccountListRoleType{ diff --git a/api/kbcloud/admin/model_account_option.go b/api/kbcloud/admin/model_account_option.go index 9e684b92..24fe55f3 100644 --- a/api/kbcloud/admin/model_account_option.go +++ b/api/kbcloud/admin/model_account_option.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AccountOption struct { - Enabled bool `json:"enabled"` - Privileges []string `json:"privileges"` - AccountNamePattern string `json:"accountNamePattern"` - Create bool `json:"create"` - ResetPassword bool `json:"resetPassword"` - Delete bool `json:"delete"` + Enabled bool `json:"enabled"` + Privileges []string `json:"privileges"` + AccountNamePattern string `json:"accountNamePattern"` + Create bool `json:"create"` + ResetPassword bool `json:"resetPassword"` + Delete bool `json:"delete"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAccountOption instantiates a new AccountOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewAccountOptionWithDefaults() *AccountOption { this := AccountOption{} return &this } - // GetEnabled returns the Enabled field value. func (o *AccountOption) GetEnabled() bool { if o == nil { @@ -68,6 +73,7 @@ func (o *AccountOption) SetEnabled(v bool) { o.Enabled = v } + // GetPrivileges returns the Privileges field value. func (o *AccountOption) GetPrivileges() []string { if o == nil { @@ -91,6 +97,7 @@ func (o *AccountOption) SetPrivileges(v []string) { o.Privileges = v } + // GetAccountNamePattern returns the AccountNamePattern field value. func (o *AccountOption) GetAccountNamePattern() string { if o == nil { @@ -114,6 +121,7 @@ func (o *AccountOption) SetAccountNamePattern(v string) { o.AccountNamePattern = v } + // GetCreate returns the Create field value. func (o *AccountOption) GetCreate() bool { if o == nil { @@ -137,6 +145,7 @@ func (o *AccountOption) SetCreate(v bool) { o.Create = v } + // GetResetPassword returns the ResetPassword field value. func (o *AccountOption) GetResetPassword() bool { if o == nil { @@ -160,6 +169,7 @@ func (o *AccountOption) SetResetPassword(v bool) { o.ResetPassword = v } + // GetDelete returns the Delete field value. func (o *AccountOption) GetDelete() bool { if o == nil { @@ -183,6 +193,8 @@ func (o *AccountOption) SetDelete(v bool) { o.Delete = v } + + // MarshalJSON serializes the struct using spec logic. func (o AccountOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -205,12 +217,12 @@ func (o AccountOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AccountOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Enabled *bool `json:"enabled"` - Privileges *[]string `json:"privileges"` - AccountNamePattern *string `json:"accountNamePattern"` - Create *bool `json:"create"` - ResetPassword *bool `json:"resetPassword"` - Delete *bool `json:"delete"` + Enabled *bool `json:"enabled"` + Privileges *[]string `json:"privileges"` + AccountNamePattern *string `json:"accountNamePattern"` + Create *bool `json:"create"` + ResetPassword *bool `json:"resetPassword"` + Delete *bool `json:"delete"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -235,7 +247,7 @@ func (o *AccountOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled", "privileges", "accountNamePattern", "create", "resetPassword", "delete"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", "privileges", "accountNamePattern", "create", "resetPassword", "delete", }) } else { return err } diff --git a/api/kbcloud/admin/model_account_role_type.go b/api/kbcloud/admin/model_account_role_type.go index a779dbb4..1810e78a 100644 --- a/api/kbcloud/admin/model_account_role_type.go +++ b/api/kbcloud/admin/model_account_role_type.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // AccountRoleType Role name should be one of [SUPERUSER, BASICUSER]. type AccountRoleType string diff --git a/api/kbcloud/admin/model_admin_user.go b/api/kbcloud/admin/model_admin_user.go index 1f4ae11d..d79de688 100644 --- a/api/kbcloud/admin/model_admin_user.go +++ b/api/kbcloud/admin/model_admin_user.go @@ -2,32 +2,37 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AdminUser Admin user info + + +// AdminUser Admin user info type AdminUser struct { // The name of the user, is unique UserName string `json:"userName"` // The email for the user Email *string `json:"email,omitempty"` // The phonenumber for the user. - PhoneNumber *string `json:"phoneNumber,omitempty"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` + PhoneNumber *string `json:"phoneNumber,omitempty"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` // return true if the default admin user need to reset password IsDefaultPassword bool `json:"isDefaultPassword"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAdminUser instantiates a new AdminUser object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -48,7 +53,6 @@ func NewAdminUserWithDefaults() *AdminUser { this := AdminUser{} return &this } - // GetUserName returns the UserName field value. func (o *AdminUser) GetUserName() string { if o == nil { @@ -72,6 +76,7 @@ func (o *AdminUser) SetUserName(v string) { o.UserName = v } + // GetEmail returns the Email field value if set, zero value otherwise. func (o *AdminUser) GetEmail() string { if o == nil || o.Email == nil { @@ -100,6 +105,7 @@ func (o *AdminUser) SetEmail(v string) { o.Email = &v } + // GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. func (o *AdminUser) GetPhoneNumber() string { if o == nil || o.PhoneNumber == nil { @@ -128,6 +134,7 @@ func (o *AdminUser) SetPhoneNumber(v string) { o.PhoneNumber = &v } + // GetCreatedAt returns the CreatedAt field value. func (o *AdminUser) GetCreatedAt() time.Time { if o == nil { @@ -151,6 +158,7 @@ func (o *AdminUser) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *AdminUser) GetUpdatedAt() time.Time { if o == nil { @@ -174,6 +182,7 @@ func (o *AdminUser) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetIsDefaultPassword returns the IsDefaultPassword field value. func (o *AdminUser) GetIsDefaultPassword() bool { if o == nil { @@ -197,6 +206,8 @@ func (o *AdminUser) SetIsDefaultPassword(v bool) { o.IsDefaultPassword = v } + + // MarshalJSON serializes the struct using spec logic. func (o AdminUser) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -231,12 +242,12 @@ func (o AdminUser) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AdminUser) UnmarshalJSON(bytes []byte) (err error) { all := struct { - UserName *string `json:"userName"` - Email *string `json:"email,omitempty"` - PhoneNumber *string `json:"phoneNumber,omitempty"` - CreatedAt *time.Time `json:"createdAt"` - UpdatedAt *time.Time `json:"updatedAt"` - IsDefaultPassword *bool `json:"isDefaultPassword"` + UserName *string `json:"userName"` + Email *string `json:"email,omitempty"` + PhoneNumber *string `json:"phoneNumber,omitempty"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` + IsDefaultPassword *bool `json:"isDefaultPassword"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -255,7 +266,7 @@ func (o *AdminUser) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"userName", "email", "phoneNumber", "createdAt", "updatedAt", "isDefaultPassword"}) + common.DeleteKeys(additionalProperties, &[]string{ "userName", "email", "phoneNumber", "createdAt", "updatedAt", "isDefaultPassword", }) } else { return err } diff --git a/api/kbcloud/admin/model_admin_user_create.go b/api/kbcloud/admin/model_admin_user_create.go index b9621e51..cd8aa89e 100644 --- a/api/kbcloud/admin/model_admin_user_create.go +++ b/api/kbcloud/admin/model_admin_user_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AdminUserCreate Admin user create + + +// AdminUserCreate Admin user create type AdminUserCreate struct { // The name of the user, is unique UserName string `json:"userName"` @@ -21,10 +26,11 @@ type AdminUserCreate struct { // The phonenumber for the user. PhoneNumber *string `json:"phoneNumber,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAdminUserCreate instantiates a new AdminUserCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +49,6 @@ func NewAdminUserCreateWithDefaults() *AdminUserCreate { this := AdminUserCreate{} return &this } - // GetUserName returns the UserName field value. func (o *AdminUserCreate) GetUserName() string { if o == nil { @@ -67,6 +72,7 @@ func (o *AdminUserCreate) SetUserName(v string) { o.UserName = v } + // GetPassword returns the Password field value. func (o *AdminUserCreate) GetPassword() string { if o == nil { @@ -90,6 +96,7 @@ func (o *AdminUserCreate) SetPassword(v string) { o.Password = v } + // GetEmail returns the Email field value if set, zero value otherwise. func (o *AdminUserCreate) GetEmail() string { if o == nil || o.Email == nil { @@ -118,6 +125,7 @@ func (o *AdminUserCreate) SetEmail(v string) { o.Email = &v } + // GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. func (o *AdminUserCreate) GetPhoneNumber() string { if o == nil || o.PhoneNumber == nil { @@ -146,6 +154,8 @@ func (o *AdminUserCreate) SetPhoneNumber(v string) { o.PhoneNumber = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AdminUserCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -170,9 +180,9 @@ func (o AdminUserCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AdminUserCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - UserName *string `json:"userName"` - Password *string `json:"password"` - Email *string `json:"email,omitempty"` + UserName *string `json:"userName"` + Password *string `json:"password"` + Email *string `json:"email,omitempty"` PhoneNumber *string `json:"phoneNumber,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -186,7 +196,7 @@ func (o *AdminUserCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"userName", "password", "email", "phoneNumber"}) + common.DeleteKeys(additionalProperties, &[]string{ "userName", "password", "email", "phoneNumber", }) } else { return err } diff --git a/api/kbcloud/admin/model_admin_user_list.go b/api/kbcloud/admin/model_admin_user_list.go index 49233249..eac4dd4b 100644 --- a/api/kbcloud/admin/model_admin_user_list.go +++ b/api/kbcloud/admin/model_admin_user_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AdminUserList Admin user list + + +// AdminUserList Admin user list type AdminUserList struct { // Items is the list of admin user objects in the list Items []AdminUser `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAdminUserList instantiates a new AdminUserList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewAdminUserListWithDefaults() *AdminUserList { this := AdminUserList{} return &this } - // GetItems returns the Items field value. func (o *AdminUserList) GetItems() []AdminUser { if o == nil { @@ -60,6 +65,8 @@ func (o *AdminUserList) SetItems(v []AdminUser) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o AdminUserList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *AdminUserList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_admin_user_update.go b/api/kbcloud/admin/model_admin_user_update.go index 619fa946..1945a5d3 100644 --- a/api/kbcloud/admin/model_admin_user_update.go +++ b/api/kbcloud/admin/model_admin_user_update.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AdminUserUpdate Admin user update + + +// AdminUserUpdate Admin user update type AdminUserUpdate struct { // The name of the user, is unique UserName string `json:"userName"` @@ -19,10 +24,11 @@ type AdminUserUpdate struct { // The phonenumber for the user. PhoneNumber *string `json:"phoneNumber,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAdminUserUpdate instantiates a new AdminUserUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewAdminUserUpdateWithDefaults() *AdminUserUpdate { this := AdminUserUpdate{} return &this } - // GetUserName returns the UserName field value. func (o *AdminUserUpdate) GetUserName() string { if o == nil { @@ -64,6 +69,7 @@ func (o *AdminUserUpdate) SetUserName(v string) { o.UserName = v } + // GetEmail returns the Email field value if set, zero value otherwise. func (o *AdminUserUpdate) GetEmail() string { if o == nil || o.Email == nil { @@ -92,6 +98,7 @@ func (o *AdminUserUpdate) SetEmail(v string) { o.Email = &v } + // GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. func (o *AdminUserUpdate) GetPhoneNumber() string { if o == nil || o.PhoneNumber == nil { @@ -120,6 +127,8 @@ func (o *AdminUserUpdate) SetPhoneNumber(v string) { o.PhoneNumber = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AdminUserUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o AdminUserUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AdminUserUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - UserName *string `json:"userName"` - Email *string `json:"email,omitempty"` + UserName *string `json:"userName"` + Email *string `json:"email,omitempty"` PhoneNumber *string `json:"phoneNumber,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *AdminUserUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"userName", "email", "phoneNumber"}) + common.DeleteKeys(additionalProperties, &[]string{ "userName", "email", "phoneNumber", }) } else { return err } diff --git a/api/kbcloud/admin/model_aggregate_meta_data.go b/api/kbcloud/admin/model_aggregate_meta_data.go index 965c3e5a..4a0f4508 100644 --- a/api/kbcloud/admin/model_aggregate_meta_data.go +++ b/api/kbcloud/admin/model_aggregate_meta_data.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AggregateMetaData A series of data points for meta data, including a count and a timestamp. + + +// AggregateMetaData A series of data points for meta data, including a count and a timestamp. type AggregateMetaData struct { // The total count of the metaData items. Total int32 `json:"total"` // The list of series items aggregated in the time range. Items []SeriesItem `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAggregateMetaData instantiates a new AggregateMetaData object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewAggregateMetaDataWithDefaults() *AggregateMetaData { this := AggregateMetaData{} return &this } - // GetTotal returns the Total field value. func (o *AggregateMetaData) GetTotal() int32 { if o == nil { @@ -63,6 +68,7 @@ func (o *AggregateMetaData) SetTotal(v int32) { o.Total = v } + // GetItems returns the Items field value. func (o *AggregateMetaData) GetItems() []SeriesItem { if o == nil { @@ -86,6 +92,8 @@ func (o *AggregateMetaData) SetItems(v []SeriesItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o AggregateMetaData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,7 +112,7 @@ func (o AggregateMetaData) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AggregateMetaData) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Total *int32 `json:"total"` + Total *int32 `json:"total"` Items *[]SeriesItem `json:"items"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,7 +126,7 @@ func (o *AggregateMetaData) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"total", "items"}) + common.DeleteKeys(additionalProperties, &[]string{ "total", "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_aggregate_meta_data_type.go b/api/kbcloud/admin/model_aggregate_meta_data_type.go index 22841f8d..7864dae4 100644 --- a/api/kbcloud/admin/model_aggregate_meta_data_type.go +++ b/api/kbcloud/admin/model_aggregate_meta_data_type.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // AggregateMetaDataType The type of the aggregate meta data. type AggregateMetaDataType string // List of AggregateMetaDataType. const ( AggregateMetaDataTypeOrganization AggregateMetaDataType = "organization" - AggregateMetaDataTypeCluster AggregateMetaDataType = "cluster" - AggregateMetaDataTypeUser AggregateMetaDataType = "user" - AggregateMetaDataTypeEnvironment AggregateMetaDataType = "environment" + AggregateMetaDataTypeCluster AggregateMetaDataType = "cluster" + AggregateMetaDataTypeUser AggregateMetaDataType = "user" + AggregateMetaDataTypeEnvironment AggregateMetaDataType = "environment" ) var allowedAggregateMetaDataTypeEnumValues = []AggregateMetaDataType{ diff --git a/api/kbcloud/admin/model_alert_cluster.go b/api/kbcloud/admin/model_alert_cluster.go index bdf119ea..7b921ed1 100644 --- a/api/kbcloud/admin/model_alert_cluster.go +++ b/api/kbcloud/admin/model_alert_cluster.go @@ -2,21 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertCluster struct { Disabled bool `json:"disabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertCluster instantiates a new AlertCluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +40,6 @@ func NewAlertClusterWithDefaults() *AlertCluster { this := AlertCluster{} return &this } - // GetDisabled returns the Disabled field value. func (o *AlertCluster) GetDisabled() bool { if o == nil { @@ -58,6 +63,8 @@ func (o *AlertCluster) SetDisabled(v bool) { o.Disabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +92,7 @@ func (o *AlertCluster) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"disabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "disabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_config.go b/api/kbcloud/admin/model_alert_config.go index 7deba0a0..1f38be37 100644 --- a/api/kbcloud/admin/model_alert_config.go +++ b/api/kbcloud/admin/model_alert_config.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertConfig struct { // Time zone offset in seconds, e.g. offset of UTC+08:00 is +8 * 60 * 60 TimeZoneOffset int32 `json:"timeZoneOffset"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertConfig instantiates a new AlertConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewAlertConfigWithDefaults() *AlertConfig { this := AlertConfig{} return &this } - // GetTimeZoneOffset returns the TimeZoneOffset field value. func (o *AlertConfig) GetTimeZoneOffset() int32 { if o == nil { @@ -59,6 +64,8 @@ func (o *AlertConfig) SetTimeZoneOffset(v int32) { o.TimeZoneOffset = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *AlertConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"timeZoneOffset"}) + common.DeleteKeys(additionalProperties, &[]string{ "timeZoneOffset", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_inhibit.go b/api/kbcloud/admin/model_alert_inhibit.go index 2374d1e5..2a9af1a7 100644 --- a/api/kbcloud/admin/model_alert_inhibit.go +++ b/api/kbcloud/admin/model_alert_inhibit.go @@ -2,24 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// AlertInhibit Alert object information + +// AlertInhibit Alert object information type AlertInhibit struct { - Id *int32 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + OrgName *string `json:"orgName,omitempty"` SourceMatch map[string][]string `json:"sourceMatch,omitempty"` TargetMatch map[string][]string `json:"targetMatch,omitempty"` - Equal []string `json:"equal,omitempty"` + Equal []string `json:"equal,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertInhibit instantiates a new AlertInhibit object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +46,6 @@ func NewAlertInhibitWithDefaults() *AlertInhibit { this := AlertInhibit{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *AlertInhibit) GetId() int32 { if o == nil || o.Id == nil { @@ -65,6 +74,7 @@ func (o *AlertInhibit) SetId(v int32) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *AlertInhibit) GetName() string { if o == nil || o.Name == nil { @@ -93,6 +103,7 @@ func (o *AlertInhibit) SetName(v string) { o.Name = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertInhibit) GetDescription() string { if o == nil || o.Description == nil { @@ -121,6 +132,7 @@ func (o *AlertInhibit) SetDescription(v string) { o.Description = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertInhibit) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -149,6 +161,7 @@ func (o *AlertInhibit) SetOrgName(v string) { o.OrgName = &v } + // GetSourceMatch returns the SourceMatch field value if set, zero value otherwise. func (o *AlertInhibit) GetSourceMatch() map[string][]string { if o == nil || o.SourceMatch == nil { @@ -177,6 +190,7 @@ func (o *AlertInhibit) SetSourceMatch(v map[string][]string) { o.SourceMatch = v } + // GetTargetMatch returns the TargetMatch field value if set, zero value otherwise. func (o *AlertInhibit) GetTargetMatch() map[string][]string { if o == nil || o.TargetMatch == nil { @@ -205,6 +219,7 @@ func (o *AlertInhibit) SetTargetMatch(v map[string][]string) { o.TargetMatch = v } + // GetEqual returns the Equal field value if set, zero value otherwise. func (o *AlertInhibit) GetEqual() []string { if o == nil || o.Equal == nil { @@ -233,6 +248,8 @@ func (o *AlertInhibit) SetEqual(v []string) { o.Equal = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertInhibit) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -270,20 +287,20 @@ func (o AlertInhibit) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertInhibit) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + OrgName *string `json:"orgName,omitempty"` SourceMatch map[string][]string `json:"sourceMatch,omitempty"` TargetMatch map[string][]string `json:"targetMatch,omitempty"` - Equal []string `json:"equal,omitempty"` + Equal []string `json:"equal,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "description", "orgName", "sourceMatch", "targetMatch", "equal"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "description", "orgName", "sourceMatch", "targetMatch", "equal", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_inhibit_list.go b/api/kbcloud/admin/model_alert_inhibit_list.go index 4b1a6020..13bafe18 100644 --- a/api/kbcloud/admin/model_alert_inhibit_list.go +++ b/api/kbcloud/admin/model_alert_inhibit_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertInhibitList AlertInhibitList is a list of alert inhibit + + +// AlertInhibitList AlertInhibitList is a list of alert inhibit type AlertInhibitList struct { // Items is the list of alert inhibits in the list Items []AlertInhibit `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertInhibitList instantiates a new AlertInhibitList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertInhibitListWithDefaults() *AlertInhibitList { this := AlertInhibitList{} return &this } - // GetItems returns the Items field value. func (o *AlertInhibitList) GetItems() []AlertInhibit { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertInhibitList) SetItems(v []AlertInhibit) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertInhibitList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertInhibitList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertInhibitList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertInhibitList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertInhibitList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertInhibit `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertInhibit `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertInhibitList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_alert_metric.go b/api/kbcloud/admin/model_alert_metric.go index 0e4997af..b32f48f5 100644 --- a/api/kbcloud/admin/model_alert_metric.go +++ b/api/kbcloud/admin/model_alert_metric.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertMetric Alert metric information + + +// AlertMetric Alert metric information type AlertMetric struct { - Key string `json:"key"` - Threshold int32 `json:"threshold"` - Notation string `json:"notation"` - Category *string `json:"category,omitempty"` + Key string `json:"key"` + Threshold int32 `json:"threshold"` + Notation string `json:"notation"` + Category *string `json:"category,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertMetric instantiates a new AlertMetric object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewAlertMetricWithDefaults() *AlertMetric { this := AlertMetric{} return &this } - // GetKey returns the Key field value. func (o *AlertMetric) GetKey() string { if o == nil { @@ -64,6 +69,7 @@ func (o *AlertMetric) SetKey(v string) { o.Key = v } + // GetThreshold returns the Threshold field value. func (o *AlertMetric) GetThreshold() int32 { if o == nil { @@ -87,6 +93,7 @@ func (o *AlertMetric) SetThreshold(v int32) { o.Threshold = v } + // GetNotation returns the Notation field value. func (o *AlertMetric) GetNotation() string { if o == nil { @@ -110,6 +117,7 @@ func (o *AlertMetric) SetNotation(v string) { o.Notation = v } + // GetCategory returns the Category field value if set, zero value otherwise. func (o *AlertMetric) GetCategory() string { if o == nil || o.Category == nil { @@ -138,6 +146,8 @@ func (o *AlertMetric) SetCategory(v string) { o.Category = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertMetric) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -160,10 +170,10 @@ func (o AlertMetric) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertMetric) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Key *string `json:"key"` - Threshold *int32 `json:"threshold"` - Notation *string `json:"notation"` - Category *string `json:"category,omitempty"` + Key *string `json:"key"` + Threshold *int32 `json:"threshold"` + Notation *string `json:"notation"` + Category *string `json:"category,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -179,7 +189,7 @@ func (o *AlertMetric) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"key", "threshold", "notation", "category"}) + common.DeleteKeys(additionalProperties, &[]string{ "key", "threshold", "notation", "category", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_metric_list.go b/api/kbcloud/admin/model_alert_metric_list.go index 6d325d39..b519c7d3 100644 --- a/api/kbcloud/admin/model_alert_metric_list.go +++ b/api/kbcloud/admin/model_alert_metric_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertMetricList AlertMetricList is a list of alert metric + + +// AlertMetricList AlertMetricList is a list of alert metric type AlertMetricList struct { // Items is the list of alert metric objects in the list Items []AlertMetric `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertMetricList instantiates a new AlertMetricList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertMetricListWithDefaults() *AlertMetricList { this := AlertMetricList{} return &this } - // GetItems returns the Items field value. func (o *AlertMetricList) GetItems() []AlertMetric { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertMetricList) SetItems(v []AlertMetric) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertMetricList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertMetricList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertMetricList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertMetricList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertMetricList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertMetric `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertMetric `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertMetricList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_alert_object.go b/api/kbcloud/admin/model_alert_object.go index bb89970d..0d5d9875 100644 --- a/api/kbcloud/admin/model_alert_object.go +++ b/api/kbcloud/admin/model_alert_object.go @@ -2,37 +2,43 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// AlertObject Alert object information + + +// AlertObject Alert object information type AlertObject struct { - Id *int32 `json:"id,omitempty"` - AlertName *string `json:"alertName,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Expr *string `json:"expr,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - Engine *string `json:"engine,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Pod *string `json:"pod,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Description *string `json:"description,omitempty"` - Fingerprint *string `json:"fingerprint,omitempty"` - StartsAt *time.Time `json:"startsAt,omitempty"` - EndsAt *time.Time `json:"endsAt,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - Count *int32 `json:"count,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + AlertName *string `json:"alertName,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Expr *string `json:"expr,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + Engine *string `json:"engine,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Pod *string `json:"pod,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + Description *string `json:"description,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + StartsAt *time.Time `json:"startsAt,omitempty"` + EndsAt *time.Time `json:"endsAt,omitempty"` + Status *AlertStatus `json:"status,omitempty"` + Count *int32 `json:"count,omitempty"` + OrgName *string `json:"orgName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertObject instantiates a new AlertObject object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -49,7 +55,6 @@ func NewAlertObjectWithDefaults() *AlertObject { this := AlertObject{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *AlertObject) GetId() int32 { if o == nil || o.Id == nil { @@ -78,6 +83,7 @@ func (o *AlertObject) SetId(v int32) { o.Id = &v } + // GetAlertName returns the AlertName field value if set, zero value otherwise. func (o *AlertObject) GetAlertName() string { if o == nil || o.AlertName == nil { @@ -106,6 +112,7 @@ func (o *AlertObject) SetAlertName(v string) { o.AlertName = &v } + // GetGroupName returns the GroupName field value if set, zero value otherwise. func (o *AlertObject) GetGroupName() string { if o == nil || o.GroupName == nil { @@ -134,6 +141,7 @@ func (o *AlertObject) SetGroupName(v string) { o.GroupName = &v } + // GetExpr returns the Expr field value if set, zero value otherwise. func (o *AlertObject) GetExpr() string { if o == nil || o.Expr == nil { @@ -162,6 +170,7 @@ func (o *AlertObject) SetExpr(v string) { o.Expr = &v } + // GetClusterName returns the ClusterName field value if set, zero value otherwise. func (o *AlertObject) GetClusterName() string { if o == nil || o.ClusterName == nil { @@ -190,6 +199,7 @@ func (o *AlertObject) SetClusterName(v string) { o.ClusterName = &v } + // GetEngine returns the Engine field value if set, zero value otherwise. func (o *AlertObject) GetEngine() string { if o == nil || o.Engine == nil { @@ -218,6 +228,7 @@ func (o *AlertObject) SetEngine(v string) { o.Engine = &v } + // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *AlertObject) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -246,6 +257,7 @@ func (o *AlertObject) SetNamespace(v string) { o.Namespace = &v } + // GetPod returns the Pod field value if set, zero value otherwise. func (o *AlertObject) GetPod() string { if o == nil || o.Pod == nil { @@ -274,6 +286,7 @@ func (o *AlertObject) SetPod(v string) { o.Pod = &v } + // GetSeverity returns the Severity field value if set, zero value otherwise. func (o *AlertObject) GetSeverity() AlertSeverity { if o == nil || o.Severity == nil { @@ -302,6 +315,7 @@ func (o *AlertObject) SetSeverity(v AlertSeverity) { o.Severity = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertObject) GetDescription() string { if o == nil || o.Description == nil { @@ -330,6 +344,7 @@ func (o *AlertObject) SetDescription(v string) { o.Description = &v } + // GetFingerprint returns the Fingerprint field value if set, zero value otherwise. func (o *AlertObject) GetFingerprint() string { if o == nil || o.Fingerprint == nil { @@ -358,6 +373,7 @@ func (o *AlertObject) SetFingerprint(v string) { o.Fingerprint = &v } + // GetStartsAt returns the StartsAt field value if set, zero value otherwise. func (o *AlertObject) GetStartsAt() time.Time { if o == nil || o.StartsAt == nil { @@ -386,6 +402,7 @@ func (o *AlertObject) SetStartsAt(v time.Time) { o.StartsAt = &v } + // GetEndsAt returns the EndsAt field value if set, zero value otherwise. func (o *AlertObject) GetEndsAt() time.Time { if o == nil || o.EndsAt == nil { @@ -414,6 +431,7 @@ func (o *AlertObject) SetEndsAt(v time.Time) { o.EndsAt = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *AlertObject) GetStatus() AlertStatus { if o == nil || o.Status == nil { @@ -442,6 +460,7 @@ func (o *AlertObject) SetStatus(v AlertStatus) { o.Status = &v } + // GetCount returns the Count field value if set, zero value otherwise. func (o *AlertObject) GetCount() int32 { if o == nil || o.Count == nil { @@ -470,6 +489,7 @@ func (o *AlertObject) SetCount(v int32) { o.Count = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertObject) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -498,6 +518,8 @@ func (o *AlertObject) SetOrgName(v string) { o.OrgName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertObject) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -570,29 +592,29 @@ func (o AlertObject) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertObject) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - AlertName *string `json:"alertName,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Expr *string `json:"expr,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - Engine *string `json:"engine,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Pod *string `json:"pod,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Description *string `json:"description,omitempty"` - Fingerprint *string `json:"fingerprint,omitempty"` - StartsAt *time.Time `json:"startsAt,omitempty"` - EndsAt *time.Time `json:"endsAt,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - Count *int32 `json:"count,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + AlertName *string `json:"alertName,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Expr *string `json:"expr,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + Engine *string `json:"engine,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Pod *string `json:"pod,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + Description *string `json:"description,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + StartsAt *time.Time `json:"startsAt,omitempty"` + EndsAt *time.Time `json:"endsAt,omitempty"` + Status *AlertStatus `json:"status,omitempty"` + Count *int32 `json:"count,omitempty"` + OrgName *string `json:"orgName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "alertName", "groupName", "expr", "clusterName", "engine", "namespace", "pod", "severity", "description", "fingerprint", "startsAt", "endsAt", "status", "count", "orgName"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "alertName", "groupName", "expr", "clusterName", "engine", "namespace", "pod", "severity", "description", "fingerprint", "startsAt", "endsAt", "status", "count", "orgName", }) } else { return err } @@ -606,7 +628,7 @@ func (o *AlertObject) UnmarshalJSON(bytes []byte) (err error) { o.Engine = all.Engine o.Namespace = all.Namespace o.Pod = all.Pod - if all.Severity != nil && !all.Severity.IsValid() { + if all.Severity != nil &&!all.Severity.IsValid() { hasInvalidField = true } else { o.Severity = all.Severity @@ -615,7 +637,7 @@ func (o *AlertObject) UnmarshalJSON(bytes []byte) (err error) { o.Fingerprint = all.Fingerprint o.StartsAt = all.StartsAt o.EndsAt = all.EndsAt - if all.Status != nil && !all.Status.IsValid() { + if all.Status != nil &&!all.Status.IsValid() { hasInvalidField = true } else { o.Status = all.Status diff --git a/api/kbcloud/admin/model_alert_object_list.go b/api/kbcloud/admin/model_alert_object_list.go index 7f5d5bfd..582863b6 100644 --- a/api/kbcloud/admin/model_alert_object_list.go +++ b/api/kbcloud/admin/model_alert_object_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertObjectList AlertObjectList is a list of alert object + + +// AlertObjectList AlertObjectList is a list of alert object type AlertObjectList struct { // Items is the list of alert objects in the list Items []AlertObject `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertObjectList instantiates a new AlertObjectList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertObjectListWithDefaults() *AlertObjectList { this := AlertObjectList{} return &this } - // GetItems returns the Items field value. func (o *AlertObjectList) GetItems() []AlertObject { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertObjectList) SetItems(v []AlertObject) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertObjectList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertObjectList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertObjectList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertObjectList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertObjectList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertObject `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertObject `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertObjectList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_alert_receiver.go b/api/kbcloud/admin/model_alert_receiver.go index e66c3fba..8cbcca3b 100644 --- a/api/kbcloud/admin/model_alert_receiver.go +++ b/api/kbcloud/admin/model_alert_receiver.go @@ -2,30 +2,36 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// AlertReceiver Alert receiver information + + +// AlertReceiver Alert receiver information type AlertReceiver struct { - CreatedAt *time.Time `json:"createdAt,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Category *AlertReceiverCategory `json:"category,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Category *AlertReceiverCategory `json:"category,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` UserGroup *AlertReceiverUserGroup `json:"userGroup,omitempty"` // Webhook config of alert receiver WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` - OrgName *string `json:"orgName,omitempty"` + OrgName *string `json:"orgName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertReceiver instantiates a new AlertReceiver object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewAlertReceiverWithDefaults() *AlertReceiver { this := AlertReceiver{} return &this } - // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AlertReceiver) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -71,6 +76,7 @@ func (o *AlertReceiver) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *AlertReceiver) GetId() string { if o == nil || o.Id == nil { @@ -99,6 +105,7 @@ func (o *AlertReceiver) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *AlertReceiver) GetName() string { if o == nil || o.Name == nil { @@ -127,6 +134,7 @@ func (o *AlertReceiver) SetName(v string) { o.Name = &v } + // GetCategory returns the Category field value if set, zero value otherwise. func (o *AlertReceiver) GetCategory() AlertReceiverCategory { if o == nil || o.Category == nil { @@ -155,6 +163,7 @@ func (o *AlertReceiver) SetCategory(v AlertReceiverCategory) { o.Category = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AlertReceiver) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -183,6 +192,7 @@ func (o *AlertReceiver) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetUserGroup returns the UserGroup field value if set, zero value otherwise. func (o *AlertReceiver) GetUserGroup() AlertReceiverUserGroup { if o == nil || o.UserGroup == nil { @@ -211,6 +221,7 @@ func (o *AlertReceiver) SetUserGroup(v AlertReceiverUserGroup) { o.UserGroup = &v } + // GetWebhookConfig returns the WebhookConfig field value if set, zero value otherwise. func (o *AlertReceiver) GetWebhookConfig() WebhookConfig { if o == nil || o.WebhookConfig == nil { @@ -239,6 +250,7 @@ func (o *AlertReceiver) SetWebhookConfig(v WebhookConfig) { o.WebhookConfig = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertReceiver) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -267,6 +279,8 @@ func (o *AlertReceiver) SetOrgName(v string) { o.OrgName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertReceiver) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -315,21 +329,21 @@ func (o AlertReceiver) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertReceiver) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CreatedAt *time.Time `json:"createdAt,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Category *AlertReceiverCategory `json:"category,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - UserGroup *AlertReceiverUserGroup `json:"userGroup,omitempty"` - WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` - OrgName *string `json:"orgName,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Category *AlertReceiverCategory `json:"category,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UserGroup *AlertReceiverUserGroup `json:"userGroup,omitempty"` + WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` + OrgName *string `json:"orgName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"createdAt", "id", "name", "category", "updatedAt", "userGroup", "webhookConfig", "orgName"}) + common.DeleteKeys(additionalProperties, &[]string{ "createdAt", "id", "name", "category", "updatedAt", "userGroup", "webhookConfig", "orgName", }) } else { return err } @@ -338,17 +352,17 @@ func (o *AlertReceiver) UnmarshalJSON(bytes []byte) (err error) { o.CreatedAt = all.CreatedAt o.Id = all.Id o.Name = all.Name - if all.Category != nil && !all.Category.IsValid() { + if all.Category != nil &&!all.Category.IsValid() { hasInvalidField = true } else { o.Category = all.Category } o.UpdatedAt = all.UpdatedAt - if all.UserGroup != nil && all.UserGroup.UnparsedObject != nil && o.UnparsedObject == nil { + if all.UserGroup != nil && all.UserGroup.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.UserGroup = all.UserGroup - if all.WebhookConfig != nil && all.WebhookConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.WebhookConfig != nil && all.WebhookConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.WebhookConfig = all.WebhookConfig diff --git a/api/kbcloud/admin/model_alert_receiver_category.go b/api/kbcloud/admin/model_alert_receiver_category.go index 33ca19be..5bc805f6 100644 --- a/api/kbcloud/admin/model_alert_receiver_category.go +++ b/api/kbcloud/admin/model_alert_receiver_category.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertReceiverCategory string // List of AlertReceiverCategory. const ( - AlertReceiverCategoryFeishu AlertReceiverCategory = "feishu" - AlertReceiverCategoryWechat AlertReceiverCategory = "wechat" - AlertReceiverCategoryDingtalk AlertReceiverCategory = "dingtalk" + AlertReceiverCategoryFeishu AlertReceiverCategory = "feishu" + AlertReceiverCategoryWechat AlertReceiverCategory = "wechat" + AlertReceiverCategoryDingtalk AlertReceiverCategory = "dingtalk" AlertReceiverCategoryReceiverGroup AlertReceiverCategory = "receiver-group" - AlertReceiverCategoryWebhook AlertReceiverCategory = "webhook" + AlertReceiverCategoryWebhook AlertReceiverCategory = "webhook" ) var allowedAlertReceiverCategoryEnumValues = []AlertReceiverCategory{ diff --git a/api/kbcloud/admin/model_alert_receiver_list.go b/api/kbcloud/admin/model_alert_receiver_list.go index e62b50bd..522ab1d0 100644 --- a/api/kbcloud/admin/model_alert_receiver_list.go +++ b/api/kbcloud/admin/model_alert_receiver_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertReceiverList AlertReceiverList is a list of alert receivers + + +// AlertReceiverList AlertReceiverList is a list of alert receivers type AlertReceiverList struct { // Items is the list of alert receiver objects in the list Items []AlertReceiver `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertReceiverList instantiates a new AlertReceiverList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertReceiverListWithDefaults() *AlertReceiverList { this := AlertReceiverList{} return &this } - // GetItems returns the Items field value. func (o *AlertReceiverList) GetItems() []AlertReceiver { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertReceiverList) SetItems(v []AlertReceiver) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertReceiverList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertReceiverList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertReceiverList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertReceiverList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertReceiverList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertReceiver `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertReceiver `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertReceiverList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_alert_receiver_user_group.go b/api/kbcloud/admin/model_alert_receiver_user_group.go index 10382f63..72a2a3b3 100644 --- a/api/kbcloud/admin/model_alert_receiver_user_group.go +++ b/api/kbcloud/admin/model_alert_receiver_user_group.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AlertReceiverUserGroup struct { - EmailEnabled *bool `json:"emailEnabled,omitempty"` - Ids []string `json:"ids,omitempty"` - SmsEnabled *bool `json:"smsEnabled,omitempty"` + EmailEnabled *bool `json:"emailEnabled,omitempty"` + Ids []string `json:"ids,omitempty"` + SmsEnabled *bool `json:"smsEnabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertReceiverUserGroup instantiates a new AlertReceiverUserGroup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewAlertReceiverUserGroupWithDefaults() *AlertReceiverUserGroup { this := AlertReceiverUserGroup{} return &this } - // GetEmailEnabled returns the EmailEnabled field value if set, zero value otherwise. func (o *AlertReceiverUserGroup) GetEmailEnabled() bool { if o == nil || o.EmailEnabled == nil { @@ -60,6 +69,7 @@ func (o *AlertReceiverUserGroup) SetEmailEnabled(v bool) { o.EmailEnabled = &v } + // GetIds returns the Ids field value if set, zero value otherwise. func (o *AlertReceiverUserGroup) GetIds() []string { if o == nil || o.Ids == nil { @@ -88,6 +98,7 @@ func (o *AlertReceiverUserGroup) SetIds(v []string) { o.Ids = v } + // GetSmsEnabled returns the SmsEnabled field value if set, zero value otherwise. func (o *AlertReceiverUserGroup) GetSmsEnabled() bool { if o == nil || o.SmsEnabled == nil { @@ -116,6 +127,8 @@ func (o *AlertReceiverUserGroup) SetSmsEnabled(v bool) { o.SmsEnabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertReceiverUserGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -141,16 +154,16 @@ func (o AlertReceiverUserGroup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertReceiverUserGroup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EmailEnabled *bool `json:"emailEnabled,omitempty"` - Ids []string `json:"ids,omitempty"` - SmsEnabled *bool `json:"smsEnabled,omitempty"` + EmailEnabled *bool `json:"emailEnabled,omitempty"` + Ids []string `json:"ids,omitempty"` + SmsEnabled *bool `json:"smsEnabled,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"emailEnabled", "ids", "smsEnabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "emailEnabled", "ids", "smsEnabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_rule.go b/api/kbcloud/admin/model_alert_rule.go index 423ba5c1..c23daf01 100644 --- a/api/kbcloud/admin/model_alert_rule.go +++ b/api/kbcloud/admin/model_alert_rule.go @@ -2,35 +2,40 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertRule Alert rule information + + +// AlertRule Alert rule information type AlertRule struct { - Description *string `json:"description,omitempty"` - Summary *string `json:"summary,omitempty"` - AlertName string `json:"alertName"` - Expr *string `json:"expr,omitempty"` - For *string `json:"for,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Description *string `json:"description,omitempty"` + Summary *string `json:"summary,omitempty"` + AlertName string `json:"alertName"` + Expr *string `json:"expr,omitempty"` + For *string `json:"for,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` // Alert metric information - Metric *AlertMetric `json:"metric,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Metric *AlertMetric `json:"metric,omitempty"` + OrgName *string `json:"orgName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertRule instantiates a new AlertRule object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +57,6 @@ func NewAlertRuleWithDefaults() *AlertRule { this.Disabled = &disabled return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertRule) GetDescription() string { if o == nil || o.Description == nil { @@ -81,6 +85,7 @@ func (o *AlertRule) SetDescription(v string) { o.Description = &v } + // GetSummary returns the Summary field value if set, zero value otherwise. func (o *AlertRule) GetSummary() string { if o == nil || o.Summary == nil { @@ -109,6 +114,7 @@ func (o *AlertRule) SetSummary(v string) { o.Summary = &v } + // GetAlertName returns the AlertName field value. func (o *AlertRule) GetAlertName() string { if o == nil { @@ -132,6 +138,7 @@ func (o *AlertRule) SetAlertName(v string) { o.AlertName = v } + // GetExpr returns the Expr field value if set, zero value otherwise. func (o *AlertRule) GetExpr() string { if o == nil || o.Expr == nil { @@ -160,6 +167,7 @@ func (o *AlertRule) SetExpr(v string) { o.Expr = &v } + // GetFor returns the For field value if set, zero value otherwise. func (o *AlertRule) GetFor() string { if o == nil || o.For == nil { @@ -188,6 +196,7 @@ func (o *AlertRule) SetFor(v string) { o.For = &v } + // GetGroupName returns the GroupName field value if set, zero value otherwise. func (o *AlertRule) GetGroupName() string { if o == nil || o.GroupName == nil { @@ -216,6 +225,7 @@ func (o *AlertRule) SetGroupName(v string) { o.GroupName = &v } + // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *AlertRule) GetDisabled() bool { if o == nil || o.Disabled == nil { @@ -244,6 +254,7 @@ func (o *AlertRule) SetDisabled(v bool) { o.Disabled = &v } + // GetSeverity returns the Severity field value if set, zero value otherwise. func (o *AlertRule) GetSeverity() AlertSeverity { if o == nil || o.Severity == nil { @@ -272,6 +283,7 @@ func (o *AlertRule) SetSeverity(v AlertSeverity) { o.Severity = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AlertRule) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -300,6 +312,7 @@ func (o *AlertRule) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AlertRule) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -328,6 +341,7 @@ func (o *AlertRule) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetMetric returns the Metric field value if set, zero value otherwise. func (o *AlertRule) GetMetric() AlertMetric { if o == nil || o.Metric == nil { @@ -356,6 +370,7 @@ func (o *AlertRule) SetMetric(v AlertMetric) { o.Metric = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertRule) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -384,6 +399,8 @@ func (o *AlertRule) SetOrgName(v string) { o.OrgName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertRule) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -442,18 +459,18 @@ func (o AlertRule) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertRule) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Description *string `json:"description,omitempty"` - Summary *string `json:"summary,omitempty"` - AlertName *string `json:"alertName"` - Expr *string `json:"expr,omitempty"` - For *string `json:"for,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - Metric *AlertMetric `json:"metric,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Description *string `json:"description,omitempty"` + Summary *string `json:"summary,omitempty"` + AlertName *string `json:"alertName"` + Expr *string `json:"expr,omitempty"` + For *string `json:"for,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Metric *AlertMetric `json:"metric,omitempty"` + OrgName *string `json:"orgName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -463,7 +480,7 @@ func (o *AlertRule) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "summary", "alertName", "expr", "for", "groupName", "disabled", "severity", "createdAt", "updatedAt", "metric", "orgName"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "summary", "alertName", "expr", "for", "groupName", "disabled", "severity", "createdAt", "updatedAt", "metric", "orgName", }) } else { return err } @@ -476,14 +493,14 @@ func (o *AlertRule) UnmarshalJSON(bytes []byte) (err error) { o.For = all.For o.GroupName = all.GroupName o.Disabled = all.Disabled - if all.Severity != nil && !all.Severity.IsValid() { + if all.Severity != nil &&!all.Severity.IsValid() { hasInvalidField = true } else { o.Severity = all.Severity } o.CreatedAt = all.CreatedAt o.UpdatedAt = all.UpdatedAt - if all.Metric != nil && all.Metric.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Metric != nil && all.Metric.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Metric = all.Metric diff --git a/api/kbcloud/admin/model_alert_rule_group.go b/api/kbcloud/admin/model_alert_rule_group.go index 27c9d3be..f3250c24 100644 --- a/api/kbcloud/admin/model_alert_rule_group.go +++ b/api/kbcloud/admin/model_alert_rule_group.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AlertRuleGroup struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Rules []AlertRule `json:"rules,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertRuleGroup instantiates a new AlertRuleGroup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewAlertRuleGroupWithDefaults() *AlertRuleGroup { this := AlertRuleGroup{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *AlertRuleGroup) GetName() string { if o == nil || o.Name == nil { @@ -59,6 +68,7 @@ func (o *AlertRuleGroup) SetName(v string) { o.Name = &v } + // GetRules returns the Rules field value if set, zero value otherwise. func (o *AlertRuleGroup) GetRules() []AlertRule { if o == nil || o.Rules == nil { @@ -87,6 +97,8 @@ func (o *AlertRuleGroup) SetRules(v []AlertRule) { o.Rules = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertRuleGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,7 +121,7 @@ func (o AlertRuleGroup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertRuleGroup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Rules []AlertRule `json:"rules,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +129,7 @@ func (o *AlertRuleGroup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "rules"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "rules", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_rule_list.go b/api/kbcloud/admin/model_alert_rule_list.go index 9358ce85..32542908 100644 --- a/api/kbcloud/admin/model_alert_rule_list.go +++ b/api/kbcloud/admin/model_alert_rule_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertRuleList AlertRuleList is a list of alert rules + + +// AlertRuleList AlertRuleList is a list of alert rules type AlertRuleList struct { // Items is the list of alert rule objects in the list Items []AlertRuleGroup `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertRuleList instantiates a new AlertRuleList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertRuleListWithDefaults() *AlertRuleList { this := AlertRuleList{} return &this } - // GetItems returns the Items field value. func (o *AlertRuleList) GetItems() []AlertRuleGroup { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertRuleList) SetItems(v []AlertRuleGroup) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertRuleList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertRuleList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertRuleList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertRuleList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertRuleList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertRuleGroup `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertRuleGroup `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertRuleList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_alert_severity.go b/api/kbcloud/admin/model_alert_severity.go index b9ae43f2..ff9dccf0 100644 --- a/api/kbcloud/admin/model_alert_severity.go +++ b/api/kbcloud/admin/model_alert_severity.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertSeverity string // List of AlertSeverity. const ( AlertSeverityCritical AlertSeverity = "critical" - AlertSeverityWarning AlertSeverity = "warning" - AlertSeverityInfo AlertSeverity = "info" + AlertSeverityWarning AlertSeverity = "warning" + AlertSeverityInfo AlertSeverity = "info" ) var allowedAlertSeverityEnumValues = []AlertSeverity{ diff --git a/api/kbcloud/admin/model_alert_sms_config.go b/api/kbcloud/admin/model_alert_sms_config.go index 0347633d..c7bd0b54 100644 --- a/api/kbcloud/admin/model_alert_sms_config.go +++ b/api/kbcloud/admin/model_alert_sms_config.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertSMSConfig Alert sms config + + +// AlertSMSConfig Alert sms config type AlertSMSConfig struct { - Name *string `json:"name,omitempty"` - AccessKeyId string `json:"accessKeyID"` - AccessKeySecret string `json:"accessKeySecret"` - Endpoint *string `json:"endpoint,omitempty"` - TemplateCode string `json:"templateCode"` - SignName *string `json:"signName,omitempty"` + Name *string `json:"name,omitempty"` + AccessKeyId string `json:"accessKeyID"` + AccessKeySecret string `json:"accessKeySecret"` + Endpoint *string `json:"endpoint,omitempty"` + TemplateCode string `json:"templateCode"` + SignName *string `json:"signName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertSMSConfig instantiates a new AlertSMSConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewAlertSMSConfigWithDefaults() *AlertSMSConfig { this := AlertSMSConfig{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *AlertSMSConfig) GetName() string { if o == nil || o.Name == nil { @@ -71,6 +76,7 @@ func (o *AlertSMSConfig) SetName(v string) { o.Name = &v } + // GetAccessKeyId returns the AccessKeyId field value. func (o *AlertSMSConfig) GetAccessKeyId() string { if o == nil { @@ -94,6 +100,7 @@ func (o *AlertSMSConfig) SetAccessKeyId(v string) { o.AccessKeyId = v } + // GetAccessKeySecret returns the AccessKeySecret field value. func (o *AlertSMSConfig) GetAccessKeySecret() string { if o == nil { @@ -117,6 +124,7 @@ func (o *AlertSMSConfig) SetAccessKeySecret(v string) { o.AccessKeySecret = v } + // GetEndpoint returns the Endpoint field value if set, zero value otherwise. func (o *AlertSMSConfig) GetEndpoint() string { if o == nil || o.Endpoint == nil { @@ -145,6 +153,7 @@ func (o *AlertSMSConfig) SetEndpoint(v string) { o.Endpoint = &v } + // GetTemplateCode returns the TemplateCode field value. func (o *AlertSMSConfig) GetTemplateCode() string { if o == nil { @@ -168,6 +177,7 @@ func (o *AlertSMSConfig) SetTemplateCode(v string) { o.TemplateCode = v } + // GetSignName returns the SignName field value if set, zero value otherwise. func (o *AlertSMSConfig) GetSignName() string { if o == nil || o.SignName == nil { @@ -196,6 +206,8 @@ func (o *AlertSMSConfig) SetSignName(v string) { o.SignName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertSMSConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -224,12 +236,12 @@ func (o AlertSMSConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertSMSConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - AccessKeyId *string `json:"accessKeyID"` + Name *string `json:"name,omitempty"` + AccessKeyId *string `json:"accessKeyID"` AccessKeySecret *string `json:"accessKeySecret"` - Endpoint *string `json:"endpoint,omitempty"` - TemplateCode *string `json:"templateCode"` - SignName *string `json:"signName,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + TemplateCode *string `json:"templateCode"` + SignName *string `json:"signName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -245,7 +257,7 @@ func (o *AlertSMSConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "accessKeyID", "accessKeySecret", "endpoint", "templateCode", "signName"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "accessKeyID", "accessKeySecret", "endpoint", "templateCode", "signName", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_smtp_config.go b/api/kbcloud/admin/model_alert_smtp_config.go index 52eee29b..6314b699 100644 --- a/api/kbcloud/admin/model_alert_smtp_config.go +++ b/api/kbcloud/admin/model_alert_smtp_config.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertSMTPConfig Alert smtp config + + +// AlertSMTPConfig Alert smtp config type AlertSMTPConfig struct { // SMTP authentication information SmtpAuthPassword string `json:"smtp_auth_password"` @@ -21,10 +26,11 @@ type AlertSMTPConfig struct { // The SMTP host through which emails are sent SmtpSmarthost string `json:"smtp_smarthost"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertSMTPConfig instantiates a new AlertSMTPConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewAlertSMTPConfigWithDefaults() *AlertSMTPConfig { this := AlertSMTPConfig{} return &this } - // GetSmtpAuthPassword returns the SmtpAuthPassword field value. func (o *AlertSMTPConfig) GetSmtpAuthPassword() string { if o == nil { @@ -69,6 +74,7 @@ func (o *AlertSMTPConfig) SetSmtpAuthPassword(v string) { o.SmtpAuthPassword = v } + // GetSmtpAuthUsername returns the SmtpAuthUsername field value. func (o *AlertSMTPConfig) GetSmtpAuthUsername() string { if o == nil { @@ -92,6 +98,7 @@ func (o *AlertSMTPConfig) SetSmtpAuthUsername(v string) { o.SmtpAuthUsername = v } + // GetSmtpFrom returns the SmtpFrom field value. func (o *AlertSMTPConfig) GetSmtpFrom() string { if o == nil { @@ -115,6 +122,7 @@ func (o *AlertSMTPConfig) SetSmtpFrom(v string) { o.SmtpFrom = v } + // GetSmtpSmarthost returns the SmtpSmarthost field value. func (o *AlertSMTPConfig) GetSmtpSmarthost() string { if o == nil { @@ -138,6 +146,8 @@ func (o *AlertSMTPConfig) SetSmtpSmarthost(v string) { o.SmtpSmarthost = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertSMTPConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -160,8 +170,8 @@ func (o *AlertSMTPConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { SmtpAuthPassword *string `json:"smtp_auth_password"` SmtpAuthUsername *string `json:"smtp_auth_username"` - SmtpFrom *string `json:"smtp_from"` - SmtpSmarthost *string `json:"smtp_smarthost"` + SmtpFrom *string `json:"smtp_from"` + SmtpSmarthost *string `json:"smtp_smarthost"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *AlertSMTPConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"smtp_auth_password", "smtp_auth_username", "smtp_from", "smtp_smarthost"}) + common.DeleteKeys(additionalProperties, &[]string{ "smtp_auth_password", "smtp_auth_username", "smtp_from", "smtp_smarthost", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_status.go b/api/kbcloud/admin/model_alert_status.go index f1fb7a3a..c66c6e8e 100644 --- a/api/kbcloud/admin/model_alert_status.go +++ b/api/kbcloud/admin/model_alert_status.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertStatus string // List of AlertStatus. const ( AlertStatusResolved AlertStatus = "resolved" - AlertStatusFiring AlertStatus = "firing" + AlertStatusFiring AlertStatus = "firing" ) var allowedAlertStatusEnumValues = []AlertStatus{ diff --git a/api/kbcloud/admin/model_alert_strategy.go b/api/kbcloud/admin/model_alert_strategy.go index 1d6fcd09..95430086 100644 --- a/api/kbcloud/admin/model_alert_strategy.go +++ b/api/kbcloud/admin/model_alert_strategy.go @@ -2,39 +2,44 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertStrategy Alert strategy information + + +// AlertStrategy Alert strategy information type AlertStrategy struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - ReceiverIds []int32 `json:"receiverIds"` - Receivers []AlertReceiver `json:"receivers,omitempty"` - Envs []string `json:"envs,omitempty"` - Severities []string `json:"severities,omitempty"` - Rules []string `json:"rules,omitempty"` - RuleObjs []AlertRule `json:"ruleObjs,omitempty"` - Engines []string `json:"engines,omitempty"` - Clusters []string `json:"clusters,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - RepeatInterval *string `json:"repeatInterval,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + ReceiverIds []int32 `json:"receiverIds"` + Receivers []AlertReceiver `json:"receivers,omitempty"` + Envs []string `json:"envs,omitempty"` + Severities []string `json:"severities,omitempty"` + Rules []string `json:"rules,omitempty"` + RuleObjs []AlertRule `json:"ruleObjs,omitempty"` + Engines []string `json:"engines,omitempty"` + Clusters []string `json:"clusters,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + RepeatInterval *string `json:"repeatInterval,omitempty"` MuteTimeInterval *AlertStrategyMuteTimeInterval `json:"muteTimeInterval,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertStrategy instantiates a new AlertStrategy object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +61,6 @@ func NewAlertStrategyWithDefaults() *AlertStrategy { this.Disabled = &disabled return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *AlertStrategy) GetId() int32 { if o == nil || o.Id == nil { @@ -85,6 +89,7 @@ func (o *AlertStrategy) SetId(v int32) { o.Id = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertStrategy) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -113,6 +118,7 @@ func (o *AlertStrategy) SetOrgName(v string) { o.OrgName = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *AlertStrategy) GetName() string { if o == nil || o.Name == nil { @@ -141,6 +147,7 @@ func (o *AlertStrategy) SetName(v string) { o.Name = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertStrategy) GetDescription() string { if o == nil || o.Description == nil { @@ -169,6 +176,7 @@ func (o *AlertStrategy) SetDescription(v string) { o.Description = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AlertStrategy) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -197,6 +205,7 @@ func (o *AlertStrategy) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AlertStrategy) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -225,6 +234,7 @@ func (o *AlertStrategy) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetReceiverIds returns the ReceiverIds field value. func (o *AlertStrategy) GetReceiverIds() []int32 { if o == nil { @@ -248,6 +258,7 @@ func (o *AlertStrategy) SetReceiverIds(v []int32) { o.ReceiverIds = v } + // GetReceivers returns the Receivers field value if set, zero value otherwise. func (o *AlertStrategy) GetReceivers() []AlertReceiver { if o == nil || o.Receivers == nil { @@ -276,6 +287,7 @@ func (o *AlertStrategy) SetReceivers(v []AlertReceiver) { o.Receivers = v } + // GetEnvs returns the Envs field value if set, zero value otherwise. func (o *AlertStrategy) GetEnvs() []string { if o == nil || o.Envs == nil { @@ -304,6 +316,7 @@ func (o *AlertStrategy) SetEnvs(v []string) { o.Envs = v } + // GetSeverities returns the Severities field value if set, zero value otherwise. func (o *AlertStrategy) GetSeverities() []string { if o == nil || o.Severities == nil { @@ -332,6 +345,7 @@ func (o *AlertStrategy) SetSeverities(v []string) { o.Severities = v } + // GetRules returns the Rules field value if set, zero value otherwise. func (o *AlertStrategy) GetRules() []string { if o == nil || o.Rules == nil { @@ -360,6 +374,7 @@ func (o *AlertStrategy) SetRules(v []string) { o.Rules = v } + // GetRuleObjs returns the RuleObjs field value if set, zero value otherwise. func (o *AlertStrategy) GetRuleObjs() []AlertRule { if o == nil || o.RuleObjs == nil { @@ -388,6 +403,7 @@ func (o *AlertStrategy) SetRuleObjs(v []AlertRule) { o.RuleObjs = v } + // GetEngines returns the Engines field value if set, zero value otherwise. func (o *AlertStrategy) GetEngines() []string { if o == nil || o.Engines == nil { @@ -416,6 +432,7 @@ func (o *AlertStrategy) SetEngines(v []string) { o.Engines = v } + // GetClusters returns the Clusters field value if set, zero value otherwise. func (o *AlertStrategy) GetClusters() []string { if o == nil || o.Clusters == nil { @@ -444,6 +461,7 @@ func (o *AlertStrategy) SetClusters(v []string) { o.Clusters = v } + // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *AlertStrategy) GetDisabled() bool { if o == nil || o.Disabled == nil { @@ -472,6 +490,7 @@ func (o *AlertStrategy) SetDisabled(v bool) { o.Disabled = &v } + // GetRepeatInterval returns the RepeatInterval field value if set, zero value otherwise. func (o *AlertStrategy) GetRepeatInterval() string { if o == nil || o.RepeatInterval == nil { @@ -500,6 +519,7 @@ func (o *AlertStrategy) SetRepeatInterval(v string) { o.RepeatInterval = &v } + // GetMuteTimeInterval returns the MuteTimeInterval field value if set, zero value otherwise. func (o *AlertStrategy) GetMuteTimeInterval() AlertStrategyMuteTimeInterval { if o == nil || o.MuteTimeInterval == nil { @@ -528,6 +548,8 @@ func (o *AlertStrategy) SetMuteTimeInterval(v AlertStrategyMuteTimeInterval) { o.MuteTimeInterval = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertStrategy) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -601,22 +623,22 @@ func (o AlertStrategy) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertStrategy) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - ReceiverIds *[]int32 `json:"receiverIds"` - Receivers []AlertReceiver `json:"receivers,omitempty"` - Envs []string `json:"envs,omitempty"` - Severities []string `json:"severities,omitempty"` - Rules []string `json:"rules,omitempty"` - RuleObjs []AlertRule `json:"ruleObjs,omitempty"` - Engines []string `json:"engines,omitempty"` - Clusters []string `json:"clusters,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - RepeatInterval *string `json:"repeatInterval,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + ReceiverIds *[]int32 `json:"receiverIds"` + Receivers []AlertReceiver `json:"receivers,omitempty"` + Envs []string `json:"envs,omitempty"` + Severities []string `json:"severities,omitempty"` + Rules []string `json:"rules,omitempty"` + RuleObjs []AlertRule `json:"ruleObjs,omitempty"` + Engines []string `json:"engines,omitempty"` + Clusters []string `json:"clusters,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + RepeatInterval *string `json:"repeatInterval,omitempty"` MuteTimeInterval *AlertStrategyMuteTimeInterval `json:"muteTimeInterval,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -627,7 +649,7 @@ func (o *AlertStrategy) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "orgName", "name", "description", "createdAt", "updatedAt", "receiverIds", "receivers", "envs", "severities", "rules", "ruleObjs", "engines", "clusters", "disabled", "repeatInterval", "muteTimeInterval"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "orgName", "name", "description", "createdAt", "updatedAt", "receiverIds", "receivers", "envs", "severities", "rules", "ruleObjs", "engines", "clusters", "disabled", "repeatInterval", "muteTimeInterval", }) } else { return err } @@ -649,7 +671,7 @@ func (o *AlertStrategy) UnmarshalJSON(bytes []byte) (err error) { o.Clusters = all.Clusters o.Disabled = all.Disabled o.RepeatInterval = all.RepeatInterval - if all.MuteTimeInterval != nil && all.MuteTimeInterval.UnparsedObject != nil && o.UnparsedObject == nil { + if all.MuteTimeInterval != nil && all.MuteTimeInterval.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.MuteTimeInterval = all.MuteTimeInterval diff --git a/api/kbcloud/admin/model_alert_strategy_list.go b/api/kbcloud/admin/model_alert_strategy_list.go index 61f8b1df..723ef3ff 100644 --- a/api/kbcloud/admin/model_alert_strategy_list.go +++ b/api/kbcloud/admin/model_alert_strategy_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertStrategyList AlertStrategyList is a list of alert strategies + + +// AlertStrategyList AlertStrategyList is a list of alert strategies type AlertStrategyList struct { // Items is the list of alert strategy objects in the list Items []AlertStrategy `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertStrategyList instantiates a new AlertStrategyList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertStrategyListWithDefaults() *AlertStrategyList { this := AlertStrategyList{} return &this } - // GetItems returns the Items field value. func (o *AlertStrategyList) GetItems() []AlertStrategy { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertStrategyList) SetItems(v []AlertStrategy) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertStrategyList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertStrategyList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertStrategyList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertStrategyList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertStrategyList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertStrategy `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertStrategy `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertStrategyList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_alert_strategy_mute_time_interval.go b/api/kbcloud/admin/model_alert_strategy_mute_time_interval.go index 40d49005..402740a3 100644 --- a/api/kbcloud/admin/model_alert_strategy_mute_time_interval.go +++ b/api/kbcloud/admin/model_alert_strategy_mute_time_interval.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AlertStrategyMuteTimeInterval struct { - Weekdays []int32 `json:"weekdays,omitempty"` - Times *AlertStrategyMuteTimeIntervalTimes `json:"times,omitempty"` + Weekdays []int32 `json:"weekdays,omitempty"` + Times *AlertStrategyMuteTimeIntervalTimes `json:"times,omitempty"` // Only mute once for `onceMinutes` minutes OnceMinutes *int32 `json:"onceMinutes,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertStrategyMuteTimeInterval instantiates a new AlertStrategyMuteTimeInterval object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewAlertStrategyMuteTimeIntervalWithDefaults() *AlertStrategyMuteTimeInterv this := AlertStrategyMuteTimeInterval{} return &this } - // GetWeekdays returns the Weekdays field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeInterval) GetWeekdays() []int32 { if o == nil || o.Weekdays == nil { @@ -61,6 +70,7 @@ func (o *AlertStrategyMuteTimeInterval) SetWeekdays(v []int32) { o.Weekdays = v } + // GetTimes returns the Times field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeInterval) GetTimes() AlertStrategyMuteTimeIntervalTimes { if o == nil || o.Times == nil { @@ -89,6 +99,7 @@ func (o *AlertStrategyMuteTimeInterval) SetTimes(v AlertStrategyMuteTimeInterval o.Times = &v } + // GetOnceMinutes returns the OnceMinutes field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeInterval) GetOnceMinutes() int32 { if o == nil || o.OnceMinutes == nil { @@ -117,6 +128,8 @@ func (o *AlertStrategyMuteTimeInterval) SetOnceMinutes(v int32) { o.OnceMinutes = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertStrategyMuteTimeInterval) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -142,23 +155,23 @@ func (o AlertStrategyMuteTimeInterval) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertStrategyMuteTimeInterval) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Weekdays []int32 `json:"weekdays,omitempty"` - Times *AlertStrategyMuteTimeIntervalTimes `json:"times,omitempty"` - OnceMinutes *int32 `json:"onceMinutes,omitempty"` + Weekdays []int32 `json:"weekdays,omitempty"` + Times *AlertStrategyMuteTimeIntervalTimes `json:"times,omitempty"` + OnceMinutes *int32 `json:"onceMinutes,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"weekdays", "times", "onceMinutes"}) + common.DeleteKeys(additionalProperties, &[]string{ "weekdays", "times", "onceMinutes", }) } else { return err } hasInvalidField := false o.Weekdays = all.Weekdays - if all.Times != nil && all.Times.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Times != nil && all.Times.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Times = all.Times diff --git a/api/kbcloud/admin/model_alert_strategy_mute_time_interval_times.go b/api/kbcloud/admin/model_alert_strategy_mute_time_interval_times.go index 7ac5c6bb..3e13de89 100644 --- a/api/kbcloud/admin/model_alert_strategy_mute_time_interval_times.go +++ b/api/kbcloud/admin/model_alert_strategy_mute_time_interval_times.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AlertStrategyMuteTimeIntervalTimes struct { // Mute start time, e.g. '17:00', should be in UTC time. StartTime *string `json:"startTime,omitempty"` // Mute end time, e.g. '24:00', should be in UTC time. EndTime *string `json:"endTime,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertStrategyMuteTimeIntervalTimes instantiates a new AlertStrategyMuteTimeIntervalTimes object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewAlertStrategyMuteTimeIntervalTimesWithDefaults() *AlertStrategyMuteTimeI this := AlertStrategyMuteTimeIntervalTimes{} return &this } - // GetStartTime returns the StartTime field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeIntervalTimes) GetStartTime() string { if o == nil || o.StartTime == nil { @@ -61,6 +70,7 @@ func (o *AlertStrategyMuteTimeIntervalTimes) SetStartTime(v string) { o.StartTime = &v } + // GetEndTime returns the EndTime field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeIntervalTimes) GetEndTime() string { if o == nil || o.EndTime == nil { @@ -89,6 +99,8 @@ func (o *AlertStrategyMuteTimeIntervalTimes) SetEndTime(v string) { o.EndTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertStrategyMuteTimeIntervalTimes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,14 +124,14 @@ func (o AlertStrategyMuteTimeIntervalTimes) MarshalJSON() ([]byte, error) { func (o *AlertStrategyMuteTimeIntervalTimes) UnmarshalJSON(bytes []byte) (err error) { all := struct { StartTime *string `json:"startTime,omitempty"` - EndTime *string `json:"endTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"startTime", "endTime"}) + common.DeleteKeys(additionalProperties, &[]string{ "startTime", "endTime", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_template.go b/api/kbcloud/admin/model_alert_template.go index f78dbe0d..02761590 100644 --- a/api/kbcloud/admin/model_alert_template.go +++ b/api/kbcloud/admin/model_alert_template.go @@ -2,38 +2,43 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertTemplate Alert template + + +// AlertTemplate Alert template type AlertTemplate struct { - CreatedAt *time.Time `json:"createdAt,omitempty"` - Description *string `json:"description,omitempty"` - EmailSubject *string `json:"emailSubject,omitempty"` - EmailText *string `json:"emailText,omitempty"` - FeishuText *string `json:"feishuText,omitempty"` - FeishuTitle *string `json:"feishuTitle,omitempty"` - DingdingText *string `json:"dingdingText,omitempty"` - DingdingTitle *string `json:"dingdingTitle,omitempty"` - WeixinText *string `json:"weixinText,omitempty"` - WeixinTitle *string `json:"weixinTitle,omitempty"` - WebhookText *string `json:"webhookText,omitempty"` - WebhookTitle *string `json:"webhookTitle,omitempty"` - Id *string `json:"id,omitempty"` - Name string `json:"name"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - IsDefault *bool `json:"isDefault,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Description *string `json:"description,omitempty"` + EmailSubject *string `json:"emailSubject,omitempty"` + EmailText *string `json:"emailText,omitempty"` + FeishuText *string `json:"feishuText,omitempty"` + FeishuTitle *string `json:"feishuTitle,omitempty"` + DingdingText *string `json:"dingdingText,omitempty"` + DingdingTitle *string `json:"dingdingTitle,omitempty"` + WeixinText *string `json:"weixinText,omitempty"` + WeixinTitle *string `json:"weixinTitle,omitempty"` + WebhookText *string `json:"webhookText,omitempty"` + WebhookTitle *string `json:"webhookTitle,omitempty"` + Id *string `json:"id,omitempty"` + Name string `json:"name"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + IsDefault *bool `json:"isDefault,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertTemplate instantiates a new AlertTemplate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -51,7 +56,6 @@ func NewAlertTemplateWithDefaults() *AlertTemplate { this := AlertTemplate{} return &this } - // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AlertTemplate) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -80,6 +84,7 @@ func (o *AlertTemplate) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertTemplate) GetDescription() string { if o == nil || o.Description == nil { @@ -108,6 +113,7 @@ func (o *AlertTemplate) SetDescription(v string) { o.Description = &v } + // GetEmailSubject returns the EmailSubject field value if set, zero value otherwise. func (o *AlertTemplate) GetEmailSubject() string { if o == nil || o.EmailSubject == nil { @@ -136,6 +142,7 @@ func (o *AlertTemplate) SetEmailSubject(v string) { o.EmailSubject = &v } + // GetEmailText returns the EmailText field value if set, zero value otherwise. func (o *AlertTemplate) GetEmailText() string { if o == nil || o.EmailText == nil { @@ -164,6 +171,7 @@ func (o *AlertTemplate) SetEmailText(v string) { o.EmailText = &v } + // GetFeishuText returns the FeishuText field value if set, zero value otherwise. func (o *AlertTemplate) GetFeishuText() string { if o == nil || o.FeishuText == nil { @@ -192,6 +200,7 @@ func (o *AlertTemplate) SetFeishuText(v string) { o.FeishuText = &v } + // GetFeishuTitle returns the FeishuTitle field value if set, zero value otherwise. func (o *AlertTemplate) GetFeishuTitle() string { if o == nil || o.FeishuTitle == nil { @@ -220,6 +229,7 @@ func (o *AlertTemplate) SetFeishuTitle(v string) { o.FeishuTitle = &v } + // GetDingdingText returns the DingdingText field value if set, zero value otherwise. func (o *AlertTemplate) GetDingdingText() string { if o == nil || o.DingdingText == nil { @@ -248,6 +258,7 @@ func (o *AlertTemplate) SetDingdingText(v string) { o.DingdingText = &v } + // GetDingdingTitle returns the DingdingTitle field value if set, zero value otherwise. func (o *AlertTemplate) GetDingdingTitle() string { if o == nil || o.DingdingTitle == nil { @@ -276,6 +287,7 @@ func (o *AlertTemplate) SetDingdingTitle(v string) { o.DingdingTitle = &v } + // GetWeixinText returns the WeixinText field value if set, zero value otherwise. func (o *AlertTemplate) GetWeixinText() string { if o == nil || o.WeixinText == nil { @@ -304,6 +316,7 @@ func (o *AlertTemplate) SetWeixinText(v string) { o.WeixinText = &v } + // GetWeixinTitle returns the WeixinTitle field value if set, zero value otherwise. func (o *AlertTemplate) GetWeixinTitle() string { if o == nil || o.WeixinTitle == nil { @@ -332,6 +345,7 @@ func (o *AlertTemplate) SetWeixinTitle(v string) { o.WeixinTitle = &v } + // GetWebhookText returns the WebhookText field value if set, zero value otherwise. func (o *AlertTemplate) GetWebhookText() string { if o == nil || o.WebhookText == nil { @@ -360,6 +374,7 @@ func (o *AlertTemplate) SetWebhookText(v string) { o.WebhookText = &v } + // GetWebhookTitle returns the WebhookTitle field value if set, zero value otherwise. func (o *AlertTemplate) GetWebhookTitle() string { if o == nil || o.WebhookTitle == nil { @@ -388,6 +403,7 @@ func (o *AlertTemplate) SetWebhookTitle(v string) { o.WebhookTitle = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *AlertTemplate) GetId() string { if o == nil || o.Id == nil { @@ -416,6 +432,7 @@ func (o *AlertTemplate) SetId(v string) { o.Id = &v } + // GetName returns the Name field value. func (o *AlertTemplate) GetName() string { if o == nil { @@ -439,6 +456,7 @@ func (o *AlertTemplate) SetName(v string) { o.Name = v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AlertTemplate) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -467,6 +485,7 @@ func (o *AlertTemplate) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetIsDefault returns the IsDefault field value if set, zero value otherwise. func (o *AlertTemplate) GetIsDefault() bool { if o == nil || o.IsDefault == nil { @@ -495,6 +514,8 @@ func (o *AlertTemplate) SetIsDefault(v bool) { o.IsDefault = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertTemplate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -565,22 +586,22 @@ func (o AlertTemplate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertTemplate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CreatedAt *time.Time `json:"createdAt,omitempty"` - Description *string `json:"description,omitempty"` - EmailSubject *string `json:"emailSubject,omitempty"` - EmailText *string `json:"emailText,omitempty"` - FeishuText *string `json:"feishuText,omitempty"` - FeishuTitle *string `json:"feishuTitle,omitempty"` - DingdingText *string `json:"dingdingText,omitempty"` - DingdingTitle *string `json:"dingdingTitle,omitempty"` - WeixinText *string `json:"weixinText,omitempty"` - WeixinTitle *string `json:"weixinTitle,omitempty"` - WebhookText *string `json:"webhookText,omitempty"` - WebhookTitle *string `json:"webhookTitle,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - IsDefault *bool `json:"isDefault,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Description *string `json:"description,omitempty"` + EmailSubject *string `json:"emailSubject,omitempty"` + EmailText *string `json:"emailText,omitempty"` + FeishuText *string `json:"feishuText,omitempty"` + FeishuTitle *string `json:"feishuTitle,omitempty"` + DingdingText *string `json:"dingdingText,omitempty"` + DingdingTitle *string `json:"dingdingTitle,omitempty"` + WeixinText *string `json:"weixinText,omitempty"` + WeixinTitle *string `json:"weixinTitle,omitempty"` + WebhookText *string `json:"webhookText,omitempty"` + WebhookTitle *string `json:"webhookTitle,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + IsDefault *bool `json:"isDefault,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -590,7 +611,7 @@ func (o *AlertTemplate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"createdAt", "description", "emailSubject", "emailText", "feishuText", "feishuTitle", "dingdingText", "dingdingTitle", "weixinText", "weixinTitle", "webhookText", "webhookTitle", "id", "name", "updatedAt", "isDefault"}) + common.DeleteKeys(additionalProperties, &[]string{ "createdAt", "description", "emailSubject", "emailText", "feishuText", "feishuTitle", "dingdingText", "dingdingTitle", "weixinText", "weixinTitle", "webhookText", "webhookTitle", "id", "name", "updatedAt", "isDefault", }) } else { return err } diff --git a/api/kbcloud/admin/model_alert_template_list.go b/api/kbcloud/admin/model_alert_template_list.go index 0158c323..bc36ec1e 100644 --- a/api/kbcloud/admin/model_alert_template_list.go +++ b/api/kbcloud/admin/model_alert_template_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertTemplateList AlertTemplateList is a list of alert templates + + +// AlertTemplateList AlertTemplateList is a list of alert templates type AlertTemplateList struct { // Items is the list of alertTemplate objects in the list Items []AlertTemplate `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertTemplateList instantiates a new AlertTemplateList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertTemplateListWithDefaults() *AlertTemplateList { this := AlertTemplateList{} return &this } - // GetItems returns the Items field value. func (o *AlertTemplateList) GetItems() []AlertTemplate { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertTemplateList) SetItems(v []AlertTemplate) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertTemplateList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertTemplateList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertTemplateList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertTemplateList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertTemplateList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertTemplate `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertTemplate `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertTemplateList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_analysis_result.go b/api/kbcloud/admin/model_analysis_result.go index 62d3bb0d..977c85d9 100644 --- a/api/kbcloud/admin/model_analysis_result.go +++ b/api/kbcloud/admin/model_analysis_result.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AnalysisResult struct { Explanation *string `json:"explanation,omitempty"` - Error *string `json:"error,omitempty"` + Error *string `json:"error,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAnalysisResult instantiates a new AnalysisResult object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewAnalysisResultWithDefaults() *AnalysisResult { this := AnalysisResult{} return &this } - // GetExplanation returns the Explanation field value if set, zero value otherwise. func (o *AnalysisResult) GetExplanation() string { if o == nil || o.Explanation == nil { @@ -59,6 +68,7 @@ func (o *AnalysisResult) SetExplanation(v string) { o.Explanation = &v } + // GetError returns the Error field value if set, zero value otherwise. func (o *AnalysisResult) GetError() string { if o == nil || o.Error == nil { @@ -87,6 +97,8 @@ func (o *AnalysisResult) SetError(v string) { o.Error = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AnalysisResult) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,14 +122,14 @@ func (o AnalysisResult) MarshalJSON() ([]byte, error) { func (o *AnalysisResult) UnmarshalJSON(bytes []byte) (err error) { all := struct { Explanation *string `json:"explanation,omitempty"` - Error *string `json:"error,omitempty"` + Error *string `json:"error,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"explanation", "error"}) + common.DeleteKeys(additionalProperties, &[]string{ "explanation", "error", }) } else { return err } diff --git a/api/kbcloud/admin/model_api_error_response.go b/api/kbcloud/admin/model_api_error_response.go index bb3472cd..c28c8cd4 100644 --- a/api/kbcloud/admin/model_api_error_response.go +++ b/api/kbcloud/admin/model_api_error_response.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// APIErrorResponse API error response. + + +// APIErrorResponse API error response. type APIErrorResponse struct { // The HTTP status code. Code int32 `json:"code"` @@ -19,10 +24,11 @@ type APIErrorResponse struct { // The message for the error. Message *string `json:"message,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAPIErrorResponse instantiates a new APIErrorResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewAPIErrorResponseWithDefaults() *APIErrorResponse { this := APIErrorResponse{} return &this } - // GetCode returns the Code field value. func (o *APIErrorResponse) GetCode() int32 { if o == nil { @@ -64,6 +69,7 @@ func (o *APIErrorResponse) SetCode(v int32) { o.Code = v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *APIErrorResponse) GetReason() string { if o == nil || o.Reason == nil { @@ -92,6 +98,7 @@ func (o *APIErrorResponse) SetReason(v string) { o.Reason = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *APIErrorResponse) GetMessage() string { if o == nil || o.Message == nil { @@ -120,6 +127,8 @@ func (o *APIErrorResponse) SetMessage(v string) { o.Message = &v } + + // MarshalJSON serializes the struct using spec logic. func (o APIErrorResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o APIErrorResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *APIErrorResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Code *int32 `json:"code"` - Reason *string `json:"reason,omitempty"` + Code *int32 `json:"code"` + Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *APIErrorResponse) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"code", "reason", "message"}) + common.DeleteKeys(additionalProperties, &[]string{ "code", "reason", "message", }) } else { return err } diff --git a/api/kbcloud/admin/model_apikey.go b/api/kbcloud/admin/model_apikey.go index ac9841cc..dc15c100 100644 --- a/api/kbcloud/admin/model_apikey.go +++ b/api/kbcloud/admin/model_apikey.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Apikey APIKey is the key for API access + + +// Apikey APIKey is the key for API access type Apikey struct { // The name of the APIKey AccessKey string `json:"accessKey"` @@ -22,10 +26,11 @@ type Apikey struct { // The create time of APIKey CreateAt time.Time `json:"createAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewApikey instantiates a new Apikey object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +51,6 @@ func NewApikeyWithDefaults() *Apikey { this := Apikey{} return &this } - // GetAccessKey returns the AccessKey field value. func (o *Apikey) GetAccessKey() string { if o == nil { @@ -70,6 +74,7 @@ func (o *Apikey) SetAccessKey(v string) { o.AccessKey = v } + // GetDescription returns the Description field value. func (o *Apikey) GetDescription() string { if o == nil { @@ -93,6 +98,7 @@ func (o *Apikey) SetDescription(v string) { o.Description = v } + // GetExpiredAt returns the ExpiredAt field value. func (o *Apikey) GetExpiredAt() time.Time { if o == nil { @@ -116,6 +122,7 @@ func (o *Apikey) SetExpiredAt(v time.Time) { o.ExpiredAt = v } + // GetCreateAt returns the CreateAt field value. func (o *Apikey) GetCreateAt() time.Time { if o == nil { @@ -139,6 +146,8 @@ func (o *Apikey) SetCreateAt(v time.Time) { o.CreateAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o Apikey) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -167,10 +176,10 @@ func (o Apikey) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Apikey) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AccessKey *string `json:"accessKey"` - Description *string `json:"description"` - ExpiredAt *time.Time `json:"expiredAt"` - CreateAt *time.Time `json:"createAt"` + AccessKey *string `json:"accessKey"` + Description *string `json:"description"` + ExpiredAt *time.Time `json:"expiredAt"` + CreateAt *time.Time `json:"createAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -189,7 +198,7 @@ func (o *Apikey) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accessKey", "description", "expiredAt", "createAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "accessKey", "description", "expiredAt", "createAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_apikey_create.go b/api/kbcloud/admin/model_apikey_create.go index e4e5fbd8..47f1247d 100644 --- a/api/kbcloud/admin/model_apikey_create.go +++ b/api/kbcloud/admin/model_apikey_create.go @@ -2,26 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ApikeyCreate APIKeyCreate is the payload for creating an APIKey + + +// ApikeyCreate APIKeyCreate is the payload for creating an APIKey type ApikeyCreate struct { // The description of the APIKey Description string `json:"description"` // The expired time of the APIKey ExpiredAt time.Time `json:"expiredAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewApikeyCreate instantiates a new ApikeyCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +45,6 @@ func NewApikeyCreateWithDefaults() *ApikeyCreate { this := ApikeyCreate{} return &this } - // GetDescription returns the Description field value. func (o *ApikeyCreate) GetDescription() string { if o == nil { @@ -64,6 +68,7 @@ func (o *ApikeyCreate) SetDescription(v string) { o.Description = v } + // GetExpiredAt returns the ExpiredAt field value. func (o *ApikeyCreate) GetExpiredAt() time.Time { if o == nil { @@ -87,6 +92,8 @@ func (o *ApikeyCreate) SetExpiredAt(v time.Time) { o.ExpiredAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o ApikeyCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,8 +116,8 @@ func (o ApikeyCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ApikeyCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Description *string `json:"description"` - ExpiredAt *time.Time `json:"expiredAt"` + Description *string `json:"description"` + ExpiredAt *time.Time `json:"expiredAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -123,7 +130,7 @@ func (o *ApikeyCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "expiredAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "expiredAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_apikey_list.go b/api/kbcloud/admin/model_apikey_list.go index d94f6396..5866933a 100644 --- a/api/kbcloud/admin/model_apikey_list.go +++ b/api/kbcloud/admin/model_apikey_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ApikeyList APIKeys is a list of APIKey objects + + +// ApikeyList APIKeys is a list of APIKey objects type ApikeyList struct { // Items is the list of APIKey objects in the list Items []Apikey `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewApikeyList instantiates a new ApikeyList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewApikeyListWithDefaults() *ApikeyList { this := ApikeyList{} return &this } - // GetItems returns the Items field value. func (o *ApikeyList) GetItems() []Apikey { if o == nil { @@ -62,6 +67,7 @@ func (o *ApikeyList) SetItems(v []Apikey) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *ApikeyList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *ApikeyList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ApikeyList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o ApikeyList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ApikeyList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Apikey `json:"items"` + Items *[]Apikey `json:"items"` PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,14 +129,14 @@ func (o *ApikeyList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_apikey_with_sk.go b/api/kbcloud/admin/model_apikey_with_sk.go index 051e7851..81add1d5 100644 --- a/api/kbcloud/admin/model_apikey_with_sk.go +++ b/api/kbcloud/admin/model_apikey_with_sk.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ApikeyWithSK APIKeyWithSK is the response for creating an APIKey + + +// ApikeyWithSK APIKeyWithSK is the response for creating an APIKey type ApikeyWithSK struct { // The accessKey of the APIKey AccessKey string `json:"accessKey"` @@ -24,10 +28,11 @@ type ApikeyWithSK struct { // The create time of APIKey CreateAt time.Time `json:"createAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewApikeyWithSK instantiates a new ApikeyWithSK object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -49,7 +54,6 @@ func NewApikeyWithSKWithDefaults() *ApikeyWithSK { this := ApikeyWithSK{} return &this } - // GetAccessKey returns the AccessKey field value. func (o *ApikeyWithSK) GetAccessKey() string { if o == nil { @@ -73,6 +77,7 @@ func (o *ApikeyWithSK) SetAccessKey(v string) { o.AccessKey = v } + // GetSecretKey returns the SecretKey field value. func (o *ApikeyWithSK) GetSecretKey() string { if o == nil { @@ -96,6 +101,7 @@ func (o *ApikeyWithSK) SetSecretKey(v string) { o.SecretKey = v } + // GetDescription returns the Description field value. func (o *ApikeyWithSK) GetDescription() string { if o == nil { @@ -119,6 +125,7 @@ func (o *ApikeyWithSK) SetDescription(v string) { o.Description = v } + // GetExpiredAt returns the ExpiredAt field value. func (o *ApikeyWithSK) GetExpiredAt() time.Time { if o == nil { @@ -142,6 +149,7 @@ func (o *ApikeyWithSK) SetExpiredAt(v time.Time) { o.ExpiredAt = v } + // GetCreateAt returns the CreateAt field value. func (o *ApikeyWithSK) GetCreateAt() time.Time { if o == nil { @@ -165,6 +173,8 @@ func (o *ApikeyWithSK) SetCreateAt(v time.Time) { o.CreateAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o ApikeyWithSK) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -194,11 +204,11 @@ func (o ApikeyWithSK) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ApikeyWithSK) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AccessKey *string `json:"accessKey"` - SecretKey *string `json:"secretKey"` - Description *string `json:"description"` - ExpiredAt *time.Time `json:"expiredAt"` - CreateAt *time.Time `json:"createAt"` + AccessKey *string `json:"accessKey"` + SecretKey *string `json:"secretKey"` + Description *string `json:"description"` + ExpiredAt *time.Time `json:"expiredAt"` + CreateAt *time.Time `json:"createAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -220,7 +230,7 @@ func (o *ApikeyWithSK) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accessKey", "secretKey", "description", "expiredAt", "createAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "accessKey", "secretKey", "description", "expiredAt", "createAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_auto_inspection.go b/api/kbcloud/admin/model_auto_inspection.go index fd87cd1d..55aacb91 100644 --- a/api/kbcloud/admin/model_auto_inspection.go +++ b/api/kbcloud/admin/model_auto_inspection.go @@ -2,35 +2,41 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type AutoInspection struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` - Creator *string `json:"creator,omitempty"` - Schedule *string `json:"schedule,omitempty"` + Creator *string `json:"creator,omitempty"` + Schedule *string `json:"schedule,omitempty"` // Specifies the unit of time for the auto inspection schedule. - RunEvery *AutoInspectionRunUnit `json:"runEvery,omitempty"` - DaysOfWeek []int32 `json:"daysOfWeek,omitempty"` - DaysOfMonth []int32 `json:"daysOfMonth,omitempty"` - Hour *int32 `json:"hour,omitempty"` - Minute *int32 `json:"minute,omitempty"` - SavedDays *int32 `json:"savedDays,omitempty"` - NextRunTime *time.Time `json:"nextRunTime,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + RunEvery *AutoInspectionRunUnit `json:"runEvery,omitempty"` + DaysOfWeek []int32 `json:"daysOfWeek,omitempty"` + DaysOfMonth []int32 `json:"daysOfMonth,omitempty"` + Hour *int32 `json:"hour,omitempty"` + Minute *int32 `json:"minute,omitempty"` + SavedDays *int32 `json:"savedDays,omitempty"` + NextRunTime *time.Time `json:"nextRunTime,omitempty"` + Enabled *bool `json:"enabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAutoInspection instantiates a new AutoInspection object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +53,6 @@ func NewAutoInspectionWithDefaults() *AutoInspection { this := AutoInspection{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *AutoInspection) GetId() int32 { if o == nil || o.Id == nil { @@ -76,6 +81,7 @@ func (o *AutoInspection) SetId(v int32) { o.Id = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AutoInspection) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -104,6 +110,7 @@ func (o *AutoInspection) SetOrgName(v string) { o.OrgName = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AutoInspection) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -132,6 +139,7 @@ func (o *AutoInspection) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AutoInspection) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -160,6 +168,7 @@ func (o *AutoInspection) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetCreator returns the Creator field value if set, zero value otherwise. func (o *AutoInspection) GetCreator() string { if o == nil || o.Creator == nil { @@ -188,6 +197,7 @@ func (o *AutoInspection) SetCreator(v string) { o.Creator = &v } + // GetSchedule returns the Schedule field value if set, zero value otherwise. func (o *AutoInspection) GetSchedule() string { if o == nil || o.Schedule == nil { @@ -216,6 +226,7 @@ func (o *AutoInspection) SetSchedule(v string) { o.Schedule = &v } + // GetRunEvery returns the RunEvery field value if set, zero value otherwise. func (o *AutoInspection) GetRunEvery() AutoInspectionRunUnit { if o == nil || o.RunEvery == nil { @@ -244,6 +255,7 @@ func (o *AutoInspection) SetRunEvery(v AutoInspectionRunUnit) { o.RunEvery = &v } + // GetDaysOfWeek returns the DaysOfWeek field value if set, zero value otherwise. func (o *AutoInspection) GetDaysOfWeek() []int32 { if o == nil || o.DaysOfWeek == nil { @@ -272,6 +284,7 @@ func (o *AutoInspection) SetDaysOfWeek(v []int32) { o.DaysOfWeek = v } + // GetDaysOfMonth returns the DaysOfMonth field value if set, zero value otherwise. func (o *AutoInspection) GetDaysOfMonth() []int32 { if o == nil || o.DaysOfMonth == nil { @@ -300,6 +313,7 @@ func (o *AutoInspection) SetDaysOfMonth(v []int32) { o.DaysOfMonth = v } + // GetHour returns the Hour field value if set, zero value otherwise. func (o *AutoInspection) GetHour() int32 { if o == nil || o.Hour == nil { @@ -328,6 +342,7 @@ func (o *AutoInspection) SetHour(v int32) { o.Hour = &v } + // GetMinute returns the Minute field value if set, zero value otherwise. func (o *AutoInspection) GetMinute() int32 { if o == nil || o.Minute == nil { @@ -356,6 +371,7 @@ func (o *AutoInspection) SetMinute(v int32) { o.Minute = &v } + // GetSavedDays returns the SavedDays field value if set, zero value otherwise. func (o *AutoInspection) GetSavedDays() int32 { if o == nil || o.SavedDays == nil { @@ -384,6 +400,7 @@ func (o *AutoInspection) SetSavedDays(v int32) { o.SavedDays = &v } + // GetNextRunTime returns the NextRunTime field value if set, zero value otherwise. func (o *AutoInspection) GetNextRunTime() time.Time { if o == nil || o.NextRunTime == nil { @@ -412,6 +429,7 @@ func (o *AutoInspection) SetNextRunTime(v time.Time) { o.NextRunTime = &v } + // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *AutoInspection) GetEnabled() bool { if o == nil || o.Enabled == nil { @@ -440,6 +458,8 @@ func (o *AutoInspection) SetEnabled(v bool) { o.Enabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AutoInspection) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -510,27 +530,27 @@ func (o AutoInspection) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AutoInspection) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Creator *string `json:"creator,omitempty"` - Schedule *string `json:"schedule,omitempty"` - RunEvery *AutoInspectionRunUnit `json:"runEvery,omitempty"` - DaysOfWeek []int32 `json:"daysOfWeek,omitempty"` - DaysOfMonth []int32 `json:"daysOfMonth,omitempty"` - Hour *int32 `json:"hour,omitempty"` - Minute *int32 `json:"minute,omitempty"` - SavedDays *int32 `json:"savedDays,omitempty"` - NextRunTime *time.Time `json:"nextRunTime,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Creator *string `json:"creator,omitempty"` + Schedule *string `json:"schedule,omitempty"` + RunEvery *AutoInspectionRunUnit `json:"runEvery,omitempty"` + DaysOfWeek []int32 `json:"daysOfWeek,omitempty"` + DaysOfMonth []int32 `json:"daysOfMonth,omitempty"` + Hour *int32 `json:"hour,omitempty"` + Minute *int32 `json:"minute,omitempty"` + SavedDays *int32 `json:"savedDays,omitempty"` + NextRunTime *time.Time `json:"nextRunTime,omitempty"` + Enabled *bool `json:"enabled,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "orgName", "updatedAt", "createdAt", "creator", "schedule", "runEvery", "daysOfWeek", "daysOfMonth", "hour", "minute", "savedDays", "nextRunTime", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "orgName", "updatedAt", "createdAt", "creator", "schedule", "runEvery", "daysOfWeek", "daysOfMonth", "hour", "minute", "savedDays", "nextRunTime", "enabled", }) } else { return err } @@ -542,7 +562,7 @@ func (o *AutoInspection) UnmarshalJSON(bytes []byte) (err error) { o.CreatedAt = all.CreatedAt o.Creator = all.Creator o.Schedule = all.Schedule - if all.RunEvery != nil && !all.RunEvery.IsValid() { + if all.RunEvery != nil &&!all.RunEvery.IsValid() { hasInvalidField = true } else { o.RunEvery = all.RunEvery diff --git a/api/kbcloud/admin/model_auto_inspection_run_unit.go b/api/kbcloud/admin/model_auto_inspection_run_unit.go index 2b4a7710..1da96a9c 100644 --- a/api/kbcloud/admin/model_auto_inspection_run_unit.go +++ b/api/kbcloud/admin/model_auto_inspection_run_unit.go @@ -2,22 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // AutoInspectionRunUnit Specifies the unit of time for the auto inspection schedule. type AutoInspectionRunUnit string // List of AutoInspectionRunUnit. const ( - AutoInspectionRunUnitHour AutoInspectionRunUnit = "hour" - AutoInspectionRunUnitDay AutoInspectionRunUnit = "day" - AutoInspectionRunUnitWeek AutoInspectionRunUnit = "week" + AutoInspectionRunUnitHour AutoInspectionRunUnit = "hour" + AutoInspectionRunUnitDay AutoInspectionRunUnit = "day" + AutoInspectionRunUnitWeek AutoInspectionRunUnit = "week" AutoInspectionRunUnitMonth AutoInspectionRunUnit = "month" ) diff --git a/api/kbcloud/admin/model_autohealing_config.go b/api/kbcloud/admin/model_autohealing_config.go index 37c6f01b..e244c05e 100644 --- a/api/kbcloud/admin/model_autohealing_config.go +++ b/api/kbcloud/admin/model_autohealing_config.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AutohealingConfig cluster instance autohealing process config + + +// AutohealingConfig cluster instance autohealing process config type AutohealingConfig struct { // Set to true to pause the auto-healing process, preventing automatic rebuilding of instances when a node fails or is in maintenance mode. PauseAutoHealingOnNodeUnavailable bool `json:"pauseAutoHealingOnNodeUnavailable"` @@ -21,10 +26,11 @@ type AutohealingConfig struct { // The maximum number of rebuild jobs that can run simultaneously for a single node. RebuildConcurrencyPerNode int32 `json:"rebuildConcurrencyPerNode"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAutohealingConfig instantiates a new AutohealingConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewAutohealingConfigWithDefaults() *AutohealingConfig { this := AutohealingConfig{} return &this } - // GetPauseAutoHealingOnNodeUnavailable returns the PauseAutoHealingOnNodeUnavailable field value. func (o *AutohealingConfig) GetPauseAutoHealingOnNodeUnavailable() bool { if o == nil { @@ -69,6 +74,7 @@ func (o *AutohealingConfig) SetPauseAutoHealingOnNodeUnavailable(v bool) { o.PauseAutoHealingOnNodeUnavailable = v } + // GetRebuildStartDelaySeconds returns the RebuildStartDelaySeconds field value. func (o *AutohealingConfig) GetRebuildStartDelaySeconds() int32 { if o == nil { @@ -92,6 +98,7 @@ func (o *AutohealingConfig) SetRebuildStartDelaySeconds(v int32) { o.RebuildStartDelaySeconds = v } + // GetMinClusterRebuildIntervalSeconds returns the MinClusterRebuildIntervalSeconds field value. func (o *AutohealingConfig) GetMinClusterRebuildIntervalSeconds() int32 { if o == nil { @@ -115,6 +122,7 @@ func (o *AutohealingConfig) SetMinClusterRebuildIntervalSeconds(v int32) { o.MinClusterRebuildIntervalSeconds = v } + // GetRebuildConcurrencyPerNode returns the RebuildConcurrencyPerNode field value. func (o *AutohealingConfig) GetRebuildConcurrencyPerNode() int32 { if o == nil { @@ -138,6 +146,8 @@ func (o *AutohealingConfig) SetRebuildConcurrencyPerNode(v int32) { o.RebuildConcurrencyPerNode = v } + + // MarshalJSON serializes the struct using spec logic. func (o AutohealingConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +168,10 @@ func (o AutohealingConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AutohealingConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - PauseAutoHealingOnNodeUnavailable *bool `json:"pauseAutoHealingOnNodeUnavailable"` - RebuildStartDelaySeconds *int32 `json:"rebuildStartDelaySeconds"` - MinClusterRebuildIntervalSeconds *int32 `json:"minClusterRebuildIntervalSeconds"` - RebuildConcurrencyPerNode *int32 `json:"rebuildConcurrencyPerNode"` + PauseAutoHealingOnNodeUnavailable *bool `json:"pauseAutoHealingOnNodeUnavailable"` + RebuildStartDelaySeconds *int32 `json:"rebuildStartDelaySeconds"` + MinClusterRebuildIntervalSeconds *int32 `json:"minClusterRebuildIntervalSeconds"` + RebuildConcurrencyPerNode *int32 `json:"rebuildConcurrencyPerNode"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *AutohealingConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"pauseAutoHealingOnNodeUnavailable", "rebuildStartDelaySeconds", "minClusterRebuildIntervalSeconds", "rebuildConcurrencyPerNode"}) + common.DeleteKeys(additionalProperties, &[]string{ "pauseAutoHealingOnNodeUnavailable", "rebuildStartDelaySeconds", "minClusterRebuildIntervalSeconds", "rebuildConcurrencyPerNode", }) } else { return err } diff --git a/api/kbcloud/admin/model_autohealing_list_item.go b/api/kbcloud/admin/model_autohealing_list_item.go index bf3c23eb..dfa3f1cd 100644 --- a/api/kbcloud/admin/model_autohealing_list_item.go +++ b/api/kbcloud/admin/model_autohealing_list_item.go @@ -2,16 +2,21 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type AutohealingListItem struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` // component to be rebuilt @@ -23,18 +28,19 @@ type AutohealingListItem struct { // current phase of rebuild job Phase *string `json:"phase,omitempty"` // whether the job is started - Started *bool `json:"started,omitempty"` + Started *bool `json:"started,omitempty"` StartMessage *string `json:"startMessage,omitempty"` // whether the job is finished - Finished *bool `json:"finished,omitempty"` - FinishMessage *string `json:"finishMessage,omitempty"` - BackupName *string `json:"backupName,omitempty"` + Finished *bool `json:"finished,omitempty"` + FinishMessage *string `json:"finishMessage,omitempty"` + BackupName *string `json:"backupName,omitempty"` RebuildInstanceOpsRequestName *string `json:"rebuildInstanceOpsRequestName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAutohealingListItem instantiates a new AutohealingListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -51,7 +57,6 @@ func NewAutohealingListItemWithDefaults() *AutohealingListItem { this := AutohealingListItem{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *AutohealingListItem) GetName() string { if o == nil || o.Name == nil { @@ -80,6 +85,7 @@ func (o *AutohealingListItem) SetName(v string) { o.Name = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AutohealingListItem) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -108,6 +114,7 @@ func (o *AutohealingListItem) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AutohealingListItem) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -136,6 +143,7 @@ func (o *AutohealingListItem) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *AutohealingListItem) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -164,6 +172,7 @@ func (o *AutohealingListItem) SetComponentName(v string) { o.ComponentName = &v } + // GetPodName returns the PodName field value if set, zero value otherwise. func (o *AutohealingListItem) GetPodName() string { if o == nil || o.PodName == nil { @@ -192,6 +201,7 @@ func (o *AutohealingListItem) SetPodName(v string) { o.PodName = &v } + // GetStartTime returns the StartTime field value if set, zero value otherwise. func (o *AutohealingListItem) GetStartTime() time.Time { if o == nil || o.StartTime == nil { @@ -220,6 +230,7 @@ func (o *AutohealingListItem) SetStartTime(v time.Time) { o.StartTime = &v } + // GetPhase returns the Phase field value if set, zero value otherwise. func (o *AutohealingListItem) GetPhase() string { if o == nil || o.Phase == nil { @@ -248,6 +259,7 @@ func (o *AutohealingListItem) SetPhase(v string) { o.Phase = &v } + // GetStarted returns the Started field value if set, zero value otherwise. func (o *AutohealingListItem) GetStarted() bool { if o == nil || o.Started == nil { @@ -276,6 +288,7 @@ func (o *AutohealingListItem) SetStarted(v bool) { o.Started = &v } + // GetStartMessage returns the StartMessage field value if set, zero value otherwise. func (o *AutohealingListItem) GetStartMessage() string { if o == nil || o.StartMessage == nil { @@ -304,6 +317,7 @@ func (o *AutohealingListItem) SetStartMessage(v string) { o.StartMessage = &v } + // GetFinished returns the Finished field value if set, zero value otherwise. func (o *AutohealingListItem) GetFinished() bool { if o == nil || o.Finished == nil { @@ -332,6 +346,7 @@ func (o *AutohealingListItem) SetFinished(v bool) { o.Finished = &v } + // GetFinishMessage returns the FinishMessage field value if set, zero value otherwise. func (o *AutohealingListItem) GetFinishMessage() string { if o == nil || o.FinishMessage == nil { @@ -360,6 +375,7 @@ func (o *AutohealingListItem) SetFinishMessage(v string) { o.FinishMessage = &v } + // GetBackupName returns the BackupName field value if set, zero value otherwise. func (o *AutohealingListItem) GetBackupName() string { if o == nil || o.BackupName == nil { @@ -388,6 +404,7 @@ func (o *AutohealingListItem) SetBackupName(v string) { o.BackupName = &v } + // GetRebuildInstanceOpsRequestName returns the RebuildInstanceOpsRequestName field value if set, zero value otherwise. func (o *AutohealingListItem) GetRebuildInstanceOpsRequestName() string { if o == nil || o.RebuildInstanceOpsRequestName == nil { @@ -416,6 +433,8 @@ func (o *AutohealingListItem) SetRebuildInstanceOpsRequestName(v string) { o.RebuildInstanceOpsRequestName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AutohealingListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -483,26 +502,26 @@ func (o AutohealingListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AutohealingListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - ComponentName *string `json:"componentName,omitempty"` - PodName *string `json:"podName,omitempty"` - StartTime *time.Time `json:"startTime,omitempty"` - Phase *string `json:"phase,omitempty"` - Started *bool `json:"started,omitempty"` - StartMessage *string `json:"startMessage,omitempty"` - Finished *bool `json:"finished,omitempty"` - FinishMessage *string `json:"finishMessage,omitempty"` - BackupName *string `json:"backupName,omitempty"` - RebuildInstanceOpsRequestName *string `json:"rebuildInstanceOpsRequestName,omitempty"` + Name *string `json:"name,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + ComponentName *string `json:"componentName,omitempty"` + PodName *string `json:"podName,omitempty"` + StartTime *time.Time `json:"startTime,omitempty"` + Phase *string `json:"phase,omitempty"` + Started *bool `json:"started,omitempty"` + StartMessage *string `json:"startMessage,omitempty"` + Finished *bool `json:"finished,omitempty"` + FinishMessage *string `json:"finishMessage,omitempty"` + BackupName *string `json:"backupName,omitempty"` + RebuildInstanceOpsRequestName *string `json:"rebuildInstanceOpsRequestName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "createdAt", "updatedAt", "componentName", "podName", "startTime", "phase", "started", "startMessage", "finished", "finishMessage", "backupName", "rebuildInstanceOpsRequestName"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "createdAt", "updatedAt", "componentName", "podName", "startTime", "phase", "started", "startMessage", "finished", "finishMessage", "backupName", "rebuildInstanceOpsRequestName", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup.go b/api/kbcloud/admin/model_backup.go index 31f199d4..d58cafb2 100644 --- a/api/kbcloud/admin/model_backup.go +++ b/api/kbcloud/admin/model_backup.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Backup backup is the payload for KubeBlocks cluster backup + + +// Backup backup is the payload for KubeBlocks cluster backup type Backup struct { // autoBackup or not AutoBackup bool `json:"autoBackup"` @@ -46,9 +50,9 @@ type Backup struct { // timeRangeStart records the start time of the backup. TimeRangeStart *time.Time `json:"timeRangeStart,omitempty"` // Backup total size. A string with capacity units in the form of "1Gi", "1Mi", "1Ki". - TotalSize string `json:"totalSize"` + TotalSize string `json:"totalSize"` FailureReason *string `json:"failureReason,omitempty"` - Extras *string `json:"extras,omitempty"` + Extras *string `json:"extras,omitempty"` // backup target pods TargetPods []string `json:"targetPods,omitempty"` // the path of backup files @@ -70,10 +74,11 @@ type Backup struct { // the cluster engine Engine *string `json:"engine,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackup instantiates a new Backup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -104,7 +109,6 @@ func NewBackupWithDefaults() *Backup { this := Backup{} return &this } - // GetAutoBackup returns the AutoBackup field value. func (o *Backup) GetAutoBackup() bool { if o == nil { @@ -128,6 +132,7 @@ func (o *Backup) SetAutoBackup(v bool) { o.AutoBackup = v } + // GetBackupMethod returns the BackupMethod field value. func (o *Backup) GetBackupMethod() string { if o == nil { @@ -151,6 +156,7 @@ func (o *Backup) SetBackupMethod(v string) { o.BackupMethod = v } + // GetBackupPolicyName returns the BackupPolicyName field value. func (o *Backup) GetBackupPolicyName() string { if o == nil { @@ -174,6 +180,7 @@ func (o *Backup) SetBackupPolicyName(v string) { o.BackupPolicyName = v } + // GetBackupRepo returns the BackupRepo field value if set, zero value otherwise. func (o *Backup) GetBackupRepo() string { if o == nil || o.BackupRepo == nil { @@ -202,6 +209,7 @@ func (o *Backup) SetBackupRepo(v string) { o.BackupRepo = &v } + // GetBackupType returns the BackupType field value. func (o *Backup) GetBackupType() BackupType { if o == nil { @@ -225,6 +233,7 @@ func (o *Backup) SetBackupType(v BackupType) { o.BackupType = v } + // GetCompletionTimestamp returns the CompletionTimestamp field value. func (o *Backup) GetCompletionTimestamp() time.Time { if o == nil { @@ -248,6 +257,7 @@ func (o *Backup) SetCompletionTimestamp(v time.Time) { o.CompletionTimestamp = v } + // GetCreationTimestamp returns the CreationTimestamp field value. func (o *Backup) GetCreationTimestamp() time.Time { if o == nil { @@ -271,6 +281,7 @@ func (o *Backup) SetCreationTimestamp(v time.Time) { o.CreationTimestamp = v } + // GetDuration returns the Duration field value. func (o *Backup) GetDuration() string { if o == nil { @@ -294,6 +305,7 @@ func (o *Backup) SetDuration(v string) { o.Duration = v } + // GetName returns the Name field value. func (o *Backup) GetName() string { if o == nil { @@ -317,6 +329,7 @@ func (o *Backup) SetName(v string) { o.Name = v } + // GetOrgName returns the OrgName field value. func (o *Backup) GetOrgName() string { if o == nil { @@ -340,6 +353,7 @@ func (o *Backup) SetOrgName(v string) { o.OrgName = v } + // GetSnapshotVolumes returns the SnapshotVolumes field value. func (o *Backup) GetSnapshotVolumes() bool { if o == nil { @@ -363,6 +377,7 @@ func (o *Backup) SetSnapshotVolumes(v bool) { o.SnapshotVolumes = v } + // GetSourceCluster returns the SourceCluster field value. func (o *Backup) GetSourceCluster() string { if o == nil { @@ -386,6 +401,7 @@ func (o *Backup) SetSourceCluster(v string) { o.SourceCluster = v } + // GetStartTimestamp returns the StartTimestamp field value. func (o *Backup) GetStartTimestamp() time.Time { if o == nil { @@ -409,6 +425,7 @@ func (o *Backup) SetStartTimestamp(v time.Time) { o.StartTimestamp = v } + // GetStatus returns the Status field value. func (o *Backup) GetStatus() BackupStatus { if o == nil { @@ -432,6 +449,7 @@ func (o *Backup) SetStatus(v BackupStatus) { o.Status = v } + // GetTimeRangeEnd returns the TimeRangeEnd field value if set, zero value otherwise. func (o *Backup) GetTimeRangeEnd() time.Time { if o == nil || o.TimeRangeEnd == nil { @@ -460,6 +478,7 @@ func (o *Backup) SetTimeRangeEnd(v time.Time) { o.TimeRangeEnd = &v } + // GetTimeRangeStart returns the TimeRangeStart field value if set, zero value otherwise. func (o *Backup) GetTimeRangeStart() time.Time { if o == nil || o.TimeRangeStart == nil { @@ -488,6 +507,7 @@ func (o *Backup) SetTimeRangeStart(v time.Time) { o.TimeRangeStart = &v } + // GetTotalSize returns the TotalSize field value. func (o *Backup) GetTotalSize() string { if o == nil { @@ -511,6 +531,7 @@ func (o *Backup) SetTotalSize(v string) { o.TotalSize = v } + // GetFailureReason returns the FailureReason field value if set, zero value otherwise. func (o *Backup) GetFailureReason() string { if o == nil || o.FailureReason == nil { @@ -539,6 +560,7 @@ func (o *Backup) SetFailureReason(v string) { o.FailureReason = &v } + // GetExtras returns the Extras field value if set, zero value otherwise. func (o *Backup) GetExtras() string { if o == nil || o.Extras == nil { @@ -567,6 +589,7 @@ func (o *Backup) SetExtras(v string) { o.Extras = &v } + // GetTargetPods returns the TargetPods field value if set, zero value otherwise. func (o *Backup) GetTargetPods() []string { if o == nil || o.TargetPods == nil { @@ -595,6 +618,7 @@ func (o *Backup) SetTargetPods(v []string) { o.TargetPods = v } + // GetPath returns the Path field value if set, zero value otherwise. func (o *Backup) GetPath() string { if o == nil || o.Path == nil { @@ -623,6 +647,7 @@ func (o *Backup) SetPath(v string) { o.Path = &v } + // GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. func (o *Backup) GetRetentionPeriod() string { if o == nil || o.RetentionPeriod == nil { @@ -651,6 +676,7 @@ func (o *Backup) SetRetentionPeriod(v string) { o.RetentionPeriod = &v } + // GetExpiration returns the Expiration field value if set, zero value otherwise. func (o *Backup) GetExpiration() time.Time { if o == nil || o.Expiration == nil { @@ -679,6 +705,7 @@ func (o *Backup) SetExpiration(v time.Time) { o.Expiration = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *Backup) GetId() string { if o == nil || o.Id == nil { @@ -707,6 +734,7 @@ func (o *Backup) SetId(v string) { o.Id = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *Backup) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -735,6 +763,7 @@ func (o *Backup) SetClusterId(v string) { o.ClusterId = &v } + // GetCloudProvider returns the CloudProvider field value if set, zero value otherwise. func (o *Backup) GetCloudProvider() string { if o == nil || o.CloudProvider == nil { @@ -763,6 +792,7 @@ func (o *Backup) SetCloudProvider(v string) { o.CloudProvider = &v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *Backup) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -791,6 +821,7 @@ func (o *Backup) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetEnvironmentName returns the EnvironmentName field value if set, zero value otherwise. func (o *Backup) GetEnvironmentName() string { if o == nil || o.EnvironmentName == nil { @@ -819,6 +850,7 @@ func (o *Backup) SetEnvironmentName(v string) { o.EnvironmentName = &v } + // GetEngine returns the Engine field value if set, zero value otherwise. func (o *Backup) GetEngine() string { if o == nil || o.Engine == nil { @@ -847,6 +879,8 @@ func (o *Backup) SetEngine(v string) { o.Engine = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Backup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -946,35 +980,35 @@ func (o Backup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Backup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AutoBackup *bool `json:"autoBackup"` - BackupMethod *string `json:"backupMethod"` - BackupPolicyName *string `json:"backupPolicyName"` - BackupRepo *string `json:"backupRepo,omitempty"` - BackupType *BackupType `json:"backupType"` - CompletionTimestamp *time.Time `json:"completionTimestamp"` - CreationTimestamp *time.Time `json:"creationTimestamp"` - Duration *string `json:"duration"` - Name *string `json:"name"` - OrgName *string `json:"orgName"` - SnapshotVolumes *bool `json:"snapshotVolumes"` - SourceCluster *string `json:"sourceCluster"` - StartTimestamp *time.Time `json:"startTimestamp"` - Status *BackupStatus `json:"status"` - TimeRangeEnd *time.Time `json:"timeRangeEnd,omitempty"` - TimeRangeStart *time.Time `json:"timeRangeStart,omitempty"` - TotalSize *string `json:"totalSize"` - FailureReason *string `json:"failureReason,omitempty"` - Extras *string `json:"extras,omitempty"` - TargetPods []string `json:"targetPods,omitempty"` - Path *string `json:"path,omitempty"` - RetentionPeriod *string `json:"retentionPeriod,omitempty"` - Expiration *time.Time `json:"expiration,omitempty"` - Id *string `json:"id,omitempty"` - ClusterId *string `json:"clusterId,omitempty"` - CloudProvider *string `json:"cloudProvider,omitempty"` - CloudRegion *string `json:"cloudRegion,omitempty"` - EnvironmentName *string `json:"environmentName,omitempty"` - Engine *string `json:"engine,omitempty"` + AutoBackup *bool `json:"autoBackup"` + BackupMethod *string `json:"backupMethod"` + BackupPolicyName *string `json:"backupPolicyName"` + BackupRepo *string `json:"backupRepo,omitempty"` + BackupType *BackupType `json:"backupType"` + CompletionTimestamp *time.Time `json:"completionTimestamp"` + CreationTimestamp *time.Time `json:"creationTimestamp"` + Duration *string `json:"duration"` + Name *string `json:"name"` + OrgName *string `json:"orgName"` + SnapshotVolumes *bool `json:"snapshotVolumes"` + SourceCluster *string `json:"sourceCluster"` + StartTimestamp *time.Time `json:"startTimestamp"` + Status *BackupStatus `json:"status"` + TimeRangeEnd *time.Time `json:"timeRangeEnd,omitempty"` + TimeRangeStart *time.Time `json:"timeRangeStart,omitempty"` + TotalSize *string `json:"totalSize"` + FailureReason *string `json:"failureReason,omitempty"` + Extras *string `json:"extras,omitempty"` + TargetPods []string `json:"targetPods,omitempty"` + Path *string `json:"path,omitempty"` + RetentionPeriod *string `json:"retentionPeriod,omitempty"` + Expiration *time.Time `json:"expiration,omitempty"` + Id *string `json:"id,omitempty"` + ClusterId *string `json:"clusterId,omitempty"` + CloudProvider *string `json:"cloudProvider,omitempty"` + CloudRegion *string `json:"cloudRegion,omitempty"` + EnvironmentName *string `json:"environmentName,omitempty"` + Engine *string `json:"engine,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -1023,7 +1057,7 @@ func (o *Backup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"autoBackup", "backupMethod", "backupPolicyName", "backupRepo", "backupType", "completionTimestamp", "creationTimestamp", "duration", "name", "orgName", "snapshotVolumes", "sourceCluster", "startTimestamp", "status", "timeRangeEnd", "timeRangeStart", "totalSize", "failureReason", "extras", "targetPods", "path", "retentionPeriod", "expiration", "id", "clusterId", "cloudProvider", "cloudRegion", "environmentName", "engine"}) + common.DeleteKeys(additionalProperties, &[]string{ "autoBackup", "backupMethod", "backupPolicyName", "backupRepo", "backupType", "completionTimestamp", "creationTimestamp", "duration", "name", "orgName", "snapshotVolumes", "sourceCluster", "startTimestamp", "status", "timeRangeEnd", "timeRangeStart", "totalSize", "failureReason", "extras", "targetPods", "path", "retentionPeriod", "expiration", "id", "clusterId", "cloudProvider", "cloudRegion", "environmentName", "engine", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_config.go b/api/kbcloud/admin/model_backup_config.go index 18ad22b3..f4c2a0bf 100644 --- a/api/kbcloud/admin/model_backup_config.go +++ b/api/kbcloud/admin/model_backup_config.go @@ -2,17 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupConfig struct { - Schedule *string `json:"schedule,omitempty"` - AccessKeyId *string `json:"accessKeyId,omitempty"` + Schedule *string `json:"schedule,omitempty"` + AccessKeyId *string `json:"accessKeyId,omitempty"` SecretAccessKey *string `json:"secretAccessKey,omitempty"` - Endpoint *string `json:"endpoint,omitempty"` - Region *string `json:"region,omitempty"` - S3Prefix *string `json:"s3Prefix,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + Region *string `json:"region,omitempty"` + S3Prefix *string `json:"s3Prefix,omitempty"` // enable or disable auto backup AutoBackup *bool `json:"autoBackup,omitempty"` // time for next backup @@ -22,10 +31,11 @@ type BackupConfig struct { // the time of last backup LastBackupTime *string `json:"lastBackupTime,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupConfig instantiates a new BackupConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +56,6 @@ func NewBackupConfigWithDefaults() *BackupConfig { this.AutoBackup = &autoBackup return &this } - // GetSchedule returns the Schedule field value if set, zero value otherwise. func (o *BackupConfig) GetSchedule() string { if o == nil || o.Schedule == nil { @@ -75,6 +84,7 @@ func (o *BackupConfig) SetSchedule(v string) { o.Schedule = &v } + // GetAccessKeyId returns the AccessKeyId field value if set, zero value otherwise. func (o *BackupConfig) GetAccessKeyId() string { if o == nil || o.AccessKeyId == nil { @@ -103,6 +113,7 @@ func (o *BackupConfig) SetAccessKeyId(v string) { o.AccessKeyId = &v } + // GetSecretAccessKey returns the SecretAccessKey field value if set, zero value otherwise. func (o *BackupConfig) GetSecretAccessKey() string { if o == nil || o.SecretAccessKey == nil { @@ -131,6 +142,7 @@ func (o *BackupConfig) SetSecretAccessKey(v string) { o.SecretAccessKey = &v } + // GetEndpoint returns the Endpoint field value if set, zero value otherwise. func (o *BackupConfig) GetEndpoint() string { if o == nil || o.Endpoint == nil { @@ -159,6 +171,7 @@ func (o *BackupConfig) SetEndpoint(v string) { o.Endpoint = &v } + // GetRegion returns the Region field value if set, zero value otherwise. func (o *BackupConfig) GetRegion() string { if o == nil || o.Region == nil { @@ -187,6 +200,7 @@ func (o *BackupConfig) SetRegion(v string) { o.Region = &v } + // GetS3Prefix returns the S3Prefix field value if set, zero value otherwise. func (o *BackupConfig) GetS3Prefix() string { if o == nil || o.S3Prefix == nil { @@ -215,6 +229,7 @@ func (o *BackupConfig) SetS3Prefix(v string) { o.S3Prefix = &v } + // GetAutoBackup returns the AutoBackup field value if set, zero value otherwise. func (o *BackupConfig) GetAutoBackup() bool { if o == nil || o.AutoBackup == nil { @@ -243,6 +258,7 @@ func (o *BackupConfig) SetAutoBackup(v bool) { o.AutoBackup = &v } + // GetNextBackupTime returns the NextBackupTime field value if set, zero value otherwise. func (o *BackupConfig) GetNextBackupTime() string { if o == nil || o.NextBackupTime == nil { @@ -271,6 +287,7 @@ func (o *BackupConfig) SetNextBackupTime(v string) { o.NextBackupTime = &v } + // GetRetentionPolicy returns the RetentionPolicy field value if set, zero value otherwise. func (o *BackupConfig) GetRetentionPolicy() string { if o == nil || o.RetentionPolicy == nil { @@ -299,6 +316,7 @@ func (o *BackupConfig) SetRetentionPolicy(v string) { o.RetentionPolicy = &v } + // GetLastBackupTime returns the LastBackupTime field value if set, zero value otherwise. func (o *BackupConfig) GetLastBackupTime() string { if o == nil || o.LastBackupTime == nil { @@ -327,6 +345,8 @@ func (o *BackupConfig) SetLastBackupTime(v string) { o.LastBackupTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -373,23 +393,23 @@ func (o BackupConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Schedule *string `json:"schedule,omitempty"` - AccessKeyId *string `json:"accessKeyId,omitempty"` + Schedule *string `json:"schedule,omitempty"` + AccessKeyId *string `json:"accessKeyId,omitempty"` SecretAccessKey *string `json:"secretAccessKey,omitempty"` - Endpoint *string `json:"endpoint,omitempty"` - Region *string `json:"region,omitempty"` - S3Prefix *string `json:"s3Prefix,omitempty"` - AutoBackup *bool `json:"autoBackup,omitempty"` - NextBackupTime *string `json:"nextBackupTime,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + Region *string `json:"region,omitempty"` + S3Prefix *string `json:"s3Prefix,omitempty"` + AutoBackup *bool `json:"autoBackup,omitempty"` + NextBackupTime *string `json:"nextBackupTime,omitempty"` RetentionPolicy *string `json:"retentionPolicy,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` + LastBackupTime *string `json:"lastBackupTime,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"schedule", "accessKeyId", "secretAccessKey", "endpoint", "region", "s3Prefix", "autoBackup", "nextBackupTime", "retentionPolicy", "lastBackupTime"}) + common.DeleteKeys(additionalProperties, &[]string{ "schedule", "accessKeyId", "secretAccessKey", "endpoint", "region", "s3Prefix", "autoBackup", "nextBackupTime", "retentionPolicy", "lastBackupTime", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_create.go b/api/kbcloud/admin/model_backup_create.go index ea83b8de..96f6d447 100644 --- a/api/kbcloud/admin/model_backup_create.go +++ b/api/kbcloud/admin/model_backup_create.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupCreate BackupCreate is the payload to create a KubeBlocks cluster backup + + +// BackupCreate BackupCreate is the payload to create a KubeBlocks cluster backup type BackupCreate struct { // name of the backup, if not specified, a name will be generated automatically Name *string `json:"name,omitempty"` // specified the backup method BackupMethod string `json:"backupMethod"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupCreate instantiates a new BackupCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewBackupCreateWithDefaults() *BackupCreate { this := BackupCreate{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *BackupCreate) GetName() string { if o == nil || o.Name == nil { @@ -67,6 +72,7 @@ func (o *BackupCreate) SetName(v string) { o.Name = &v } + // GetBackupMethod returns the BackupMethod field value. func (o *BackupCreate) GetBackupMethod() string { if o == nil { @@ -90,6 +96,8 @@ func (o *BackupCreate) SetBackupMethod(v string) { o.BackupMethod = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o BackupCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` BackupMethod *string `json:"backupMethod"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,7 +129,7 @@ func (o *BackupCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "backupMethod"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "backupMethod", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_download.go b/api/kbcloud/admin/model_backup_download.go index fe6d61ad..702d70f0 100644 --- a/api/kbcloud/admin/model_backup_download.go +++ b/api/kbcloud/admin/model_backup_download.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupDownload struct { // the paths of file to download Filepaths []string `json:"filepaths,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupDownload instantiates a new BackupDownload object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewBackupDownloadWithDefaults() *BackupDownload { this := BackupDownload{} return &this } - // GetFilepaths returns the Filepaths field value if set, zero value otherwise. func (o *BackupDownload) GetFilepaths() []string { if o == nil || o.Filepaths == nil { @@ -59,6 +68,8 @@ func (o *BackupDownload) SetFilepaths(v []string) { o.Filepaths = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupDownload) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *BackupDownload) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"filepaths"}) + common.DeleteKeys(additionalProperties, &[]string{ "filepaths", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_list.go b/api/kbcloud/admin/model_backup_list.go index e07883d3..0c42cde8 100644 --- a/api/kbcloud/admin/model_backup_list.go +++ b/api/kbcloud/admin/model_backup_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupList BackupList is a list of backups + + +// BackupList BackupList is a list of backups type BackupList struct { // Items is the list of backup policy objects in the list Items []Backup `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupList instantiates a new BackupList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewBackupListWithDefaults() *BackupList { this := BackupList{} return &this } - // GetItems returns the Items field value. func (o *BackupList) GetItems() []Backup { if o == nil { @@ -62,6 +67,7 @@ func (o *BackupList) SetItems(v []Backup) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *BackupList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *BackupList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o BackupList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Backup `json:"items"` + Items *[]Backup `json:"items"` PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,14 +129,14 @@ func (o *BackupList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_backup_log.go b/api/kbcloud/admin/model_backup_log.go index 0a66982a..d4e0133a 100644 --- a/api/kbcloud/admin/model_backup_log.go +++ b/api/kbcloud/admin/model_backup_log.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// BackupLog backup workload logs +// BackupLog backup workload logs type BackupLog struct { // items is the list of backupLogByPod objects Items []BackupLogByPod `json:"items,omitempty"` // backup id BackupId *string `json:"backupId,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupLog instantiates a new BackupLog object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewBackupLogWithDefaults() *BackupLog { this := BackupLog{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *BackupLog) GetItems() []BackupLogByPod { if o == nil || o.Items == nil { @@ -62,6 +71,7 @@ func (o *BackupLog) SetItems(v []BackupLogByPod) { o.Items = v } + // GetBackupId returns the BackupId field value if set, zero value otherwise. func (o *BackupLog) GetBackupId() string { if o == nil || o.BackupId == nil { @@ -90,6 +100,8 @@ func (o *BackupLog) SetBackupId(v string) { o.BackupId = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupLog) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o BackupLog) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupLog) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items []BackupLogByPod `json:"items,omitempty"` - BackupId *string `json:"backupId,omitempty"` + Items []BackupLogByPod `json:"items,omitempty"` + BackupId *string `json:"backupId,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "backupId"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "backupId", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_log_by_pod.go b/api/kbcloud/admin/model_backup_log_by_pod.go index 3c2a7edb..028084dd 100644 --- a/api/kbcloud/admin/model_backup_log_by_pod.go +++ b/api/kbcloud/admin/model_backup_log_by_pod.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// BackupLogByPod info of backup workload log + + +// BackupLogByPod info of backup workload log type BackupLogByPod struct { // logs of the backup workload Log *string `json:"log,omitempty"` @@ -19,10 +24,11 @@ type BackupLogByPod struct { // Date/time when the backup pod was created. CreationTimestamp *time.Time `json:"creationTimestamp,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupLogByPod instantiates a new BackupLogByPod object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewBackupLogByPodWithDefaults() *BackupLogByPod { this := BackupLogByPod{} return &this } - // GetLog returns the Log field value if set, zero value otherwise. func (o *BackupLogByPod) GetLog() string { if o == nil || o.Log == nil { @@ -68,6 +73,7 @@ func (o *BackupLogByPod) SetLog(v string) { o.Log = &v } + // GetPodName returns the PodName field value if set, zero value otherwise. func (o *BackupLogByPod) GetPodName() string { if o == nil || o.PodName == nil { @@ -96,6 +102,7 @@ func (o *BackupLogByPod) SetPodName(v string) { o.PodName = &v } + // GetCreationTimestamp returns the CreationTimestamp field value if set, zero value otherwise. func (o *BackupLogByPod) GetCreationTimestamp() time.Time { if o == nil || o.CreationTimestamp == nil { @@ -124,6 +131,8 @@ func (o *BackupLogByPod) SetCreationTimestamp(v time.Time) { o.CreationTimestamp = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupLogByPod) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,8 +162,8 @@ func (o BackupLogByPod) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupLogByPod) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Log *string `json:"log,omitempty"` - PodName *string `json:"podName,omitempty"` + Log *string `json:"log,omitempty"` + PodName *string `json:"podName,omitempty"` CreationTimestamp *time.Time `json:"creationTimestamp,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -162,7 +171,7 @@ func (o *BackupLogByPod) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"log", "podName", "creationTimestamp"}) + common.DeleteKeys(additionalProperties, &[]string{ "log", "podName", "creationTimestamp", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_method_option.go b/api/kbcloud/admin/model_backup_method_option.go index 08f99ea0..f7491b11 100644 --- a/api/kbcloud/admin/model_backup_method_option.go +++ b/api/kbcloud/admin/model_backup_method_option.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type BackupMethodOption struct { - Name string `json:"name"` + Name string `json:"name"` Description *LocalizedDescription `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupMethodOption instantiates a new BackupMethodOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewBackupMethodOptionWithDefaults() *BackupMethodOption { this := BackupMethodOption{} return &this } - // GetName returns the Name field value. func (o *BackupMethodOption) GetName() string { if o == nil { @@ -59,6 +64,7 @@ func (o *BackupMethodOption) SetName(v string) { o.Name = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *BackupMethodOption) GetDescription() LocalizedDescription { if o == nil || o.Description == nil { @@ -87,6 +93,8 @@ func (o *BackupMethodOption) SetDescription(v LocalizedDescription) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupMethodOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -107,7 +115,7 @@ func (o BackupMethodOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupMethodOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` Description *LocalizedDescription `json:"description,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,14 +126,14 @@ func (o *BackupMethodOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "description", }) } else { return err } hasInvalidField := false o.Name = *all.Name - if all.Description != nil && all.Description.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Description != nil && all.Description.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Description = all.Description diff --git a/api/kbcloud/admin/model_backup_option.go b/api/kbcloud/admin/model_backup_option.go index 41cff416..2d5b228b 100644 --- a/api/kbcloud/admin/model_backup_option.go +++ b/api/kbcloud/admin/model_backup_option.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupOption struct { - DefaultMethod *string `json:"defaultMethod,omitempty"` - FullMethod []BackupMethodOption `json:"fullMethod,omitempty"` + DefaultMethod *string `json:"defaultMethod,omitempty"` + FullMethod []BackupMethodOption `json:"fullMethod,omitempty"` ContinuousMethod []BackupMethodOption `json:"continuousMethod,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupOption instantiates a new BackupOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewBackupOptionWithDefaults() *BackupOption { this := BackupOption{} return &this } - // GetDefaultMethod returns the DefaultMethod field value if set, zero value otherwise. func (o *BackupOption) GetDefaultMethod() string { if o == nil || o.DefaultMethod == nil { @@ -60,6 +69,7 @@ func (o *BackupOption) SetDefaultMethod(v string) { o.DefaultMethod = &v } + // GetFullMethod returns the FullMethod field value if set, zero value otherwise. func (o *BackupOption) GetFullMethod() []BackupMethodOption { if o == nil || o.FullMethod == nil { @@ -88,6 +98,7 @@ func (o *BackupOption) SetFullMethod(v []BackupMethodOption) { o.FullMethod = v } + // GetContinuousMethod returns the ContinuousMethod field value if set, zero value otherwise. func (o *BackupOption) GetContinuousMethod() []BackupMethodOption { if o == nil || o.ContinuousMethod == nil { @@ -116,6 +127,8 @@ func (o *BackupOption) SetContinuousMethod(v []BackupMethodOption) { o.ContinuousMethod = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -141,8 +154,8 @@ func (o BackupOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - DefaultMethod *string `json:"defaultMethod,omitempty"` - FullMethod []BackupMethodOption `json:"fullMethod,omitempty"` + DefaultMethod *string `json:"defaultMethod,omitempty"` + FullMethod []BackupMethodOption `json:"fullMethod,omitempty"` ContinuousMethod []BackupMethodOption `json:"continuousMethod,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -150,7 +163,7 @@ func (o *BackupOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"defaultMethod", "fullMethod", "continuousMethod"}) + common.DeleteKeys(additionalProperties, &[]string{ "defaultMethod", "fullMethod", "continuousMethod", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_policy.go b/api/kbcloud/admin/model_backup_policy.go index 64ab8740..c40a3989 100644 --- a/api/kbcloud/admin/model_backup_policy.go +++ b/api/kbcloud/admin/model_backup_policy.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// BackupPolicy BackupPolicy is the payload for KubeBlocks cluster backup policy + + +// BackupPolicy BackupPolicy is the payload for KubeBlocks cluster backup policy type BackupPolicy struct { // specify whether to use auto backup AutoBackup *bool `json:"autoBackup,omitempty"` @@ -29,10 +34,11 @@ type BackupPolicy struct { // the time to do next backup NextBackupTime *time.Time `json:"nextBackupTime,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupPolicy instantiates a new BackupPolicy object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -57,7 +63,6 @@ func NewBackupPolicyWithDefaults() *BackupPolicy { this.PitrEnabled = &pitrEnabled return &this } - // GetAutoBackup returns the AutoBackup field value if set, zero value otherwise. func (o *BackupPolicy) GetAutoBackup() bool { if o == nil || o.AutoBackup == nil { @@ -86,6 +91,7 @@ func (o *BackupPolicy) SetAutoBackup(v bool) { o.AutoBackup = &v } + // GetAutoBackupMethod returns the AutoBackupMethod field value if set, zero value otherwise. func (o *BackupPolicy) GetAutoBackupMethod() string { if o == nil || o.AutoBackupMethod == nil { @@ -114,6 +120,7 @@ func (o *BackupPolicy) SetAutoBackupMethod(v string) { o.AutoBackupMethod = &v } + // GetPitrEnabled returns the PitrEnabled field value if set, zero value otherwise. func (o *BackupPolicy) GetPitrEnabled() bool { if o == nil || o.PitrEnabled == nil { @@ -142,6 +149,7 @@ func (o *BackupPolicy) SetPitrEnabled(v bool) { o.PitrEnabled = &v } + // GetCronExpression returns the CronExpression field value if set, zero value otherwise. func (o *BackupPolicy) GetCronExpression() string { if o == nil || o.CronExpression == nil { @@ -170,6 +178,7 @@ func (o *BackupPolicy) SetCronExpression(v string) { o.CronExpression = &v } + // GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. func (o *BackupPolicy) GetRetentionPeriod() string { if o == nil || o.RetentionPeriod == nil { @@ -198,6 +207,7 @@ func (o *BackupPolicy) SetRetentionPeriod(v string) { o.RetentionPeriod = &v } + // GetBackupRepo returns the BackupRepo field value if set, zero value otherwise. func (o *BackupPolicy) GetBackupRepo() string { if o == nil || o.BackupRepo == nil { @@ -226,6 +236,7 @@ func (o *BackupPolicy) SetBackupRepo(v string) { o.BackupRepo = &v } + // GetRetentionPolicy returns the RetentionPolicy field value if set, zero value otherwise. func (o *BackupPolicy) GetRetentionPolicy() BackupRetentionPolicy { if o == nil || o.RetentionPolicy == nil { @@ -254,6 +265,7 @@ func (o *BackupPolicy) SetRetentionPolicy(v BackupRetentionPolicy) { o.RetentionPolicy = &v } + // GetNextBackupTime returns the NextBackupTime field value if set, zero value otherwise. func (o *BackupPolicy) GetNextBackupTime() time.Time { if o == nil || o.NextBackupTime == nil { @@ -282,6 +294,8 @@ func (o *BackupPolicy) SetNextBackupTime(v time.Time) { o.NextBackupTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupPolicy) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -326,21 +340,21 @@ func (o BackupPolicy) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupPolicy) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AutoBackup *bool `json:"autoBackup,omitempty"` - AutoBackupMethod *string `json:"autoBackupMethod,omitempty"` - PitrEnabled *bool `json:"pitrEnabled,omitempty"` - CronExpression *string `json:"cronExpression,omitempty"` - RetentionPeriod *string `json:"retentionPeriod,omitempty"` - BackupRepo *string `json:"backupRepo,omitempty"` - RetentionPolicy *BackupRetentionPolicy `json:"retentionPolicy,omitempty"` - NextBackupTime *time.Time `json:"nextBackupTime,omitempty"` + AutoBackup *bool `json:"autoBackup,omitempty"` + AutoBackupMethod *string `json:"autoBackupMethod,omitempty"` + PitrEnabled *bool `json:"pitrEnabled,omitempty"` + CronExpression *string `json:"cronExpression,omitempty"` + RetentionPeriod *string `json:"retentionPeriod,omitempty"` + BackupRepo *string `json:"backupRepo,omitempty"` + RetentionPolicy *BackupRetentionPolicy `json:"retentionPolicy,omitempty"` + NextBackupTime *time.Time `json:"nextBackupTime,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"autoBackup", "autoBackupMethod", "pitrEnabled", "cronExpression", "retentionPeriod", "backupRepo", "retentionPolicy", "nextBackupTime"}) + common.DeleteKeys(additionalProperties, &[]string{ "autoBackup", "autoBackupMethod", "pitrEnabled", "cronExpression", "retentionPeriod", "backupRepo", "retentionPolicy", "nextBackupTime", }) } else { return err } @@ -352,7 +366,7 @@ func (o *BackupPolicy) UnmarshalJSON(bytes []byte) (err error) { o.CronExpression = all.CronExpression o.RetentionPeriod = all.RetentionPeriod o.BackupRepo = all.BackupRepo - if all.RetentionPolicy != nil && !all.RetentionPolicy.IsValid() { + if all.RetentionPolicy != nil &&!all.RetentionPolicy.IsValid() { hasInvalidField = true } else { o.RetentionPolicy = all.RetentionPolicy diff --git a/api/kbcloud/admin/model_backup_repo.go b/api/kbcloud/admin/model_backup_repo.go index 8f2c993b..501e4294 100644 --- a/api/kbcloud/admin/model_backup_repo.go +++ b/api/kbcloud/admin/model_backup_repo.go @@ -2,17 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" - "github.com/google/uuid" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupRepo backupRepo is the payload for KubeBlocks cluster backup repo + + +// BackupRepo backupRepo is the payload for KubeBlocks cluster backup repo type BackupRepo struct { // the access method for backup repo AccessMethod BackupRepoAccessMethod `json:"accessMethod"` @@ -45,10 +48,11 @@ type BackupRepo struct { // failedMessage specifies the message of the backupRepo failure FailedMessage *string `json:"failedMessage,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepo instantiates a new BackupRepo object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -76,7 +80,6 @@ func NewBackupRepoWithDefaults() *BackupRepo { this.AccessMethod = accessMethod return &this } - // GetAccessMethod returns the AccessMethod field value. func (o *BackupRepo) GetAccessMethod() BackupRepoAccessMethod { if o == nil { @@ -100,6 +103,7 @@ func (o *BackupRepo) SetAccessMethod(v BackupRepoAccessMethod) { o.AccessMethod = v } + // GetId returns the Id field value if set, zero value otherwise. func (o *BackupRepo) GetId() string { if o == nil || o.Id == nil { @@ -128,6 +132,7 @@ func (o *BackupRepo) SetId(v string) { o.Id = &v } + // GetBackupNums returns the BackupNums field value if set, zero value otherwise. func (o *BackupRepo) GetBackupNums() int32 { if o == nil || o.BackupNums == nil { @@ -156,6 +161,7 @@ func (o *BackupRepo) SetBackupNums(v int32) { o.BackupNums = &v } + // GetConfig returns the Config field value. func (o *BackupRepo) GetConfig() map[string]string { if o == nil { @@ -179,6 +185,7 @@ func (o *BackupRepo) SetConfig(v map[string]string) { o.Config = v } + // GetCreatedAt returns the CreatedAt field value. func (o *BackupRepo) GetCreatedAt() time.Time { if o == nil { @@ -202,6 +209,7 @@ func (o *BackupRepo) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDefault returns the Default field value. func (o *BackupRepo) GetDefault() bool { if o == nil { @@ -225,6 +233,7 @@ func (o *BackupRepo) SetDefault(v bool) { o.Default = v } + // GetEnvironmentId returns the EnvironmentId field value. func (o *BackupRepo) GetEnvironmentId() uuid.UUID { if o == nil { @@ -248,6 +257,7 @@ func (o *BackupRepo) SetEnvironmentId(v uuid.UUID) { o.EnvironmentId = v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *BackupRepo) GetEnvironmentName() string { if o == nil { @@ -271,6 +281,7 @@ func (o *BackupRepo) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetName returns the Name field value. func (o *BackupRepo) GetName() string { if o == nil { @@ -294,6 +305,7 @@ func (o *BackupRepo) SetName(v string) { o.Name = v } + // GetStatus returns the Status field value. func (o *BackupRepo) GetStatus() string { if o == nil { @@ -317,6 +329,7 @@ func (o *BackupRepo) SetStatus(v string) { o.Status = v } + // GetStorageId returns the StorageId field value if set, zero value otherwise. func (o *BackupRepo) GetStorageId() string { if o == nil || o.StorageId == nil { @@ -345,6 +358,7 @@ func (o *BackupRepo) SetStorageId(v string) { o.StorageId = &v } + // GetStorageProvider returns the StorageProvider field value. func (o *BackupRepo) GetStorageProvider() string { if o == nil { @@ -368,6 +382,7 @@ func (o *BackupRepo) SetStorageProvider(v string) { o.StorageProvider = v } + // GetTotalSize returns the TotalSize field value if set, zero value otherwise. func (o *BackupRepo) GetTotalSize() string { if o == nil || o.TotalSize == nil { @@ -396,6 +411,7 @@ func (o *BackupRepo) SetTotalSize(v string) { o.TotalSize = &v } + // GetFailedReason returns the FailedReason field value if set, zero value otherwise. func (o *BackupRepo) GetFailedReason() string { if o == nil || o.FailedReason == nil { @@ -424,6 +440,7 @@ func (o *BackupRepo) SetFailedReason(v string) { o.FailedReason = &v } + // GetFailedMessage returns the FailedMessage field value if set, zero value otherwise. func (o *BackupRepo) GetFailedMessage() string { if o == nil || o.FailedMessage == nil { @@ -452,6 +469,8 @@ func (o *BackupRepo) SetFailedMessage(v string) { o.FailedMessage = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -499,21 +518,21 @@ func (o BackupRepo) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupRepo) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AccessMethod *BackupRepoAccessMethod `json:"accessMethod"` - Id *string `json:"id,omitempty"` - BackupNums *int32 `json:"backupNums,omitempty"` - Config *map[string]string `json:"config"` - CreatedAt *time.Time `json:"createdAt"` - Default *bool `json:"default"` - EnvironmentId *uuid.UUID `json:"environmentId"` - EnvironmentName *string `json:"environmentName"` - Name *string `json:"name"` - Status *string `json:"status"` - StorageId *string `json:"storageID,omitempty"` - StorageProvider *string `json:"storageProvider"` - TotalSize *string `json:"totalSize,omitempty"` - FailedReason *string `json:"failedReason,omitempty"` - FailedMessage *string `json:"failedMessage,omitempty"` + AccessMethod *BackupRepoAccessMethod `json:"accessMethod"` + Id *string `json:"id,omitempty"` + BackupNums *int32 `json:"backupNums,omitempty"` + Config *map[string]string `json:"config"` + CreatedAt *time.Time `json:"createdAt"` + Default *bool `json:"default"` + EnvironmentId *uuid.UUID `json:"environmentId"` + EnvironmentName *string `json:"environmentName"` + Name *string `json:"name"` + Status *string `json:"status"` + StorageId *string `json:"storageID,omitempty"` + StorageProvider *string `json:"storageProvider"` + TotalSize *string `json:"totalSize,omitempty"` + FailedReason *string `json:"failedReason,omitempty"` + FailedMessage *string `json:"failedMessage,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -547,7 +566,7 @@ func (o *BackupRepo) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accessMethod", "id", "backupNums", "config", "createdAt", "default", "environmentId", "environmentName", "name", "status", "storageID", "storageProvider", "totalSize", "failedReason", "failedMessage"}) + common.DeleteKeys(additionalProperties, &[]string{ "accessMethod", "id", "backupNums", "config", "createdAt", "default", "environmentId", "environmentName", "name", "status", "storageID", "storageProvider", "totalSize", "failedReason", "failedMessage", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_repo_access_method.go b/api/kbcloud/admin/model_backup_repo_access_method.go index 681581aa..b667e0b1 100644 --- a/api/kbcloud/admin/model_backup_repo_access_method.go +++ b/api/kbcloud/admin/model_backup_repo_access_method.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupRepoAccessMethod the access method for backup repo type BackupRepoAccessMethod string // List of BackupRepoAccessMethod. const ( BackupRepoAccessMethodMount BackupRepoAccessMethod = "Mount" - BackupRepoAccessMethodTool BackupRepoAccessMethod = "Tool" + BackupRepoAccessMethodTool BackupRepoAccessMethod = "Tool" ) var allowedBackupRepoAccessMethodEnumValues = []BackupRepoAccessMethod{ diff --git a/api/kbcloud/admin/model_backup_repo_check.go b/api/kbcloud/admin/model_backup_repo_check.go index cc55f4fc..8ed76fba 100644 --- a/api/kbcloud/admin/model_backup_repo_check.go +++ b/api/kbcloud/admin/model_backup_repo_check.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupRepoCheck struct { // whether backup repo pass the check Success *bool `json:"success,omitempty"` // the info when failed to pass the check Message interface{} `json:"message,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepoCheck instantiates a new BackupRepoCheck object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewBackupRepoCheckWithDefaults() *BackupRepoCheck { this := BackupRepoCheck{} return &this } - // GetSuccess returns the Success field value if set, zero value otherwise. func (o *BackupRepoCheck) GetSuccess() bool { if o == nil || o.Success == nil { @@ -61,6 +70,7 @@ func (o *BackupRepoCheck) SetSuccess(v bool) { o.Success = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *BackupRepoCheck) GetMessage() interface{} { if o == nil || o.Message == nil { @@ -89,6 +99,8 @@ func (o *BackupRepoCheck) SetMessage(v interface{}) { o.Message = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepoCheck) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +123,7 @@ func (o BackupRepoCheck) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupRepoCheck) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Success *bool `json:"success,omitempty"` + Success *bool `json:"success,omitempty"` Message interface{} `json:"message,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +131,7 @@ func (o *BackupRepoCheck) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"success", "message"}) + common.DeleteKeys(additionalProperties, &[]string{ "success", "message", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_repo_create.go b/api/kbcloud/admin/model_backup_repo_create.go index 44cf8147..a8f3b212 100644 --- a/api/kbcloud/admin/model_backup_repo_create.go +++ b/api/kbcloud/admin/model_backup_repo_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupRepoCreate BackupRepoCreate is the payload to create a KubeBlocks cluster backup repo + + +// BackupRepoCreate BackupRepoCreate is the payload to create a KubeBlocks cluster backup repo type BackupRepoCreate struct { // the id of storage that backup repo used StorageId string `json:"storageID"` @@ -27,10 +32,11 @@ type BackupRepoCreate struct { // Specify the capacity of the new created PVC VolumeCapacity *string `json:"volumeCapacity,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepoCreate instantiates a new BackupRepoCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +59,6 @@ func NewBackupRepoCreateWithDefaults() *BackupRepoCreate { this.AccessMethod = &accessMethod return &this } - // GetStorageId returns the StorageId field value. func (o *BackupRepoCreate) GetStorageId() string { if o == nil { @@ -77,6 +82,7 @@ func (o *BackupRepoCreate) SetStorageId(v string) { o.StorageId = v } + // GetAccessMethod returns the AccessMethod field value if set, zero value otherwise. func (o *BackupRepoCreate) GetAccessMethod() BackupRepoAccessMethod { if o == nil || o.AccessMethod == nil { @@ -105,6 +111,7 @@ func (o *BackupRepoCreate) SetAccessMethod(v BackupRepoAccessMethod) { o.AccessMethod = &v } + // GetDefault returns the Default field value if set, zero value otherwise. func (o *BackupRepoCreate) GetDefault() bool { if o == nil || o.Default == nil { @@ -133,6 +140,7 @@ func (o *BackupRepoCreate) SetDefault(v bool) { o.Default = &v } + // GetName returns the Name field value. func (o *BackupRepoCreate) GetName() string { if o == nil { @@ -156,6 +164,7 @@ func (o *BackupRepoCreate) SetName(v string) { o.Name = v } + // GetParams returns the Params field value if set, zero value otherwise. func (o *BackupRepoCreate) GetParams() map[string]string { if o == nil || o.Params == nil { @@ -184,6 +193,7 @@ func (o *BackupRepoCreate) SetParams(v map[string]string) { o.Params = v } + // GetPvReclaimPolicy returns the PvReclaimPolicy field value if set, zero value otherwise. func (o *BackupRepoCreate) GetPvReclaimPolicy() BackupRepoPVReclaimPolicy { if o == nil || o.PvReclaimPolicy == nil { @@ -212,6 +222,7 @@ func (o *BackupRepoCreate) SetPvReclaimPolicy(v BackupRepoPVReclaimPolicy) { o.PvReclaimPolicy = &v } + // GetVolumeCapacity returns the VolumeCapacity field value if set, zero value otherwise. func (o *BackupRepoCreate) GetVolumeCapacity() string { if o == nil || o.VolumeCapacity == nil { @@ -240,6 +251,8 @@ func (o *BackupRepoCreate) SetVolumeCapacity(v string) { o.VolumeCapacity = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepoCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -273,13 +286,13 @@ func (o BackupRepoCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupRepoCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - StorageId *string `json:"storageID"` - AccessMethod *BackupRepoAccessMethod `json:"accessMethod,omitempty"` - Default *bool `json:"default,omitempty"` - Name *string `json:"name"` - Params map[string]string `json:"params,omitempty"` + StorageId *string `json:"storageID"` + AccessMethod *BackupRepoAccessMethod `json:"accessMethod,omitempty"` + Default *bool `json:"default,omitempty"` + Name *string `json:"name"` + Params map[string]string `json:"params,omitempty"` PvReclaimPolicy *BackupRepoPVReclaimPolicy `json:"pvReclaimPolicy,omitempty"` - VolumeCapacity *string `json:"volumeCapacity,omitempty"` + VolumeCapacity *string `json:"volumeCapacity,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -292,14 +305,14 @@ func (o *BackupRepoCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"storageID", "accessMethod", "default", "name", "params", "pvReclaimPolicy", "volumeCapacity"}) + common.DeleteKeys(additionalProperties, &[]string{ "storageID", "accessMethod", "default", "name", "params", "pvReclaimPolicy", "volumeCapacity", }) } else { return err } hasInvalidField := false o.StorageId = *all.StorageId - if all.AccessMethod != nil && !all.AccessMethod.IsValid() { + if all.AccessMethod != nil &&!all.AccessMethod.IsValid() { hasInvalidField = true } else { o.AccessMethod = all.AccessMethod @@ -307,7 +320,7 @@ func (o *BackupRepoCreate) UnmarshalJSON(bytes []byte) (err error) { o.Default = all.Default o.Name = *all.Name o.Params = all.Params - if all.PvReclaimPolicy != nil && !all.PvReclaimPolicy.IsValid() { + if all.PvReclaimPolicy != nil &&!all.PvReclaimPolicy.IsValid() { hasInvalidField = true } else { o.PvReclaimPolicy = all.PvReclaimPolicy diff --git a/api/kbcloud/admin/model_backup_repo_list.go b/api/kbcloud/admin/model_backup_repo_list.go index 6352b209..5e807c62 100644 --- a/api/kbcloud/admin/model_backup_repo_list.go +++ b/api/kbcloud/admin/model_backup_repo_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupRepoList BackupRepoList is a list of backupRepo + + +// BackupRepoList BackupRepoList is a list of backupRepo type BackupRepoList struct { // Items is the list of backupRepo objects in the list Items []BackupRepo `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepoList instantiates a new BackupRepoList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewBackupRepoListWithDefaults() *BackupRepoList { this := BackupRepoList{} return &this } - // GetItems returns the Items field value. func (o *BackupRepoList) GetItems() []BackupRepo { if o == nil { @@ -62,6 +67,7 @@ func (o *BackupRepoList) SetItems(v []BackupRepo) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *BackupRepoList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *BackupRepoList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepoList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o BackupRepoList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupRepoList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]BackupRepo `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]BackupRepo `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *BackupRepoList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_backup_repo_pv_reclaim_policy.go b/api/kbcloud/admin/model_backup_repo_pv_reclaim_policy.go index cc72b396..b24cc56a 100644 --- a/api/kbcloud/admin/model_backup_repo_pv_reclaim_policy.go +++ b/api/kbcloud/admin/model_backup_repo_pv_reclaim_policy.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupRepoPVReclaimPolicy Specify the reclaim policy for PVs created by this backup repo type BackupRepoPVReclaimPolicy string diff --git a/api/kbcloud/admin/model_backup_repo_update.go b/api/kbcloud/admin/model_backup_repo_update.go index 82eb7e1f..23008195 100644 --- a/api/kbcloud/admin/model_backup_repo_update.go +++ b/api/kbcloud/admin/model_backup_repo_update.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// BackupRepoUpdate BackupRepoUpdate is the payload to update a KubeBlocks cluster backup repo +// BackupRepoUpdate BackupRepoUpdate is the payload to update a KubeBlocks cluster backup repo type BackupRepoUpdate struct { // default specifies whether the backupRepo is the default backupRepo Default *bool `json:"default,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepoUpdate instantiates a new BackupRepoUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewBackupRepoUpdateWithDefaults() *BackupRepoUpdate { this := BackupRepoUpdate{} return &this } - // GetDefault returns the Default field value if set, zero value otherwise. func (o *BackupRepoUpdate) GetDefault() bool { if o == nil || o.Default == nil { @@ -60,6 +69,8 @@ func (o *BackupRepoUpdate) SetDefault(v bool) { o.Default = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepoUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *BackupRepoUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"default"}) + common.DeleteKeys(additionalProperties, &[]string{ "default", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_repo_view.go b/api/kbcloud/admin/model_backup_repo_view.go index a2b85c90..3921d84e 100644 --- a/api/kbcloud/admin/model_backup_repo_view.go +++ b/api/kbcloud/admin/model_backup_repo_view.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupRepoView struct { // the router to show in backup repo Filepath *string `json:"filepath,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepoView instantiates a new BackupRepoView object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewBackupRepoViewWithDefaults() *BackupRepoView { this := BackupRepoView{} return &this } - // GetFilepath returns the Filepath field value if set, zero value otherwise. func (o *BackupRepoView) GetFilepath() string { if o == nil || o.Filepath == nil { @@ -59,6 +68,8 @@ func (o *BackupRepoView) SetFilepath(v string) { o.Filepath = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepoView) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *BackupRepoView) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"filepath"}) + common.DeleteKeys(additionalProperties, &[]string{ "filepath", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_retention_policy.go b/api/kbcloud/admin/model_backup_retention_policy.go index 14d6bf6f..a5f56ac6 100644 --- a/api/kbcloud/admin/model_backup_retention_policy.go +++ b/api/kbcloud/admin/model_backup_retention_policy.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupRetentionPolicy backup retention policy when cluster is deleted type BackupRetentionPolicy string // List of BackupRetentionPolicy. const ( - BackupRetentionPolicyAll BackupRetentionPolicy = "All" + BackupRetentionPolicyAll BackupRetentionPolicy = "All" BackupRetentionPolicyLastOne BackupRetentionPolicy = "LastOne" BackupRetentionPolicyWipeOut BackupRetentionPolicy = "WipeOut" ) diff --git a/api/kbcloud/admin/model_backup_stats.go b/api/kbcloud/admin/model_backup_stats.go index 217bb0e2..91fd57e5 100644 --- a/api/kbcloud/admin/model_backup_stats.go +++ b/api/kbcloud/admin/model_backup_stats.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// BackupStats Backup statistic info + + +// BackupStats Backup statistic info type BackupStats struct { // Number of backups for each defferent status BackupStatsStatus []BackupStatsStatus `json:"backupStatsStatus,omitempty"` @@ -21,10 +26,11 @@ type BackupStats struct { // backup status of the latest backup LatestBackupStatus common.NullableString `json:"latestBackupStatus,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupStats instantiates a new BackupStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewBackupStatsWithDefaults() *BackupStats { this := BackupStats{} return &this } - // GetBackupStatsStatus returns the BackupStatsStatus field value if set, zero value otherwise. func (o *BackupStats) GetBackupStatsStatus() []BackupStatsStatus { if o == nil || o.BackupStatsStatus == nil { @@ -70,6 +75,7 @@ func (o *BackupStats) SetBackupStatsStatus(v []BackupStatsStatus) { o.BackupStatsStatus = v } + // GetBackupStatsEngine returns the BackupStatsEngine field value if set, zero value otherwise. func (o *BackupStats) GetBackupStatsEngine() []BackupStatsEngine { if o == nil || o.BackupStatsEngine == nil { @@ -98,6 +104,7 @@ func (o *BackupStats) SetBackupStatsEngine(v []BackupStatsEngine) { o.BackupStatsEngine = v } + // GetLatestBackupTime returns the LatestBackupTime field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BackupStats) GetLatestBackupTime() time.Time { if o == nil || o.LatestBackupTime.Get() == nil { @@ -111,7 +118,7 @@ func (o *BackupStats) GetLatestBackupTime() time.Time { // 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 *BackupStats) GetLatestBackupTimeOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.LatestBackupTime.Get(), o.LatestBackupTime.IsSet() @@ -126,7 +133,6 @@ func (o *BackupStats) HasLatestBackupTime() bool { func (o *BackupStats) SetLatestBackupTime(v time.Time) { o.LatestBackupTime.Set(&v) } - // SetLatestBackupTimeNil sets the value for LatestBackupTime to be an explicit nil. func (o *BackupStats) SetLatestBackupTimeNil() { o.LatestBackupTime.Set(nil) @@ -137,6 +143,7 @@ func (o *BackupStats) UnsetLatestBackupTime() { o.LatestBackupTime.Unset() } + // GetLatestBackupStatus returns the LatestBackupStatus field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BackupStats) GetLatestBackupStatus() string { if o == nil || o.LatestBackupStatus.Get() == nil { @@ -150,7 +157,7 @@ func (o *BackupStats) GetLatestBackupStatus() string { // 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 *BackupStats) GetLatestBackupStatusOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.LatestBackupStatus.Get(), o.LatestBackupStatus.IsSet() @@ -165,7 +172,6 @@ func (o *BackupStats) HasLatestBackupStatus() bool { func (o *BackupStats) SetLatestBackupStatus(v string) { o.LatestBackupStatus.Set(&v) } - // SetLatestBackupStatusNil sets the value for LatestBackupStatus to be an explicit nil. func (o *BackupStats) SetLatestBackupStatusNil() { o.LatestBackupStatus.Set(nil) @@ -176,6 +182,8 @@ func (o *BackupStats) UnsetLatestBackupStatus() { o.LatestBackupStatus.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o BackupStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -204,9 +212,9 @@ func (o BackupStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - BackupStatsStatus []BackupStatsStatus `json:"backupStatsStatus,omitempty"` - BackupStatsEngine []BackupStatsEngine `json:"backupStatsEngine,omitempty"` - LatestBackupTime common.NullableTime `json:"latestBackupTime,omitempty"` + BackupStatsStatus []BackupStatsStatus `json:"backupStatsStatus,omitempty"` + BackupStatsEngine []BackupStatsEngine `json:"backupStatsEngine,omitempty"` + LatestBackupTime common.NullableTime `json:"latestBackupTime,omitempty"` LatestBackupStatus common.NullableString `json:"latestBackupStatus,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -214,7 +222,7 @@ func (o *BackupStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"backupStatsStatus", "backupStatsEngine", "latestBackupTime", "latestBackupStatus"}) + common.DeleteKeys(additionalProperties, &[]string{ "backupStatsStatus", "backupStatsEngine", "latestBackupTime", "latestBackupStatus", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_stats_engine.go b/api/kbcloud/admin/model_backup_stats_engine.go index 488b5f54..b8c92d2c 100644 --- a/api/kbcloud/admin/model_backup_stats_engine.go +++ b/api/kbcloud/admin/model_backup_stats_engine.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// BackupStatsEngine Totalsize and number of backups for the engine + + +// BackupStatsEngine Totalsize and number of backups for the engine type BackupStatsEngine struct { // Engine name EngineName *string `json:"engineName,omitempty"` @@ -15,10 +24,11 @@ type BackupStatsEngine struct { // The number of backups for each engine BackupNum *int64 `json:"backupNum,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupStatsEngine instantiates a new BackupStatsEngine object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewBackupStatsEngineWithDefaults() *BackupStatsEngine { this := BackupStatsEngine{} return &this } - // GetEngineName returns the EngineName field value if set, zero value otherwise. func (o *BackupStatsEngine) GetEngineName() string { if o == nil || o.EngineName == nil { @@ -64,6 +73,7 @@ func (o *BackupStatsEngine) SetEngineName(v string) { o.EngineName = &v } + // GetBackupSize returns the BackupSize field value if set, zero value otherwise. func (o *BackupStatsEngine) GetBackupSize() string { if o == nil || o.BackupSize == nil { @@ -92,6 +102,7 @@ func (o *BackupStatsEngine) SetBackupSize(v string) { o.BackupSize = &v } + // GetBackupNum returns the BackupNum field value if set, zero value otherwise. func (o *BackupStatsEngine) GetBackupNum() int64 { if o == nil || o.BackupNum == nil { @@ -120,6 +131,8 @@ func (o *BackupStatsEngine) SetBackupNum(v int64) { o.BackupNum = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupStatsEngine) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -147,14 +160,14 @@ func (o *BackupStatsEngine) UnmarshalJSON(bytes []byte) (err error) { all := struct { EngineName *string `json:"engineName,omitempty"` BackupSize *string `json:"backupSize,omitempty"` - BackupNum *int64 `json:"backupNum,omitempty"` + BackupNum *int64 `json:"backupNum,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "backupSize", "backupNum"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "backupSize", "backupNum", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_stats_status.go b/api/kbcloud/admin/model_backup_stats_status.go index 1498ac2b..7f3e8801 100644 --- a/api/kbcloud/admin/model_backup_stats_status.go +++ b/api/kbcloud/admin/model_backup_stats_status.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// BackupStatsStatus Number of backups for the status +// BackupStatsStatus Number of backups for the status type BackupStatsStatus struct { // Backup status Status *string `json:"status,omitempty"` // Number of backups for each status BackupNum *int64 `json:"backupNum,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupStatsStatus instantiates a new BackupStatsStatus object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewBackupStatsStatusWithDefaults() *BackupStatsStatus { this := BackupStatsStatus{} return &this } - // GetStatus returns the Status field value if set, zero value otherwise. func (o *BackupStatsStatus) GetStatus() string { if o == nil || o.Status == nil { @@ -62,6 +71,7 @@ func (o *BackupStatsStatus) SetStatus(v string) { o.Status = &v } + // GetBackupNum returns the BackupNum field value if set, zero value otherwise. func (o *BackupStatsStatus) GetBackupNum() int64 { if o == nil || o.BackupNum == nil { @@ -90,6 +100,8 @@ func (o *BackupStatsStatus) SetBackupNum(v int64) { o.BackupNum = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupStatsStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o BackupStatsStatus) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupStatsStatus) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Status *string `json:"status,omitempty"` - BackupNum *int64 `json:"backupNum,omitempty"` + Status *string `json:"status,omitempty"` + BackupNum *int64 `json:"backupNum,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"status", "backupNum"}) + common.DeleteKeys(additionalProperties, &[]string{ "status", "backupNum", }) } else { return err } diff --git a/api/kbcloud/admin/model_backup_status.go b/api/kbcloud/admin/model_backup_status.go index 1e8dc278..6b2cfff5 100644 --- a/api/kbcloud/admin/model_backup_status.go +++ b/api/kbcloud/admin/model_backup_status.go @@ -2,25 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupStatus The current status. Valid values are New, InProgress, Completed, Failed. type BackupStatus string // List of BackupStatus. const ( - BackupStatusNew BackupStatus = "New" + BackupStatusNew BackupStatus = "New" BackupStatusInProgress BackupStatus = "InProgress" - BackupStatusRunning BackupStatus = "Running" - BackupStatusCompleted BackupStatus = "Completed" - BackupStatusFailed BackupStatus = "Failed" - BackupStatusDeleting BackupStatus = "Deleting" + BackupStatusRunning BackupStatus = "Running" + BackupStatusCompleted BackupStatus = "Completed" + BackupStatusFailed BackupStatus = "Failed" + BackupStatusDeleting BackupStatus = "Deleting" ) var allowedBackupStatusEnumValues = []BackupStatus{ diff --git a/api/kbcloud/admin/model_backup_type.go b/api/kbcloud/admin/model_backup_type.go index 34536b3a..adeb11ab 100644 --- a/api/kbcloud/admin/model_backup_type.go +++ b/api/kbcloud/admin/model_backup_type.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupType the type of backup type BackupType string // List of BackupType. const ( - BackupTypeFull BackupType = "Full" - BackupTypeIncremental BackupType = "Incremental" + BackupTypeFull BackupType = "Full" + BackupTypeIncremental BackupType = "Incremental" BackupTypeDifferential BackupType = "Differential" - BackupTypeContinuous BackupType = "Continuous" + BackupTypeContinuous BackupType = "Continuous" ) var allowedBackupTypeEnumValues = []BackupType{ diff --git a/api/kbcloud/admin/model_backup_view.go b/api/kbcloud/admin/model_backup_view.go index 8cc3d4c5..5e0c5b0d 100644 --- a/api/kbcloud/admin/model_backup_view.go +++ b/api/kbcloud/admin/model_backup_view.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupView struct { // the paths of file to view Filepaths []string `json:"filepaths,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupView instantiates a new BackupView object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewBackupViewWithDefaults() *BackupView { this := BackupView{} return &this } - // GetFilepaths returns the Filepaths field value if set, zero value otherwise. func (o *BackupView) GetFilepaths() []string { if o == nil || o.Filepaths == nil { @@ -59,6 +68,8 @@ func (o *BackupView) SetFilepaths(v []string) { o.Filepaths = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupView) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *BackupView) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"filepaths"}) + common.DeleteKeys(additionalProperties, &[]string{ "filepaths", }) } else { return err } diff --git a/api/kbcloud/admin/model_bench_option.go b/api/kbcloud/admin/model_bench_option.go index be78c707..1fb0c80a 100644 --- a/api/kbcloud/admin/model_bench_option.go +++ b/api/kbcloud/admin/model_bench_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type BenchOption struct { - Pgbench bool `json:"pgbench"` + Pgbench bool `json:"pgbench"` Sysbench bool `json:"sysbench"` - Tpcc bool `json:"tpcc"` - Ycsb bool `json:"ycsb"` + Tpcc bool `json:"tpcc"` + Ycsb bool `json:"ycsb"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBenchOption instantiates a new BenchOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewBenchOptionWithDefaults() *BenchOption { this := BenchOption{} return &this } - // GetPgbench returns the Pgbench field value. func (o *BenchOption) GetPgbench() bool { if o == nil { @@ -64,6 +69,7 @@ func (o *BenchOption) SetPgbench(v bool) { o.Pgbench = v } + // GetSysbench returns the Sysbench field value. func (o *BenchOption) GetSysbench() bool { if o == nil { @@ -87,6 +93,7 @@ func (o *BenchOption) SetSysbench(v bool) { o.Sysbench = v } + // GetTpcc returns the Tpcc field value. func (o *BenchOption) GetTpcc() bool { if o == nil { @@ -110,6 +117,7 @@ func (o *BenchOption) SetTpcc(v bool) { o.Tpcc = v } + // GetYcsb returns the Ycsb field value. func (o *BenchOption) GetYcsb() bool { if o == nil { @@ -133,6 +141,8 @@ func (o *BenchOption) SetYcsb(v bool) { o.Ycsb = v } + + // MarshalJSON serializes the struct using spec logic. func (o BenchOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,10 +163,10 @@ func (o BenchOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BenchOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Pgbench *bool `json:"pgbench"` + Pgbench *bool `json:"pgbench"` Sysbench *bool `json:"sysbench"` - Tpcc *bool `json:"tpcc"` - Ycsb *bool `json:"ycsb"` + Tpcc *bool `json:"tpcc"` + Ycsb *bool `json:"ycsb"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -175,7 +185,7 @@ func (o *BenchOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"pgbench", "sysbench", "tpcc", "ycsb"}) + common.DeleteKeys(additionalProperties, &[]string{ "pgbench", "sysbench", "tpcc", "ycsb", }) } else { return err } diff --git a/api/kbcloud/admin/model_class.go b/api/kbcloud/admin/model_class.go index 2cb60c73..d160989c 100644 --- a/api/kbcloud/admin/model_class.go +++ b/api/kbcloud/admin/model_class.go @@ -2,28 +2,38 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Class struct { - Engine *string `json:"engine,omitempty"` - Code *string `json:"code,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` - Mode *string `json:"mode,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - CpuRequest *float64 `json:"cpuRequest,omitempty"` - CpuLimit *float64 `json:"cpuLimit,omitempty"` - Memory *float64 `json:"memory,omitempty"` - MemoryRequest *float64 `json:"memoryRequest,omitempty"` - MemoryLimit *float64 `json:"memoryLimit,omitempty"` - Component *string `json:"component,omitempty"` - Series *ClassSeries `json:"series,omitempty"` + Engine *string `json:"engine,omitempty"` + Code *string `json:"code,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` + Mode *string `json:"mode,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + CpuRequest *float64 `json:"cpuRequest,omitempty"` + CpuLimit *float64 `json:"cpuLimit,omitempty"` + Memory *float64 `json:"memory,omitempty"` + MemoryRequest *float64 `json:"memoryRequest,omitempty"` + MemoryLimit *float64 `json:"memoryLimit,omitempty"` + Component *string `json:"component,omitempty"` + Series *ClassSeries `json:"series,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClass instantiates a new Class object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +50,6 @@ func NewClassWithDefaults() *Class { this := Class{} return &this } - // GetEngine returns the Engine field value if set, zero value otherwise. func (o *Class) GetEngine() string { if o == nil || o.Engine == nil { @@ -69,6 +78,7 @@ func (o *Class) SetEngine(v string) { o.Engine = &v } + // GetCode returns the Code field value if set, zero value otherwise. func (o *Class) GetCode() string { if o == nil || o.Code == nil { @@ -97,6 +107,7 @@ func (o *Class) SetCode(v string) { o.Code = &v } + // GetCodeShort returns the CodeShort field value if set, zero value otherwise. func (o *Class) GetCodeShort() string { if o == nil || o.CodeShort == nil { @@ -125,6 +136,7 @@ func (o *Class) SetCodeShort(v string) { o.CodeShort = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *Class) GetMode() string { if o == nil || o.Mode == nil { @@ -153,6 +165,7 @@ func (o *Class) SetMode(v string) { o.Mode = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *Class) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -181,6 +194,7 @@ func (o *Class) SetCpu(v float64) { o.Cpu = &v } + // GetCpuRequest returns the CpuRequest field value if set, zero value otherwise. func (o *Class) GetCpuRequest() float64 { if o == nil || o.CpuRequest == nil { @@ -209,6 +223,7 @@ func (o *Class) SetCpuRequest(v float64) { o.CpuRequest = &v } + // GetCpuLimit returns the CpuLimit field value if set, zero value otherwise. func (o *Class) GetCpuLimit() float64 { if o == nil || o.CpuLimit == nil { @@ -237,6 +252,7 @@ func (o *Class) SetCpuLimit(v float64) { o.CpuLimit = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *Class) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -265,6 +281,7 @@ func (o *Class) SetMemory(v float64) { o.Memory = &v } + // GetMemoryRequest returns the MemoryRequest field value if set, zero value otherwise. func (o *Class) GetMemoryRequest() float64 { if o == nil || o.MemoryRequest == nil { @@ -293,6 +310,7 @@ func (o *Class) SetMemoryRequest(v float64) { o.MemoryRequest = &v } + // GetMemoryLimit returns the MemoryLimit field value if set, zero value otherwise. func (o *Class) GetMemoryLimit() float64 { if o == nil || o.MemoryLimit == nil { @@ -321,6 +339,7 @@ func (o *Class) SetMemoryLimit(v float64) { o.MemoryLimit = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *Class) GetComponent() string { if o == nil || o.Component == nil { @@ -349,6 +368,7 @@ func (o *Class) SetComponent(v string) { o.Component = &v } + // GetSeries returns the Series field value if set, zero value otherwise. func (o *Class) GetSeries() ClassSeries { if o == nil || o.Series == nil { @@ -377,6 +397,8 @@ func (o *Class) SetSeries(v ClassSeries) { o.Series = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Class) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -429,25 +451,25 @@ func (o Class) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Class) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Engine *string `json:"engine,omitempty"` - Code *string `json:"code,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` - Mode *string `json:"mode,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - CpuRequest *float64 `json:"cpuRequest,omitempty"` - CpuLimit *float64 `json:"cpuLimit,omitempty"` - Memory *float64 `json:"memory,omitempty"` - MemoryRequest *float64 `json:"memoryRequest,omitempty"` - MemoryLimit *float64 `json:"memoryLimit,omitempty"` - Component *string `json:"component,omitempty"` - Series *ClassSeries `json:"series,omitempty"` + Engine *string `json:"engine,omitempty"` + Code *string `json:"code,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` + Mode *string `json:"mode,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + CpuRequest *float64 `json:"cpuRequest,omitempty"` + CpuLimit *float64 `json:"cpuLimit,omitempty"` + Memory *float64 `json:"memory,omitempty"` + MemoryRequest *float64 `json:"memoryRequest,omitempty"` + MemoryLimit *float64 `json:"memoryLimit,omitempty"` + Component *string `json:"component,omitempty"` + Series *ClassSeries `json:"series,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engine", "code", "codeShort", "mode", "cpu", "cpuRequest", "cpuLimit", "memory", "memoryRequest", "memoryLimit", "component", "series"}) + common.DeleteKeys(additionalProperties, &[]string{ "engine", "code", "codeShort", "mode", "cpu", "cpuRequest", "cpuLimit", "memory", "memoryRequest", "memoryLimit", "component", "series", }) } else { return err } @@ -464,7 +486,7 @@ func (o *Class) UnmarshalJSON(bytes []byte) (err error) { o.MemoryRequest = all.MemoryRequest o.MemoryLimit = all.MemoryLimit o.Component = all.Component - if all.Series != nil && !all.Series.IsValid() { + if all.Series != nil &&!all.Series.IsValid() { hasInvalidField = true } else { o.Series = all.Series diff --git a/api/kbcloud/admin/model_class_batch.go b/api/kbcloud/admin/model_class_batch.go index 294a893f..a4598896 100644 --- a/api/kbcloud/admin/model_class_batch.go +++ b/api/kbcloud/admin/model_class_batch.go @@ -2,22 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ClassBatch struct { - Engine *string `json:"engine,omitempty"` - Mode *string `json:"mode,omitempty"` - Component *string `json:"component,omitempty"` - Series *ClassSeries `json:"series,omitempty"` - CpuOverCommit *float64 `json:"cpuOverCommit,omitempty"` - MemoryOverCommit *float64 `json:"memoryOverCommit,omitempty"` + Engine *string `json:"engine,omitempty"` + Mode *string `json:"mode,omitempty"` + Component *string `json:"component,omitempty"` + Series *ClassSeries `json:"series,omitempty"` + CpuOverCommit *float64 `json:"cpuOverCommit,omitempty"` + MemoryOverCommit *float64 `json:"memoryOverCommit,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClassBatch instantiates a new ClassBatch object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +44,6 @@ func NewClassBatchWithDefaults() *ClassBatch { this := ClassBatch{} return &this } - // GetEngine returns the Engine field value if set, zero value otherwise. func (o *ClassBatch) GetEngine() string { if o == nil || o.Engine == nil { @@ -63,6 +72,7 @@ func (o *ClassBatch) SetEngine(v string) { o.Engine = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *ClassBatch) GetMode() string { if o == nil || o.Mode == nil { @@ -91,6 +101,7 @@ func (o *ClassBatch) SetMode(v string) { o.Mode = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ClassBatch) GetComponent() string { if o == nil || o.Component == nil { @@ -119,6 +130,7 @@ func (o *ClassBatch) SetComponent(v string) { o.Component = &v } + // GetSeries returns the Series field value if set, zero value otherwise. func (o *ClassBatch) GetSeries() ClassSeries { if o == nil || o.Series == nil { @@ -147,6 +159,7 @@ func (o *ClassBatch) SetSeries(v ClassSeries) { o.Series = &v } + // GetCpuOverCommit returns the CpuOverCommit field value if set, zero value otherwise. func (o *ClassBatch) GetCpuOverCommit() float64 { if o == nil || o.CpuOverCommit == nil { @@ -175,6 +188,7 @@ func (o *ClassBatch) SetCpuOverCommit(v float64) { o.CpuOverCommit = &v } + // GetMemoryOverCommit returns the MemoryOverCommit field value if set, zero value otherwise. func (o *ClassBatch) GetMemoryOverCommit() float64 { if o == nil || o.MemoryOverCommit == nil { @@ -203,6 +217,8 @@ func (o *ClassBatch) SetMemoryOverCommit(v float64) { o.MemoryOverCommit = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ClassBatch) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -237,19 +253,19 @@ func (o ClassBatch) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClassBatch) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Engine *string `json:"engine,omitempty"` - Mode *string `json:"mode,omitempty"` - Component *string `json:"component,omitempty"` - Series *ClassSeries `json:"series,omitempty"` - CpuOverCommit *float64 `json:"cpuOverCommit,omitempty"` - MemoryOverCommit *float64 `json:"memoryOverCommit,omitempty"` + Engine *string `json:"engine,omitempty"` + Mode *string `json:"mode,omitempty"` + Component *string `json:"component,omitempty"` + Series *ClassSeries `json:"series,omitempty"` + CpuOverCommit *float64 `json:"cpuOverCommit,omitempty"` + MemoryOverCommit *float64 `json:"memoryOverCommit,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engine", "mode", "component", "series", "cpuOverCommit", "memoryOverCommit"}) + common.DeleteKeys(additionalProperties, &[]string{ "engine", "mode", "component", "series", "cpuOverCommit", "memoryOverCommit", }) } else { return err } @@ -258,7 +274,7 @@ func (o *ClassBatch) UnmarshalJSON(bytes []byte) (err error) { o.Engine = all.Engine o.Mode = all.Mode o.Component = all.Component - if all.Series != nil && !all.Series.IsValid() { + if all.Series != nil &&!all.Series.IsValid() { hasInvalidField = true } else { o.Series = all.Series diff --git a/api/kbcloud/admin/model_class_series.go b/api/kbcloud/admin/model_class_series.go index 2a729185..a41aa026 100644 --- a/api/kbcloud/admin/model_class_series.go +++ b/api/kbcloud/admin/model_class_series.go @@ -2,19 +2,24 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ClassSeries string // List of ClassSeries. const ( - ClassSeriesGeneral ClassSeries = "general" + ClassSeriesGeneral ClassSeries = "general" ClassSeriesExclusive ClassSeries = "exclusive" ) diff --git a/api/kbcloud/admin/model_clean_cloud_resource_policy.go b/api/kbcloud/admin/model_clean_cloud_resource_policy.go deleted file mode 100644 index 305b22b8..00000000 --- a/api/kbcloud/admin/model_clean_cloud_resource_policy.go +++ /dev/null @@ -1,66 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package admin - -import ( - "fmt" - - "github.com/apecloud/kb-cloud-client-go/api/common" -) - -// CleanCloudResourcePolicy The policy to clean cloud resources, either `Delete` or `Retain` -type CleanCloudResourcePolicy string - -// List of CleanCloudResourcePolicy. -const ( - CLEANCLOUDRESOURCEPOLICY_DELETE CleanCloudResourcePolicy = "Delete" - CLEANCLOUDRESOURCEPOLICY_RETAIN CleanCloudResourcePolicy = "Retain" -) - -var allowedCleanCloudResourcePolicyEnumValues = []CleanCloudResourcePolicy{ - CLEANCLOUDRESOURCEPOLICY_DELETE, - CLEANCLOUDRESOURCEPOLICY_RETAIN, -} - -// GetAllowedValues returns the list of possible values. -func (v *CleanCloudResourcePolicy) GetAllowedValues() []CleanCloudResourcePolicy { - return allowedCleanCloudResourcePolicyEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *CleanCloudResourcePolicy) UnmarshalJSON(src []byte) error { - var value string - err := common.Unmarshal(src, &value) - if err != nil { - return err - } - *v = CleanCloudResourcePolicy(value) - return nil -} - -// NewCleanCloudResourcePolicyFromValue returns a pointer to a valid CleanCloudResourcePolicy -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewCleanCloudResourcePolicyFromValue(v string) (*CleanCloudResourcePolicy, error) { - ev := CleanCloudResourcePolicy(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for CleanCloudResourcePolicy: valid values are %v", v, allowedCleanCloudResourcePolicyEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v CleanCloudResourcePolicy) IsValid() bool { - for _, existing := range allowedCleanCloudResourcePolicyEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CleanCloudResourcePolicy value. -func (v CleanCloudResourcePolicy) Ptr() *CleanCloudResourcePolicy { - return &v -} diff --git a/api/kbcloud/admin/model_cloud_resource_clean_policy.go b/api/kbcloud/admin/model_cloud_resource_clean_policy.go deleted file mode 100644 index b4a8164c..00000000 --- a/api/kbcloud/admin/model_cloud_resource_clean_policy.go +++ /dev/null @@ -1,66 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package admin - -import ( - "fmt" - - "github.com/apecloud/kb-cloud-client-go/api/common" -) - -// CloudResourceCleanPolicy The policy to clean cloud resources, either `Delete` or `Retain` -type CloudResourceCleanPolicy string - -// List of CloudResourceCleanPolicy. -const ( - CloudResourceCleanPolicyDelete CloudResourceCleanPolicy = "Delete" - CloudResourceCleanPolicyRetain CloudResourceCleanPolicy = "Retain" -) - -var allowedCloudResourceCleanPolicyEnumValues = []CloudResourceCleanPolicy{ - CloudResourceCleanPolicyDelete, - CloudResourceCleanPolicyRetain, -} - -// GetAllowedValues returns the list of possible values. -func (v *CloudResourceCleanPolicy) GetAllowedValues() []CloudResourceCleanPolicy { - return allowedCloudResourceCleanPolicyEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *CloudResourceCleanPolicy) UnmarshalJSON(src []byte) error { - var value string - err := common.Unmarshal(src, &value) - if err != nil { - return err - } - *v = CloudResourceCleanPolicy(value) - return nil -} - -// NewCloudResourceCleanPolicyFromValue returns a pointer to a valid CloudResourceCleanPolicy -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewCloudResourceCleanPolicyFromValue(v string) (*CloudResourceCleanPolicy, error) { - ev := CloudResourceCleanPolicy(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for CloudResourceCleanPolicy: valid values are %v", v, allowedCloudResourceCleanPolicyEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v CloudResourceCleanPolicy) IsValid() bool { - for _, existing := range allowedCloudResourceCleanPolicyEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CloudResourceCleanPolicy value. -func (v CloudResourceCleanPolicy) Ptr() *CloudResourceCleanPolicy { - return &v -} diff --git a/api/kbcloud/admin/model_cluster.go b/api/kbcloud/admin/model_cluster.go index 28d00595..5777389d 100644 --- a/api/kbcloud/admin/model_cluster.go +++ b/api/kbcloud/admin/model_cluster.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Cluster KubeBlocks cluster information + + +// Cluster KubeBlocks cluster information type Cluster struct { // Cluster ID Id interface{} `json:"id,omitempty"` @@ -34,7 +38,7 @@ type Cluster struct { // Hash of cluster. Name must be unique within an Org Hash *string `json:"hash,omitempty"` // Cluster Application Engine - Engine string `json:"engine"` + Engine string `json:"engine"` License *ClusterLicense `json:"license,omitempty"` // Items is the list of parameter template in the list ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` @@ -96,13 +100,12 @@ type Cluster struct { NodeGroup common.NullableString `json:"nodeGroup,omitempty"` // Cluster main component codeShort CodeShort *string `json:"codeShort,omitempty"` - // Display name of cluster. - DisplayName *string `json:"displayName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewCluster instantiates a new Cluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -162,7 +165,6 @@ func NewClusterWithDefaults() *Cluster { this.PodAntiAffinityEnabled = &podAntiAffinityEnabled return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Cluster) GetId() interface{} { if o == nil || o.Id == nil { @@ -191,6 +193,7 @@ func (o *Cluster) SetId(v interface{}) { o.Id = v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *Cluster) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -219,6 +222,7 @@ func (o *Cluster) SetOrgName(v string) { o.OrgName = &v } + // GetCloudProvider returns the CloudProvider field value if set, zero value otherwise. func (o *Cluster) GetCloudProvider() string { if o == nil || o.CloudProvider == nil { @@ -247,6 +251,7 @@ func (o *Cluster) SetCloudProvider(v string) { o.CloudProvider = &v } + // GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. func (o *Cluster) GetEnvironmentId() string { if o == nil || o.EnvironmentId == nil { @@ -275,6 +280,7 @@ func (o *Cluster) SetEnvironmentId(v string) { o.EnvironmentId = &v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *Cluster) GetEnvironmentName() string { if o == nil { @@ -298,6 +304,7 @@ func (o *Cluster) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetEnvironmentType returns the EnvironmentType field value if set, zero value otherwise. func (o *Cluster) GetEnvironmentType() string { if o == nil || o.EnvironmentType == nil { @@ -326,6 +333,7 @@ func (o *Cluster) SetEnvironmentType(v string) { o.EnvironmentType = &v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *Cluster) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -354,6 +362,7 @@ func (o *Cluster) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *Cluster) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -382,6 +391,7 @@ func (o *Cluster) SetNamespace(v string) { o.Namespace = &v } + // GetName returns the Name field value. func (o *Cluster) GetName() string { if o == nil { @@ -405,6 +415,7 @@ func (o *Cluster) SetName(v string) { o.Name = v } + // GetHash returns the Hash field value if set, zero value otherwise. func (o *Cluster) GetHash() string { if o == nil || o.Hash == nil { @@ -433,6 +444,7 @@ func (o *Cluster) SetHash(v string) { o.Hash = &v } + // GetEngine returns the Engine field value. func (o *Cluster) GetEngine() string { if o == nil { @@ -456,6 +468,7 @@ func (o *Cluster) SetEngine(v string) { o.Engine = v } + // GetLicense returns the License field value if set, zero value otherwise. func (o *Cluster) GetLicense() ClusterLicense { if o == nil || o.License == nil { @@ -484,6 +497,7 @@ func (o *Cluster) SetLicense(v ClusterLicense) { o.License = &v } + // GetParamTpls returns the ParamTpls field value if set, zero value otherwise. func (o *Cluster) GetParamTpls() []ParamTplsItem { if o == nil || o.ParamTpls == nil { @@ -512,6 +526,7 @@ func (o *Cluster) SetParamTpls(v []ParamTplsItem) { o.ParamTpls = v } + // GetValues returns the Values field value if set, zero value otherwise. func (o *Cluster) GetValues() map[string]interface{} { if o == nil || o.Values == nil { @@ -540,6 +555,7 @@ func (o *Cluster) SetValues(v map[string]interface{}) { o.Values = v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *Cluster) GetVersion() string { if o == nil || o.Version == nil { @@ -568,6 +584,7 @@ func (o *Cluster) SetVersion(v string) { o.Version = &v } + // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *Cluster) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -596,6 +613,7 @@ func (o *Cluster) SetReplicas(v int32) { o.Replicas = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *Cluster) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -624,6 +642,7 @@ func (o *Cluster) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *Cluster) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -652,6 +671,7 @@ func (o *Cluster) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *Cluster) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -680,6 +700,7 @@ func (o *Cluster) SetStorage(v float64) { o.Storage = &v } + // GetTerminationPolicy returns the TerminationPolicy field value if set, zero value otherwise. func (o *Cluster) GetTerminationPolicy() ClusterTerminationPolicy { if o == nil || o.TerminationPolicy == nil { @@ -708,6 +729,7 @@ func (o *Cluster) SetTerminationPolicy(v ClusterTerminationPolicy) { o.TerminationPolicy = &v } + // GetMonitorEnabled returns the MonitorEnabled field value if set, zero value otherwise. func (o *Cluster) GetMonitorEnabled() bool { if o == nil || o.MonitorEnabled == nil { @@ -736,6 +758,7 @@ func (o *Cluster) SetMonitorEnabled(v bool) { o.MonitorEnabled = &v } + // GetVpcEndpointEnabled returns the VpcEndpointEnabled field value if set, zero value otherwise. func (o *Cluster) GetVpcEndpointEnabled() bool { if o == nil || o.VpcEndpointEnabled == nil { @@ -764,6 +787,7 @@ func (o *Cluster) SetVpcEndpointEnabled(v bool) { o.VpcEndpointEnabled = &v } + // GetInternetEndpointEnabled returns the InternetEndpointEnabled field value if set, zero value otherwise. func (o *Cluster) GetInternetEndpointEnabled() bool { if o == nil || o.InternetEndpointEnabled == nil { @@ -792,6 +816,7 @@ func (o *Cluster) SetInternetEndpointEnabled(v bool) { o.InternetEndpointEnabled = &v } + // GetTlsEnabled returns the TlsEnabled field value if set, zero value otherwise. func (o *Cluster) GetTlsEnabled() bool { if o == nil || o.TlsEnabled == nil { @@ -820,6 +845,7 @@ func (o *Cluster) SetTlsEnabled(v bool) { o.TlsEnabled = &v } + // GetNodePortEnabled returns the NodePortEnabled field value if set, zero value otherwise. func (o *Cluster) GetNodePortEnabled() bool { if o == nil || o.NodePortEnabled == nil { @@ -848,6 +874,7 @@ func (o *Cluster) SetNodePortEnabled(v bool) { o.NodePortEnabled = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Cluster) GetStatus() string { if o == nil || o.Status == nil { @@ -876,6 +903,7 @@ func (o *Cluster) SetStatus(v string) { o.Status = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Cluster) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -904,6 +932,7 @@ func (o *Cluster) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Cluster) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -932,6 +961,7 @@ func (o *Cluster) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetCreateOnlySet returns the CreateOnlySet field value if set, zero value otherwise. func (o *Cluster) GetCreateOnlySet() bool { if o == nil || o.CreateOnlySet == nil { @@ -960,6 +990,7 @@ func (o *Cluster) SetCreateOnlySet(v bool) { o.CreateOnlySet = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *Cluster) GetMode() string { if o == nil || o.Mode == nil { @@ -988,6 +1019,7 @@ func (o *Cluster) SetMode(v string) { o.Mode = &v } + // GetProxyEnabled returns the ProxyEnabled field value if set, zero value otherwise. func (o *Cluster) GetProxyEnabled() bool { if o == nil || o.ProxyEnabled == nil { @@ -1016,6 +1048,7 @@ func (o *Cluster) SetProxyEnabled(v bool) { o.ProxyEnabled = &v } + // GetComponents returns the Components field value if set, zero value otherwise. func (o *Cluster) GetComponents() []ComponentsItem { if o == nil || o.Components == nil { @@ -1044,6 +1077,7 @@ func (o *Cluster) SetComponents(v []ComponentsItem) { o.Components = v } + // GetExtra returns the Extra field value if set, zero value otherwise. func (o *Cluster) GetExtra() map[string]interface{} { if o == nil || o.Extra == nil { @@ -1072,6 +1106,7 @@ func (o *Cluster) SetExtra(v map[string]interface{}) { o.Extra = v } + // GetInitOptions returns the InitOptions field value if set, zero value otherwise. func (o *Cluster) GetInitOptions() []InitOptionsItem { if o == nil || o.InitOptions == nil { @@ -1100,6 +1135,7 @@ func (o *Cluster) SetInitOptions(v []InitOptionsItem) { o.InitOptions = v } + // GetExtraInfo returns the ExtraInfo field value if set, zero value otherwise. func (o *Cluster) GetExtraInfo() map[string]interface{} { if o == nil || o.ExtraInfo == nil { @@ -1128,6 +1164,7 @@ func (o *Cluster) SetExtraInfo(v map[string]interface{}) { o.ExtraInfo = v } + // GetTolerations returns the Tolerations field value if set, zero value otherwise. func (o *Cluster) GetTolerations() string { if o == nil || o.Tolerations == nil { @@ -1156,6 +1193,7 @@ func (o *Cluster) SetTolerations(v string) { o.Tolerations = &v } + // GetSingleZone returns the SingleZone field value if set, zero value otherwise. func (o *Cluster) GetSingleZone() bool { if o == nil || o.SingleZone == nil { @@ -1184,6 +1222,7 @@ func (o *Cluster) SetSingleZone(v bool) { o.SingleZone = &v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *Cluster) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -1212,6 +1251,7 @@ func (o *Cluster) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetPodAntiAffinityEnabled returns the PodAntiAffinityEnabled field value if set, zero value otherwise. func (o *Cluster) GetPodAntiAffinityEnabled() bool { if o == nil || o.PodAntiAffinityEnabled == nil { @@ -1240,6 +1280,7 @@ func (o *Cluster) SetPodAntiAffinityEnabled(v bool) { o.PodAntiAffinityEnabled = &v } + // GetBackup returns the Backup field value if set, zero value otherwise. func (o *Cluster) GetBackup() ClusterBackup { if o == nil || o.Backup == nil { @@ -1268,6 +1309,7 @@ func (o *Cluster) SetBackup(v ClusterBackup) { o.Backup = &v } + // GetNodeGroup returns the NodeGroup field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Cluster) GetNodeGroup() string { if o == nil || o.NodeGroup.Get() == nil { @@ -1281,7 +1323,7 @@ func (o *Cluster) GetNodeGroup() string { // 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 *Cluster) GetNodeGroupOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.NodeGroup.Get(), o.NodeGroup.IsSet() @@ -1296,7 +1338,6 @@ func (o *Cluster) HasNodeGroup() bool { func (o *Cluster) SetNodeGroup(v string) { o.NodeGroup.Set(&v) } - // SetNodeGroupNil sets the value for NodeGroup to be an explicit nil. func (o *Cluster) SetNodeGroupNil() { o.NodeGroup.Set(nil) @@ -1307,6 +1348,7 @@ func (o *Cluster) UnsetNodeGroup() { o.NodeGroup.Unset() } + // GetCodeShort returns the CodeShort field value if set, zero value otherwise. func (o *Cluster) GetCodeShort() string { if o == nil || o.CodeShort == nil { @@ -1335,33 +1377,7 @@ func (o *Cluster) SetCodeShort(v string) { o.CodeShort = &v } -// GetDisplayName returns the DisplayName field value if set, zero value otherwise. -func (o *Cluster) GetDisplayName() string { - if o == nil || o.DisplayName == nil { - 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 *Cluster) GetDisplayNameOk() (*string, bool) { - if o == nil || o.DisplayName == nil { - return nil, false - } - return o.DisplayName, true -} - -// HasDisplayName returns a boolean if a field has been set. -func (o *Cluster) HasDisplayName() bool { - return o != nil && o.DisplayName != nil -} - -// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. -func (o *Cluster) SetDisplayName(v string) { - o.DisplayName = &v -} // MarshalJSON serializes the struct using spec logic. func (o Cluster) MarshalJSON() ([]byte, error) { @@ -1497,9 +1513,6 @@ func (o Cluster) MarshalJSON() ([]byte, error) { if o.CodeShort != nil { toSerialize["codeShort"] = o.CodeShort } - if o.DisplayName != nil { - toSerialize["displayName"] = o.DisplayName - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1510,49 +1523,48 @@ func (o Cluster) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id interface{} `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - CloudProvider *string `json:"cloudProvider,omitempty"` - EnvironmentId *string `json:"environmentId,omitempty"` - EnvironmentName *string `json:"environmentName"` - EnvironmentType *string `json:"environmentType,omitempty"` - CloudRegion *string `json:"cloudRegion,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Name *string `json:"name"` - Hash *string `json:"hash,omitempty"` - Engine *string `json:"engine"` - License *ClusterLicense `json:"license,omitempty"` - ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` - Values map[string]interface{} `json:"Values,omitempty"` - Version *string `json:"version,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *float64 `json:"storage,omitempty"` - TerminationPolicy *ClusterTerminationPolicy `json:"terminationPolicy,omitempty"` - MonitorEnabled *bool `json:"monitorEnabled,omitempty"` - VpcEndpointEnabled *bool `json:"vpcEndpointEnabled,omitempty"` - InternetEndpointEnabled *bool `json:"internetEndpointEnabled,omitempty"` - TlsEnabled *bool `json:"tlsEnabled,omitempty"` - NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` - Status *string `json:"status,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreateOnlySet *bool `json:"createOnlySet,omitempty"` - Mode *string `json:"mode,omitempty"` - ProxyEnabled *bool `json:"proxyEnabled,omitempty"` - Components []ComponentsItem `json:"components,omitempty"` - Extra map[string]interface{} `json:"extra,omitempty"` - InitOptions []InitOptionsItem `json:"initOptions,omitempty"` - ExtraInfo map[string]interface{} `json:"extraInfo,omitempty"` - Tolerations *string `json:"tolerations,omitempty"` - SingleZone *bool `json:"singleZone,omitempty"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` - Backup *ClusterBackup `json:"backup,omitempty"` - NodeGroup common.NullableString `json:"nodeGroup,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` - DisplayName *string `json:"displayName,omitempty"` + Id interface{} `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + CloudProvider *string `json:"cloudProvider,omitempty"` + EnvironmentId *string `json:"environmentId,omitempty"` + EnvironmentName *string `json:"environmentName"` + EnvironmentType *string `json:"environmentType,omitempty"` + CloudRegion *string `json:"cloudRegion,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name"` + Hash *string `json:"hash,omitempty"` + Engine *string `json:"engine"` + License *ClusterLicense `json:"license,omitempty"` + ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` + Values map[string]interface{} `json:"Values,omitempty"` + Version *string `json:"version,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *float64 `json:"storage,omitempty"` + TerminationPolicy *ClusterTerminationPolicy `json:"terminationPolicy,omitempty"` + MonitorEnabled *bool `json:"monitorEnabled,omitempty"` + VpcEndpointEnabled *bool `json:"vpcEndpointEnabled,omitempty"` + InternetEndpointEnabled *bool `json:"internetEndpointEnabled,omitempty"` + TlsEnabled *bool `json:"tlsEnabled,omitempty"` + NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` + Status *string `json:"status,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreateOnlySet *bool `json:"createOnlySet,omitempty"` + Mode *string `json:"mode,omitempty"` + ProxyEnabled *bool `json:"proxyEnabled,omitempty"` + Components []ComponentsItem `json:"components,omitempty"` + Extra map[string]interface{} `json:"extra,omitempty"` + InitOptions []InitOptionsItem `json:"initOptions,omitempty"` + ExtraInfo map[string]interface{} `json:"extraInfo,omitempty"` + Tolerations *string `json:"tolerations,omitempty"` + SingleZone *bool `json:"singleZone,omitempty"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` + Backup *ClusterBackup `json:"backup,omitempty"` + NodeGroup common.NullableString `json:"nodeGroup,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -1568,7 +1580,7 @@ func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "orgName", "cloudProvider", "environmentId", "environmentName", "environmentType", "cloudRegion", "namespace", "name", "hash", "engine", "license", "paramTpls", "Values", "version", "replicas", "cpu", "memory", "storage", "terminationPolicy", "monitorEnabled", "vpcEndpointEnabled", "internetEndpointEnabled", "tlsEnabled", "nodePortEnabled", "status", "createdAt", "updatedAt", "createOnlySet", "mode", "proxyEnabled", "components", "extra", "initOptions", "extraInfo", "tolerations", "singleZone", "availabilityZones", "podAntiAffinityEnabled", "backup", "nodeGroup", "codeShort", "displayName"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "orgName", "cloudProvider", "environmentId", "environmentName", "environmentType", "cloudRegion", "namespace", "name", "hash", "engine", "license", "paramTpls", "Values", "version", "replicas", "cpu", "memory", "storage", "terminationPolicy", "monitorEnabled", "vpcEndpointEnabled", "internetEndpointEnabled", "tlsEnabled", "nodePortEnabled", "status", "createdAt", "updatedAt", "createOnlySet", "mode", "proxyEnabled", "components", "extra", "initOptions", "extraInfo", "tolerations", "singleZone", "availabilityZones", "podAntiAffinityEnabled", "backup", "nodeGroup", "codeShort", }) } else { return err } @@ -1585,7 +1597,7 @@ func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { o.Name = *all.Name o.Hash = all.Hash o.Engine = *all.Engine - if all.License != nil && all.License.UnparsedObject != nil && o.UnparsedObject == nil { + if all.License != nil && all.License.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.License = all.License @@ -1596,7 +1608,7 @@ func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { o.Cpu = all.Cpu o.Memory = all.Memory o.Storage = all.Storage - if all.TerminationPolicy != nil && !all.TerminationPolicy.IsValid() { + if all.TerminationPolicy != nil &&!all.TerminationPolicy.IsValid() { hasInvalidField = true } else { o.TerminationPolicy = all.TerminationPolicy @@ -1620,13 +1632,12 @@ func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { o.SingleZone = all.SingleZone o.AvailabilityZones = all.AvailabilityZones o.PodAntiAffinityEnabled = all.PodAntiAffinityEnabled - if all.Backup != nil && all.Backup.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Backup != nil && all.Backup.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Backup = all.Backup o.NodeGroup = all.NodeGroup o.CodeShort = all.CodeShort - o.DisplayName = all.DisplayName if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/kbcloud/admin/model_cluster_backup.go b/api/kbcloud/admin/model_cluster_backup.go index 7d0aaa08..08a2e10f 100644 --- a/api/kbcloud/admin/model_cluster_backup.go +++ b/api/kbcloud/admin/model_cluster_backup.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ClusterBackup clusterBackup is the payload for cluster backup +// ClusterBackup clusterBackup is the payload for cluster backup type ClusterBackup struct { // PITREnabled or not PitrEnabled *bool `json:"PITREnabled,omitempty"` @@ -25,10 +34,11 @@ type ClusterBackup struct { // snapshotVolumes specifies whether to take snapshots of persistent volumes to back up SnapshotVolumes common.NullableBool `json:"snapshotVolumes,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterBackup instantiates a new ClusterBackup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +63,6 @@ func NewClusterBackupWithDefaults() *ClusterBackup { this.AutoBackup = &autoBackup return &this } - // GetPitrEnabled returns the PitrEnabled field value if set, zero value otherwise. func (o *ClusterBackup) GetPitrEnabled() bool { if o == nil || o.PitrEnabled == nil { @@ -82,6 +91,7 @@ func (o *ClusterBackup) SetPitrEnabled(v bool) { o.PitrEnabled = &v } + // GetAutoBackup returns the AutoBackup field value if set, zero value otherwise. func (o *ClusterBackup) GetAutoBackup() bool { if o == nil || o.AutoBackup == nil { @@ -110,6 +120,7 @@ func (o *ClusterBackup) SetAutoBackup(v bool) { o.AutoBackup = &v } + // GetAutoBackupMethod returns the AutoBackupMethod field value if set, zero value otherwise. func (o *ClusterBackup) GetAutoBackupMethod() string { if o == nil || o.AutoBackupMethod == nil { @@ -138,6 +149,7 @@ func (o *ClusterBackup) SetAutoBackupMethod(v string) { o.AutoBackupMethod = &v } + // GetBackupRepo returns the BackupRepo field value if set, zero value otherwise. func (o *ClusterBackup) GetBackupRepo() string { if o == nil || o.BackupRepo == nil { @@ -166,6 +178,7 @@ func (o *ClusterBackup) SetBackupRepo(v string) { o.BackupRepo = &v } + // GetCronExpression returns the CronExpression field value if set, zero value otherwise. func (o *ClusterBackup) GetCronExpression() string { if o == nil || o.CronExpression == nil { @@ -194,6 +207,7 @@ func (o *ClusterBackup) SetCronExpression(v string) { o.CronExpression = &v } + // GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. func (o *ClusterBackup) GetRetentionPeriod() string { if o == nil || o.RetentionPeriod == nil { @@ -222,6 +236,7 @@ func (o *ClusterBackup) SetRetentionPeriod(v string) { o.RetentionPeriod = &v } + // GetRetentionPolicy returns the RetentionPolicy field value if set, zero value otherwise. func (o *ClusterBackup) GetRetentionPolicy() BackupRetentionPolicy { if o == nil || o.RetentionPolicy == nil { @@ -250,6 +265,7 @@ func (o *ClusterBackup) SetRetentionPolicy(v BackupRetentionPolicy) { o.RetentionPolicy = &v } + // GetSnapshotVolumes returns the SnapshotVolumes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ClusterBackup) GetSnapshotVolumes() bool { if o == nil || o.SnapshotVolumes.Get() == nil { @@ -263,7 +279,7 @@ func (o *ClusterBackup) GetSnapshotVolumes() bool { // 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 *ClusterBackup) GetSnapshotVolumesOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return o.SnapshotVolumes.Get(), o.SnapshotVolumes.IsSet() @@ -278,7 +294,6 @@ func (o *ClusterBackup) HasSnapshotVolumes() bool { func (o *ClusterBackup) SetSnapshotVolumes(v bool) { o.SnapshotVolumes.Set(&v) } - // SetSnapshotVolumesNil sets the value for SnapshotVolumes to be an explicit nil. func (o *ClusterBackup) SetSnapshotVolumesNil() { o.SnapshotVolumes.Set(nil) @@ -289,6 +304,8 @@ func (o *ClusterBackup) UnsetSnapshotVolumes() { o.SnapshotVolumes.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterBackup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -329,21 +346,21 @@ func (o ClusterBackup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterBackup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - PitrEnabled *bool `json:"PITREnabled,omitempty"` - AutoBackup *bool `json:"autoBackup,omitempty"` - AutoBackupMethod *string `json:"autoBackupMethod,omitempty"` - BackupRepo *string `json:"backupRepo,omitempty"` - CronExpression *string `json:"cronExpression,omitempty"` - RetentionPeriod *string `json:"retentionPeriod,omitempty"` - RetentionPolicy *BackupRetentionPolicy `json:"retentionPolicy,omitempty"` - SnapshotVolumes common.NullableBool `json:"snapshotVolumes,omitempty"` + PitrEnabled *bool `json:"PITREnabled,omitempty"` + AutoBackup *bool `json:"autoBackup,omitempty"` + AutoBackupMethod *string `json:"autoBackupMethod,omitempty"` + BackupRepo *string `json:"backupRepo,omitempty"` + CronExpression *string `json:"cronExpression,omitempty"` + RetentionPeriod *string `json:"retentionPeriod,omitempty"` + RetentionPolicy *BackupRetentionPolicy `json:"retentionPolicy,omitempty"` + SnapshotVolumes common.NullableBool `json:"snapshotVolumes,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"PITREnabled", "autoBackup", "autoBackupMethod", "backupRepo", "cronExpression", "retentionPeriod", "retentionPolicy", "snapshotVolumes"}) + common.DeleteKeys(additionalProperties, &[]string{ "PITREnabled", "autoBackup", "autoBackupMethod", "backupRepo", "cronExpression", "retentionPeriod", "retentionPolicy", "snapshotVolumes", }) } else { return err } @@ -355,7 +372,7 @@ func (o *ClusterBackup) UnmarshalJSON(bytes []byte) (err error) { o.BackupRepo = all.BackupRepo o.CronExpression = all.CronExpression o.RetentionPeriod = all.RetentionPeriod - if all.RetentionPolicy != nil && !all.RetentionPolicy.IsValid() { + if all.RetentionPolicy != nil &&!all.RetentionPolicy.IsValid() { hasInvalidField = true } else { o.RetentionPolicy = all.RetentionPolicy diff --git a/api/kbcloud/admin/model_cluster_event.go b/api/kbcloud/admin/model_cluster_event.go index 35df87e7..10b4ded9 100644 --- a/api/kbcloud/admin/model_cluster_event.go +++ b/api/kbcloud/admin/model_cluster_event.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Cluster_event event is the information of operation event + + +// Cluster_event event is the information of operation event type Cluster_event struct { // ID of the event Id *string `json:"id,omitempty"` @@ -43,10 +48,11 @@ type Cluster_event struct { // event created time CreatedAt *time.Time `json:"createdAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewCluster_event instantiates a new Cluster_event object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -63,7 +69,6 @@ func NewCluster_eventWithDefaults() *Cluster_event { this := Cluster_event{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Cluster_event) GetId() string { if o == nil || o.Id == nil { @@ -92,6 +97,7 @@ func (o *Cluster_event) SetId(v string) { o.Id = &v } + // GetResourceId returns the ResourceId field value if set, zero value otherwise. func (o *Cluster_event) GetResourceId() string { if o == nil || o.ResourceId == nil { @@ -120,6 +126,7 @@ func (o *Cluster_event) SetResourceId(v string) { o.ResourceId = &v } + // GetResourceType returns the ResourceType field value if set, zero value otherwise. func (o *Cluster_event) GetResourceType() EventResourceType { if o == nil || o.ResourceType == nil { @@ -148,6 +155,7 @@ func (o *Cluster_event) SetResourceType(v EventResourceType) { o.ResourceType = &v } + // GetResourceName returns the ResourceName field value if set, zero value otherwise. func (o *Cluster_event) GetResourceName() string { if o == nil || o.ResourceName == nil { @@ -176,6 +184,7 @@ func (o *Cluster_event) SetResourceName(v string) { o.ResourceName = &v } + // GetOperator returns the Operator field value if set, zero value otherwise. func (o *Cluster_event) GetOperator() string { if o == nil || o.Operator == nil { @@ -204,6 +213,7 @@ func (o *Cluster_event) SetOperator(v string) { o.Operator = &v } + // GetOperatorId returns the OperatorId field value if set, zero value otherwise. func (o *Cluster_event) GetOperatorId() string { if o == nil || o.OperatorId == nil { @@ -232,6 +242,7 @@ func (o *Cluster_event) SetOperatorId(v string) { o.OperatorId = &v } + // GetDetails returns the Details field value if set, zero value otherwise. func (o *Cluster_event) GetDetails() string { if o == nil || o.Details == nil { @@ -260,6 +271,7 @@ func (o *Cluster_event) SetDetails(v string) { o.Details = &v } + // GetHasTask returns the HasTask field value if set, zero value otherwise. func (o *Cluster_event) GetHasTask() bool { if o == nil || o.HasTask == nil { @@ -288,6 +300,7 @@ func (o *Cluster_event) SetHasTask(v bool) { o.HasTask = &v } + // GetResult returns the Result field value if set, zero value otherwise. func (o *Cluster_event) GetResult() string { if o == nil || o.Result == nil { @@ -316,6 +329,7 @@ func (o *Cluster_event) SetResult(v string) { o.Result = &v } + // GetEventName returns the EventName field value if set, zero value otherwise. func (o *Cluster_event) GetEventName() string { if o == nil || o.EventName == nil { @@ -344,6 +358,7 @@ func (o *Cluster_event) SetEventName(v string) { o.EventName = &v } + // GetResultStatus returns the ResultStatus field value if set, zero value otherwise. func (o *Cluster_event) GetResultStatus() EventResultStatus { if o == nil || o.ResultStatus == nil { @@ -372,6 +387,7 @@ func (o *Cluster_event) SetResultStatus(v EventResultStatus) { o.ResultStatus = &v } + // GetSource returns the Source field value if set, zero value otherwise. func (o *Cluster_event) GetSource() EventSource { if o == nil || o.Source == nil { @@ -400,6 +416,7 @@ func (o *Cluster_event) SetSource(v EventSource) { o.Source = &v } + // GetEnd returns the End field value if set, zero value otherwise. func (o *Cluster_event) GetEnd() time.Time { if o == nil || o.End == nil { @@ -428,6 +445,7 @@ func (o *Cluster_event) SetEnd(v time.Time) { o.End = &v } + // GetStart returns the Start field value if set, zero value otherwise. func (o *Cluster_event) GetStart() time.Time { if o == nil || o.Start == nil { @@ -456,6 +474,7 @@ func (o *Cluster_event) SetStart(v time.Time) { o.Start = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Cluster_event) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -484,6 +503,8 @@ func (o *Cluster_event) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Cluster_event) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -557,28 +578,28 @@ func (o Cluster_event) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Cluster_event) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` + Id *string `json:"id,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` ResourceType *EventResourceType `json:"resourceType,omitempty"` - ResourceName *string `json:"resourceName,omitempty"` - Operator *string `json:"operator,omitempty"` - OperatorId *string `json:"operatorId,omitempty"` - Details *string `json:"details,omitempty"` - HasTask *bool `json:"hasTask,omitempty"` - Result *string `json:"result,omitempty"` - EventName *string `json:"eventName,omitempty"` + ResourceName *string `json:"resourceName,omitempty"` + Operator *string `json:"operator,omitempty"` + OperatorId *string `json:"operatorId,omitempty"` + Details *string `json:"details,omitempty"` + HasTask *bool `json:"hasTask,omitempty"` + Result *string `json:"result,omitempty"` + EventName *string `json:"eventName,omitempty"` ResultStatus *EventResultStatus `json:"resultStatus,omitempty"` - Source *EventSource `json:"source,omitempty"` - End *time.Time `json:"end,omitempty"` - Start *time.Time `json:"start,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` + Source *EventSource `json:"source,omitempty"` + End *time.Time `json:"end,omitempty"` + Start *time.Time `json:"start,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "resourceId", "resourceType", "resourceName", "operator", "operatorId", "details", "hasTask", "result", "eventName", "resultStatus", "source", "end", "start", "createdAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "resourceId", "resourceType", "resourceName", "operator", "operatorId", "details", "hasTask", "result", "eventName", "resultStatus", "source", "end", "start", "createdAt", }) } else { return err } @@ -586,7 +607,7 @@ func (o *Cluster_event) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField := false o.Id = all.Id o.ResourceId = all.ResourceId - if all.ResourceType != nil && !all.ResourceType.IsValid() { + if all.ResourceType != nil &&!all.ResourceType.IsValid() { hasInvalidField = true } else { o.ResourceType = all.ResourceType @@ -598,12 +619,12 @@ func (o *Cluster_event) UnmarshalJSON(bytes []byte) (err error) { o.HasTask = all.HasTask o.Result = all.Result o.EventName = all.EventName - if all.ResultStatus != nil && !all.ResultStatus.IsValid() { + if all.ResultStatus != nil &&!all.ResultStatus.IsValid() { hasInvalidField = true } else { o.ResultStatus = all.ResultStatus } - if all.Source != nil && !all.Source.IsValid() { + if all.Source != nil &&!all.Source.IsValid() { hasInvalidField = true } else { o.Source = all.Source diff --git a/api/kbcloud/admin/model_cluster_execution_log.go b/api/kbcloud/admin/model_cluster_execution_log.go index 01e9dc98..facd6ce0 100644 --- a/api/kbcloud/admin/model_cluster_execution_log.go +++ b/api/kbcloud/admin/model_cluster_execution_log.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ClusterExecutionLog Log entry for cluster execution + + +// ClusterExecutionLog Log entry for cluster execution type ClusterExecutionLog struct { // Timestamp of the execution Timestamp int64 `json:"timestamp"` @@ -27,10 +32,11 @@ type ClusterExecutionLog struct { // Additional information Extra map[string]interface{} `json:"extra"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterExecutionLog instantiates a new ClusterExecutionLog object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -54,7 +60,6 @@ func NewClusterExecutionLogWithDefaults() *ClusterExecutionLog { this := ClusterExecutionLog{} return &this } - // GetTimestamp returns the Timestamp field value. func (o *ClusterExecutionLog) GetTimestamp() int64 { if o == nil { @@ -78,6 +83,7 @@ func (o *ClusterExecutionLog) SetTimestamp(v int64) { o.Timestamp = v } + // GetClient returns the Client field value. func (o *ClusterExecutionLog) GetClient() string { if o == nil { @@ -101,6 +107,7 @@ func (o *ClusterExecutionLog) SetClient(v string) { o.Client = v } + // GetDbName returns the DbName field value. func (o *ClusterExecutionLog) GetDbName() string { if o == nil { @@ -124,6 +131,7 @@ func (o *ClusterExecutionLog) SetDbName(v string) { o.DbName = v } + // GetUser returns the User field value. func (o *ClusterExecutionLog) GetUser() string { if o == nil { @@ -147,6 +155,7 @@ func (o *ClusterExecutionLog) SetUser(v string) { o.User = v } + // GetExecutionTime returns the ExecutionTime field value. func (o *ClusterExecutionLog) GetExecutionTime() float64 { if o == nil { @@ -170,6 +179,7 @@ func (o *ClusterExecutionLog) SetExecutionTime(v float64) { o.ExecutionTime = v } + // GetCommand returns the Command field value. func (o *ClusterExecutionLog) GetCommand() string { if o == nil { @@ -193,6 +203,7 @@ func (o *ClusterExecutionLog) SetCommand(v string) { o.Command = v } + // GetExtra returns the Extra field value. func (o *ClusterExecutionLog) GetExtra() map[string]interface{} { if o == nil { @@ -216,6 +227,8 @@ func (o *ClusterExecutionLog) SetExtra(v map[string]interface{}) { o.Extra = v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterExecutionLog) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -239,13 +252,13 @@ func (o ClusterExecutionLog) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterExecutionLog) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Timestamp *int64 `json:"timestamp"` - Client *string `json:"client"` - DbName *string `json:"dbName"` - User *string `json:"user"` - ExecutionTime *float64 `json:"executionTime"` - Command *string `json:"command"` - Extra *map[string]interface{} `json:"extra"` + Timestamp *int64 `json:"timestamp"` + Client *string `json:"client"` + DbName *string `json:"dbName"` + User *string `json:"user"` + ExecutionTime *float64 `json:"executionTime"` + Command *string `json:"command"` + Extra *map[string]interface{} `json:"extra"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -273,7 +286,7 @@ func (o *ClusterExecutionLog) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"timestamp", "client", "dbName", "user", "executionTime", "command", "extra"}) + common.DeleteKeys(additionalProperties, &[]string{ "timestamp", "client", "dbName", "user", "executionTime", "command", "extra", }) } else { return err } diff --git a/api/kbcloud/admin/model_cluster_license.go b/api/kbcloud/admin/model_cluster_license.go index 15bf0490..d2083290 100644 --- a/api/kbcloud/admin/model_cluster_license.go +++ b/api/kbcloud/admin/model_cluster_license.go @@ -2,25 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - _io "io" - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type ClusterLicense struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` - Key *_io.Reader `json:"key,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` + Key *_io.Reader `json:"key,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterLicense instantiates a new ClusterLicense object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +42,6 @@ func NewClusterLicenseWithDefaults() *ClusterLicense { this := ClusterLicense{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *ClusterLicense) GetId() string { if o == nil || o.Id == nil { @@ -66,6 +70,7 @@ func (o *ClusterLicense) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *ClusterLicense) GetName() string { if o == nil || o.Name == nil { @@ -94,6 +99,7 @@ func (o *ClusterLicense) SetName(v string) { o.Name = &v } + // GetExpiredAt returns the ExpiredAt field value if set, zero value otherwise. func (o *ClusterLicense) GetExpiredAt() time.Time { if o == nil || o.ExpiredAt == nil { @@ -122,6 +128,7 @@ func (o *ClusterLicense) SetExpiredAt(v time.Time) { o.ExpiredAt = &v } + // GetKey returns the Key field value if set, zero value otherwise. func (o *ClusterLicense) GetKey() _io.Reader { if o == nil || o.Key == nil { @@ -150,6 +157,8 @@ func (o *ClusterLicense) SetKey(v _io.Reader) { o.Key = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterLicense) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -182,17 +191,17 @@ func (o ClusterLicense) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterLicense) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` - Key *_io.Reader `json:"key,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` + Key *_io.Reader `json:"key,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "expiredAt", "key"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "expiredAt", "key", }) } else { return err } diff --git a/api/kbcloud/admin/model_cluster_list.go b/api/kbcloud/admin/model_cluster_list.go index bddd5e2b..275e0bbf 100644 --- a/api/kbcloud/admin/model_cluster_list.go +++ b/api/kbcloud/admin/model_cluster_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ClusterList ClusterList is a list of KubeBlocks clusters + + +// ClusterList ClusterList is a list of KubeBlocks clusters type ClusterList struct { // Items is the list of KubeBlocks cluster objects in the list Items []ClusterListItem `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterList instantiates a new ClusterList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewClusterListWithDefaults() *ClusterList { this := ClusterList{} return &this } - // GetItems returns the Items field value. func (o *ClusterList) GetItems() []ClusterListItem { if o == nil { @@ -62,6 +67,7 @@ func (o *ClusterList) SetItems(v []ClusterListItem) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *ClusterList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *ClusterList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o ClusterList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]ClusterListItem `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]ClusterListItem `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *ClusterList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_cluster_list_item.go b/api/kbcloud/admin/model_cluster_list_item.go index 0a8e9de4..49c78c07 100644 --- a/api/kbcloud/admin/model_cluster_list_item.go +++ b/api/kbcloud/admin/model_cluster_list_item.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ClusterListItem KubeBlocks cluster information + + +// ClusterListItem KubeBlocks cluster information type ClusterListItem struct { // Cloud Provider CloudProvider string `json:"cloudProvider"` @@ -50,10 +54,11 @@ type ClusterListItem struct { // Org Name OrgName *string `json:"orgName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterListItem instantiates a new ClusterListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -80,7 +85,6 @@ func NewClusterListItemWithDefaults() *ClusterListItem { this := ClusterListItem{} return &this } - // GetCloudProvider returns the CloudProvider field value. func (o *ClusterListItem) GetCloudProvider() string { if o == nil { @@ -104,6 +108,7 @@ func (o *ClusterListItem) SetCloudProvider(v string) { o.CloudProvider = v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *ClusterListItem) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -132,6 +137,7 @@ func (o *ClusterListItem) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *ClusterListItem) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -160,6 +166,7 @@ func (o *ClusterListItem) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetCreatedAt returns the CreatedAt field value. func (o *ClusterListItem) GetCreatedAt() time.Time { if o == nil { @@ -183,6 +190,7 @@ func (o *ClusterListItem) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *ClusterListItem) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -211,6 +219,7 @@ func (o *ClusterListItem) SetDisplayName(v string) { o.DisplayName = &v } + // GetEngine returns the Engine field value. func (o *ClusterListItem) GetEngine() string { if o == nil { @@ -234,6 +243,7 @@ func (o *ClusterListItem) SetEngine(v string) { o.Engine = v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *ClusterListItem) GetMode() string { if o == nil || o.Mode == nil { @@ -262,6 +272,7 @@ func (o *ClusterListItem) SetMode(v string) { o.Mode = &v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *ClusterListItem) GetEnvironmentName() string { if o == nil { @@ -285,6 +296,7 @@ func (o *ClusterListItem) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetId returns the Id field value. func (o *ClusterListItem) GetId() string { if o == nil { @@ -308,6 +320,7 @@ func (o *ClusterListItem) SetId(v string) { o.Id = v } + // GetName returns the Name field value. func (o *ClusterListItem) GetName() string { if o == nil { @@ -331,6 +344,7 @@ func (o *ClusterListItem) SetName(v string) { o.Name = v } + // GetStatus returns the Status field value. func (o *ClusterListItem) GetStatus() string { if o == nil { @@ -354,6 +368,7 @@ func (o *ClusterListItem) SetStatus(v string) { o.Status = v } + // GetTerminationPolicy returns the TerminationPolicy field value. func (o *ClusterListItem) GetTerminationPolicy() string { if o == nil { @@ -377,6 +392,7 @@ func (o *ClusterListItem) SetTerminationPolicy(v string) { o.TerminationPolicy = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *ClusterListItem) GetUpdatedAt() time.Time { if o == nil { @@ -400,6 +416,7 @@ func (o *ClusterListItem) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetVersion returns the Version field value. func (o *ClusterListItem) GetVersion() string { if o == nil { @@ -423,6 +440,7 @@ func (o *ClusterListItem) SetVersion(v string) { o.Version = v } + // GetClassCode returns the ClassCode field value if set, zero value otherwise. func (o *ClusterListItem) GetClassCode() string { if o == nil || o.ClassCode == nil { @@ -451,6 +469,7 @@ func (o *ClusterListItem) SetClassCode(v string) { o.ClassCode = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *ClusterListItem) GetStorage() string { if o == nil || o.Storage == nil { @@ -479,6 +498,7 @@ func (o *ClusterListItem) SetStorage(v string) { o.Storage = &v } + // GetCodeShort returns the CodeShort field value if set, zero value otherwise. func (o *ClusterListItem) GetCodeShort() string { if o == nil || o.CodeShort == nil { @@ -507,6 +527,7 @@ func (o *ClusterListItem) SetCodeShort(v string) { o.CodeShort = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *ClusterListItem) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -535,6 +556,8 @@ func (o *ClusterListItem) SetOrgName(v string) { o.OrgName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -593,24 +616,24 @@ func (o ClusterListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CloudProvider *string `json:"cloudProvider"` - CloudRegion *string `json:"cloudRegion,omitempty"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - CreatedAt *time.Time `json:"createdAt"` - DisplayName *string `json:"displayName,omitempty"` - Engine *string `json:"engine"` - Mode *string `json:"mode,omitempty"` - EnvironmentName *string `json:"environmentName"` - Id *string `json:"id"` - Name *string `json:"name"` - Status *string `json:"status"` - TerminationPolicy *string `json:"terminationPolicy"` - UpdatedAt *time.Time `json:"updatedAt"` - Version *string `json:"version"` - ClassCode *string `json:"classCode,omitempty"` - Storage *string `json:"storage,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` - OrgName *string `json:"orgName,omitempty"` + CloudProvider *string `json:"cloudProvider"` + CloudRegion *string `json:"cloudRegion,omitempty"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + CreatedAt *time.Time `json:"createdAt"` + DisplayName *string `json:"displayName,omitempty"` + Engine *string `json:"engine"` + Mode *string `json:"mode,omitempty"` + EnvironmentName *string `json:"environmentName"` + Id *string `json:"id"` + Name *string `json:"name"` + Status *string `json:"status"` + TerminationPolicy *string `json:"terminationPolicy"` + UpdatedAt *time.Time `json:"updatedAt"` + Version *string `json:"version"` + ClassCode *string `json:"classCode,omitempty"` + Storage *string `json:"storage,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` + OrgName *string `json:"orgName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -647,7 +670,7 @@ func (o *ClusterListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cloudProvider", "cloudRegion", "availabilityZones", "createdAt", "displayName", "engine", "mode", "environmentName", "id", "name", "status", "terminationPolicy", "updatedAt", "version", "classCode", "storage", "codeShort", "orgName"}) + common.DeleteKeys(additionalProperties, &[]string{ "cloudProvider", "cloudRegion", "availabilityZones", "createdAt", "displayName", "engine", "mode", "environmentName", "id", "name", "status", "terminationPolicy", "updatedAt", "version", "classCode", "storage", "codeShort", "orgName", }) } else { return err } diff --git a/api/kbcloud/admin/model_cluster_metrics.go b/api/kbcloud/admin/model_cluster_metrics.go index c8a3b03e..4ac85459 100644 --- a/api/kbcloud/admin/model_cluster_metrics.go +++ b/api/kbcloud/admin/model_cluster_metrics.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ClusterMetrics Cluster metrics +// ClusterMetrics Cluster metrics type ClusterMetrics struct { - Value []interface{} `json:"value,omitempty"` + Value []interface{} `json:"value,omitempty"` Values [][]interface{} `json:"values,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterMetrics instantiates a new ClusterMetrics object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,10 +41,9 @@ func NewClusterMetricsWithDefaults() *ClusterMetrics { this := ClusterMetrics{} return &this } - // GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ClusterMetrics) GetValue() []interface{} { - if o == nil { + if o == nil { var ret []interface{} return ret } @@ -61,6 +70,7 @@ func (o *ClusterMetrics) SetValue(v []interface{}) { o.Value = v } + // GetValues returns the Values field value if set, zero value otherwise. func (o *ClusterMetrics) GetValues() [][]interface{} { if o == nil || o.Values == nil { @@ -89,6 +99,8 @@ func (o *ClusterMetrics) SetValues(v [][]interface{}) { o.Values = v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterMetrics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +123,7 @@ func (o ClusterMetrics) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterMetrics) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Value []interface{} `json:"value,omitempty"` + Value []interface{} `json:"value,omitempty"` Values [][]interface{} `json:"values,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +131,7 @@ func (o *ClusterMetrics) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"value", "values"}) + common.DeleteKeys(additionalProperties, &[]string{ "value", "values", }) } else { return err } diff --git a/api/kbcloud/admin/model_cluster_termination_policy.go b/api/kbcloud/admin/model_cluster_termination_policy.go index 88e85aad..8d50bb93 100644 --- a/api/kbcloud/admin/model_cluster_termination_policy.go +++ b/api/kbcloud/admin/model_cluster_termination_policy.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // ClusterTerminationPolicy The termination policy of cluster. type ClusterTerminationPolicy string // List of ClusterTerminationPolicy. const ( ClusterTerminationPolicyDoNotTerminate ClusterTerminationPolicy = "DoNotTerminate" - ClusterTerminationPolicyHalt ClusterTerminationPolicy = "Halt" - ClusterTerminationPolicyDelete ClusterTerminationPolicy = "Delete" - ClusterTerminationPolicyWipeOut ClusterTerminationPolicy = "WipeOut" + ClusterTerminationPolicyHalt ClusterTerminationPolicy = "Halt" + ClusterTerminationPolicyDelete ClusterTerminationPolicy = "Delete" + ClusterTerminationPolicyWipeOut ClusterTerminationPolicy = "WipeOut" ) var allowedClusterTerminationPolicyEnumValues = []ClusterTerminationPolicy{ diff --git a/api/kbcloud/admin/model_cluster_update.go b/api/kbcloud/admin/model_cluster_update.go index 6bad7716..f62a9e64 100644 --- a/api/kbcloud/admin/model_cluster_update.go +++ b/api/kbcloud/admin/model_cluster_update.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// ClusterUpdate ClusterUpdate is the payload to update a KubeBlocks cluster + +// ClusterUpdate ClusterUpdate is the payload to update a KubeBlocks cluster type ClusterUpdate struct { // The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Replicas *int32 `json:"replicas,omitempty"` @@ -28,13 +37,12 @@ type ClusterUpdate struct { ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` // Tolerations of cluster Tolerations *string `json:"tolerations,omitempty"` - // Display name of cluster. - DisplayName *string `json:"displayName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterUpdate instantiates a new ClusterUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +63,6 @@ func NewClusterUpdateWithDefaults() *ClusterUpdate { this.TerminationPolicy = &terminationPolicy return &this } - // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *ClusterUpdate) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -84,6 +91,7 @@ func (o *ClusterUpdate) SetReplicas(v int32) { o.Replicas = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *ClusterUpdate) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -112,6 +120,7 @@ func (o *ClusterUpdate) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *ClusterUpdate) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -140,6 +149,7 @@ func (o *ClusterUpdate) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *ClusterUpdate) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -168,6 +178,7 @@ func (o *ClusterUpdate) SetStorage(v float64) { o.Storage = &v } + // GetTerminationPolicy returns the TerminationPolicy field value if set, zero value otherwise. func (o *ClusterUpdate) GetTerminationPolicy() ClusterTerminationPolicy { if o == nil || o.TerminationPolicy == nil { @@ -196,6 +207,7 @@ func (o *ClusterUpdate) SetTerminationPolicy(v ClusterTerminationPolicy) { o.TerminationPolicy = &v } + // GetMonitorEnabled returns the MonitorEnabled field value if set, zero value otherwise. func (o *ClusterUpdate) GetMonitorEnabled() bool { if o == nil || o.MonitorEnabled == nil { @@ -224,6 +236,7 @@ func (o *ClusterUpdate) SetMonitorEnabled(v bool) { o.MonitorEnabled = &v } + // GetVpcEndpointEnabled returns the VpcEndpointEnabled field value if set, zero value otherwise. func (o *ClusterUpdate) GetVpcEndpointEnabled() bool { if o == nil || o.VpcEndpointEnabled == nil { @@ -252,6 +265,7 @@ func (o *ClusterUpdate) SetVpcEndpointEnabled(v bool) { o.VpcEndpointEnabled = &v } + // GetInternetEndpointEnabled returns the InternetEndpointEnabled field value if set, zero value otherwise. func (o *ClusterUpdate) GetInternetEndpointEnabled() bool { if o == nil || o.InternetEndpointEnabled == nil { @@ -280,6 +294,7 @@ func (o *ClusterUpdate) SetInternetEndpointEnabled(v bool) { o.InternetEndpointEnabled = &v } + // GetParamTpls returns the ParamTpls field value if set, zero value otherwise. func (o *ClusterUpdate) GetParamTpls() []ParamTplsItem { if o == nil || o.ParamTpls == nil { @@ -308,6 +323,7 @@ func (o *ClusterUpdate) SetParamTpls(v []ParamTplsItem) { o.ParamTpls = v } + // GetTolerations returns the Tolerations field value if set, zero value otherwise. func (o *ClusterUpdate) GetTolerations() string { if o == nil || o.Tolerations == nil { @@ -336,33 +352,7 @@ func (o *ClusterUpdate) SetTolerations(v string) { o.Tolerations = &v } -// GetDisplayName returns the DisplayName field value if set, zero value otherwise. -func (o *ClusterUpdate) GetDisplayName() string { - if o == nil || o.DisplayName == nil { - 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 *ClusterUpdate) GetDisplayNameOk() (*string, bool) { - if o == nil || o.DisplayName == nil { - return nil, false - } - return o.DisplayName, true -} - -// HasDisplayName returns a boolean if a field has been set. -func (o *ClusterUpdate) HasDisplayName() bool { - return o != nil && o.DisplayName != nil -} -// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. -func (o *ClusterUpdate) SetDisplayName(v string) { - o.DisplayName = &v -} // MarshalJSON serializes the struct using spec logic. func (o ClusterUpdate) MarshalJSON() ([]byte, error) { @@ -400,9 +390,6 @@ func (o ClusterUpdate) MarshalJSON() ([]byte, error) { if o.Tolerations != nil { toSerialize["tolerations"] = o.Tolerations } - if o.DisplayName != nil { - toSerialize["displayName"] = o.DisplayName - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -413,24 +400,23 @@ func (o ClusterUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Replicas *int32 `json:"replicas,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *float64 `json:"storage,omitempty"` - TerminationPolicy *ClusterTerminationPolicy `json:"terminationPolicy,omitempty"` - MonitorEnabled *bool `json:"monitorEnabled,omitempty"` - VpcEndpointEnabled *bool `json:"vpcEndpointEnabled,omitempty"` - InternetEndpointEnabled *bool `json:"internetEndpointEnabled,omitempty"` - ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` - Tolerations *string `json:"tolerations,omitempty"` - DisplayName *string `json:"displayName,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *float64 `json:"storage,omitempty"` + TerminationPolicy *ClusterTerminationPolicy `json:"terminationPolicy,omitempty"` + MonitorEnabled *bool `json:"monitorEnabled,omitempty"` + VpcEndpointEnabled *bool `json:"vpcEndpointEnabled,omitempty"` + InternetEndpointEnabled *bool `json:"internetEndpointEnabled,omitempty"` + ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` + Tolerations *string `json:"tolerations,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"replicas", "cpu", "memory", "storage", "terminationPolicy", "monitorEnabled", "vpcEndpointEnabled", "internetEndpointEnabled", "paramTpls", "tolerations", "displayName"}) + common.DeleteKeys(additionalProperties, &[]string{ "replicas", "cpu", "memory", "storage", "terminationPolicy", "monitorEnabled", "vpcEndpointEnabled", "internetEndpointEnabled", "paramTpls", "tolerations", }) } else { return err } @@ -440,7 +426,7 @@ func (o *ClusterUpdate) UnmarshalJSON(bytes []byte) (err error) { o.Cpu = all.Cpu o.Memory = all.Memory o.Storage = all.Storage - if all.TerminationPolicy != nil && !all.TerminationPolicy.IsValid() { + if all.TerminationPolicy != nil &&!all.TerminationPolicy.IsValid() { hasInvalidField = true } else { o.TerminationPolicy = all.TerminationPolicy @@ -450,7 +436,6 @@ func (o *ClusterUpdate) UnmarshalJSON(bytes []byte) (err error) { o.InternetEndpointEnabled = all.InternetEndpointEnabled o.ParamTpls = all.ParamTpls o.Tolerations = all.Tolerations - o.DisplayName = all.DisplayName if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/kbcloud/admin/model_component.go b/api/kbcloud/admin/model_component.go index 1379a770..b7f8d441 100644 --- a/api/kbcloud/admin/model_component.go +++ b/api/kbcloud/admin/model_component.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Component Component info in environment + + +// Component Component info in environment type Component struct { // Kubernetes version of the environment KubernetesVersion *string `json:"kubernetesVersion,omitempty"` @@ -31,10 +36,11 @@ type Component struct { // Namespace info for environment Namespaces []string `json:"namespaces,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponent instantiates a new Component object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +58,6 @@ func NewComponentWithDefaults() *Component { this := Component{} return &this } - // GetKubernetesVersion returns the KubernetesVersion field value if set, zero value otherwise. func (o *Component) GetKubernetesVersion() string { if o == nil || o.KubernetesVersion == nil { @@ -81,6 +86,7 @@ func (o *Component) SetKubernetesVersion(v string) { o.KubernetesVersion = &v } + // GetKbVersion returns the KbVersion field value if set, zero value otherwise. func (o *Component) GetKbVersion() string { if o == nil || o.KbVersion == nil { @@ -109,6 +115,7 @@ func (o *Component) SetKbVersion(v string) { o.KbVersion = &v } + // GetGeminiVersion returns the GeminiVersion field value if set, zero value otherwise. func (o *Component) GetGeminiVersion() string { if o == nil || o.GeminiVersion == nil { @@ -137,6 +144,7 @@ func (o *Component) SetGeminiVersion(v string) { o.GeminiVersion = &v } + // GetOteldVersion returns the OteldVersion field value if set, zero value otherwise. func (o *Component) GetOteldVersion() string { if o == nil || o.OteldVersion == nil { @@ -165,6 +173,7 @@ func (o *Component) SetOteldVersion(v string) { o.OteldVersion = &v } + // GetImageRegistry returns the ImageRegistry field value if set, zero value otherwise. func (o *Component) GetImageRegistry() string { if o == nil || o.ImageRegistry == nil { @@ -193,6 +202,7 @@ func (o *Component) SetImageRegistry(v string) { o.ImageRegistry = &v } + // GetDefaultStorageClass returns the DefaultStorageClass field value. func (o *Component) GetDefaultStorageClass() string { if o == nil { @@ -216,6 +226,7 @@ func (o *Component) SetDefaultStorageClass(v string) { o.DefaultStorageClass = v } + // GetCpuOvercommitRatio returns the CpuOvercommitRatio field value if set, zero value otherwise. func (o *Component) GetCpuOvercommitRatio() float64 { if o == nil || o.CpuOvercommitRatio == nil { @@ -244,6 +255,7 @@ func (o *Component) SetCpuOvercommitRatio(v float64) { o.CpuOvercommitRatio = &v } + // GetMemoryOvercommitRatio returns the MemoryOvercommitRatio field value if set, zero value otherwise. func (o *Component) GetMemoryOvercommitRatio() float64 { if o == nil || o.MemoryOvercommitRatio == nil { @@ -272,6 +284,7 @@ func (o *Component) SetMemoryOvercommitRatio(v float64) { o.MemoryOvercommitRatio = &v } + // GetNamespaces returns the Namespaces field value if set, zero value otherwise. func (o *Component) GetNamespaces() []string { if o == nil || o.Namespaces == nil { @@ -300,6 +313,8 @@ func (o *Component) SetNamespaces(v []string) { o.Namespaces = v } + + // MarshalJSON serializes the struct using spec logic. func (o Component) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -341,15 +356,15 @@ func (o Component) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Component) UnmarshalJSON(bytes []byte) (err error) { all := struct { - KubernetesVersion *string `json:"kubernetesVersion,omitempty"` - KbVersion *string `json:"kbVersion,omitempty"` - GeminiVersion *string `json:"geminiVersion,omitempty"` - OteldVersion *string `json:"oteldVersion,omitempty"` - ImageRegistry *string `json:"imageRegistry,omitempty"` - DefaultStorageClass *string `json:"defaultStorageClass"` - CpuOvercommitRatio *float64 `json:"cpuOvercommitRatio,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + KbVersion *string `json:"kbVersion,omitempty"` + GeminiVersion *string `json:"geminiVersion,omitempty"` + OteldVersion *string `json:"oteldVersion,omitempty"` + ImageRegistry *string `json:"imageRegistry,omitempty"` + DefaultStorageClass *string `json:"defaultStorageClass"` + CpuOvercommitRatio *float64 `json:"cpuOvercommitRatio,omitempty"` MemoryOvercommitRatio *float64 `json:"memoryOvercommitRatio,omitempty"` - Namespaces []string `json:"namespaces,omitempty"` + Namespaces []string `json:"namespaces,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -359,7 +374,7 @@ func (o *Component) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"kubernetesVersion", "kbVersion", "geminiVersion", "oteldVersion", "imageRegistry", "defaultStorageClass", "cpuOvercommitRatio", "memoryOvercommitRatio", "namespaces"}) + common.DeleteKeys(additionalProperties, &[]string{ "kubernetesVersion", "kbVersion", "geminiVersion", "oteldVersion", "imageRegistry", "defaultStorageClass", "cpuOvercommitRatio", "memoryOvercommitRatio", "namespaces", }) } else { return err } diff --git a/api/kbcloud/admin/model_component_ops_option.go b/api/kbcloud/admin/model_component_ops_option.go index 9c0b83c4..7748d2d7 100644 --- a/api/kbcloud/admin/model_component_ops_option.go +++ b/api/kbcloud/admin/model_component_ops_option.go @@ -2,28 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOpsOption struct { Component string `json:"component"` - DisableHa *bool `json:"disableHA,omitempty"` + DisableHa *bool `json:"disableHA,omitempty"` // parameter for rebuild instance ops InPlace *bool `json:"inPlace,omitempty"` // indicate whether backup is required when Inplace is true - NeedBackupWhenInPlace *bool `json:"needBackupWhenInPlace,omitempty"` - RestoreEnv []ComponentOpsOptionRestoreEnvItem `json:"restoreEnv,omitempty"` - DependentCustomOps *ComponentOpsOptionDependentCustomOps `json:"dependentCustomOps,omitempty"` + NeedBackupWhenInPlace *bool `json:"needBackupWhenInPlace,omitempty"` + RestoreEnv []ComponentOpsOptionRestoreEnvItem `json:"restoreEnv,omitempty"` + DependentCustomOps *ComponentOpsOptionDependentCustomOps `json:"dependentCustomOps,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOpsOption instantiates a new ComponentOpsOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +59,6 @@ func NewComponentOpsOptionWithDefaults() *ComponentOpsOption { this.NeedBackupWhenInPlace = &needBackupWhenInPlace return &this } - // GetComponent returns the Component field value. func (o *ComponentOpsOption) GetComponent() string { if o == nil { @@ -77,6 +82,7 @@ func (o *ComponentOpsOption) SetComponent(v string) { o.Component = v } + // GetDisableHa returns the DisableHa field value if set, zero value otherwise. func (o *ComponentOpsOption) GetDisableHa() bool { if o == nil || o.DisableHa == nil { @@ -105,6 +111,7 @@ func (o *ComponentOpsOption) SetDisableHa(v bool) { o.DisableHa = &v } + // GetInPlace returns the InPlace field value if set, zero value otherwise. func (o *ComponentOpsOption) GetInPlace() bool { if o == nil || o.InPlace == nil { @@ -133,6 +140,7 @@ func (o *ComponentOpsOption) SetInPlace(v bool) { o.InPlace = &v } + // GetNeedBackupWhenInPlace returns the NeedBackupWhenInPlace field value if set, zero value otherwise. func (o *ComponentOpsOption) GetNeedBackupWhenInPlace() bool { if o == nil || o.NeedBackupWhenInPlace == nil { @@ -161,6 +169,7 @@ func (o *ComponentOpsOption) SetNeedBackupWhenInPlace(v bool) { o.NeedBackupWhenInPlace = &v } + // GetRestoreEnv returns the RestoreEnv field value if set, zero value otherwise. func (o *ComponentOpsOption) GetRestoreEnv() []ComponentOpsOptionRestoreEnvItem { if o == nil || o.RestoreEnv == nil { @@ -189,6 +198,7 @@ func (o *ComponentOpsOption) SetRestoreEnv(v []ComponentOpsOptionRestoreEnvItem) o.RestoreEnv = v } + // GetDependentCustomOps returns the DependentCustomOps field value if set, zero value otherwise. func (o *ComponentOpsOption) GetDependentCustomOps() ComponentOpsOptionDependentCustomOps { if o == nil || o.DependentCustomOps == nil { @@ -217,6 +227,8 @@ func (o *ComponentOpsOption) SetDependentCustomOps(v ComponentOpsOptionDependent o.DependentCustomOps = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOpsOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -249,12 +261,12 @@ func (o ComponentOpsOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOpsOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` - DisableHa *bool `json:"disableHA,omitempty"` - InPlace *bool `json:"inPlace,omitempty"` - NeedBackupWhenInPlace *bool `json:"needBackupWhenInPlace,omitempty"` - RestoreEnv []ComponentOpsOptionRestoreEnvItem `json:"restoreEnv,omitempty"` - DependentCustomOps *ComponentOpsOptionDependentCustomOps `json:"dependentCustomOps,omitempty"` + Component *string `json:"component"` + DisableHa *bool `json:"disableHA,omitempty"` + InPlace *bool `json:"inPlace,omitempty"` + NeedBackupWhenInPlace *bool `json:"needBackupWhenInPlace,omitempty"` + RestoreEnv []ComponentOpsOptionRestoreEnvItem `json:"restoreEnv,omitempty"` + DependentCustomOps *ComponentOpsOptionDependentCustomOps `json:"dependentCustomOps,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -264,7 +276,7 @@ func (o *ComponentOpsOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "disableHA", "inPlace", "needBackupWhenInPlace", "restoreEnv", "dependentCustomOps"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "disableHA", "inPlace", "needBackupWhenInPlace", "restoreEnv", "dependentCustomOps", }) } else { return err } @@ -275,7 +287,7 @@ func (o *ComponentOpsOption) UnmarshalJSON(bytes []byte) (err error) { o.InPlace = all.InPlace o.NeedBackupWhenInPlace = all.NeedBackupWhenInPlace o.RestoreEnv = all.RestoreEnv - if all.DependentCustomOps != nil && all.DependentCustomOps.UnparsedObject != nil && o.UnparsedObject == nil { + if all.DependentCustomOps != nil && all.DependentCustomOps.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.DependentCustomOps = all.DependentCustomOps diff --git a/api/kbcloud/admin/model_component_ops_option_dependent_custom_ops.go b/api/kbcloud/admin/model_component_ops_option_dependent_custom_ops.go index 4f76d508..c73f36c7 100644 --- a/api/kbcloud/admin/model_component_ops_option_dependent_custom_ops.go +++ b/api/kbcloud/admin/model_component_ops_option_dependent_custom_ops.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentOpsOptionDependentCustomOps struct { // opsDefinition name OpsDefName *string `json:"opsDefName,omitempty"` @@ -22,10 +31,11 @@ type ComponentOpsOptionDependentCustomOps struct { // custom ops parameters Params []ComponentOpsOptionDependentCustomOpsParamsItem `json:"params,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOpsOptionDependentCustomOps instantiates a new ComponentOpsOptionDependentCustomOps object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +52,6 @@ func NewComponentOpsOptionDependentCustomOpsWithDefaults() *ComponentOpsOptionDe this := ComponentOpsOptionDependentCustomOps{} return &this } - // GetOpsDefName returns the OpsDefName field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOps) GetOpsDefName() string { if o == nil || o.OpsDefName == nil { @@ -71,6 +80,7 @@ func (o *ComponentOpsOptionDependentCustomOps) SetOpsDefName(v string) { o.OpsDefName = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOps) GetComponent() string { if o == nil || o.Component == nil { @@ -99,6 +109,7 @@ func (o *ComponentOpsOptionDependentCustomOps) SetComponent(v string) { o.Component = &v } + // GetWhen returns the When field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOps) GetWhen() string { if o == nil || o.When == nil { @@ -127,6 +138,7 @@ func (o *ComponentOpsOptionDependentCustomOps) SetWhen(v string) { o.When = &v } + // GetParams returns the Params field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOps) GetParams() []ComponentOpsOptionDependentCustomOpsParamsItem { if o == nil || o.Params == nil { @@ -155,6 +167,8 @@ func (o *ComponentOpsOptionDependentCustomOps) SetParams(v []ComponentOpsOptionD o.Params = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOpsOptionDependentCustomOps) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -183,17 +197,17 @@ func (o ComponentOpsOptionDependentCustomOps) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOpsOptionDependentCustomOps) UnmarshalJSON(bytes []byte) (err error) { all := struct { - OpsDefName *string `json:"opsDefName,omitempty"` - Component *string `json:"component,omitempty"` - When *string `json:"when,omitempty"` - Params []ComponentOpsOptionDependentCustomOpsParamsItem `json:"params,omitempty"` + OpsDefName *string `json:"opsDefName,omitempty"` + Component *string `json:"component,omitempty"` + When *string `json:"when,omitempty"` + Params []ComponentOpsOptionDependentCustomOpsParamsItem `json:"params,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"opsDefName", "component", "when", "params"}) + common.DeleteKeys(additionalProperties, &[]string{ "opsDefName", "component", "when", "params", }) } else { return err } diff --git a/api/kbcloud/admin/model_component_ops_option_dependent_custom_ops_params_item.go b/api/kbcloud/admin/model_component_ops_option_dependent_custom_ops_params_item.go index bf9642b2..9954fa09 100644 --- a/api/kbcloud/admin/model_component_ops_option_dependent_custom_ops_params_item.go +++ b/api/kbcloud/admin/model_component_ops_option_dependent_custom_ops_params_item.go @@ -2,14 +2,23 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentOpsOptionDependentCustomOpsParamsItem struct { // parameter name. Name *string `json:"name,omitempty"` - // parameter value, you can define a go template expression to refer the variable of the current ops. + // parameter value, you can define a go template expression to refer the variable of the current ops. // available built-in objects that can be referenced in the expression include: // - cluster: cluster record // - params: ops input parameters @@ -18,10 +27,11 @@ type ComponentOpsOptionDependentCustomOpsParamsItem struct { // Value *string `json:"value,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOpsOptionDependentCustomOpsParamsItem instantiates a new ComponentOpsOptionDependentCustomOpsParamsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +48,6 @@ func NewComponentOpsOptionDependentCustomOpsParamsItemWithDefaults() *ComponentO this := ComponentOpsOptionDependentCustomOpsParamsItem{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOpsParamsItem) GetName() string { if o == nil || o.Name == nil { @@ -67,6 +76,7 @@ func (o *ComponentOpsOptionDependentCustomOpsParamsItem) SetName(v string) { o.Name = &v } + // GetValue returns the Value field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOpsParamsItem) GetValue() string { if o == nil || o.Value == nil { @@ -95,6 +105,8 @@ func (o *ComponentOpsOptionDependentCustomOpsParamsItem) SetValue(v string) { o.Value = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOpsOptionDependentCustomOpsParamsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -117,7 +129,7 @@ func (o ComponentOpsOptionDependentCustomOpsParamsItem) MarshalJSON() ([]byte, e // UnmarshalJSON deserializes the given payload. func (o *ComponentOpsOptionDependentCustomOpsParamsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -125,7 +137,7 @@ func (o *ComponentOpsOptionDependentCustomOpsParamsItem) UnmarshalJSON(bytes []b } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "value", }) } else { return err } diff --git a/api/kbcloud/admin/model_component_ops_option_restore_env_item.go b/api/kbcloud/admin/model_component_ops_option_restore_env_item.go index 4997a8e2..dc128eb2 100644 --- a/api/kbcloud/admin/model_component_ops_option_restore_env_item.go +++ b/api/kbcloud/admin/model_component_ops_option_restore_env_item.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOpsOptionRestoreEnvItem struct { // env name Name string `json:"name"` // env value Value string `json:"value"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOpsOptionRestoreEnvItem instantiates a new ComponentOpsOptionRestoreEnvItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewComponentOpsOptionRestoreEnvItemWithDefaults() *ComponentOpsOptionRestor this := ComponentOpsOptionRestoreEnvItem{} return &this } - // GetName returns the Name field value. func (o *ComponentOpsOptionRestoreEnvItem) GetName() string { if o == nil { @@ -62,6 +67,7 @@ func (o *ComponentOpsOptionRestoreEnvItem) SetName(v string) { o.Name = v } + // GetValue returns the Value field value. func (o *ComponentOpsOptionRestoreEnvItem) GetValue() string { if o == nil { @@ -85,6 +91,8 @@ func (o *ComponentOpsOptionRestoreEnvItem) SetValue(v string) { o.Value = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOpsOptionRestoreEnvItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -103,7 +111,7 @@ func (o ComponentOpsOptionRestoreEnvItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOpsOptionRestoreEnvItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` Value *string `json:"value"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +125,7 @@ func (o *ComponentOpsOptionRestoreEnvItem) UnmarshalJSON(bytes []byte) (err erro } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "value", }) } else { return err } diff --git a/api/kbcloud/admin/model_component_option.go b/api/kbcloud/admin/model_component_option.go index 1428c414..f8de507c 100644 --- a/api/kbcloud/admin/model_component_option.go +++ b/api/kbcloud/admin/model_component_option.go @@ -2,32 +2,38 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOption struct { // component type Name string `json:"name"` // Determine whether the componentDef of kb-cluster belongs to this component type through this matching regularization. // if not set, componentDef must be equal to component type. // - MatchRegex *string `json:"matchRegex,omitempty"` - Title LocalizedDescription `json:"title"` - Order int32 `json:"order"` - RoleOrder []string `json:"roleOrder"` - Version *ComponentOptionVersion `json:"version,omitempty"` + MatchRegex *string `json:"matchRegex,omitempty"` + Title LocalizedDescription `json:"title"` + Order int32 `json:"order"` + RoleOrder []string `json:"roleOrder"` + Version *ComponentOptionVersion `json:"version,omitempty"` // Main component flag Main *bool `json:"main,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOption instantiates a new ComponentOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -48,7 +54,6 @@ func NewComponentOptionWithDefaults() *ComponentOption { this := ComponentOption{} return &this } - // GetName returns the Name field value. func (o *ComponentOption) GetName() string { if o == nil { @@ -72,6 +77,7 @@ func (o *ComponentOption) SetName(v string) { o.Name = v } + // GetMatchRegex returns the MatchRegex field value if set, zero value otherwise. func (o *ComponentOption) GetMatchRegex() string { if o == nil || o.MatchRegex == nil { @@ -100,6 +106,7 @@ func (o *ComponentOption) SetMatchRegex(v string) { o.MatchRegex = &v } + // GetTitle returns the Title field value. func (o *ComponentOption) GetTitle() LocalizedDescription { if o == nil { @@ -123,6 +130,7 @@ func (o *ComponentOption) SetTitle(v LocalizedDescription) { o.Title = v } + // GetOrder returns the Order field value. func (o *ComponentOption) GetOrder() int32 { if o == nil { @@ -146,6 +154,7 @@ func (o *ComponentOption) SetOrder(v int32) { o.Order = v } + // GetRoleOrder returns the RoleOrder field value. func (o *ComponentOption) GetRoleOrder() []string { if o == nil { @@ -169,6 +178,7 @@ func (o *ComponentOption) SetRoleOrder(v []string) { o.RoleOrder = v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *ComponentOption) GetVersion() ComponentOptionVersion { if o == nil || o.Version == nil { @@ -197,6 +207,7 @@ func (o *ComponentOption) SetVersion(v ComponentOptionVersion) { o.Version = &v } + // GetMain returns the Main field value if set, zero value otherwise. func (o *ComponentOption) GetMain() bool { if o == nil || o.Main == nil { @@ -225,6 +236,8 @@ func (o *ComponentOption) SetMain(v bool) { o.Main = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -254,13 +267,13 @@ func (o ComponentOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - MatchRegex *string `json:"matchRegex,omitempty"` - Title *LocalizedDescription `json:"title"` - Order *int32 `json:"order"` - RoleOrder *[]string `json:"roleOrder"` - Version *ComponentOptionVersion `json:"version,omitempty"` - Main *bool `json:"main,omitempty"` + Name *string `json:"name"` + MatchRegex *string `json:"matchRegex,omitempty"` + Title *LocalizedDescription `json:"title"` + Order *int32 `json:"order"` + RoleOrder *[]string `json:"roleOrder"` + Version *ComponentOptionVersion `json:"version,omitempty"` + Main *bool `json:"main,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -279,7 +292,7 @@ func (o *ComponentOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "matchRegex", "title", "order", "roleOrder", "version", "main"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "matchRegex", "title", "order", "roleOrder", "version", "main", }) } else { return err } @@ -293,7 +306,7 @@ func (o *ComponentOption) UnmarshalJSON(bytes []byte) (err error) { o.Title = *all.Title o.Order = *all.Order o.RoleOrder = *all.RoleOrder - if all.Version != nil && all.Version.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Version != nil && all.Version.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Version = all.Version diff --git a/api/kbcloud/admin/model_component_option_version.go b/api/kbcloud/admin/model_component_option_version.go index 0ac429d2..fb021420 100644 --- a/api/kbcloud/admin/model_component_option_version.go +++ b/api/kbcloud/admin/model_component_option_version.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOptionVersion struct { // component version name - ComponentVersionName string `json:"componentVersionName"` - MinorVersion *ComponentOptionVersionMinorVersion `json:"minorVersion,omitempty"` - MajorVersion ComponentOptionVersionMajorVersion `json:"majorVersion"` + ComponentVersionName string `json:"componentVersionName"` + MinorVersion *ComponentOptionVersionMinorVersion `json:"minorVersion,omitempty"` + MajorVersion ComponentOptionVersionMajorVersion `json:"majorVersion"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOptionVersion instantiates a new ComponentOptionVersion object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewComponentOptionVersionWithDefaults() *ComponentOptionVersion { this := ComponentOptionVersion{} return &this } - // GetComponentVersionName returns the ComponentVersionName field value. func (o *ComponentOptionVersion) GetComponentVersionName() string { if o == nil { @@ -62,6 +67,7 @@ func (o *ComponentOptionVersion) SetComponentVersionName(v string) { o.ComponentVersionName = v } + // GetMinorVersion returns the MinorVersion field value if set, zero value otherwise. func (o *ComponentOptionVersion) GetMinorVersion() ComponentOptionVersionMinorVersion { if o == nil || o.MinorVersion == nil { @@ -90,6 +96,7 @@ func (o *ComponentOptionVersion) SetMinorVersion(v ComponentOptionVersionMinorVe o.MinorVersion = &v } + // GetMajorVersion returns the MajorVersion field value. func (o *ComponentOptionVersion) GetMajorVersion() ComponentOptionVersionMajorVersion { if o == nil { @@ -113,6 +120,8 @@ func (o *ComponentOptionVersion) SetMajorVersion(v ComponentOptionVersionMajorVe o.MajorVersion = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOptionVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -134,9 +143,9 @@ func (o ComponentOptionVersion) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOptionVersion) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ComponentVersionName *string `json:"componentVersionName"` - MinorVersion *ComponentOptionVersionMinorVersion `json:"minorVersion,omitempty"` - MajorVersion *ComponentOptionVersionMajorVersion `json:"majorVersion"` + ComponentVersionName *string `json:"componentVersionName"` + MinorVersion *ComponentOptionVersionMinorVersion `json:"minorVersion,omitempty"` + MajorVersion *ComponentOptionVersionMajorVersion `json:"majorVersion"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,14 +158,14 @@ func (o *ComponentOptionVersion) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"componentVersionName", "minorVersion", "majorVersion"}) + common.DeleteKeys(additionalProperties, &[]string{ "componentVersionName", "minorVersion", "majorVersion", }) } else { return err } hasInvalidField := false o.ComponentVersionName = *all.ComponentVersionName - if all.MinorVersion != nil && all.MinorVersion.UnparsedObject != nil && o.UnparsedObject == nil { + if all.MinorVersion != nil && all.MinorVersion.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.MinorVersion = all.MinorVersion diff --git a/api/kbcloud/admin/model_component_option_version_major_version.go b/api/kbcloud/admin/model_component_option_version_major_version.go index 69e76bf5..d68a03dd 100644 --- a/api/kbcloud/admin/model_component_option_version_major_version.go +++ b/api/kbcloud/admin/model_component_option_version_major_version.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOptionVersionMajorVersion struct { // default major version. Default *string `json:"default,omitempty"` - // ServiceVersion uses semver syntax(X Y.Z), such MySQL 5.7.4 and PG 14.8.0. + // ServiceVersion uses semver syntax(X Y.Z), such MySQL 5.7.4 and PG 14.8.0. // Currently supports [X, X.Y, X.Y.Z] formats to determine major versions of the engine from the serviceVersion // - Rule string `json:"rule"` + Rule string `json:"rule"` VersionMapping []ComponentOptionVersionMajorVersionVersionMappingItem `json:"versionMapping,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOptionVersionMajorVersion instantiates a new ComponentOptionVersionMajorVersion object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewComponentOptionVersionMajorVersionWithDefaults() *ComponentOptionVersion this := ComponentOptionVersionMajorVersion{} return &this } - // GetDefault returns the Default field value if set, zero value otherwise. func (o *ComponentOptionVersionMajorVersion) GetDefault() string { if o == nil || o.Default == nil { @@ -69,6 +74,7 @@ func (o *ComponentOptionVersionMajorVersion) SetDefault(v string) { o.Default = &v } + // GetRule returns the Rule field value. func (o *ComponentOptionVersionMajorVersion) GetRule() string { if o == nil { @@ -92,6 +98,7 @@ func (o *ComponentOptionVersionMajorVersion) SetRule(v string) { o.Rule = v } + // GetVersionMapping returns the VersionMapping field value if set, zero value otherwise. func (o *ComponentOptionVersionMajorVersion) GetVersionMapping() []ComponentOptionVersionMajorVersionVersionMappingItem { if o == nil || o.VersionMapping == nil { @@ -120,6 +127,8 @@ func (o *ComponentOptionVersionMajorVersion) SetVersionMapping(v []ComponentOpti o.VersionMapping = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOptionVersionMajorVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o ComponentOptionVersionMajorVersion) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOptionVersionMajorVersion) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Default *string `json:"default,omitempty"` - Rule *string `json:"rule"` + Default *string `json:"default,omitempty"` + Rule *string `json:"rule"` VersionMapping []ComponentOptionVersionMajorVersionVersionMappingItem `json:"versionMapping,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *ComponentOptionVersionMajorVersion) UnmarshalJSON(bytes []byte) (err er } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"default", "rule", "versionMapping"}) + common.DeleteKeys(additionalProperties, &[]string{ "default", "rule", "versionMapping", }) } else { return err } diff --git a/api/kbcloud/admin/model_component_option_version_major_version_version_mapping_item.go b/api/kbcloud/admin/model_component_option_version_major_version_version_mapping_item.go index 36c419f8..45f246c4 100644 --- a/api/kbcloud/admin/model_component_option_version_major_version_version_mapping_item.go +++ b/api/kbcloud/admin/model_component_option_version_major_version_version_mapping_item.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ComponentOptionVersionMajorVersionVersionMappingItem Configure the mapping relationship with the main component's major versions. +// ComponentOptionVersionMajorVersionVersionMappingItem Configure the mapping relationship with the main component's major versions. type ComponentOptionVersionMajorVersionVersionMappingItem struct { // major version of the main component MainComponentMajorVersion *string `json:"mainComponentMajorVersion,omitempty"` // major versions of the current component Versions []string `json:"versions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOptionVersionMajorVersionVersionMappingItem instantiates a new ComponentOptionVersionMajorVersionVersionMappingItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewComponentOptionVersionMajorVersionVersionMappingItemWithDefaults() *Comp this := ComponentOptionVersionMajorVersionVersionMappingItem{} return &this } - // GetMainComponentMajorVersion returns the MainComponentMajorVersion field value if set, zero value otherwise. func (o *ComponentOptionVersionMajorVersionVersionMappingItem) GetMainComponentMajorVersion() string { if o == nil || o.MainComponentMajorVersion == nil { @@ -62,6 +71,7 @@ func (o *ComponentOptionVersionMajorVersionVersionMappingItem) SetMainComponentM o.MainComponentMajorVersion = &v } + // GetVersions returns the Versions field value if set, zero value otherwise. func (o *ComponentOptionVersionMajorVersionVersionMappingItem) GetVersions() []string { if o == nil || o.Versions == nil { @@ -90,6 +100,8 @@ func (o *ComponentOptionVersionMajorVersionVersionMappingItem) SetVersions(v []s o.Versions = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOptionVersionMajorVersionVersionMappingItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o ComponentOptionVersionMajorVersionVersionMappingItem) MarshalJSON() ([]b // UnmarshalJSON deserializes the given payload. func (o *ComponentOptionVersionMajorVersionVersionMappingItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - MainComponentMajorVersion *string `json:"mainComponentMajorVersion,omitempty"` - Versions []string `json:"versions,omitempty"` + MainComponentMajorVersion *string `json:"mainComponentMajorVersion,omitempty"` + Versions []string `json:"versions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"mainComponentMajorVersion", "versions"}) + common.DeleteKeys(additionalProperties, &[]string{ "mainComponentMajorVersion", "versions", }) } else { return err } diff --git a/api/kbcloud/admin/model_component_option_version_minor_version.go b/api/kbcloud/admin/model_component_option_version_minor_version.go index a51d3dd6..49ad977d 100644 --- a/api/kbcloud/admin/model_component_option_version_minor_version.go +++ b/api/kbcloud/admin/model_component_option_version_minor_version.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentOptionVersionMinorVersion struct { // determine whether minor version can be rolled back. Rollback *bool `json:"rollback,omitempty"` // disable roll back the preRelease minor version. DisableRollbackPreRelease *bool `json:"disableRollbackPreRelease,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOptionVersionMinorVersion instantiates a new ComponentOptionVersionMinorVersion object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewComponentOptionVersionMinorVersionWithDefaults() *ComponentOptionVersion this := ComponentOptionVersionMinorVersion{} return &this } - // GetRollback returns the Rollback field value if set, zero value otherwise. func (o *ComponentOptionVersionMinorVersion) GetRollback() bool { if o == nil || o.Rollback == nil { @@ -61,6 +70,7 @@ func (o *ComponentOptionVersionMinorVersion) SetRollback(v bool) { o.Rollback = &v } + // GetDisableRollbackPreRelease returns the DisableRollbackPreRelease field value if set, zero value otherwise. func (o *ComponentOptionVersionMinorVersion) GetDisableRollbackPreRelease() bool { if o == nil || o.DisableRollbackPreRelease == nil { @@ -89,6 +99,8 @@ func (o *ComponentOptionVersionMinorVersion) SetDisableRollbackPreRelease(v bool o.DisableRollbackPreRelease = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOptionVersionMinorVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +123,7 @@ func (o ComponentOptionVersionMinorVersion) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOptionVersionMinorVersion) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Rollback *bool `json:"rollback,omitempty"` + Rollback *bool `json:"rollback,omitempty"` DisableRollbackPreRelease *bool `json:"disableRollbackPreRelease,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +131,7 @@ func (o *ComponentOptionVersionMinorVersion) UnmarshalJSON(bytes []byte) (err er } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"rollback", "disableRollbackPreRelease"}) + common.DeleteKeys(additionalProperties, &[]string{ "rollback", "disableRollbackPreRelease", }) } else { return err } diff --git a/api/kbcloud/admin/model_component_version.go b/api/kbcloud/admin/model_component_version.go index 7427e574..2f771940 100644 --- a/api/kbcloud/admin/model_component_version.go +++ b/api/kbcloud/admin/model_component_version.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// ComponentVersion component version + + +// ComponentVersion component version type ComponentVersion struct { Kubeblocks *string `json:"kubeblocks,omitempty"` - Gemini *string `json:"gemini,omitempty"` - Oteld *string `json:"oteld,omitempty"` + Gemini *string `json:"gemini,omitempty"` + Oteld *string `json:"oteld,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentVersion instantiates a new ComponentVersion object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewComponentVersionWithDefaults() *ComponentVersion { this := ComponentVersion{} return &this } - // GetKubeblocks returns the Kubeblocks field value if set, zero value otherwise. func (o *ComponentVersion) GetKubeblocks() string { if o == nil || o.Kubeblocks == nil { @@ -61,6 +70,7 @@ func (o *ComponentVersion) SetKubeblocks(v string) { o.Kubeblocks = &v } + // GetGemini returns the Gemini field value if set, zero value otherwise. func (o *ComponentVersion) GetGemini() string { if o == nil || o.Gemini == nil { @@ -89,6 +99,7 @@ func (o *ComponentVersion) SetGemini(v string) { o.Gemini = &v } + // GetOteld returns the Oteld field value if set, zero value otherwise. func (o *ComponentVersion) GetOteld() string { if o == nil || o.Oteld == nil { @@ -117,6 +128,8 @@ func (o *ComponentVersion) SetOteld(v string) { o.Oteld = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,15 +156,15 @@ func (o ComponentVersion) MarshalJSON() ([]byte, error) { func (o *ComponentVersion) UnmarshalJSON(bytes []byte) (err error) { all := struct { Kubeblocks *string `json:"kubeblocks,omitempty"` - Gemini *string `json:"gemini,omitempty"` - Oteld *string `json:"oteld,omitempty"` + Gemini *string `json:"gemini,omitempty"` + Oteld *string `json:"oteld,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"kubeblocks", "gemini", "oteld"}) + common.DeleteKeys(additionalProperties, &[]string{ "kubeblocks", "gemini", "oteld", }) } else { return err } diff --git a/api/kbcloud/admin/model_components_item.go b/api/kbcloud/admin/model_components_item.go index b925c403..f9b45f5c 100644 --- a/api/kbcloud/admin/model_components_item.go +++ b/api/kbcloud/admin/model_components_item.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentsItem struct { // component name Name *string `json:"name,omitempty"` @@ -18,8 +27,8 @@ type ComponentsItem struct { // enable monitor Monitor *bool `json:"monitor,omitempty"` // The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. - Replicas *int32 `json:"replicas,omitempty"` - ClassCode *string `json:"classCode,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + ClassCode *string `json:"classCode,omitempty"` ClassSeries *string `json:"classSeries,omitempty"` // CPU cores. Cpu *float64 `json:"cpu,omitempty"` @@ -28,15 +37,16 @@ type ComponentsItem struct { // Storage Storage *string `json:"storage,omitempty"` // StorageClass name - StorageClass *string `json:"storageClass,omitempty"` - Volumes []ComponentsItemVolumesItem `json:"volumes,omitempty"` + StorageClass *string `json:"storageClass,omitempty"` + Volumes []ComponentsItemVolumesItem `json:"volumes,omitempty"` // Cluster main component codeShort CodeShort *string `json:"codeShort,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentsItem instantiates a new ComponentsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +63,6 @@ func NewComponentsItemWithDefaults() *ComponentsItem { this := ComponentsItem{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *ComponentsItem) GetName() string { if o == nil || o.Name == nil { @@ -82,6 +91,7 @@ func (o *ComponentsItem) SetName(v string) { o.Name = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ComponentsItem) GetComponent() string { if o == nil || o.Component == nil { @@ -110,6 +120,7 @@ func (o *ComponentsItem) SetComponent(v string) { o.Component = &v } + // GetComponentDef returns the ComponentDef field value if set, zero value otherwise. func (o *ComponentsItem) GetComponentDef() string { if o == nil || o.ComponentDef == nil { @@ -138,6 +149,7 @@ func (o *ComponentsItem) SetComponentDef(v string) { o.ComponentDef = &v } + // GetCompNum returns the CompNum field value if set, zero value otherwise. func (o *ComponentsItem) GetCompNum() int32 { if o == nil || o.CompNum == nil { @@ -166,6 +178,7 @@ func (o *ComponentsItem) SetCompNum(v int32) { o.CompNum = &v } + // GetMonitor returns the Monitor field value if set, zero value otherwise. func (o *ComponentsItem) GetMonitor() bool { if o == nil || o.Monitor == nil { @@ -194,6 +207,7 @@ func (o *ComponentsItem) SetMonitor(v bool) { o.Monitor = &v } + // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *ComponentsItem) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -222,6 +236,7 @@ func (o *ComponentsItem) SetReplicas(v int32) { o.Replicas = &v } + // GetClassCode returns the ClassCode field value if set, zero value otherwise. func (o *ComponentsItem) GetClassCode() string { if o == nil || o.ClassCode == nil { @@ -250,6 +265,7 @@ func (o *ComponentsItem) SetClassCode(v string) { o.ClassCode = &v } + // GetClassSeries returns the ClassSeries field value if set, zero value otherwise. func (o *ComponentsItem) GetClassSeries() string { if o == nil || o.ClassSeries == nil { @@ -278,6 +294,7 @@ func (o *ComponentsItem) SetClassSeries(v string) { o.ClassSeries = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *ComponentsItem) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -306,6 +323,7 @@ func (o *ComponentsItem) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *ComponentsItem) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -334,6 +352,7 @@ func (o *ComponentsItem) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *ComponentsItem) GetStorage() string { if o == nil || o.Storage == nil { @@ -362,6 +381,7 @@ func (o *ComponentsItem) SetStorage(v string) { o.Storage = &v } + // GetStorageClass returns the StorageClass field value if set, zero value otherwise. func (o *ComponentsItem) GetStorageClass() string { if o == nil || o.StorageClass == nil { @@ -390,6 +410,7 @@ func (o *ComponentsItem) SetStorageClass(v string) { o.StorageClass = &v } + // GetVolumes returns the Volumes field value if set, zero value otherwise. func (o *ComponentsItem) GetVolumes() []ComponentsItemVolumesItem { if o == nil || o.Volumes == nil { @@ -418,6 +439,7 @@ func (o *ComponentsItem) SetVolumes(v []ComponentsItemVolumesItem) { o.Volumes = v } + // GetCodeShort returns the CodeShort field value if set, zero value otherwise. func (o *ComponentsItem) GetCodeShort() string { if o == nil || o.CodeShort == nil { @@ -446,6 +468,8 @@ func (o *ComponentsItem) SetCodeShort(v string) { o.CodeShort = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -504,27 +528,27 @@ func (o ComponentsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Component *string `json:"component,omitempty"` - ComponentDef *string `json:"componentDef,omitempty"` - CompNum *int32 `json:"compNum,omitempty"` - Monitor *bool `json:"monitor,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - ClassCode *string `json:"classCode,omitempty"` - ClassSeries *string `json:"classSeries,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *string `json:"storage,omitempty"` - StorageClass *string `json:"storageClass,omitempty"` - Volumes []ComponentsItemVolumesItem `json:"volumes,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` + Name *string `json:"name,omitempty"` + Component *string `json:"component,omitempty"` + ComponentDef *string `json:"componentDef,omitempty"` + CompNum *int32 `json:"compNum,omitempty"` + Monitor *bool `json:"monitor,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + ClassCode *string `json:"classCode,omitempty"` + ClassSeries *string `json:"classSeries,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *string `json:"storage,omitempty"` + StorageClass *string `json:"storageClass,omitempty"` + Volumes []ComponentsItemVolumesItem `json:"volumes,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "component", "componentDef", "compNum", "monitor", "replicas", "classCode", "classSeries", "cpu", "memory", "storage", "storageClass", "volumes", "codeShort"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "component", "componentDef", "compNum", "monitor", "replicas", "classCode", "classSeries", "cpu", "memory", "storage", "storageClass", "volumes", "codeShort", }) } else { return err } diff --git a/api/kbcloud/admin/model_components_item_volumes_item.go b/api/kbcloud/admin/model_components_item_volumes_item.go index b8653c64..97359fdf 100644 --- a/api/kbcloud/admin/model_components_item_volumes_item.go +++ b/api/kbcloud/admin/model_components_item_volumes_item.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentsItemVolumesItem struct { // volume name Name *string `json:"name,omitempty"` // Storage size, the unit is Gi. Storage *float64 `json:"storage,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentsItemVolumesItem instantiates a new ComponentsItemVolumesItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewComponentsItemVolumesItemWithDefaults() *ComponentsItemVolumesItem { this := ComponentsItemVolumesItem{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *ComponentsItemVolumesItem) GetName() string { if o == nil || o.Name == nil { @@ -61,6 +70,7 @@ func (o *ComponentsItemVolumesItem) SetName(v string) { o.Name = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *ComponentsItemVolumesItem) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -89,6 +99,8 @@ func (o *ComponentsItemVolumesItem) SetStorage(v float64) { o.Storage = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentsItemVolumesItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +123,7 @@ func (o ComponentsItemVolumesItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentsItemVolumesItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Storage *float64 `json:"storage,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +131,7 @@ func (o *ComponentsItemVolumesItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "storage"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "storage", }) } else { return err } diff --git a/api/kbcloud/admin/model_configuration.go b/api/kbcloud/admin/model_configuration.go index 77dbb798..671525b9 100644 --- a/api/kbcloud/admin/model_configuration.go +++ b/api/kbcloud/admin/model_configuration.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Configuration Cluster parameters configuration, include the file name and content of the parameters + + +// Configuration Cluster parameters configuration, include the file name and content of the parameters type Configuration struct { // The name of the configuration file FileName string `json:"fileName"` // The content of the configuration file Content string `json:"content"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewConfiguration instantiates a new Configuration object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewConfigurationWithDefaults() *Configuration { this := Configuration{} return &this } - // GetFileName returns the FileName field value. func (o *Configuration) GetFileName() string { if o == nil { @@ -63,6 +68,7 @@ func (o *Configuration) SetFileName(v string) { o.FileName = v } + // GetContent returns the Content field value. func (o *Configuration) GetContent() string { if o == nil { @@ -86,6 +92,8 @@ func (o *Configuration) SetContent(v string) { o.Content = v } + + // MarshalJSON serializes the struct using spec logic. func (o Configuration) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -105,7 +113,7 @@ func (o Configuration) MarshalJSON() ([]byte, error) { func (o *Configuration) UnmarshalJSON(bytes []byte) (err error) { all := struct { FileName *string `json:"fileName"` - Content *string `json:"content"` + Content *string `json:"content"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *Configuration) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"fileName", "content"}) + common.DeleteKeys(additionalProperties, &[]string{ "fileName", "content", }) } else { return err } diff --git a/api/kbcloud/admin/model_configuration_list.go b/api/kbcloud/admin/model_configuration_list.go index b5b307d8..dfdab9fd 100644 --- a/api/kbcloud/admin/model_configuration_list.go +++ b/api/kbcloud/admin/model_configuration_list.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ConfigurationList A list of cluster parameters configuration +// ConfigurationList A list of cluster parameters configuration type ConfigurationList struct { Items []Configuration `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewConfigurationList instantiates a new ConfigurationList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewConfigurationListWithDefaults() *ConfigurationList { this := ConfigurationList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ConfigurationList) GetItems() []Configuration { if o == nil || o.Items == nil { @@ -59,6 +68,8 @@ func (o *ConfigurationList) SetItems(v []Configuration) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ConfigurationList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *ConfigurationList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_configuration_with_regex.go b/api/kbcloud/admin/model_configuration_with_regex.go index fd2b40fc..debe424b 100644 --- a/api/kbcloud/admin/model_configuration_with_regex.go +++ b/api/kbcloud/admin/model_configuration_with_regex.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ConfigurationWithRegex Cluster parameters configuration, include the file name and content of the parameters + + +// ConfigurationWithRegex Cluster parameters configuration, include the file name and content of the parameters type ConfigurationWithRegex struct { // The name of the configuration file FileName string `json:"fileName"` @@ -19,10 +24,11 @@ type ConfigurationWithRegex struct { // the template regex Regex string `json:"regex"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewConfigurationWithRegex instantiates a new ConfigurationWithRegex object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewConfigurationWithRegexWithDefaults() *ConfigurationWithRegex { this := ConfigurationWithRegex{} return &this } - // GetFileName returns the FileName field value. func (o *ConfigurationWithRegex) GetFileName() string { if o == nil { @@ -66,6 +71,7 @@ func (o *ConfigurationWithRegex) SetFileName(v string) { o.FileName = v } + // GetContent returns the Content field value. func (o *ConfigurationWithRegex) GetContent() string { if o == nil { @@ -89,6 +95,7 @@ func (o *ConfigurationWithRegex) SetContent(v string) { o.Content = v } + // GetRegex returns the Regex field value. func (o *ConfigurationWithRegex) GetRegex() string { if o == nil { @@ -112,6 +119,8 @@ func (o *ConfigurationWithRegex) SetRegex(v string) { o.Regex = v } + + // MarshalJSON serializes the struct using spec logic. func (o ConfigurationWithRegex) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -132,8 +141,8 @@ func (o ConfigurationWithRegex) MarshalJSON() ([]byte, error) { func (o *ConfigurationWithRegex) UnmarshalJSON(bytes []byte) (err error) { all := struct { FileName *string `json:"fileName"` - Content *string `json:"content"` - Regex *string `json:"regex"` + Content *string `json:"content"` + Regex *string `json:"regex"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,7 +158,7 @@ func (o *ConfigurationWithRegex) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"fileName", "content", "regex"}) + common.DeleteKeys(additionalProperties, &[]string{ "fileName", "content", "regex", }) } else { return err } diff --git a/api/kbcloud/admin/model_cpu.go b/api/kbcloud/admin/model_cpu.go index e7cd1687..5895b778 100644 --- a/api/kbcloud/admin/model_cpu.go +++ b/api/kbcloud/admin/model_cpu.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type CPU struct { - CpuCapacity *string `json:"cpu_capacity,omitempty"` + CpuCapacity *string `json:"cpu_capacity,omitempty"` CpuCapacityMax *string `json:"cpu_capacity_max,omitempty"` - CpuAssigned *string `json:"cpu_assigned,omitempty"` + CpuAssigned *string `json:"cpu_assigned,omitempty"` CpuAssignedMax *string `json:"cpu_assigned_max,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewCPU instantiates a new CPU object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewCPUWithDefaults() *CPU { this := CPU{} return &this } - // GetCpuCapacity returns the CpuCapacity field value if set, zero value otherwise. func (o *CPU) GetCpuCapacity() string { if o == nil || o.CpuCapacity == nil { @@ -61,6 +70,7 @@ func (o *CPU) SetCpuCapacity(v string) { o.CpuCapacity = &v } + // GetCpuCapacityMax returns the CpuCapacityMax field value if set, zero value otherwise. func (o *CPU) GetCpuCapacityMax() string { if o == nil || o.CpuCapacityMax == nil { @@ -89,6 +99,7 @@ func (o *CPU) SetCpuCapacityMax(v string) { o.CpuCapacityMax = &v } + // GetCpuAssigned returns the CpuAssigned field value if set, zero value otherwise. func (o *CPU) GetCpuAssigned() string { if o == nil || o.CpuAssigned == nil { @@ -117,6 +128,7 @@ func (o *CPU) SetCpuAssigned(v string) { o.CpuAssigned = &v } + // GetCpuAssignedMax returns the CpuAssignedMax field value if set, zero value otherwise. func (o *CPU) GetCpuAssignedMax() string { if o == nil || o.CpuAssignedMax == nil { @@ -145,6 +157,8 @@ func (o *CPU) SetCpuAssignedMax(v string) { o.CpuAssignedMax = &v } + + // MarshalJSON serializes the struct using spec logic. func (o CPU) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -173,9 +187,9 @@ func (o CPU) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *CPU) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CpuCapacity *string `json:"cpu_capacity,omitempty"` + CpuCapacity *string `json:"cpu_capacity,omitempty"` CpuCapacityMax *string `json:"cpu_capacity_max,omitempty"` - CpuAssigned *string `json:"cpu_assigned,omitempty"` + CpuAssigned *string `json:"cpu_assigned,omitempty"` CpuAssignedMax *string `json:"cpu_assigned_max,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -183,7 +197,7 @@ func (o *CPU) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cpu_capacity", "cpu_capacity_max", "cpu_assigned", "cpu_assigned_max"}) + common.DeleteKeys(additionalProperties, &[]string{ "cpu_capacity", "cpu_capacity_max", "cpu_assigned", "cpu_assigned_max", }) } else { return err } diff --git a/api/kbcloud/admin/model_dashboard_option.go b/api/kbcloud/admin/model_dashboard_option.go index 427703fd..545a2a67 100644 --- a/api/kbcloud/admin/model_dashboard_option.go +++ b/api/kbcloud/admin/model_dashboard_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type DashboardOption struct { - Component string `json:"component"` - DashboardUid string `json:"dashboardUid"` - Variables map[string]string `json:"variables"` + Component string `json:"component"` + DashboardUid string `json:"dashboardUid"` + Variables map[string]string `json:"variables"` InstancePanels []DashboardOptionInstancePanelsItem `json:"instancePanels"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDashboardOption instantiates a new DashboardOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewDashboardOptionWithDefaults() *DashboardOption { this := DashboardOption{} return &this } - // GetComponent returns the Component field value. func (o *DashboardOption) GetComponent() string { if o == nil { @@ -64,6 +69,7 @@ func (o *DashboardOption) SetComponent(v string) { o.Component = v } + // GetDashboardUid returns the DashboardUid field value. func (o *DashboardOption) GetDashboardUid() string { if o == nil { @@ -87,6 +93,7 @@ func (o *DashboardOption) SetDashboardUid(v string) { o.DashboardUid = v } + // GetVariables returns the Variables field value. func (o *DashboardOption) GetVariables() map[string]string { if o == nil { @@ -110,6 +117,7 @@ func (o *DashboardOption) SetVariables(v map[string]string) { o.Variables = v } + // GetInstancePanels returns the InstancePanels field value. func (o *DashboardOption) GetInstancePanels() []DashboardOptionInstancePanelsItem { if o == nil { @@ -133,6 +141,8 @@ func (o *DashboardOption) SetInstancePanels(v []DashboardOptionInstancePanelsIte o.InstancePanels = v } + + // MarshalJSON serializes the struct using spec logic. func (o DashboardOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,9 +163,9 @@ func (o DashboardOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DashboardOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` - DashboardUid *string `json:"dashboardUid"` - Variables *map[string]string `json:"variables"` + Component *string `json:"component"` + DashboardUid *string `json:"dashboardUid"` + Variables *map[string]string `json:"variables"` InstancePanels *[]DashboardOptionInstancePanelsItem `json:"instancePanels"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -175,7 +185,7 @@ func (o *DashboardOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "dashboardUid", "variables", "instancePanels"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "dashboardUid", "variables", "instancePanels", }) } else { return err } diff --git a/api/kbcloud/admin/model_dashboard_option_instance_panels_item.go b/api/kbcloud/admin/model_dashboard_option_instance_panels_item.go index b1ceef51..bfd3ed67 100644 --- a/api/kbcloud/admin/model_dashboard_option_instance_panels_item.go +++ b/api/kbcloud/admin/model_dashboard_option_instance_panels_item.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type DashboardOptionInstancePanelsItem struct { - Role *string `json:"role,omitempty"` + Role *string `json:"role,omitempty"` Panels []DashboardOptionInstancePanelsItemPanelsItem `json:"panels,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDashboardOptionInstancePanelsItem instantiates a new DashboardOptionInstancePanelsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewDashboardOptionInstancePanelsItemWithDefaults() *DashboardOptionInstance this := DashboardOptionInstancePanelsItem{} return &this } - // GetRole returns the Role field value if set, zero value otherwise. func (o *DashboardOptionInstancePanelsItem) GetRole() string { if o == nil || o.Role == nil { @@ -59,6 +68,7 @@ func (o *DashboardOptionInstancePanelsItem) SetRole(v string) { o.Role = &v } + // GetPanels returns the Panels field value if set, zero value otherwise. func (o *DashboardOptionInstancePanelsItem) GetPanels() []DashboardOptionInstancePanelsItemPanelsItem { if o == nil || o.Panels == nil { @@ -87,6 +97,8 @@ func (o *DashboardOptionInstancePanelsItem) SetPanels(v []DashboardOptionInstanc o.Panels = v } + + // MarshalJSON serializes the struct using spec logic. func (o DashboardOptionInstancePanelsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,7 +121,7 @@ func (o DashboardOptionInstancePanelsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DashboardOptionInstancePanelsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Role *string `json:"role,omitempty"` + Role *string `json:"role,omitempty"` Panels []DashboardOptionInstancePanelsItemPanelsItem `json:"panels,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +129,7 @@ func (o *DashboardOptionInstancePanelsItem) UnmarshalJSON(bytes []byte) (err err } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"role", "panels"}) + common.DeleteKeys(additionalProperties, &[]string{ "role", "panels", }) } else { return err } diff --git a/api/kbcloud/admin/model_dashboard_option_instance_panels_item_panels_item.go b/api/kbcloud/admin/model_dashboard_option_instance_panels_item_panels_item.go index e56d56a0..cb3b66b7 100644 --- a/api/kbcloud/admin/model_dashboard_option_instance_panels_item_panels_item.go +++ b/api/kbcloud/admin/model_dashboard_option_instance_panels_item_panels_item.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type DashboardOptionInstancePanelsItemPanelsItem struct { Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDashboardOptionInstancePanelsItemPanelsItem instantiates a new DashboardOptionInstancePanelsItemPanelsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewDashboardOptionInstancePanelsItemPanelsItemWithDefaults() *DashboardOpti this := DashboardOptionInstancePanelsItemPanelsItem{} return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *DashboardOptionInstancePanelsItemPanelsItem) GetDescription() string { if o == nil || o.Description == nil { @@ -59,6 +68,7 @@ func (o *DashboardOptionInstancePanelsItemPanelsItem) SetDescription(v string) { o.Description = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *DashboardOptionInstancePanelsItemPanelsItem) GetId() string { if o == nil || o.Id == nil { @@ -87,6 +97,8 @@ func (o *DashboardOptionInstancePanelsItemPanelsItem) SetId(v string) { o.Id = &v } + + // MarshalJSON serializes the struct using spec logic. func (o DashboardOptionInstancePanelsItemPanelsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,14 +122,14 @@ func (o DashboardOptionInstancePanelsItemPanelsItem) MarshalJSON() ([]byte, erro func (o *DashboardOptionInstancePanelsItemPanelsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "id"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "id", }) } else { return err } diff --git a/api/kbcloud/admin/model_data_disk.go b/api/kbcloud/admin/model_data_disk.go index bb292d57..e0984432 100644 --- a/api/kbcloud/admin/model_data_disk.go +++ b/api/kbcloud/admin/model_data_disk.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type DataDisk struct { - DataDiskCapacity *string `json:"data_disk_capacity,omitempty"` - DataDiskAllocated *string `json:"data_disk_allocated,omitempty"` - DataDiskInUse *string `json:"data_disk_in_use,omitempty"` + DataDiskCapacity *string `json:"data_disk_capacity,omitempty"` + DataDiskAllocated *string `json:"data_disk_allocated,omitempty"` + DataDiskInUse *string `json:"data_disk_in_use,omitempty"` DataDiskHealthStatus *string `json:"data_disk_health_status,omitempty"` DataDiskAbnormalTime *string `json:"data_disk_abnormal_time,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDataDisk instantiates a new DataDisk object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewDataDiskWithDefaults() *DataDisk { this := DataDisk{} return &this } - // GetDataDiskCapacity returns the DataDiskCapacity field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskCapacity() string { if o == nil || o.DataDiskCapacity == nil { @@ -62,6 +71,7 @@ func (o *DataDisk) SetDataDiskCapacity(v string) { o.DataDiskCapacity = &v } + // GetDataDiskAllocated returns the DataDiskAllocated field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskAllocated() string { if o == nil || o.DataDiskAllocated == nil { @@ -90,6 +100,7 @@ func (o *DataDisk) SetDataDiskAllocated(v string) { o.DataDiskAllocated = &v } + // GetDataDiskInUse returns the DataDiskInUse field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskInUse() string { if o == nil || o.DataDiskInUse == nil { @@ -118,6 +129,7 @@ func (o *DataDisk) SetDataDiskInUse(v string) { o.DataDiskInUse = &v } + // GetDataDiskHealthStatus returns the DataDiskHealthStatus field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskHealthStatus() string { if o == nil || o.DataDiskHealthStatus == nil { @@ -146,6 +158,7 @@ func (o *DataDisk) SetDataDiskHealthStatus(v string) { o.DataDiskHealthStatus = &v } + // GetDataDiskAbnormalTime returns the DataDiskAbnormalTime field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskAbnormalTime() string { if o == nil || o.DataDiskAbnormalTime == nil { @@ -174,6 +187,8 @@ func (o *DataDisk) SetDataDiskAbnormalTime(v string) { o.DataDiskAbnormalTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o DataDisk) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -205,9 +220,9 @@ func (o DataDisk) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DataDisk) UnmarshalJSON(bytes []byte) (err error) { all := struct { - DataDiskCapacity *string `json:"data_disk_capacity,omitempty"` - DataDiskAllocated *string `json:"data_disk_allocated,omitempty"` - DataDiskInUse *string `json:"data_disk_in_use,omitempty"` + DataDiskCapacity *string `json:"data_disk_capacity,omitempty"` + DataDiskAllocated *string `json:"data_disk_allocated,omitempty"` + DataDiskInUse *string `json:"data_disk_in_use,omitempty"` DataDiskHealthStatus *string `json:"data_disk_health_status,omitempty"` DataDiskAbnormalTime *string `json:"data_disk_abnormal_time,omitempty"` }{} @@ -216,7 +231,7 @@ func (o *DataDisk) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"data_disk_capacity", "data_disk_allocated", "data_disk_in_use", "data_disk_health_status", "data_disk_abnormal_time"}) + common.DeleteKeys(additionalProperties, &[]string{ "data_disk_capacity", "data_disk_allocated", "data_disk_in_use", "data_disk_health_status", "data_disk_abnormal_time", }) } else { return err } diff --git a/api/kbcloud/admin/model_database.go b/api/kbcloud/admin/model_database.go index f7b4f03f..63ea1efa 100644 --- a/api/kbcloud/admin/model_database.go +++ b/api/kbcloud/admin/model_database.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Database Cluster database information + + +// Database Cluster database information type Database struct { // component type Component *string `json:"component,omitempty"` @@ -23,10 +28,11 @@ type Database struct { // Description of the database. Description *string `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatabase instantiates a new Database object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewDatabaseWithDefaults() *Database { this := Database{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *Database) GetComponent() string { if o == nil || o.Component == nil { @@ -73,6 +78,7 @@ func (o *Database) SetComponent(v string) { o.Component = &v } + // GetName returns the Name field value. func (o *Database) GetName() string { if o == nil { @@ -96,6 +102,7 @@ func (o *Database) SetName(v string) { o.Name = v } + // GetAccountName returns the AccountName field value if set, zero value otherwise. func (o *Database) GetAccountName() string { if o == nil || o.AccountName == nil { @@ -124,6 +131,7 @@ func (o *Database) SetAccountName(v string) { o.AccountName = &v } + // GetCharset returns the Charset field value if set, zero value otherwise. func (o *Database) GetCharset() string { if o == nil || o.Charset == nil { @@ -152,6 +160,7 @@ func (o *Database) SetCharset(v string) { o.Charset = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Database) GetDescription() string { if o == nil || o.Description == nil { @@ -180,6 +189,8 @@ func (o *Database) SetDescription(v string) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Database) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -209,10 +220,10 @@ func (o Database) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Database) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - Name *string `json:"name"` + Component *string `json:"component,omitempty"` + Name *string `json:"name"` AccountName *string `json:"accountName,omitempty"` - Charset *string `json:"charset,omitempty"` + Charset *string `json:"charset,omitempty"` Description *string `json:"description,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -223,7 +234,7 @@ func (o *Database) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "name", "accountName", "charset", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "name", "accountName", "charset", "description", }) } else { return err } diff --git a/api/kbcloud/admin/model_database_item.go b/api/kbcloud/admin/model_database_item.go index c8aadc9b..8ed6a7f1 100644 --- a/api/kbcloud/admin/model_database_item.go +++ b/api/kbcloud/admin/model_database_item.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// DatabaseItem Cluster database information + + +// DatabaseItem Cluster database information type DatabaseItem struct { // Specify the name of database, which must be unique. Name string `json:"name"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatabaseItem instantiates a new DatabaseItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewDatabaseItemWithDefaults() *DatabaseItem { this := DatabaseItem{} return &this } - // GetName returns the Name field value. func (o *DatabaseItem) GetName() string { if o == nil { @@ -60,6 +65,8 @@ func (o *DatabaseItem) SetName(v string) { o.Name = v } + + // MarshalJSON serializes the struct using spec logic. func (o DatabaseItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *DatabaseItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", }) } else { return err } diff --git a/api/kbcloud/admin/model_database_list.go b/api/kbcloud/admin/model_database_list.go index 2a09be54..86cd16a3 100644 --- a/api/kbcloud/admin/model_database_list.go +++ b/api/kbcloud/admin/model_database_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// DatabaseList DatabaesList is a list of Databaes + + +// DatabaseList DatabaesList is a list of Databaes type DatabaseList struct { // Items is the list of Databases objects in the list Items []DatabaseItem `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatabaseList instantiates a new DatabaseList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewDatabaseListWithDefaults() *DatabaseList { this := DatabaseList{} return &this } - // GetItems returns the Items field value. func (o *DatabaseList) GetItems() []DatabaseItem { if o == nil { @@ -60,6 +65,8 @@ func (o *DatabaseList) SetItems(v []DatabaseItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o DatabaseList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *DatabaseList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_database_option.go b/api/kbcloud/admin/model_database_option.go index da2decd2..f63b013f 100644 --- a/api/kbcloud/admin/model_database_option.go +++ b/api/kbcloud/admin/model_database_option.go @@ -2,21 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type DatabaseOption struct { Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatabaseOption instantiates a new DatabaseOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +40,6 @@ func NewDatabaseOptionWithDefaults() *DatabaseOption { this := DatabaseOption{} return &this } - // GetEnabled returns the Enabled field value. func (o *DatabaseOption) GetEnabled() bool { if o == nil { @@ -58,6 +63,8 @@ func (o *DatabaseOption) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o DatabaseOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +92,7 @@ func (o *DatabaseOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_datasource.go b/api/kbcloud/admin/model_datasource.go index fb16a4cb..61bd02e8 100644 --- a/api/kbcloud/admin/model_datasource.go +++ b/api/kbcloud/admin/model_datasource.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type Datasource struct { // the id of datasource Id *string `json:"id,omitempty"` // the name of datasource Name *string `json:"name,omitempty"` // the database type - Type string `json:"type"` + Type string `json:"type"` Options map[string]interface{} `json:"options,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatasource instantiates a new Datasource object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewDatasourceWithDefaults() *Datasource { this := Datasource{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Datasource) GetId() string { if o == nil || o.Id == nil { @@ -69,6 +74,7 @@ func (o *Datasource) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Datasource) GetName() string { if o == nil || o.Name == nil { @@ -97,6 +103,7 @@ func (o *Datasource) SetName(v string) { o.Name = &v } + // GetType returns the Type field value. func (o *Datasource) GetType() string { if o == nil { @@ -120,6 +127,7 @@ func (o *Datasource) SetType(v string) { o.Type = v } + // GetOptions returns the Options field value if set, zero value otherwise. func (o *Datasource) GetOptions() map[string]interface{} { if o == nil || o.Options == nil { @@ -148,6 +156,8 @@ func (o *Datasource) SetOptions(v map[string]interface{}) { o.Options = v } + + // MarshalJSON serializes the struct using spec logic. func (o Datasource) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -174,9 +184,9 @@ func (o Datasource) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Datasource) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type"` Options map[string]interface{} `json:"options,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -187,7 +197,7 @@ func (o *Datasource) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "type", "options"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "type", "options", }) } else { return err } diff --git a/api/kbcloud/admin/model_dms_import_form_data.go b/api/kbcloud/admin/model_dms_import_form_data.go index c05cdeac..9553441a 100644 --- a/api/kbcloud/admin/model_dms_import_form_data.go +++ b/api/kbcloud/admin/model_dms_import_form_data.go @@ -2,24 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - _io "io" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// DmsImportFormData the data of the import task + + +// DmsImportFormData the data of the import task type DmsImportFormData struct { // the data file, csv or other format File _io.Reader `json:"file"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDmsImportFormData instantiates a new DmsImportFormData object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +42,6 @@ func NewDmsImportFormDataWithDefaults() *DmsImportFormData { this := DmsImportFormData{} return &this } - // GetFile returns the File field value. func (o *DmsImportFormData) GetFile() _io.Reader { if o == nil { @@ -61,6 +65,8 @@ func (o *DmsImportFormData) SetFile(v _io.Reader) { o.File = v } + + // MarshalJSON serializes the struct using spec logic. func (o DmsImportFormData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -88,7 +94,7 @@ func (o *DmsImportFormData) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"file"}) + common.DeleteKeys(additionalProperties, &[]string{ "file", }) } else { return err } diff --git a/api/kbcloud/admin/model_dms_option.go b/api/kbcloud/admin/model_dms_option.go index 849b245f..06930214 100644 --- a/api/kbcloud/admin/model_dms_option.go +++ b/api/kbcloud/admin/model_dms_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type DmsOption struct { - Enabled bool `json:"enabled"` - Protocol string `json:"protocol"` - Feature map[string]interface{} `json:"feature,omitempty"` - TableMetadata []interface{} `json:"tableMetadata,omitempty"` + Enabled bool `json:"enabled"` + Protocol string `json:"protocol"` + Feature map[string]interface{} `json:"feature,omitempty"` + TableMetadata []interface{} `json:"tableMetadata,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDmsOption instantiates a new DmsOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewDmsOptionWithDefaults() *DmsOption { this := DmsOption{} return &this } - // GetEnabled returns the Enabled field value. func (o *DmsOption) GetEnabled() bool { if o == nil { @@ -62,6 +67,7 @@ func (o *DmsOption) SetEnabled(v bool) { o.Enabled = v } + // GetProtocol returns the Protocol field value. func (o *DmsOption) GetProtocol() string { if o == nil { @@ -85,6 +91,7 @@ func (o *DmsOption) SetProtocol(v string) { o.Protocol = v } + // GetFeature returns the Feature field value if set, zero value otherwise. func (o *DmsOption) GetFeature() map[string]interface{} { if o == nil || o.Feature == nil { @@ -113,6 +120,7 @@ func (o *DmsOption) SetFeature(v map[string]interface{}) { o.Feature = v } + // GetTableMetadata returns the TableMetadata field value if set, zero value otherwise. func (o *DmsOption) GetTableMetadata() []interface{} { if o == nil || o.TableMetadata == nil { @@ -141,6 +149,8 @@ func (o *DmsOption) SetTableMetadata(v []interface{}) { o.TableMetadata = v } + + // MarshalJSON serializes the struct using spec logic. func (o DmsOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -165,10 +175,10 @@ func (o DmsOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DmsOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Enabled *bool `json:"enabled"` - Protocol *string `json:"protocol"` - Feature map[string]interface{} `json:"feature,omitempty"` - TableMetadata []interface{} `json:"tableMetadata,omitempty"` + Enabled *bool `json:"enabled"` + Protocol *string `json:"protocol"` + Feature map[string]interface{} `json:"feature,omitempty"` + TableMetadata []interface{} `json:"tableMetadata,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -181,7 +191,7 @@ func (o *DmsOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled", "protocol", "feature", "tableMetadata"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", "protocol", "feature", "tableMetadata", }) } else { return err } diff --git a/api/kbcloud/admin/model_dms_task_info.go b/api/kbcloud/admin/model_dms_task_info.go index f1e2fcd3..2e6f4ae2 100644 --- a/api/kbcloud/admin/model_dms_task_info.go +++ b/api/kbcloud/admin/model_dms_task_info.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type DmsTaskInfo struct { // task id Id *string `json:"id,omitempty"` @@ -20,14 +25,15 @@ type DmsTaskInfo struct { // task status Status *string `json:"status,omitempty"` // task type - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDmsTaskInfo instantiates a new DmsTaskInfo object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewDmsTaskInfoWithDefaults() *DmsTaskInfo { this := DmsTaskInfo{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *DmsTaskInfo) GetId() string { if o == nil || o.Id == nil { @@ -73,6 +78,7 @@ func (o *DmsTaskInfo) SetId(v string) { o.Id = &v } + // GetDatasource returns the Datasource field value if set, zero value otherwise. func (o *DmsTaskInfo) GetDatasource() string { if o == nil || o.Datasource == nil { @@ -101,6 +107,7 @@ func (o *DmsTaskInfo) SetDatasource(v string) { o.Datasource = &v } + // GetMessage returns the Message field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DmsTaskInfo) GetMessage() string { if o == nil || o.Message.Get() == nil { @@ -114,7 +121,7 @@ func (o *DmsTaskInfo) GetMessage() string { // 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 *DmsTaskInfo) GetMessageOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Message.Get(), o.Message.IsSet() @@ -129,7 +136,6 @@ func (o *DmsTaskInfo) HasMessage() bool { func (o *DmsTaskInfo) SetMessage(v string) { o.Message.Set(&v) } - // SetMessageNil sets the value for Message to be an explicit nil. func (o *DmsTaskInfo) SetMessageNil() { o.Message.Set(nil) @@ -140,6 +146,7 @@ func (o *DmsTaskInfo) UnsetMessage() { o.Message.Unset() } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *DmsTaskInfo) GetStatus() string { if o == nil || o.Status == nil { @@ -168,6 +175,7 @@ func (o *DmsTaskInfo) SetStatus(v string) { o.Status = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *DmsTaskInfo) GetType() string { if o == nil || o.Type == nil { @@ -196,6 +204,7 @@ func (o *DmsTaskInfo) SetType(v string) { o.Type = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *DmsTaskInfo) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -224,6 +233,7 @@ func (o *DmsTaskInfo) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *DmsTaskInfo) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -252,6 +262,8 @@ func (o *DmsTaskInfo) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o DmsTaskInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -297,20 +309,20 @@ func (o DmsTaskInfo) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DmsTaskInfo) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Datasource *string `json:"datasource,omitempty"` - Message common.NullableString `json:"message,omitempty"` - Status *string `json:"status,omitempty"` - Type *string `json:"type,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *string `json:"id,omitempty"` + Datasource *string `json:"datasource,omitempty"` + Message common.NullableString `json:"message,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "datasource", "message", "status", "type", "updatedAt", "createdAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "datasource", "message", "status", "type", "updatedAt", "createdAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_dms_task_list.go b/api/kbcloud/admin/model_dms_task_list.go index ec906054..2dcc5665 100644 --- a/api/kbcloud/admin/model_dms_task_list.go +++ b/api/kbcloud/admin/model_dms_task_list.go @@ -2,17 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type DmsTaskList struct { Tasks []DmsTaskInfo `json:"tasks,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDmsTaskList instantiates a new DmsTaskList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -29,7 +39,6 @@ func NewDmsTaskListWithDefaults() *DmsTaskList { this := DmsTaskList{} return &this } - // GetTasks returns the Tasks field value if set, zero value otherwise. func (o *DmsTaskList) GetTasks() []DmsTaskInfo { if o == nil || o.Tasks == nil { @@ -58,6 +67,8 @@ func (o *DmsTaskList) SetTasks(v []DmsTaskInfo) { o.Tasks = v } + + // MarshalJSON serializes the struct using spec logic. func (o DmsTaskList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -84,7 +95,7 @@ func (o *DmsTaskList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"tasks"}) + common.DeleteKeys(additionalProperties, &[]string{ "tasks", }) } else { return err } diff --git a/api/kbcloud/admin/model_endpoint.go b/api/kbcloud/admin/model_endpoint.go index cb1a7f95..52f94871 100644 --- a/api/kbcloud/admin/model_endpoint.go +++ b/api/kbcloud/admin/model_endpoint.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Endpoint Endpoint is the information of cluster endpoints + + +// Endpoint Endpoint is the information of cluster endpoints type Endpoint struct { // title of the endpoint Title string `json:"title"` @@ -33,10 +38,11 @@ type Endpoint struct { // Whether the endpoint is mutable Mutable bool `json:"mutable"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEndpoint instantiates a new Endpoint object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -62,7 +68,6 @@ func NewEndpointWithDefaults() *Endpoint { this := Endpoint{} return &this } - // GetTitle returns the Title field value. func (o *Endpoint) GetTitle() string { if o == nil { @@ -86,6 +91,7 @@ func (o *Endpoint) SetTitle(v string) { o.Title = v } + // GetComponent returns the Component field value. func (o *Endpoint) GetComponent() string { if o == nil { @@ -109,6 +115,7 @@ func (o *Endpoint) SetComponent(v string) { o.Component = v } + // GetHosts returns the Hosts field value. func (o *Endpoint) GetHosts() []string { if o == nil { @@ -132,6 +139,7 @@ func (o *Endpoint) SetHosts(v []string) { o.Hosts = v } + // GetPort returns the Port field value. func (o *Endpoint) GetPort() int32 { if o == nil { @@ -155,6 +163,7 @@ func (o *Endpoint) SetPort(v int32) { o.Port = v } + // GetType returns the Type field value. func (o *Endpoint) GetType() EndpointType { if o == nil { @@ -178,6 +187,7 @@ func (o *Endpoint) SetType(v EndpointType) { o.Type = v } + // GetNetworkType returns the NetworkType field value. func (o *Endpoint) GetNetworkType() EndpointNetworkType { if o == nil { @@ -201,6 +211,7 @@ func (o *Endpoint) SetNetworkType(v EndpointNetworkType) { o.NetworkType = v } + // GetServiceName returns the ServiceName field value. func (o *Endpoint) GetServiceName() string { if o == nil { @@ -224,6 +235,7 @@ func (o *Endpoint) SetServiceName(v string) { o.ServiceName = v } + // GetPortName returns the PortName field value. func (o *Endpoint) GetPortName() string { if o == nil { @@ -247,6 +259,7 @@ func (o *Endpoint) SetPortName(v string) { o.PortName = v } + // GetInstances returns the Instances field value if set, zero value otherwise. func (o *Endpoint) GetInstances() []string { if o == nil || o.Instances == nil { @@ -275,6 +288,7 @@ func (o *Endpoint) SetInstances(v []string) { o.Instances = v } + // GetMutable returns the Mutable field value. func (o *Endpoint) GetMutable() bool { if o == nil { @@ -298,6 +312,8 @@ func (o *Endpoint) SetMutable(v bool) { o.Mutable = v } + + // MarshalJSON serializes the struct using spec logic. func (o Endpoint) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -326,16 +342,16 @@ func (o Endpoint) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Endpoint) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Title *string `json:"title"` - Component *string `json:"component"` - Hosts *[]string `json:"hosts"` - Port *int32 `json:"port"` - Type *EndpointType `json:"type"` + Title *string `json:"title"` + Component *string `json:"component"` + Hosts *[]string `json:"hosts"` + Port *int32 `json:"port"` + Type *EndpointType `json:"type"` NetworkType *EndpointNetworkType `json:"networkType"` - ServiceName *string `json:"serviceName"` - PortName *string `json:"portName"` - Instances []string `json:"instances,omitempty"` - Mutable *bool `json:"mutable"` + ServiceName *string `json:"serviceName"` + PortName *string `json:"portName"` + Instances []string `json:"instances,omitempty"` + Mutable *bool `json:"mutable"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -369,7 +385,7 @@ func (o *Endpoint) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"title", "component", "hosts", "port", "type", "networkType", "serviceName", "portName", "instances", "mutable"}) + common.DeleteKeys(additionalProperties, &[]string{ "title", "component", "hosts", "port", "type", "networkType", "serviceName", "portName", "instances", "mutable", }) } else { return err } diff --git a/api/kbcloud/admin/model_endpoint_list.go b/api/kbcloud/admin/model_endpoint_list.go index 0cab56bd..2c76248f 100644 --- a/api/kbcloud/admin/model_endpoint_list.go +++ b/api/kbcloud/admin/model_endpoint_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EndpointList struct { // Items is the list of endpoint objects in the list Items []Endpoint `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEndpointList instantiates a new EndpointList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewEndpointListWithDefaults() *EndpointList { this := EndpointList{} return &this } - // GetItems returns the Items field value. func (o *EndpointList) GetItems() []Endpoint { if o == nil { @@ -59,6 +64,8 @@ func (o *EndpointList) SetItems(v []Endpoint) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EndpointList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *EndpointList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_endpoint_network_type.go b/api/kbcloud/admin/model_endpoint_network_type.go index 6af08d96..77b69aeb 100644 --- a/api/kbcloud/admin/model_endpoint_network_type.go +++ b/api/kbcloud/admin/model_endpoint_network_type.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EndpointNetworkType Network type of endpoint type EndpointNetworkType string diff --git a/api/kbcloud/admin/model_endpoint_option.go b/api/kbcloud/admin/model_endpoint_option.go index 5019a45f..ef36761e 100644 --- a/api/kbcloud/admin/model_endpoint_option.go +++ b/api/kbcloud/admin/model_endpoint_option.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EndpointOption struct { - Title LocalizedDescription `json:"title"` - Component string `json:"component"` - PortName string `json:"portName"` - Type []string `json:"type"` - Port int32 `json:"port"` + Title LocalizedDescription `json:"title"` + Component string `json:"component"` + PortName string `json:"portName"` + Type []string `json:"type"` + Port int32 `json:"port"` // whether the endpoint supports system use, such as health check, dms, databases & accounts management etc. SupportsSystemUse *bool `json:"supportsSystemUse,omitempty"` // service name pattern, e.g. ClusterName-ComponentName or .ClusterName` @@ -27,10 +32,11 @@ type EndpointOption struct { // selector of k8s service Selector map[string]string `json:"selector,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEndpointOption instantiates a new EndpointOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +62,6 @@ func NewEndpointOptionWithDefaults() *EndpointOption { this.ServicePattern = &servicePattern return &this } - // GetTitle returns the Title field value. func (o *EndpointOption) GetTitle() LocalizedDescription { if o == nil { @@ -80,6 +85,7 @@ func (o *EndpointOption) SetTitle(v LocalizedDescription) { o.Title = v } + // GetComponent returns the Component field value. func (o *EndpointOption) GetComponent() string { if o == nil { @@ -103,6 +109,7 @@ func (o *EndpointOption) SetComponent(v string) { o.Component = v } + // GetPortName returns the PortName field value. func (o *EndpointOption) GetPortName() string { if o == nil { @@ -126,6 +133,7 @@ func (o *EndpointOption) SetPortName(v string) { o.PortName = v } + // GetType returns the Type field value. func (o *EndpointOption) GetType() []string { if o == nil { @@ -149,6 +157,7 @@ func (o *EndpointOption) SetType(v []string) { o.Type = v } + // GetPort returns the Port field value. func (o *EndpointOption) GetPort() int32 { if o == nil { @@ -172,6 +181,7 @@ func (o *EndpointOption) SetPort(v int32) { o.Port = v } + // GetSupportsSystemUse returns the SupportsSystemUse field value if set, zero value otherwise. func (o *EndpointOption) GetSupportsSystemUse() bool { if o == nil || o.SupportsSystemUse == nil { @@ -200,6 +210,7 @@ func (o *EndpointOption) SetSupportsSystemUse(v bool) { o.SupportsSystemUse = &v } + // GetServicePattern returns the ServicePattern field value if set, zero value otherwise. func (o *EndpointOption) GetServicePattern() EngineOptionsServicePattern { if o == nil || o.ServicePattern == nil { @@ -228,6 +239,7 @@ func (o *EndpointOption) SetServicePattern(v EngineOptionsServicePattern) { o.ServicePattern = &v } + // GetServiceNameRegex returns the ServiceNameRegex field value if set, zero value otherwise. func (o *EndpointOption) GetServiceNameRegex() string { if o == nil || o.ServiceNameRegex == nil { @@ -256,6 +268,7 @@ func (o *EndpointOption) SetServiceNameRegex(v string) { o.ServiceNameRegex = &v } + // GetServiceName returns the ServiceName field value if set, zero value otherwise. func (o *EndpointOption) GetServiceName() string { if o == nil || o.ServiceName == nil { @@ -284,6 +297,7 @@ func (o *EndpointOption) SetServiceName(v string) { o.ServiceName = &v } + // GetSelector returns the Selector field value if set, zero value otherwise. func (o *EndpointOption) GetSelector() map[string]string { if o == nil || o.Selector == nil { @@ -312,6 +326,8 @@ func (o *EndpointOption) SetSelector(v map[string]string) { o.Selector = v } + + // MarshalJSON serializes the struct using spec logic. func (o EndpointOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -348,16 +364,16 @@ func (o EndpointOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EndpointOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Title *LocalizedDescription `json:"title"` - Component *string `json:"component"` - PortName *string `json:"portName"` - Type *[]string `json:"type"` - Port *int32 `json:"port"` - SupportsSystemUse *bool `json:"supportsSystemUse,omitempty"` - ServicePattern *EngineOptionsServicePattern `json:"servicePattern,omitempty"` - ServiceNameRegex *string `json:"serviceNameRegex,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` - Selector map[string]string `json:"selector,omitempty"` + Title *LocalizedDescription `json:"title"` + Component *string `json:"component"` + PortName *string `json:"portName"` + Type *[]string `json:"type"` + Port *int32 `json:"port"` + SupportsSystemUse *bool `json:"supportsSystemUse,omitempty"` + ServicePattern *EngineOptionsServicePattern `json:"servicePattern,omitempty"` + ServiceNameRegex *string `json:"serviceNameRegex,omitempty"` + ServiceName *string `json:"serviceName,omitempty"` + Selector map[string]string `json:"selector,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -379,7 +395,7 @@ func (o *EndpointOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"title", "component", "portName", "type", "port", "supportsSystemUse", "servicePattern", "serviceNameRegex", "serviceName", "selector"}) + common.DeleteKeys(additionalProperties, &[]string{ "title", "component", "portName", "type", "port", "supportsSystemUse", "servicePattern", "serviceNameRegex", "serviceName", "selector", }) } else { return err } @@ -394,7 +410,7 @@ func (o *EndpointOption) UnmarshalJSON(bytes []byte) (err error) { o.Type = *all.Type o.Port = *all.Port o.SupportsSystemUse = all.SupportsSystemUse - if all.ServicePattern != nil && !all.ServicePattern.IsValid() { + if all.ServicePattern != nil &&!all.ServicePattern.IsValid() { hasInvalidField = true } else { o.ServicePattern = all.ServicePattern diff --git a/api/kbcloud/admin/model_endpoint_type.go b/api/kbcloud/admin/model_endpoint_type.go index 917611f6..e2243b3b 100644 --- a/api/kbcloud/admin/model_endpoint_type.go +++ b/api/kbcloud/admin/model_endpoint_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EndpointType Type of endpoint type EndpointType string // List of EndpointType. const ( - EndpointTypeClusterIp EndpointType = "ClusterIP" - EndpointTypeNodePort EndpointType = "NodePort" + EndpointTypeClusterIp EndpointType = "ClusterIP" + EndpointTypeNodePort EndpointType = "NodePort" EndpointTypeLoadBalancer EndpointType = "LoadBalancer" ) diff --git a/api/kbcloud/admin/model_engine.go b/api/kbcloud/admin/model_engine.go index 10ad0e6b..0fd6fd83 100644 --- a/api/kbcloud/admin/model_engine.go +++ b/api/kbcloud/admin/model_engine.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Engine struct { // engine ID Id *string `json:"id,omitempty"` @@ -34,10 +43,11 @@ type Engine struct { // clusterversion in the engines ClusterVersions []string `json:"clusterVersions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngine instantiates a new Engine object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -54,7 +64,6 @@ func NewEngineWithDefaults() *Engine { this := Engine{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Engine) GetId() string { if o == nil || o.Id == nil { @@ -83,6 +92,7 @@ func (o *Engine) SetId(v string) { o.Id = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Engine) GetDescription() string { if o == nil || o.Description == nil { @@ -111,6 +121,7 @@ func (o *Engine) SetDescription(v string) { o.Description = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Engine) GetName() string { if o == nil || o.Name == nil { @@ -139,6 +150,7 @@ func (o *Engine) SetName(v string) { o.Name = &v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *Engine) GetVersion() string { if o == nil || o.Version == nil { @@ -167,6 +179,7 @@ func (o *Engine) SetVersion(v string) { o.Version = &v } + // GetKbVersionConstraint returns the KbVersionConstraint field value if set, zero value otherwise. func (o *Engine) GetKbVersionConstraint() string { if o == nil || o.KbVersionConstraint == nil { @@ -195,6 +208,7 @@ func (o *Engine) SetKbVersionConstraint(v string) { o.KbVersionConstraint = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *Engine) GetType() EngineType { if o == nil || o.Type == nil { @@ -223,6 +237,7 @@ func (o *Engine) SetType(v EngineType) { o.Type = &v } + // GetInstalled returns the Installed field value if set, zero value otherwise. func (o *Engine) GetInstalled() bool { if o == nil || o.Installed == nil { @@ -251,6 +266,7 @@ func (o *Engine) SetInstalled(v bool) { o.Installed = &v } + // GetProvider returns the Provider field value if set, zero value otherwise. func (o *Engine) GetProvider() string { if o == nil || o.Provider == nil { @@ -279,6 +295,7 @@ func (o *Engine) SetProvider(v string) { o.Provider = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Engine) GetStatus() EngineStatus { if o == nil || o.Status == nil { @@ -307,6 +324,7 @@ func (o *Engine) SetStatus(v EngineStatus) { o.Status = &v } + // GetAvailableVersion returns the AvailableVersion field value if set, zero value otherwise. func (o *Engine) GetAvailableVersion() []string { if o == nil || o.AvailableVersion == nil { @@ -335,6 +353,7 @@ func (o *Engine) SetAvailableVersion(v []string) { o.AvailableVersion = v } + // GetUpgradeHistory returns the UpgradeHistory field value if set, zero value otherwise. func (o *Engine) GetUpgradeHistory() string { if o == nil || o.UpgradeHistory == nil { @@ -363,6 +382,7 @@ func (o *Engine) SetUpgradeHistory(v string) { o.UpgradeHistory = &v } + // GetErrMsg returns the ErrMsg field value if set, zero value otherwise. func (o *Engine) GetErrMsg() string { if o == nil || o.ErrMsg == nil { @@ -391,6 +411,7 @@ func (o *Engine) SetErrMsg(v string) { o.ErrMsg = &v } + // GetClusterVersions returns the ClusterVersions field value if set, zero value otherwise. func (o *Engine) GetClusterVersions() []string { if o == nil || o.ClusterVersions == nil { @@ -419,6 +440,8 @@ func (o *Engine) SetClusterVersions(v []string) { o.ClusterVersions = v } + + // MarshalJSON serializes the struct using spec logic. func (o Engine) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -474,26 +497,26 @@ func (o Engine) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Engine) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - Version *string `json:"version,omitempty"` - KbVersionConstraint *string `json:"kbVersionConstraint,omitempty"` - Type *EngineType `json:"type,omitempty"` - Installed *bool `json:"installed,omitempty"` - Provider *string `json:"provider,omitempty"` - Status *EngineStatus `json:"status,omitempty"` - AvailableVersion []string `json:"availableVersion,omitempty"` - UpgradeHistory *string `json:"upgradeHistory,omitempty"` - ErrMsg *string `json:"errMsg,omitempty"` - ClusterVersions []string `json:"clusterVersions,omitempty"` + Id *string `json:"id,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + KbVersionConstraint *string `json:"kbVersionConstraint,omitempty"` + Type *EngineType `json:"type,omitempty"` + Installed *bool `json:"installed,omitempty"` + Provider *string `json:"provider,omitempty"` + Status *EngineStatus `json:"status,omitempty"` + AvailableVersion []string `json:"availableVersion,omitempty"` + UpgradeHistory *string `json:"upgradeHistory,omitempty"` + ErrMsg *string `json:"errMsg,omitempty"` + ClusterVersions []string `json:"clusterVersions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "description", "name", "version", "kbVersionConstraint", "type", "installed", "provider", "status", "availableVersion", "upgradeHistory", "errMsg", "clusterVersions"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "description", "name", "version", "kbVersionConstraint", "type", "installed", "provider", "status", "availableVersion", "upgradeHistory", "errMsg", "clusterVersions", }) } else { return err } @@ -504,14 +527,14 @@ func (o *Engine) UnmarshalJSON(bytes []byte) (err error) { o.Name = all.Name o.Version = all.Version o.KbVersionConstraint = all.KbVersionConstraint - if all.Type != nil && !all.Type.IsValid() { + if all.Type != nil &&!all.Type.IsValid() { hasInvalidField = true } else { o.Type = all.Type } o.Installed = all.Installed o.Provider = all.Provider - if all.Status != nil && !all.Status.IsValid() { + if all.Status != nil &&!all.Status.IsValid() { hasInvalidField = true } else { o.Status = all.Status diff --git a/api/kbcloud/admin/model_engine_license.go b/api/kbcloud/admin/model_engine_license.go index 180b593d..2826f3ef 100644 --- a/api/kbcloud/admin/model_engine_license.go +++ b/api/kbcloud/admin/model_engine_license.go @@ -2,29 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineLicense struct { - EngineName string `json:"engineName"` - Name string `json:"name"` - Key *string `json:"key,omitempty"` - Description *string `json:"description,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Id *int32 `json:"id,omitempty"` - IdString *string `json:"idString,omitempty"` + EngineName string `json:"engineName"` + Name string `json:"name"` + Key *string `json:"key,omitempty"` + Description *string `json:"description,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *int32 `json:"id,omitempty"` + IdString *string `json:"idString,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineLicense instantiates a new EngineLicense object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +48,6 @@ func NewEngineLicenseWithDefaults() *EngineLicense { this := EngineLicense{} return &this } - // GetEngineName returns the EngineName field value. func (o *EngineLicense) GetEngineName() string { if o == nil { @@ -67,6 +71,7 @@ func (o *EngineLicense) SetEngineName(v string) { o.EngineName = v } + // GetName returns the Name field value. func (o *EngineLicense) GetName() string { if o == nil { @@ -90,6 +95,7 @@ func (o *EngineLicense) SetName(v string) { o.Name = v } + // GetKey returns the Key field value if set, zero value otherwise. func (o *EngineLicense) GetKey() string { if o == nil || o.Key == nil { @@ -118,6 +124,7 @@ func (o *EngineLicense) SetKey(v string) { o.Key = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *EngineLicense) GetDescription() string { if o == nil || o.Description == nil { @@ -146,6 +153,7 @@ func (o *EngineLicense) SetDescription(v string) { o.Description = &v } + // GetExpiredAt returns the ExpiredAt field value if set, zero value otherwise. func (o *EngineLicense) GetExpiredAt() time.Time { if o == nil || o.ExpiredAt == nil { @@ -174,6 +182,7 @@ func (o *EngineLicense) SetExpiredAt(v time.Time) { o.ExpiredAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *EngineLicense) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -202,6 +211,7 @@ func (o *EngineLicense) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *EngineLicense) GetId() int32 { if o == nil || o.Id == nil { @@ -230,6 +240,7 @@ func (o *EngineLicense) SetId(v int32) { o.Id = &v } + // GetIdString returns the IdString field value if set, zero value otherwise. func (o *EngineLicense) GetIdString() string { if o == nil || o.IdString == nil { @@ -258,6 +269,8 @@ func (o *EngineLicense) SetIdString(v string) { o.IdString = &v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineLicense) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -302,14 +315,14 @@ func (o EngineLicense) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineLicense) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EngineName *string `json:"engineName"` - Name *string `json:"name"` - Key *string `json:"key,omitempty"` - Description *string `json:"description,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Id *int32 `json:"id,omitempty"` - IdString *string `json:"idString,omitempty"` + EngineName *string `json:"engineName"` + Name *string `json:"name"` + Key *string `json:"key,omitempty"` + Description *string `json:"description,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *int32 `json:"id,omitempty"` + IdString *string `json:"idString,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -322,7 +335,7 @@ func (o *EngineLicense) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "name", "key", "description", "expiredAt", "createdAt", "id", "idString"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "name", "key", "description", "expiredAt", "createdAt", "id", "idString", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_license_form_data.go b/api/kbcloud/admin/model_engine_license_form_data.go index aa73f3a5..46e44c7c 100644 --- a/api/kbcloud/admin/model_engine_license_form_data.go +++ b/api/kbcloud/admin/model_engine_license_form_data.go @@ -2,24 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - _io "io" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EngineLicenseFormData the data of the engine license + + +// EngineLicenseFormData the data of the engine license type EngineLicenseFormData struct { // The license file to upload LicenseFile _io.Reader `json:"licenseFile"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineLicenseFormData instantiates a new EngineLicenseFormData object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +42,6 @@ func NewEngineLicenseFormDataWithDefaults() *EngineLicenseFormData { this := EngineLicenseFormData{} return &this } - // GetLicenseFile returns the LicenseFile field value. func (o *EngineLicenseFormData) GetLicenseFile() _io.Reader { if o == nil { @@ -61,6 +65,8 @@ func (o *EngineLicenseFormData) SetLicenseFile(v _io.Reader) { o.LicenseFile = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineLicenseFormData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -88,7 +94,7 @@ func (o *EngineLicenseFormData) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"licenseFile"}) + common.DeleteKeys(additionalProperties, &[]string{ "licenseFile", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_license_list.go b/api/kbcloud/admin/model_engine_license_list.go index b3fbde74..2c7f8a1c 100644 --- a/api/kbcloud/admin/model_engine_license_list.go +++ b/api/kbcloud/admin/model_engine_license_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineLicenseList struct { // Items is the list of engineLicense objects in the list Items []EngineLicense `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineLicenseList instantiates a new EngineLicenseList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewEngineLicenseListWithDefaults() *EngineLicenseList { this := EngineLicenseList{} return &this } - // GetItems returns the Items field value. func (o *EngineLicenseList) GetItems() []EngineLicense { if o == nil { @@ -59,6 +64,8 @@ func (o *EngineLicenseList) SetItems(v []EngineLicense) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineLicenseList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *EngineLicenseList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_option.go b/api/kbcloud/admin/model_engine_option.go index 057e4457..cc15eb77 100644 --- a/api/kbcloud/admin/model_engine_option.go +++ b/api/kbcloud/admin/model_engine_option.go @@ -2,45 +2,51 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOption struct { - EngineName string `json:"engineName"` - Title string `json:"title"` - Description LocalizedDescription `json:"description"` - Versions []string `json:"versions"` - Components []ComponentOption `json:"components"` - Modes []ModeOption `json:"modes"` - Account AccountOption `json:"account"` - Database *DatabaseOption `json:"database,omitempty"` - Dms DmsOption `json:"dms"` - Backup BackupOption `json:"backup"` - Bench BenchOption `json:"bench"` - Endpoints []EndpointOption `json:"endpoints"` - Promote []ComponentOpsOption `json:"promote"` - Stop []ComponentOpsOption `json:"stop"` - Start []ComponentOpsOption `json:"start"` - Restart []ComponentOpsOption `json:"restart"` - Hscale []ComponentOpsOption `json:"hscale"` - Vscale []ComponentOpsOption `json:"vscale"` - License *EngineOptionLicense `json:"license,omitempty"` + EngineName string `json:"engineName"` + Title string `json:"title"` + Description LocalizedDescription `json:"description"` + Versions []string `json:"versions"` + Components []ComponentOption `json:"components"` + Modes []ModeOption `json:"modes"` + Account AccountOption `json:"account"` + Database *DatabaseOption `json:"database,omitempty"` + Dms DmsOption `json:"dms"` + Backup BackupOption `json:"backup"` + Bench BenchOption `json:"bench"` + Endpoints []EndpointOption `json:"endpoints"` + Promote []ComponentOpsOption `json:"promote"` + Stop []ComponentOpsOption `json:"stop"` + Start []ComponentOpsOption `json:"start"` + Restart []ComponentOpsOption `json:"restart"` + Hscale []ComponentOpsOption `json:"hscale"` + Vscale []ComponentOpsOption `json:"vscale"` + License *EngineOptionLicense `json:"license,omitempty"` StorageExpansion []ComponentOpsOption `json:"storageExpansion"` - RebuildInstance []ComponentOpsOption `json:"rebuildInstance,omitempty"` - Metrics MetricsOption `json:"metrics"` - Dashboards []DashboardOption `json:"dashboards"` - Logs []LogOption `json:"logs"` - Parameters []ParameterOption `json:"parameters"` + RebuildInstance []ComponentOpsOption `json:"rebuildInstance,omitempty"` + Metrics MetricsOption `json:"metrics"` + Dashboards []DashboardOption `json:"dashboards"` + Logs []LogOption `json:"logs"` + Parameters []ParameterOption `json:"parameters"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineOption instantiates a new EngineOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -79,7 +85,6 @@ func NewEngineOptionWithDefaults() *EngineOption { this := EngineOption{} return &this } - // GetEngineName returns the EngineName field value. func (o *EngineOption) GetEngineName() string { if o == nil { @@ -103,6 +108,7 @@ func (o *EngineOption) SetEngineName(v string) { o.EngineName = v } + // GetTitle returns the Title field value. func (o *EngineOption) GetTitle() string { if o == nil { @@ -126,6 +132,7 @@ func (o *EngineOption) SetTitle(v string) { o.Title = v } + // GetDescription returns the Description field value. func (o *EngineOption) GetDescription() LocalizedDescription { if o == nil { @@ -149,6 +156,7 @@ func (o *EngineOption) SetDescription(v LocalizedDescription) { o.Description = v } + // GetVersions returns the Versions field value. func (o *EngineOption) GetVersions() []string { if o == nil { @@ -172,6 +180,7 @@ func (o *EngineOption) SetVersions(v []string) { o.Versions = v } + // GetComponents returns the Components field value. func (o *EngineOption) GetComponents() []ComponentOption { if o == nil { @@ -195,6 +204,7 @@ func (o *EngineOption) SetComponents(v []ComponentOption) { o.Components = v } + // GetModes returns the Modes field value. func (o *EngineOption) GetModes() []ModeOption { if o == nil { @@ -218,6 +228,7 @@ func (o *EngineOption) SetModes(v []ModeOption) { o.Modes = v } + // GetAccount returns the Account field value. func (o *EngineOption) GetAccount() AccountOption { if o == nil { @@ -241,6 +252,7 @@ func (o *EngineOption) SetAccount(v AccountOption) { o.Account = v } + // GetDatabase returns the Database field value if set, zero value otherwise. func (o *EngineOption) GetDatabase() DatabaseOption { if o == nil || o.Database == nil { @@ -269,6 +281,7 @@ func (o *EngineOption) SetDatabase(v DatabaseOption) { o.Database = &v } + // GetDms returns the Dms field value. func (o *EngineOption) GetDms() DmsOption { if o == nil { @@ -292,6 +305,7 @@ func (o *EngineOption) SetDms(v DmsOption) { o.Dms = v } + // GetBackup returns the Backup field value. func (o *EngineOption) GetBackup() BackupOption { if o == nil { @@ -315,6 +329,7 @@ func (o *EngineOption) SetBackup(v BackupOption) { o.Backup = v } + // GetBench returns the Bench field value. func (o *EngineOption) GetBench() BenchOption { if o == nil { @@ -338,6 +353,7 @@ func (o *EngineOption) SetBench(v BenchOption) { o.Bench = v } + // GetEndpoints returns the Endpoints field value. func (o *EngineOption) GetEndpoints() []EndpointOption { if o == nil { @@ -361,6 +377,7 @@ func (o *EngineOption) SetEndpoints(v []EndpointOption) { o.Endpoints = v } + // GetPromote returns the Promote field value. func (o *EngineOption) GetPromote() []ComponentOpsOption { if o == nil { @@ -384,6 +401,7 @@ func (o *EngineOption) SetPromote(v []ComponentOpsOption) { o.Promote = v } + // GetStop returns the Stop field value. func (o *EngineOption) GetStop() []ComponentOpsOption { if o == nil { @@ -407,6 +425,7 @@ func (o *EngineOption) SetStop(v []ComponentOpsOption) { o.Stop = v } + // GetStart returns the Start field value. func (o *EngineOption) GetStart() []ComponentOpsOption { if o == nil { @@ -430,6 +449,7 @@ func (o *EngineOption) SetStart(v []ComponentOpsOption) { o.Start = v } + // GetRestart returns the Restart field value. func (o *EngineOption) GetRestart() []ComponentOpsOption { if o == nil { @@ -453,6 +473,7 @@ func (o *EngineOption) SetRestart(v []ComponentOpsOption) { o.Restart = v } + // GetHscale returns the Hscale field value. func (o *EngineOption) GetHscale() []ComponentOpsOption { if o == nil { @@ -476,6 +497,7 @@ func (o *EngineOption) SetHscale(v []ComponentOpsOption) { o.Hscale = v } + // GetVscale returns the Vscale field value. func (o *EngineOption) GetVscale() []ComponentOpsOption { if o == nil { @@ -499,6 +521,7 @@ func (o *EngineOption) SetVscale(v []ComponentOpsOption) { o.Vscale = v } + // GetLicense returns the License field value if set, zero value otherwise. func (o *EngineOption) GetLicense() EngineOptionLicense { if o == nil || o.License == nil { @@ -527,6 +550,7 @@ func (o *EngineOption) SetLicense(v EngineOptionLicense) { o.License = &v } + // GetStorageExpansion returns the StorageExpansion field value. func (o *EngineOption) GetStorageExpansion() []ComponentOpsOption { if o == nil { @@ -550,6 +574,7 @@ func (o *EngineOption) SetStorageExpansion(v []ComponentOpsOption) { o.StorageExpansion = v } + // GetRebuildInstance returns the RebuildInstance field value if set, zero value otherwise. func (o *EngineOption) GetRebuildInstance() []ComponentOpsOption { if o == nil || o.RebuildInstance == nil { @@ -578,6 +603,7 @@ func (o *EngineOption) SetRebuildInstance(v []ComponentOpsOption) { o.RebuildInstance = v } + // GetMetrics returns the Metrics field value. func (o *EngineOption) GetMetrics() MetricsOption { if o == nil { @@ -601,6 +627,7 @@ func (o *EngineOption) SetMetrics(v MetricsOption) { o.Metrics = v } + // GetDashboards returns the Dashboards field value. func (o *EngineOption) GetDashboards() []DashboardOption { if o == nil { @@ -624,6 +651,7 @@ func (o *EngineOption) SetDashboards(v []DashboardOption) { o.Dashboards = v } + // GetLogs returns the Logs field value. func (o *EngineOption) GetLogs() []LogOption { if o == nil { @@ -647,6 +675,7 @@ func (o *EngineOption) SetLogs(v []LogOption) { o.Logs = v } + // GetParameters returns the Parameters field value. func (o *EngineOption) GetParameters() []ParameterOption { if o == nil { @@ -670,6 +699,8 @@ func (o *EngineOption) SetParameters(v []ParameterOption) { o.Parameters = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -717,31 +748,31 @@ func (o EngineOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EngineName *string `json:"engineName"` - Title *string `json:"title"` - Description *LocalizedDescription `json:"description"` - Versions *[]string `json:"versions"` - Components *[]ComponentOption `json:"components"` - Modes *[]ModeOption `json:"modes"` - Account *AccountOption `json:"account"` - Database *DatabaseOption `json:"database,omitempty"` - Dms *DmsOption `json:"dms"` - Backup *BackupOption `json:"backup"` - Bench *BenchOption `json:"bench"` - Endpoints *[]EndpointOption `json:"endpoints"` - Promote *[]ComponentOpsOption `json:"promote"` - Stop *[]ComponentOpsOption `json:"stop"` - Start *[]ComponentOpsOption `json:"start"` - Restart *[]ComponentOpsOption `json:"restart"` - Hscale *[]ComponentOpsOption `json:"hscale"` - Vscale *[]ComponentOpsOption `json:"vscale"` - License *EngineOptionLicense `json:"license,omitempty"` + EngineName *string `json:"engineName"` + Title *string `json:"title"` + Description *LocalizedDescription `json:"description"` + Versions *[]string `json:"versions"` + Components *[]ComponentOption `json:"components"` + Modes *[]ModeOption `json:"modes"` + Account *AccountOption `json:"account"` + Database *DatabaseOption `json:"database,omitempty"` + Dms *DmsOption `json:"dms"` + Backup *BackupOption `json:"backup"` + Bench *BenchOption `json:"bench"` + Endpoints *[]EndpointOption `json:"endpoints"` + Promote *[]ComponentOpsOption `json:"promote"` + Stop *[]ComponentOpsOption `json:"stop"` + Start *[]ComponentOpsOption `json:"start"` + Restart *[]ComponentOpsOption `json:"restart"` + Hscale *[]ComponentOpsOption `json:"hscale"` + Vscale *[]ComponentOpsOption `json:"vscale"` + License *EngineOptionLicense `json:"license,omitempty"` StorageExpansion *[]ComponentOpsOption `json:"storageExpansion"` - RebuildInstance []ComponentOpsOption `json:"rebuildInstance,omitempty"` - Metrics *MetricsOption `json:"metrics"` - Dashboards *[]DashboardOption `json:"dashboards"` - Logs *[]LogOption `json:"logs"` - Parameters *[]ParameterOption `json:"parameters"` + RebuildInstance []ComponentOpsOption `json:"rebuildInstance,omitempty"` + Metrics *MetricsOption `json:"metrics"` + Dashboards *[]DashboardOption `json:"dashboards"` + Logs *[]LogOption `json:"logs"` + Parameters *[]ParameterOption `json:"parameters"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -814,7 +845,7 @@ func (o *EngineOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "title", "description", "versions", "components", "modes", "account", "database", "dms", "backup", "bench", "endpoints", "promote", "stop", "start", "restart", "hscale", "vscale", "license", "storageExpansion", "rebuildInstance", "metrics", "dashboards", "logs", "parameters"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "title", "description", "versions", "components", "modes", "account", "database", "dms", "backup", "bench", "endpoints", "promote", "stop", "start", "restart", "hscale", "vscale", "license", "storageExpansion", "rebuildInstance", "metrics", "dashboards", "logs", "parameters", }) } else { return err } @@ -833,7 +864,7 @@ func (o *EngineOption) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField = true } o.Account = *all.Account - if all.Database != nil && all.Database.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Database != nil && all.Database.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Database = all.Database @@ -856,7 +887,7 @@ func (o *EngineOption) UnmarshalJSON(bytes []byte) (err error) { o.Restart = *all.Restart o.Hscale = *all.Hscale o.Vscale = *all.Vscale - if all.License != nil && all.License.UnparsedObject != nil && o.UnparsedObject == nil { + if all.License != nil && all.License.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.License = all.License diff --git a/api/kbcloud/admin/model_engine_option_history.go b/api/kbcloud/admin/model_engine_option_history.go index b903c759..70dbb3ad 100644 --- a/api/kbcloud/admin/model_engine_option_history.go +++ b/api/kbcloud/admin/model_engine_option_history.go @@ -2,25 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOptionHistory struct { - ModifierId string `json:"modifierId"` - ModifierEmail string `json:"modifierEmail"` - Option EngineOption `json:"option"` - CreatedAt time.Time `json:"createdAt"` + ModifierId string `json:"modifierId"` + ModifierEmail string `json:"modifierEmail"` + Option EngineOption `json:"option"` + CreatedAt time.Time `json:"createdAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineOptionHistory instantiates a new EngineOptionHistory object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +46,6 @@ func NewEngineOptionHistoryWithDefaults() *EngineOptionHistory { this := EngineOptionHistory{} return &this } - // GetModifierId returns the ModifierId field value. func (o *EngineOptionHistory) GetModifierId() string { if o == nil { @@ -65,6 +69,7 @@ func (o *EngineOptionHistory) SetModifierId(v string) { o.ModifierId = v } + // GetModifierEmail returns the ModifierEmail field value. func (o *EngineOptionHistory) GetModifierEmail() string { if o == nil { @@ -88,6 +93,7 @@ func (o *EngineOptionHistory) SetModifierEmail(v string) { o.ModifierEmail = v } + // GetOption returns the Option field value. func (o *EngineOptionHistory) GetOption() EngineOption { if o == nil { @@ -111,6 +117,7 @@ func (o *EngineOptionHistory) SetOption(v EngineOption) { o.Option = v } + // GetCreatedAt returns the CreatedAt field value. func (o *EngineOptionHistory) GetCreatedAt() time.Time { if o == nil { @@ -134,6 +141,8 @@ func (o *EngineOptionHistory) SetCreatedAt(v time.Time) { o.CreatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineOptionHistory) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +167,10 @@ func (o EngineOptionHistory) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineOptionHistory) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ModifierId *string `json:"modifierId"` - ModifierEmail *string `json:"modifierEmail"` - Option *EngineOption `json:"option"` - CreatedAt *time.Time `json:"createdAt"` + ModifierId *string `json:"modifierId"` + ModifierEmail *string `json:"modifierEmail"` + Option *EngineOption `json:"option"` + CreatedAt *time.Time `json:"createdAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +189,7 @@ func (o *EngineOptionHistory) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"modifierId", "modifierEmail", "option", "createdAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "modifierId", "modifierEmail", "option", "createdAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_option_history_list.go b/api/kbcloud/admin/model_engine_option_history_list.go index be74f0e5..e9c219a1 100644 --- a/api/kbcloud/admin/model_engine_option_history_list.go +++ b/api/kbcloud/admin/model_engine_option_history_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOptionHistoryList struct { // Items is the list of engineOptionHistory objects in the list Items []EngineOptionHistory `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineOptionHistoryList instantiates a new EngineOptionHistoryList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewEngineOptionHistoryListWithDefaults() *EngineOptionHistoryList { this := EngineOptionHistoryList{} return &this } - // GetItems returns the Items field value. func (o *EngineOptionHistoryList) GetItems() []EngineOptionHistory { if o == nil { @@ -59,6 +64,8 @@ func (o *EngineOptionHistoryList) SetItems(v []EngineOptionHistory) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineOptionHistoryList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *EngineOptionHistoryList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_option_license.go b/api/kbcloud/admin/model_engine_option_license.go index 44c2e6f7..b585de7e 100644 --- a/api/kbcloud/admin/model_engine_option_license.go +++ b/api/kbcloud/admin/model_engine_option_license.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOptionLicense struct { // Indicate whether the current cluster requires users to input the license Required *bool `json:"required,omitempty"` // support to refer the cluster name with variable ${clusterName} SecretName string `json:"secretName"` // the license file name - FileName string `json:"fileName"` + FileName string `json:"fileName"` Components []LicenseOption `json:"components,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineOptionLicense instantiates a new EngineOptionLicense object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewEngineOptionLicenseWithDefaults() *EngineOptionLicense { this := EngineOptionLicense{} return &this } - // GetRequired returns the Required field value if set, zero value otherwise. func (o *EngineOptionLicense) GetRequired() bool { if o == nil || o.Required == nil { @@ -70,6 +75,7 @@ func (o *EngineOptionLicense) SetRequired(v bool) { o.Required = &v } + // GetSecretName returns the SecretName field value. func (o *EngineOptionLicense) GetSecretName() string { if o == nil { @@ -93,6 +99,7 @@ func (o *EngineOptionLicense) SetSecretName(v string) { o.SecretName = v } + // GetFileName returns the FileName field value. func (o *EngineOptionLicense) GetFileName() string { if o == nil { @@ -116,6 +123,7 @@ func (o *EngineOptionLicense) SetFileName(v string) { o.FileName = v } + // GetComponents returns the Components field value if set, zero value otherwise. func (o *EngineOptionLicense) GetComponents() []LicenseOption { if o == nil || o.Components == nil { @@ -144,6 +152,8 @@ func (o *EngineOptionLicense) SetComponents(v []LicenseOption) { o.Components = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineOptionLicense) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -168,9 +178,9 @@ func (o EngineOptionLicense) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineOptionLicense) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Required *bool `json:"required,omitempty"` - SecretName *string `json:"secretName"` - FileName *string `json:"fileName"` + Required *bool `json:"required,omitempty"` + SecretName *string `json:"secretName"` + FileName *string `json:"fileName"` Components []LicenseOption `json:"components,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -184,7 +194,7 @@ func (o *EngineOptionLicense) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"required", "secretName", "fileName", "components"}) + common.DeleteKeys(additionalProperties, &[]string{ "required", "secretName", "fileName", "components", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_option_list.go b/api/kbcloud/admin/model_engine_option_list.go index 5860fdde..f4b9f303 100644 --- a/api/kbcloud/admin/model_engine_option_list.go +++ b/api/kbcloud/admin/model_engine_option_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOptionList struct { // Items is the list of engineOption objects in the list Items []EngineOption `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineOptionList instantiates a new EngineOptionList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewEngineOptionListWithDefaults() *EngineOptionList { this := EngineOptionList{} return &this } - // GetItems returns the Items field value. func (o *EngineOptionList) GetItems() []EngineOption { if o == nil { @@ -59,6 +64,8 @@ func (o *EngineOptionList) SetItems(v []EngineOption) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineOptionList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *EngineOptionList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_option_version.go b/api/kbcloud/admin/model_engine_option_version.go index 72aac0cc..2bb81401 100644 --- a/api/kbcloud/admin/model_engine_option_version.go +++ b/api/kbcloud/admin/model_engine_option_version.go @@ -2,19 +2,24 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOptionVersion string // List of EngineOptionVersion. const ( - EngineOptionVersionCurrent EngineOptionVersion = "current" + EngineOptionVersionCurrent EngineOptionVersion = "current" EngineOptionVersionOriginal EngineOptionVersion = "original" ) diff --git a/api/kbcloud/admin/model_engine_options_metrics_query_type.go b/api/kbcloud/admin/model_engine_options_metrics_query_type.go index 6d6a8c9e..43a74e9b 100644 --- a/api/kbcloud/admin/model_engine_options_metrics_query_type.go +++ b/api/kbcloud/admin/model_engine_options_metrics_query_type.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EngineOptionsMetricsQueryType Specifies the type of metrics query to be performed. // 'instant' for a single point in time, 'range' for a time range. +// type EngineOptionsMetricsQueryType string // List of EngineOptionsMetricsQueryType. const ( EngineOptionsMetricsQueryTypeInstant EngineOptionsMetricsQueryType = "instant" - EngineOptionsMetricsQueryTypeRange EngineOptionsMetricsQueryType = "range" + EngineOptionsMetricsQueryTypeRange EngineOptionsMetricsQueryType = "range" ) var allowedEngineOptionsMetricsQueryTypeEnumValues = []EngineOptionsMetricsQueryType{ diff --git a/api/kbcloud/admin/model_engine_options_service_pattern.go b/api/kbcloud/admin/model_engine_options_service_pattern.go index 3f95d7d1..0c6a11d4 100644 --- a/api/kbcloud/admin/model_engine_options_service_pattern.go +++ b/api/kbcloud/admin/model_engine_options_service_pattern.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EngineOptionsServicePattern service name pattern, e.g. ClusterName-ComponentName or .ClusterName` type EngineOptionsServicePattern string // List of EngineOptionsServicePattern. const ( - EngineOptionsServicePatternClusterComponent EngineOptionsServicePattern = "cluster-component" - EngineOptionsServicePatternCluster EngineOptionsServicePattern = "cluster" + EngineOptionsServicePatternClusterComponent EngineOptionsServicePattern = "cluster-component" + EngineOptionsServicePatternCluster EngineOptionsServicePattern = "cluster" EngineOptionsServicePatternClusterComponentService EngineOptionsServicePattern = "cluster-component-service" ) diff --git a/api/kbcloud/admin/model_engine_service_versions.go b/api/kbcloud/admin/model_engine_service_versions.go index c3f30568..ff6d3c91 100644 --- a/api/kbcloud/admin/model_engine_service_versions.go +++ b/api/kbcloud/admin/model_engine_service_versions.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type EngineServiceVersions struct { // component type, refer to componentDef and support NamePrefix - Component *string `json:"component,omitempty"` - UpgradeableVersions []string `json:"upgradeableVersions,omitempty"` - Versions []EngineServiceVersionsVersionsItem `json:"versions,omitempty"` + Component *string `json:"component,omitempty"` + UpgradeableVersions []string `json:"upgradeableVersions,omitempty"` + Versions []EngineServiceVersionsVersionsItem `json:"versions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineServiceVersions instantiates a new EngineServiceVersions object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewEngineServiceVersionsWithDefaults() *EngineServiceVersions { this := EngineServiceVersions{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *EngineServiceVersions) GetComponent() string { if o == nil || o.Component == nil { @@ -61,6 +70,7 @@ func (o *EngineServiceVersions) SetComponent(v string) { o.Component = &v } + // GetUpgradeableVersions returns the UpgradeableVersions field value if set, zero value otherwise. func (o *EngineServiceVersions) GetUpgradeableVersions() []string { if o == nil || o.UpgradeableVersions == nil { @@ -89,6 +99,7 @@ func (o *EngineServiceVersions) SetUpgradeableVersions(v []string) { o.UpgradeableVersions = v } + // GetVersions returns the Versions field value if set, zero value otherwise. func (o *EngineServiceVersions) GetVersions() []EngineServiceVersionsVersionsItem { if o == nil || o.Versions == nil { @@ -117,6 +128,8 @@ func (o *EngineServiceVersions) SetVersions(v []EngineServiceVersionsVersionsIte o.Versions = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineServiceVersions) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -142,16 +155,16 @@ func (o EngineServiceVersions) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineServiceVersions) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - UpgradeableVersions []string `json:"upgradeableVersions,omitempty"` - Versions []EngineServiceVersionsVersionsItem `json:"versions,omitempty"` + Component *string `json:"component,omitempty"` + UpgradeableVersions []string `json:"upgradeableVersions,omitempty"` + Versions []EngineServiceVersionsVersionsItem `json:"versions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "upgradeableVersions", "versions"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "upgradeableVersions", "versions", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_service_versions_versions_item.go b/api/kbcloud/admin/model_engine_service_versions_versions_item.go index 9f747669..a843706c 100644 --- a/api/kbcloud/admin/model_engine_service_versions_versions_item.go +++ b/api/kbcloud/admin/model_engine_service_versions_versions_item.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type EngineServiceVersionsVersionsItem struct { - MajorVersion *string `json:"majorVersion,omitempty"` + MajorVersion *string `json:"majorVersion,omitempty"` MinorVersions []string `json:"minorVersions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineServiceVersionsVersionsItem instantiates a new EngineServiceVersionsVersionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewEngineServiceVersionsVersionsItemWithDefaults() *EngineServiceVersionsVe this := EngineServiceVersionsVersionsItem{} return &this } - // GetMajorVersion returns the MajorVersion field value if set, zero value otherwise. func (o *EngineServiceVersionsVersionsItem) GetMajorVersion() string { if o == nil || o.MajorVersion == nil { @@ -59,6 +68,7 @@ func (o *EngineServiceVersionsVersionsItem) SetMajorVersion(v string) { o.MajorVersion = &v } + // GetMinorVersions returns the MinorVersions field value if set, zero value otherwise. func (o *EngineServiceVersionsVersionsItem) GetMinorVersions() []string { if o == nil || o.MinorVersions == nil { @@ -87,6 +97,8 @@ func (o *EngineServiceVersionsVersionsItem) SetMinorVersions(v []string) { o.MinorVersions = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineServiceVersionsVersionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,7 +121,7 @@ func (o EngineServiceVersionsVersionsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineServiceVersionsVersionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - MajorVersion *string `json:"majorVersion,omitempty"` + MajorVersion *string `json:"majorVersion,omitempty"` MinorVersions []string `json:"minorVersions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +129,7 @@ func (o *EngineServiceVersionsVersionsItem) UnmarshalJSON(bytes []byte) (err err } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"majorVersion", "minorVersions"}) + common.DeleteKeys(additionalProperties, &[]string{ "majorVersion", "minorVersions", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_status.go b/api/kbcloud/admin/model_engine_status.go index 90060a0d..10515100 100644 --- a/api/kbcloud/admin/model_engine_status.go +++ b/api/kbcloud/admin/model_engine_status.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EngineStatus engine addon status in K8s type EngineStatus string // List of EngineStatus. const ( - EngineStatusDisabled EngineStatus = "Disabled" - EngineStatusEnabled EngineStatus = "Enabled" - EngineStatusFailed EngineStatus = "Failed" - EngineStatusEnabling EngineStatus = "Enabling" + EngineStatusDisabled EngineStatus = "Disabled" + EngineStatusEnabled EngineStatus = "Enabled" + EngineStatusFailed EngineStatus = "Failed" + EngineStatusEnabling EngineStatus = "Enabling" EngineStatusDisabling EngineStatus = "Disabling" ) diff --git a/api/kbcloud/admin/model_engine_type.go b/api/kbcloud/admin/model_engine_type.go index ed5044f6..d18d9722 100644 --- a/api/kbcloud/admin/model_engine_type.go +++ b/api/kbcloud/admin/model_engine_type.go @@ -2,29 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EngineType engine type type EngineType string // List of EngineType. const ( - EngineTypeRdbms EngineType = "RDBMS" + EngineTypeRdbms EngineType = "RDBMS" EngineTypeSearchEngine EngineType = "search-engine" - EngineTypeKeyValue EngineType = "key-value" - EngineTypeTimeSeries EngineType = "time-series" - EngineTypeStreaming EngineType = "streaming" - EngineTypeLlm EngineType = "LLM" - EngineTypeVector EngineType = "vector" - EngineTypeDocument EngineType = "document" - EngineTypeGraph EngineType = "graph" - EngineTypeOther EngineType = "other" + EngineTypeKeyValue EngineType = "key-value" + EngineTypeTimeSeries EngineType = "time-series" + EngineTypeStreaming EngineType = "streaming" + EngineTypeLlm EngineType = "LLM" + EngineTypeVector EngineType = "vector" + EngineTypeDocument EngineType = "document" + EngineTypeGraph EngineType = "graph" + EngineTypeOther EngineType = "other" ) var allowedEngineTypeEnumValues = []EngineType{ diff --git a/api/kbcloud/admin/model_engine_version.go b/api/kbcloud/admin/model_engine_version.go index dd1e6f86..2944370d 100644 --- a/api/kbcloud/admin/model_engine_version.go +++ b/api/kbcloud/admin/model_engine_version.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EngineVersion EngineVersionRecord + + +// EngineVersion EngineVersionRecord type EngineVersion struct { // Primary Key for the EngineVersionRecord Id int32 `json:"id"` @@ -36,10 +40,11 @@ type EngineVersion struct { // Timestamp when the record was last updated UpdatedAt common.NullableTime `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineVersion instantiates a new EngineVersion object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -65,7 +70,6 @@ func NewEngineVersionWithDefaults() *EngineVersion { this.SetImageRegistry = *common.NewNullableBool(&setImageRegistry) return &this } - // GetId returns the Id field value. func (o *EngineVersion) GetId() int32 { if o == nil { @@ -89,6 +93,7 @@ func (o *EngineVersion) SetId(v int32) { o.Id = v } + // GetEngineName returns the EngineName field value. func (o *EngineVersion) GetEngineName() string { if o == nil { @@ -112,6 +117,7 @@ func (o *EngineVersion) SetEngineName(v string) { o.EngineName = v } + // GetVersion returns the Version field value. func (o *EngineVersion) GetVersion() string { if o == nil { @@ -135,6 +141,7 @@ func (o *EngineVersion) SetVersion(v string) { o.Version = v } + // GetKbVersionConstraint returns the KbVersionConstraint field value. func (o *EngineVersion) GetKbVersionConstraint() string { if o == nil { @@ -158,6 +165,7 @@ func (o *EngineVersion) SetKbVersionConstraint(v string) { o.KbVersionConstraint = v } + // GetClusterChartUrl returns the ClusterChartUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersion) GetClusterChartUrl() string { if o == nil || o.ClusterChartUrl.Get() == nil { @@ -171,7 +179,7 @@ func (o *EngineVersion) GetClusterChartUrl() string { // 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 *EngineVersion) GetClusterChartUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ClusterChartUrl.Get(), o.ClusterChartUrl.IsSet() @@ -186,7 +194,6 @@ func (o *EngineVersion) HasClusterChartUrl() bool { func (o *EngineVersion) SetClusterChartUrl(v string) { o.ClusterChartUrl.Set(&v) } - // SetClusterChartUrlNil sets the value for ClusterChartUrl to be an explicit nil. func (o *EngineVersion) SetClusterChartUrlNil() { o.ClusterChartUrl.Set(nil) @@ -197,6 +204,7 @@ func (o *EngineVersion) UnsetClusterChartUrl() { o.ClusterChartUrl.Unset() } + // GetChartUrl returns the ChartUrl field value. func (o *EngineVersion) GetChartUrl() string { if o == nil { @@ -220,6 +228,7 @@ func (o *EngineVersion) SetChartUrl(v string) { o.ChartUrl = v } + // GetSetValues returns the SetValues field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersion) GetSetValues() string { if o == nil || o.SetValues.Get() == nil { @@ -233,7 +242,7 @@ func (o *EngineVersion) GetSetValues() string { // 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 *EngineVersion) GetSetValuesOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.SetValues.Get(), o.SetValues.IsSet() @@ -248,7 +257,6 @@ func (o *EngineVersion) HasSetValues() bool { func (o *EngineVersion) SetSetValues(v string) { o.SetValues.Set(&v) } - // SetSetValuesNil sets the value for SetValues to be an explicit nil. func (o *EngineVersion) SetSetValuesNil() { o.SetValues.Set(nil) @@ -259,6 +267,7 @@ func (o *EngineVersion) UnsetSetValues() { o.SetValues.Unset() } + // GetChartsImage returns the ChartsImage field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersion) GetChartsImage() string { if o == nil || o.ChartsImage.Get() == nil { @@ -272,7 +281,7 @@ func (o *EngineVersion) GetChartsImage() string { // 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 *EngineVersion) GetChartsImageOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ChartsImage.Get(), o.ChartsImage.IsSet() @@ -287,7 +296,6 @@ func (o *EngineVersion) HasChartsImage() bool { func (o *EngineVersion) SetChartsImage(v string) { o.ChartsImage.Set(&v) } - // SetChartsImageNil sets the value for ChartsImage to be an explicit nil. func (o *EngineVersion) SetChartsImageNil() { o.ChartsImage.Set(nil) @@ -298,6 +306,7 @@ func (o *EngineVersion) UnsetChartsImage() { o.ChartsImage.Unset() } + // GetSetImageRegistry returns the SetImageRegistry field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersion) GetSetImageRegistry() bool { if o == nil || o.SetImageRegistry.Get() == nil { @@ -311,7 +320,7 @@ func (o *EngineVersion) GetSetImageRegistry() bool { // 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 *EngineVersion) GetSetImageRegistryOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return o.SetImageRegistry.Get(), o.SetImageRegistry.IsSet() @@ -326,7 +335,6 @@ func (o *EngineVersion) HasSetImageRegistry() bool { func (o *EngineVersion) SetSetImageRegistry(v bool) { o.SetImageRegistry.Set(&v) } - // SetSetImageRegistryNil sets the value for SetImageRegistry to be an explicit nil. func (o *EngineVersion) SetSetImageRegistryNil() { o.SetImageRegistry.Set(nil) @@ -337,6 +345,7 @@ func (o *EngineVersion) UnsetSetImageRegistry() { o.SetImageRegistry.Unset() } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersion) GetCreatedAt() time.Time { if o == nil || o.CreatedAt.Get() == nil { @@ -350,7 +359,7 @@ func (o *EngineVersion) GetCreatedAt() time.Time { // 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 *EngineVersion) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.CreatedAt.Get(), o.CreatedAt.IsSet() @@ -365,7 +374,6 @@ func (o *EngineVersion) HasCreatedAt() bool { func (o *EngineVersion) SetCreatedAt(v time.Time) { o.CreatedAt.Set(&v) } - // SetCreatedAtNil sets the value for CreatedAt to be an explicit nil. func (o *EngineVersion) SetCreatedAtNil() { o.CreatedAt.Set(nil) @@ -376,6 +384,7 @@ func (o *EngineVersion) UnsetCreatedAt() { o.CreatedAt.Unset() } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersion) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt.Get() == nil { @@ -389,7 +398,7 @@ func (o *EngineVersion) GetUpdatedAt() time.Time { // 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 *EngineVersion) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.UpdatedAt.Get(), o.UpdatedAt.IsSet() @@ -404,7 +413,6 @@ func (o *EngineVersion) HasUpdatedAt() bool { func (o *EngineVersion) SetUpdatedAt(v time.Time) { o.UpdatedAt.Set(&v) } - // SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil. func (o *EngineVersion) SetUpdatedAtNil() { o.UpdatedAt.Set(nil) @@ -415,6 +423,8 @@ func (o *EngineVersion) UnsetUpdatedAt() { o.UpdatedAt.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o EngineVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -454,17 +464,17 @@ func (o EngineVersion) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineVersion) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id"` - EngineName *string `json:"engineName"` - Version *string `json:"version"` - KbVersionConstraint *string `json:"kbVersionConstraint"` - ClusterChartUrl common.NullableString `json:"clusterChartUrl,omitempty"` - ChartUrl *string `json:"chartUrl"` - SetValues common.NullableString `json:"setValues,omitempty"` - ChartsImage common.NullableString `json:"chartsImage,omitempty"` - SetImageRegistry common.NullableBool `json:"setImageRegistry,omitempty"` - CreatedAt common.NullableTime `json:"createdAt,omitempty"` - UpdatedAt common.NullableTime `json:"updatedAt,omitempty"` + Id *int32 `json:"id"` + EngineName *string `json:"engineName"` + Version *string `json:"version"` + KbVersionConstraint *string `json:"kbVersionConstraint"` + ClusterChartUrl common.NullableString `json:"clusterChartUrl,omitempty"` + ChartUrl *string `json:"chartUrl"` + SetValues common.NullableString `json:"setValues,omitempty"` + ChartsImage common.NullableString `json:"chartsImage,omitempty"` + SetImageRegistry common.NullableBool `json:"setImageRegistry,omitempty"` + CreatedAt common.NullableTime `json:"createdAt,omitempty"` + UpdatedAt common.NullableTime `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -486,7 +496,7 @@ func (o *EngineVersion) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "engineName", "version", "kbVersionConstraint", "clusterChartUrl", "chartUrl", "setValues", "chartsImage", "setImageRegistry", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "engineName", "version", "kbVersionConstraint", "clusterChartUrl", "chartUrl", "setValues", "chartsImage", "setImageRegistry", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_version_create.go b/api/kbcloud/admin/model_engine_version_create.go index a820a2bd..49a99486 100644 --- a/api/kbcloud/admin/model_engine_version_create.go +++ b/api/kbcloud/admin/model_engine_version_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EngineVersionCreate EngineVersionRecord create option + + +// EngineVersionCreate EngineVersionRecord create option type EngineVersionCreate struct { // Name of the engine EngineName string `json:"engineName"` @@ -29,10 +34,11 @@ type EngineVersionCreate struct { // Determines if the image registry is set SetImageRegistry common.NullableBool `json:"setImageRegistry,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineVersionCreate instantiates a new EngineVersionCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -57,7 +63,6 @@ func NewEngineVersionCreateWithDefaults() *EngineVersionCreate { this.SetImageRegistry = *common.NewNullableBool(&setImageRegistry) return &this } - // GetEngineName returns the EngineName field value. func (o *EngineVersionCreate) GetEngineName() string { if o == nil { @@ -81,6 +86,7 @@ func (o *EngineVersionCreate) SetEngineName(v string) { o.EngineName = v } + // GetVersion returns the Version field value. func (o *EngineVersionCreate) GetVersion() string { if o == nil { @@ -104,6 +110,7 @@ func (o *EngineVersionCreate) SetVersion(v string) { o.Version = v } + // GetKbVersionConstraint returns the KbVersionConstraint field value. func (o *EngineVersionCreate) GetKbVersionConstraint() string { if o == nil { @@ -127,6 +134,7 @@ func (o *EngineVersionCreate) SetKbVersionConstraint(v string) { o.KbVersionConstraint = v } + // GetClusterChartUrl returns the ClusterChartUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionCreate) GetClusterChartUrl() string { if o == nil || o.ClusterChartUrl.Get() == nil { @@ -140,7 +148,7 @@ func (o *EngineVersionCreate) GetClusterChartUrl() string { // 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 *EngineVersionCreate) GetClusterChartUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ClusterChartUrl.Get(), o.ClusterChartUrl.IsSet() @@ -155,7 +163,6 @@ func (o *EngineVersionCreate) HasClusterChartUrl() bool { func (o *EngineVersionCreate) SetClusterChartUrl(v string) { o.ClusterChartUrl.Set(&v) } - // SetClusterChartUrlNil sets the value for ClusterChartUrl to be an explicit nil. func (o *EngineVersionCreate) SetClusterChartUrlNil() { o.ClusterChartUrl.Set(nil) @@ -166,6 +173,7 @@ func (o *EngineVersionCreate) UnsetClusterChartUrl() { o.ClusterChartUrl.Unset() } + // GetChartUrl returns the ChartUrl field value. func (o *EngineVersionCreate) GetChartUrl() string { if o == nil { @@ -189,6 +197,7 @@ func (o *EngineVersionCreate) SetChartUrl(v string) { o.ChartUrl = v } + // GetSetValues returns the SetValues field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionCreate) GetSetValues() string { if o == nil || o.SetValues.Get() == nil { @@ -202,7 +211,7 @@ func (o *EngineVersionCreate) GetSetValues() string { // 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 *EngineVersionCreate) GetSetValuesOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.SetValues.Get(), o.SetValues.IsSet() @@ -217,7 +226,6 @@ func (o *EngineVersionCreate) HasSetValues() bool { func (o *EngineVersionCreate) SetSetValues(v string) { o.SetValues.Set(&v) } - // SetSetValuesNil sets the value for SetValues to be an explicit nil. func (o *EngineVersionCreate) SetSetValuesNil() { o.SetValues.Set(nil) @@ -228,6 +236,7 @@ func (o *EngineVersionCreate) UnsetSetValues() { o.SetValues.Unset() } + // GetChartsImage returns the ChartsImage field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionCreate) GetChartsImage() string { if o == nil || o.ChartsImage.Get() == nil { @@ -241,7 +250,7 @@ func (o *EngineVersionCreate) GetChartsImage() string { // 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 *EngineVersionCreate) GetChartsImageOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ChartsImage.Get(), o.ChartsImage.IsSet() @@ -256,7 +265,6 @@ func (o *EngineVersionCreate) HasChartsImage() bool { func (o *EngineVersionCreate) SetChartsImage(v string) { o.ChartsImage.Set(&v) } - // SetChartsImageNil sets the value for ChartsImage to be an explicit nil. func (o *EngineVersionCreate) SetChartsImageNil() { o.ChartsImage.Set(nil) @@ -267,6 +275,7 @@ func (o *EngineVersionCreate) UnsetChartsImage() { o.ChartsImage.Unset() } + // GetSetImageRegistry returns the SetImageRegistry field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionCreate) GetSetImageRegistry() bool { if o == nil || o.SetImageRegistry.Get() == nil { @@ -280,7 +289,7 @@ func (o *EngineVersionCreate) GetSetImageRegistry() bool { // 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 *EngineVersionCreate) GetSetImageRegistryOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return o.SetImageRegistry.Get(), o.SetImageRegistry.IsSet() @@ -295,7 +304,6 @@ func (o *EngineVersionCreate) HasSetImageRegistry() bool { func (o *EngineVersionCreate) SetSetImageRegistry(v bool) { o.SetImageRegistry.Set(&v) } - // SetSetImageRegistryNil sets the value for SetImageRegistry to be an explicit nil. func (o *EngineVersionCreate) SetSetImageRegistryNil() { o.SetImageRegistry.Set(nil) @@ -306,6 +314,8 @@ func (o *EngineVersionCreate) UnsetSetImageRegistry() { o.SetImageRegistry.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o EngineVersionCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -338,14 +348,14 @@ func (o EngineVersionCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineVersionCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EngineName *string `json:"engineName"` - Version *string `json:"version"` - KbVersionConstraint *string `json:"kbVersionConstraint"` - ClusterChartUrl common.NullableString `json:"clusterChartUrl,omitempty"` - ChartUrl *string `json:"chartUrl"` - SetValues common.NullableString `json:"setValues,omitempty"` - ChartsImage common.NullableString `json:"chartsImage,omitempty"` - SetImageRegistry common.NullableBool `json:"setImageRegistry,omitempty"` + EngineName *string `json:"engineName"` + Version *string `json:"version"` + KbVersionConstraint *string `json:"kbVersionConstraint"` + ClusterChartUrl common.NullableString `json:"clusterChartUrl,omitempty"` + ChartUrl *string `json:"chartUrl"` + SetValues common.NullableString `json:"setValues,omitempty"` + ChartsImage common.NullableString `json:"chartsImage,omitempty"` + SetImageRegistry common.NullableBool `json:"setImageRegistry,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -364,7 +374,7 @@ func (o *EngineVersionCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "version", "kbVersionConstraint", "clusterChartUrl", "chartUrl", "setValues", "chartsImage", "setImageRegistry"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "version", "kbVersionConstraint", "clusterChartUrl", "chartUrl", "setValues", "chartsImage", "setImageRegistry", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_version_delete.go b/api/kbcloud/admin/model_engine_version_delete.go index 220f8356..8d8fbf84 100644 --- a/api/kbcloud/admin/model_engine_version_delete.go +++ b/api/kbcloud/admin/model_engine_version_delete.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EngineVersionDelete EngineVersionRecord delete option + + +// EngineVersionDelete EngineVersionRecord delete option type EngineVersionDelete struct { // Name of the engine EngineName string `json:"engineName"` // Version of the engine Version string `json:"version"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineVersionDelete instantiates a new EngineVersionDelete object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewEngineVersionDeleteWithDefaults() *EngineVersionDelete { this := EngineVersionDelete{} return &this } - // GetEngineName returns the EngineName field value. func (o *EngineVersionDelete) GetEngineName() string { if o == nil { @@ -63,6 +68,7 @@ func (o *EngineVersionDelete) SetEngineName(v string) { o.EngineName = v } + // GetVersion returns the Version field value. func (o *EngineVersionDelete) GetVersion() string { if o == nil { @@ -86,6 +92,8 @@ func (o *EngineVersionDelete) SetVersion(v string) { o.Version = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineVersionDelete) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -105,7 +113,7 @@ func (o EngineVersionDelete) MarshalJSON() ([]byte, error) { func (o *EngineVersionDelete) UnmarshalJSON(bytes []byte) (err error) { all := struct { EngineName *string `json:"engineName"` - Version *string `json:"version"` + Version *string `json:"version"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *EngineVersionDelete) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "version"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "version", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_version_list.go b/api/kbcloud/admin/model_engine_version_list.go index 8062c8fd..0675ffe8 100644 --- a/api/kbcloud/admin/model_engine_version_list.go +++ b/api/kbcloud/admin/model_engine_version_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EngineVersionList EngineVersionRecord list + + +// EngineVersionList EngineVersionRecord list type EngineVersionList struct { Items []EngineVersion `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineVersionList instantiates a new EngineVersionList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewEngineVersionListWithDefaults() *EngineVersionList { this := EngineVersionList{} return &this } - // GetItems returns the Items field value. func (o *EngineVersionList) GetItems() []EngineVersion { if o == nil { @@ -59,6 +64,8 @@ func (o *EngineVersionList) SetItems(v []EngineVersion) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineVersionList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *EngineVersionList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_engine_version_update.go b/api/kbcloud/admin/model_engine_version_update.go index 70c8ed8b..d788788c 100644 --- a/api/kbcloud/admin/model_engine_version_update.go +++ b/api/kbcloud/admin/model_engine_version_update.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EngineVersionUpdate EngineVersionRecord update option + + +// EngineVersionUpdate EngineVersionRecord update option type EngineVersionUpdate struct { // Name of the engine EngineName string `json:"engineName"` @@ -29,10 +34,11 @@ type EngineVersionUpdate struct { // Determines if the image registry is set SetImageRegistry common.NullableBool `json:"setImageRegistry,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineVersionUpdate instantiates a new EngineVersionUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +61,6 @@ func NewEngineVersionUpdateWithDefaults() *EngineVersionUpdate { this.SetImageRegistry = *common.NewNullableBool(&setImageRegistry) return &this } - // GetEngineName returns the EngineName field value. func (o *EngineVersionUpdate) GetEngineName() string { if o == nil { @@ -79,6 +84,7 @@ func (o *EngineVersionUpdate) SetEngineName(v string) { o.EngineName = v } + // GetVersion returns the Version field value. func (o *EngineVersionUpdate) GetVersion() string { if o == nil { @@ -102,6 +108,7 @@ func (o *EngineVersionUpdate) SetVersion(v string) { o.Version = v } + // GetKbVersionConstraint returns the KbVersionConstraint field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionUpdate) GetKbVersionConstraint() string { if o == nil || o.KbVersionConstraint.Get() == nil { @@ -115,7 +122,7 @@ func (o *EngineVersionUpdate) GetKbVersionConstraint() string { // 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 *EngineVersionUpdate) GetKbVersionConstraintOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.KbVersionConstraint.Get(), o.KbVersionConstraint.IsSet() @@ -130,7 +137,6 @@ func (o *EngineVersionUpdate) HasKbVersionConstraint() bool { func (o *EngineVersionUpdate) SetKbVersionConstraint(v string) { o.KbVersionConstraint.Set(&v) } - // SetKbVersionConstraintNil sets the value for KbVersionConstraint to be an explicit nil. func (o *EngineVersionUpdate) SetKbVersionConstraintNil() { o.KbVersionConstraint.Set(nil) @@ -141,6 +147,7 @@ func (o *EngineVersionUpdate) UnsetKbVersionConstraint() { o.KbVersionConstraint.Unset() } + // GetClusterChartUrl returns the ClusterChartUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionUpdate) GetClusterChartUrl() string { if o == nil || o.ClusterChartUrl.Get() == nil { @@ -154,7 +161,7 @@ func (o *EngineVersionUpdate) GetClusterChartUrl() string { // 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 *EngineVersionUpdate) GetClusterChartUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ClusterChartUrl.Get(), o.ClusterChartUrl.IsSet() @@ -169,7 +176,6 @@ func (o *EngineVersionUpdate) HasClusterChartUrl() bool { func (o *EngineVersionUpdate) SetClusterChartUrl(v string) { o.ClusterChartUrl.Set(&v) } - // SetClusterChartUrlNil sets the value for ClusterChartUrl to be an explicit nil. func (o *EngineVersionUpdate) SetClusterChartUrlNil() { o.ClusterChartUrl.Set(nil) @@ -180,6 +186,7 @@ func (o *EngineVersionUpdate) UnsetClusterChartUrl() { o.ClusterChartUrl.Unset() } + // GetChartUrl returns the ChartUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionUpdate) GetChartUrl() string { if o == nil || o.ChartUrl.Get() == nil { @@ -193,7 +200,7 @@ func (o *EngineVersionUpdate) GetChartUrl() string { // 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 *EngineVersionUpdate) GetChartUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ChartUrl.Get(), o.ChartUrl.IsSet() @@ -208,7 +215,6 @@ func (o *EngineVersionUpdate) HasChartUrl() bool { func (o *EngineVersionUpdate) SetChartUrl(v string) { o.ChartUrl.Set(&v) } - // SetChartUrlNil sets the value for ChartUrl to be an explicit nil. func (o *EngineVersionUpdate) SetChartUrlNil() { o.ChartUrl.Set(nil) @@ -219,6 +225,7 @@ func (o *EngineVersionUpdate) UnsetChartUrl() { o.ChartUrl.Unset() } + // GetSetValues returns the SetValues field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionUpdate) GetSetValues() string { if o == nil || o.SetValues.Get() == nil { @@ -232,7 +239,7 @@ func (o *EngineVersionUpdate) GetSetValues() string { // 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 *EngineVersionUpdate) GetSetValuesOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.SetValues.Get(), o.SetValues.IsSet() @@ -247,7 +254,6 @@ func (o *EngineVersionUpdate) HasSetValues() bool { func (o *EngineVersionUpdate) SetSetValues(v string) { o.SetValues.Set(&v) } - // SetSetValuesNil sets the value for SetValues to be an explicit nil. func (o *EngineVersionUpdate) SetSetValuesNil() { o.SetValues.Set(nil) @@ -258,6 +264,7 @@ func (o *EngineVersionUpdate) UnsetSetValues() { o.SetValues.Unset() } + // GetChartsImage returns the ChartsImage field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionUpdate) GetChartsImage() string { if o == nil || o.ChartsImage.Get() == nil { @@ -271,7 +278,7 @@ func (o *EngineVersionUpdate) GetChartsImage() string { // 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 *EngineVersionUpdate) GetChartsImageOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ChartsImage.Get(), o.ChartsImage.IsSet() @@ -286,7 +293,6 @@ func (o *EngineVersionUpdate) HasChartsImage() bool { func (o *EngineVersionUpdate) SetChartsImage(v string) { o.ChartsImage.Set(&v) } - // SetChartsImageNil sets the value for ChartsImage to be an explicit nil. func (o *EngineVersionUpdate) SetChartsImageNil() { o.ChartsImage.Set(nil) @@ -297,6 +303,7 @@ func (o *EngineVersionUpdate) UnsetChartsImage() { o.ChartsImage.Unset() } + // GetSetImageRegistry returns the SetImageRegistry field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EngineVersionUpdate) GetSetImageRegistry() bool { if o == nil || o.SetImageRegistry.Get() == nil { @@ -310,7 +317,7 @@ func (o *EngineVersionUpdate) GetSetImageRegistry() bool { // 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 *EngineVersionUpdate) GetSetImageRegistryOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return o.SetImageRegistry.Get(), o.SetImageRegistry.IsSet() @@ -325,7 +332,6 @@ func (o *EngineVersionUpdate) HasSetImageRegistry() bool { func (o *EngineVersionUpdate) SetSetImageRegistry(v bool) { o.SetImageRegistry.Set(&v) } - // SetSetImageRegistryNil sets the value for SetImageRegistry to be an explicit nil. func (o *EngineVersionUpdate) SetSetImageRegistryNil() { o.SetImageRegistry.Set(nil) @@ -336,6 +342,8 @@ func (o *EngineVersionUpdate) UnsetSetImageRegistry() { o.SetImageRegistry.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o EngineVersionUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -372,14 +380,14 @@ func (o EngineVersionUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineVersionUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EngineName *string `json:"engineName"` - Version *string `json:"version"` + EngineName *string `json:"engineName"` + Version *string `json:"version"` KbVersionConstraint common.NullableString `json:"kbVersionConstraint,omitempty"` - ClusterChartUrl common.NullableString `json:"clusterChartUrl,omitempty"` - ChartUrl common.NullableString `json:"chartUrl,omitempty"` - SetValues common.NullableString `json:"setValues,omitempty"` - ChartsImage common.NullableString `json:"chartsImage,omitempty"` - SetImageRegistry common.NullableBool `json:"setImageRegistry,omitempty"` + ClusterChartUrl common.NullableString `json:"clusterChartUrl,omitempty"` + ChartUrl common.NullableString `json:"chartUrl,omitempty"` + SetValues common.NullableString `json:"setValues,omitempty"` + ChartsImage common.NullableString `json:"chartsImage,omitempty"` + SetImageRegistry common.NullableBool `json:"setImageRegistry,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -392,7 +400,7 @@ func (o *EngineVersionUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "version", "kbVersionConstraint", "clusterChartUrl", "chartUrl", "setValues", "chartsImage", "setImageRegistry"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "version", "kbVersionConstraint", "clusterChartUrl", "chartUrl", "setValues", "chartsImage", "setImageRegistry", }) } else { return err } diff --git a/api/kbcloud/admin/model_environment.go b/api/kbcloud/admin/model_environment.go index 8a63919a..9151bd53 100644 --- a/api/kbcloud/admin/model_environment.go +++ b/api/kbcloud/admin/model_environment.go @@ -2,17 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" - "github.com/google/uuid" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Environment Environment info + + +// Environment Environment info type Environment struct { // Cloud Provider Provider string `json:"provider"` @@ -27,8 +30,8 @@ type Environment struct { // The description of the organization Description *string `json:"description,omitempty"` // The display name of the context - DisplayName string `json:"displayName"` - Id uuid.UUID `json:"id"` + DisplayName string `json:"displayName"` + Id uuid.UUID `json:"id"` // The full, unique name of this Object in the format contexts/{name}, set during creation. name must be a valid RFC 1123 compliant DNS label Name string `json:"name"` // Organizations that have access for this environment @@ -52,10 +55,11 @@ type Environment struct { // Environment delete policy to protect environment from false delete DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironment instantiates a new Environment object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -88,7 +92,6 @@ func NewEnvironmentWithDefaults() *Environment { this.DeletePolicy = &deletePolicy return &this } - // GetProvider returns the Provider field value. func (o *Environment) GetProvider() string { if o == nil { @@ -112,6 +115,7 @@ func (o *Environment) SetProvider(v string) { o.Provider = v } + // GetRegion returns the Region field value. func (o *Environment) GetRegion() string { if o == nil { @@ -135,6 +139,7 @@ func (o *Environment) SetRegion(v string) { o.Region = v } + // GetAvailabilityZones returns the AvailabilityZones field value. func (o *Environment) GetAvailabilityZones() []string { if o == nil { @@ -158,6 +163,7 @@ func (o *Environment) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetSchedulingConfig returns the SchedulingConfig field value if set, zero value otherwise. func (o *Environment) GetSchedulingConfig() SchedulingConfig { if o == nil || o.SchedulingConfig == nil { @@ -186,6 +192,7 @@ func (o *Environment) SetSchedulingConfig(v SchedulingConfig) { o.SchedulingConfig = &v } + // GetNetworkConfig returns the NetworkConfig field value if set, zero value otherwise. func (o *Environment) GetNetworkConfig() NetworkConfig { if o == nil || o.NetworkConfig == nil { @@ -214,6 +221,7 @@ func (o *Environment) SetNetworkConfig(v NetworkConfig) { o.NetworkConfig = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Environment) GetDescription() string { if o == nil || o.Description == nil { @@ -242,6 +250,7 @@ func (o *Environment) SetDescription(v string) { o.Description = &v } + // GetDisplayName returns the DisplayName field value. func (o *Environment) GetDisplayName() string { if o == nil { @@ -265,6 +274,7 @@ func (o *Environment) SetDisplayName(v string) { o.DisplayName = v } + // GetId returns the Id field value. func (o *Environment) GetId() uuid.UUID { if o == nil { @@ -288,6 +298,7 @@ func (o *Environment) SetId(v uuid.UUID) { o.Id = v } + // GetName returns the Name field value. func (o *Environment) GetName() string { if o == nil { @@ -311,6 +322,7 @@ func (o *Environment) SetName(v string) { o.Name = v } + // GetOrganizations returns the Organizations field value. func (o *Environment) GetOrganizations() []string { if o == nil { @@ -334,6 +346,7 @@ func (o *Environment) SetOrganizations(v []string) { o.Organizations = v } + // GetMetricsMonitorEnabled returns the MetricsMonitorEnabled field value if set, zero value otherwise. func (o *Environment) GetMetricsMonitorEnabled() bool { if o == nil || o.MetricsMonitorEnabled == nil { @@ -362,6 +375,7 @@ func (o *Environment) SetMetricsMonitorEnabled(v bool) { o.MetricsMonitorEnabled = &v } + // GetState returns the State field value. func (o *Environment) GetState() EnvironmentState { if o == nil { @@ -385,6 +399,7 @@ func (o *Environment) SetState(v EnvironmentState) { o.State = v } + // GetType returns the Type field value. func (o *Environment) GetType() EnvironmentType { if o == nil { @@ -408,6 +423,7 @@ func (o *Environment) SetType(v EnvironmentType) { o.Type = v } + // GetProvisionConfig returns the ProvisionConfig field value. func (o *Environment) GetProvisionConfig() ProvisionConfig { if o == nil { @@ -431,6 +447,7 @@ func (o *Environment) SetProvisionConfig(v ProvisionConfig) { o.ProvisionConfig = v } + // GetAutohealingConfig returns the AutohealingConfig field value if set, zero value otherwise. func (o *Environment) GetAutohealingConfig() AutohealingConfig { if o == nil || o.AutohealingConfig == nil { @@ -459,6 +476,7 @@ func (o *Environment) SetAutohealingConfig(v AutohealingConfig) { o.AutohealingConfig = &v } + // GetCreatedAt returns the CreatedAt field value. func (o *Environment) GetCreatedAt() time.Time { if o == nil { @@ -482,6 +500,7 @@ func (o *Environment) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Environment) GetUpdatedAt() time.Time { if o == nil { @@ -505,6 +524,7 @@ func (o *Environment) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetExtraInfo returns the ExtraInfo field value if set, zero value otherwise. func (o *Environment) GetExtraInfo() string { if o == nil || o.ExtraInfo == nil { @@ -533,6 +553,7 @@ func (o *Environment) SetExtraInfo(v string) { o.ExtraInfo = &v } + // GetDeletePolicy returns the DeletePolicy field value if set, zero value otherwise. func (o *Environment) GetDeletePolicy() EnvironmentDeletePolicy { if o == nil || o.DeletePolicy == nil { @@ -561,6 +582,8 @@ func (o *Environment) SetDeletePolicy(v EnvironmentDeletePolicy) { o.DeletePolicy = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Environment) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -618,25 +641,25 @@ func (o Environment) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Environment) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Provider *string `json:"provider"` - Region *string `json:"region"` - AvailabilityZones *[]string `json:"availabilityZones"` - SchedulingConfig *SchedulingConfig `json:"schedulingConfig,omitempty"` - NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName"` - Id *uuid.UUID `json:"id"` - Name *string `json:"name"` - Organizations *[]string `json:"organizations"` - MetricsMonitorEnabled *bool `json:"metricsMonitorEnabled,omitempty"` - State *EnvironmentState `json:"state"` - Type *EnvironmentType `json:"type"` - ProvisionConfig *ProvisionConfig `json:"provisionConfig"` - AutohealingConfig *AutohealingConfig `json:"autohealingConfig,omitempty"` - CreatedAt *time.Time `json:"createdAt"` - UpdatedAt *time.Time `json:"updatedAt"` - ExtraInfo *string `json:"extraInfo,omitempty"` - DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` + Provider *string `json:"provider"` + Region *string `json:"region"` + AvailabilityZones *[]string `json:"availabilityZones"` + SchedulingConfig *SchedulingConfig `json:"schedulingConfig,omitempty"` + NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName"` + Id *uuid.UUID `json:"id"` + Name *string `json:"name"` + Organizations *[]string `json:"organizations"` + MetricsMonitorEnabled *bool `json:"metricsMonitorEnabled,omitempty"` + State *EnvironmentState `json:"state"` + Type *EnvironmentType `json:"type"` + ProvisionConfig *ProvisionConfig `json:"provisionConfig"` + AutohealingConfig *AutohealingConfig `json:"autohealingConfig,omitempty"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` + ExtraInfo *string `json:"extraInfo,omitempty"` + DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -679,7 +702,7 @@ func (o *Environment) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"provider", "region", "availabilityZones", "schedulingConfig", "networkConfig", "description", "displayName", "id", "name", "organizations", "metricsMonitorEnabled", "state", "type", "provisionConfig", "autohealingConfig", "createdAt", "updatedAt", "extraInfo", "deletePolicy"}) + common.DeleteKeys(additionalProperties, &[]string{ "provider", "region", "availabilityZones", "schedulingConfig", "networkConfig", "description", "displayName", "id", "name", "organizations", "metricsMonitorEnabled", "state", "type", "provisionConfig", "autohealingConfig", "createdAt", "updatedAt", "extraInfo", "deletePolicy", }) } else { return err } @@ -688,11 +711,11 @@ func (o *Environment) UnmarshalJSON(bytes []byte) (err error) { o.Provider = *all.Provider o.Region = *all.Region o.AvailabilityZones = *all.AvailabilityZones - if all.SchedulingConfig != nil && all.SchedulingConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.SchedulingConfig != nil && all.SchedulingConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.SchedulingConfig = all.SchedulingConfig - if all.NetworkConfig != nil && all.NetworkConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.NetworkConfig != nil && all.NetworkConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.NetworkConfig = all.NetworkConfig @@ -716,14 +739,14 @@ func (o *Environment) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField = true } o.ProvisionConfig = *all.ProvisionConfig - if all.AutohealingConfig != nil && all.AutohealingConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.AutohealingConfig != nil && all.AutohealingConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.AutohealingConfig = all.AutohealingConfig o.CreatedAt = *all.CreatedAt o.UpdatedAt = *all.UpdatedAt o.ExtraInfo = all.ExtraInfo - if all.DeletePolicy != nil && !all.DeletePolicy.IsValid() { + if all.DeletePolicy != nil &&!all.DeletePolicy.IsValid() { hasInvalidField = true } else { o.DeletePolicy = all.DeletePolicy diff --git a/api/kbcloud/admin/model_environment_added.go b/api/kbcloud/admin/model_environment_added.go deleted file mode 100644 index f1aa15c7..00000000 --- a/api/kbcloud/admin/model_environment_added.go +++ /dev/null @@ -1,178 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package admin - -import "github.com/apecloud/kb-cloud-client-go/api/common" - -type EnvironmentAdded struct { - // whether the environment has ever been added - AddedBefore *bool `json:"addedBefore,omitempty"` - // whether the environment is still in use - StillInUse *bool `json:"stillInUse,omitempty"` - // Environment info - Environment *Environment `json:"environment,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewEnvironmentAdded instantiates a new EnvironmentAdded object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewEnvironmentAdded() *EnvironmentAdded { - this := EnvironmentAdded{} - return &this -} - -// NewEnvironmentAddedWithDefaults instantiates a new EnvironmentAdded object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewEnvironmentAddedWithDefaults() *EnvironmentAdded { - this := EnvironmentAdded{} - return &this -} - -// GetAddedBefore returns the AddedBefore field value if set, zero value otherwise. -func (o *EnvironmentAdded) GetAddedBefore() bool { - if o == nil || o.AddedBefore == nil { - var ret bool - return ret - } - return *o.AddedBefore -} - -// GetAddedBeforeOk returns a tuple with the AddedBefore field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvironmentAdded) GetAddedBeforeOk() (*bool, bool) { - if o == nil || o.AddedBefore == nil { - return nil, false - } - return o.AddedBefore, true -} - -// HasAddedBefore returns a boolean if a field has been set. -func (o *EnvironmentAdded) HasAddedBefore() bool { - return o != nil && o.AddedBefore != nil -} - -// SetAddedBefore gets a reference to the given bool and assigns it to the AddedBefore field. -func (o *EnvironmentAdded) SetAddedBefore(v bool) { - o.AddedBefore = &v -} - -// GetStillInUse returns the StillInUse field value if set, zero value otherwise. -func (o *EnvironmentAdded) GetStillInUse() bool { - if o == nil || o.StillInUse == nil { - var ret bool - return ret - } - return *o.StillInUse -} - -// GetStillInUseOk returns a tuple with the StillInUse field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvironmentAdded) GetStillInUseOk() (*bool, bool) { - if o == nil || o.StillInUse == nil { - return nil, false - } - return o.StillInUse, true -} - -// HasStillInUse returns a boolean if a field has been set. -func (o *EnvironmentAdded) HasStillInUse() bool { - return o != nil && o.StillInUse != nil -} - -// SetStillInUse gets a reference to the given bool and assigns it to the StillInUse field. -func (o *EnvironmentAdded) SetStillInUse(v bool) { - o.StillInUse = &v -} - -// GetEnvironment returns the Environment field value if set, zero value otherwise. -func (o *EnvironmentAdded) GetEnvironment() Environment { - if o == nil || o.Environment == nil { - var ret Environment - return ret - } - return *o.Environment -} - -// GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvironmentAdded) GetEnvironmentOk() (*Environment, bool) { - if o == nil || o.Environment == nil { - return nil, false - } - return o.Environment, true -} - -// HasEnvironment returns a boolean if a field has been set. -func (o *EnvironmentAdded) HasEnvironment() bool { - return o != nil && o.Environment != nil -} - -// SetEnvironment gets a reference to the given Environment and assigns it to the Environment field. -func (o *EnvironmentAdded) SetEnvironment(v Environment) { - o.Environment = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o EnvironmentAdded) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return common.Marshal(o.UnparsedObject) - } - if o.AddedBefore != nil { - toSerialize["addedBefore"] = o.AddedBefore - } - if o.StillInUse != nil { - toSerialize["stillInUse"] = o.StillInUse - } - if o.Environment != nil { - toSerialize["environment"] = o.Environment - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return common.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *EnvironmentAdded) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - AddedBefore *bool `json:"addedBefore,omitempty"` - StillInUse *bool `json:"stillInUse,omitempty"` - Environment *Environment `json:"environment,omitempty"` - }{} - if err = common.Unmarshal(bytes, &all); err != nil { - return common.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"addedBefore", "stillInUse", "environment"}) - } else { - return err - } - - hasInvalidField := false - o.AddedBefore = all.AddedBefore - o.StillInUse = all.StillInUse - if all.Environment != nil && all.Environment.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Environment = all.Environment - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return common.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/kbcloud/admin/model_environment_backup_repo.go b/api/kbcloud/admin/model_environment_backup_repo.go deleted file mode 100644 index 94c48022..00000000 --- a/api/kbcloud/admin/model_environment_backup_repo.go +++ /dev/null @@ -1,99 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package admin - -import "github.com/apecloud/kb-cloud-client-go/api/common" - -type EnvironmentBackupRepo struct { - // backup repo list - Items []RawBackupRepo `json:"items,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewEnvironmentBackupRepo instantiates a new EnvironmentBackupRepo object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewEnvironmentBackupRepo() *EnvironmentBackupRepo { - this := EnvironmentBackupRepo{} - return &this -} - -// NewEnvironmentBackupRepoWithDefaults instantiates a new EnvironmentBackupRepo object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewEnvironmentBackupRepoWithDefaults() *EnvironmentBackupRepo { - this := EnvironmentBackupRepo{} - return &this -} - -// GetItems returns the Items field value if set, zero value otherwise. -func (o *EnvironmentBackupRepo) GetItems() []RawBackupRepo { - if o == nil || o.Items == nil { - var ret []RawBackupRepo - return ret - } - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvironmentBackupRepo) GetItemsOk() (*[]RawBackupRepo, bool) { - if o == nil || o.Items == nil { - return nil, false - } - return &o.Items, true -} - -// HasItems returns a boolean if a field has been set. -func (o *EnvironmentBackupRepo) HasItems() bool { - return o != nil && o.Items != nil -} - -// SetItems gets a reference to the given []RawBackupRepo and assigns it to the Items field. -func (o *EnvironmentBackupRepo) SetItems(v []RawBackupRepo) { - o.Items = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o EnvironmentBackupRepo) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return common.Marshal(o.UnparsedObject) - } - if o.Items != nil { - toSerialize["items"] = o.Items - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return common.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *EnvironmentBackupRepo) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Items []RawBackupRepo `json:"items,omitempty"` - }{} - if err = common.Unmarshal(bytes, &all); err != nil { - return common.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) - } else { - return err - } - o.Items = all.Items - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/kbcloud/admin/model_environment_condition.go b/api/kbcloud/admin/model_environment_condition.go index 0307ffbe..6d5d0824 100644 --- a/api/kbcloud/admin/model_environment_condition.go +++ b/api/kbcloud/admin/model_environment_condition.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EnvironmentCondition EnvironmentCondition contains details for the current condition of this environment. + + +// EnvironmentCondition EnvironmentCondition contains details for the current condition of this environment. type EnvironmentCondition struct { // Human-readable message indicating details about last transition. Message *string `json:"message,omitempty"` @@ -21,10 +26,11 @@ type EnvironmentCondition struct { // Type is the type of the condition. Type string `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentCondition instantiates a new EnvironmentCondition object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +49,6 @@ func NewEnvironmentConditionWithDefaults() *EnvironmentCondition { this := EnvironmentCondition{} return &this } - // GetMessage returns the Message field value if set, zero value otherwise. func (o *EnvironmentCondition) GetMessage() string { if o == nil || o.Message == nil { @@ -72,6 +77,7 @@ func (o *EnvironmentCondition) SetMessage(v string) { o.Message = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *EnvironmentCondition) GetReason() string { if o == nil || o.Reason == nil { @@ -100,6 +106,7 @@ func (o *EnvironmentCondition) SetReason(v string) { o.Reason = &v } + // GetStatus returns the Status field value. func (o *EnvironmentCondition) GetStatus() EnvironmentConditionStatus { if o == nil { @@ -123,6 +130,7 @@ func (o *EnvironmentCondition) SetStatus(v EnvironmentConditionStatus) { o.Status = v } + // GetType returns the Type field value. func (o *EnvironmentCondition) GetType() string { if o == nil { @@ -146,6 +154,8 @@ func (o *EnvironmentCondition) SetType(v string) { o.Type = v } + + // MarshalJSON serializes the struct using spec logic. func (o EnvironmentCondition) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -170,10 +180,10 @@ func (o EnvironmentCondition) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EnvironmentCondition) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` - Status *EnvironmentConditionStatus `json:"status"` - Type *string `json:"type"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Status *EnvironmentConditionStatus `json:"status"` + Type *string `json:"type"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -186,7 +196,7 @@ func (o *EnvironmentCondition) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"message", "reason", "status", "type"}) + common.DeleteKeys(additionalProperties, &[]string{ "message", "reason", "status", "type", }) } else { return err } diff --git a/api/kbcloud/admin/model_environment_condition_status.go b/api/kbcloud/admin/model_environment_condition_status.go index c097ba21..10ee5ea4 100644 --- a/api/kbcloud/admin/model_environment_condition_status.go +++ b/api/kbcloud/admin/model_environment_condition_status.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EnvironmentConditionStatus Status is the status of the condition. Can be True, False, Unknown. type EnvironmentConditionStatus string // List of EnvironmentConditionStatus. const ( - EnvironmentConditionStatusTrue EnvironmentConditionStatus = "True" - EnvironmentConditionStatusFalse EnvironmentConditionStatus = "False" + EnvironmentConditionStatusTrue EnvironmentConditionStatus = "True" + EnvironmentConditionStatusFalse EnvironmentConditionStatus = "False" EnvironmentConditionStatusUnknown EnvironmentConditionStatus = "Unknown" ) diff --git a/api/kbcloud/admin/model_environment_create.go b/api/kbcloud/admin/model_environment_create.go index c7c3449f..e63db3e3 100644 --- a/api/kbcloud/admin/model_environment_create.go +++ b/api/kbcloud/admin/model_environment_create.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" - "github.com/google/uuid" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EnvironmentCreate Environment creation info + + +// EnvironmentCreate Environment creation info type EnvironmentCreate struct { // The full, unique name of this Object in the format environments/{name}, set during creation. name must be a valid RFC 1123 compliant DNS label Name string `json:"name"` @@ -32,19 +36,18 @@ type EnvironmentCreate struct { // The description of the organization Description *string `json:"description,omitempty"` // The display name of the environment - DisplayName string `json:"displayName"` - Id *uuid.UUID `json:"id,omitempty"` + DisplayName string `json:"displayName"` + Id *uuid.UUID `json:"id,omitempty"` // Extra info for environment ExtraInfo *string `json:"extraInfo,omitempty"` // Environment delete policy to protect environment from false delete DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` - // overwrite a environment if it has been added before - Overwrite *bool `json:"overwrite,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentCreate instantiates a new EnvironmentCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -60,8 +63,6 @@ func NewEnvironmentCreate(name string, typeVar EnvironmentType, provisionConfig this.DisplayName = displayName var deletePolicy EnvironmentDeletePolicy = EnvironmentDeletePolicyDoNotDelete this.DeletePolicy = &deletePolicy - var overwrite bool = false - this.Overwrite = &overwrite return &this } @@ -72,11 +73,8 @@ func NewEnvironmentCreateWithDefaults() *EnvironmentCreate { this := EnvironmentCreate{} var deletePolicy EnvironmentDeletePolicy = EnvironmentDeletePolicyDoNotDelete this.DeletePolicy = &deletePolicy - var overwrite bool = false - this.Overwrite = &overwrite return &this } - // GetName returns the Name field value. func (o *EnvironmentCreate) GetName() string { if o == nil { @@ -100,6 +98,7 @@ func (o *EnvironmentCreate) SetName(v string) { o.Name = v } + // GetType returns the Type field value. func (o *EnvironmentCreate) GetType() EnvironmentType { if o == nil { @@ -123,6 +122,7 @@ func (o *EnvironmentCreate) SetType(v EnvironmentType) { o.Type = v } + // GetSchedulingConfig returns the SchedulingConfig field value if set, zero value otherwise. func (o *EnvironmentCreate) GetSchedulingConfig() SchedulingConfig { if o == nil || o.SchedulingConfig == nil { @@ -151,6 +151,7 @@ func (o *EnvironmentCreate) SetSchedulingConfig(v SchedulingConfig) { o.SchedulingConfig = &v } + // GetProvisionConfig returns the ProvisionConfig field value. func (o *EnvironmentCreate) GetProvisionConfig() ProvisionConfig { if o == nil { @@ -174,6 +175,7 @@ func (o *EnvironmentCreate) SetProvisionConfig(v ProvisionConfig) { o.ProvisionConfig = v } + // GetOrganizations returns the Organizations field value. func (o *EnvironmentCreate) GetOrganizations() []string { if o == nil { @@ -197,6 +199,7 @@ func (o *EnvironmentCreate) SetOrganizations(v []string) { o.Organizations = v } + // GetProvider returns the Provider field value. func (o *EnvironmentCreate) GetProvider() string { if o == nil { @@ -220,6 +223,7 @@ func (o *EnvironmentCreate) SetProvider(v string) { o.Provider = v } + // GetRegion returns the Region field value. func (o *EnvironmentCreate) GetRegion() string { if o == nil { @@ -243,6 +247,7 @@ func (o *EnvironmentCreate) SetRegion(v string) { o.Region = v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *EnvironmentCreate) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -271,6 +276,7 @@ func (o *EnvironmentCreate) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *EnvironmentCreate) GetDescription() string { if o == nil || o.Description == nil { @@ -299,6 +305,7 @@ func (o *EnvironmentCreate) SetDescription(v string) { o.Description = &v } + // GetDisplayName returns the DisplayName field value. func (o *EnvironmentCreate) GetDisplayName() string { if o == nil { @@ -322,6 +329,7 @@ func (o *EnvironmentCreate) SetDisplayName(v string) { o.DisplayName = v } + // GetId returns the Id field value if set, zero value otherwise. func (o *EnvironmentCreate) GetId() uuid.UUID { if o == nil || o.Id == nil { @@ -350,6 +358,7 @@ func (o *EnvironmentCreate) SetId(v uuid.UUID) { o.Id = &v } + // GetExtraInfo returns the ExtraInfo field value if set, zero value otherwise. func (o *EnvironmentCreate) GetExtraInfo() string { if o == nil || o.ExtraInfo == nil { @@ -378,6 +387,7 @@ func (o *EnvironmentCreate) SetExtraInfo(v string) { o.ExtraInfo = &v } + // GetDeletePolicy returns the DeletePolicy field value if set, zero value otherwise. func (o *EnvironmentCreate) GetDeletePolicy() EnvironmentDeletePolicy { if o == nil || o.DeletePolicy == nil { @@ -406,33 +416,7 @@ func (o *EnvironmentCreate) SetDeletePolicy(v EnvironmentDeletePolicy) { o.DeletePolicy = &v } -// GetOverwrite returns the Overwrite field value if set, zero value otherwise. -func (o *EnvironmentCreate) GetOverwrite() bool { - if o == nil || o.Overwrite == nil { - var ret bool - return ret - } - return *o.Overwrite -} - -// GetOverwriteOk returns a tuple with the Overwrite field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvironmentCreate) GetOverwriteOk() (*bool, bool) { - if o == nil || o.Overwrite == nil { - return nil, false - } - return o.Overwrite, true -} -// HasOverwrite returns a boolean if a field has been set. -func (o *EnvironmentCreate) HasOverwrite() bool { - return o != nil && o.Overwrite != nil -} - -// SetOverwrite gets a reference to the given bool and assigns it to the Overwrite field. -func (o *EnvironmentCreate) SetOverwrite(v bool) { - o.Overwrite = &v -} // MarshalJSON serializes the struct using spec logic. func (o EnvironmentCreate) MarshalJSON() ([]byte, error) { @@ -465,9 +449,6 @@ func (o EnvironmentCreate) MarshalJSON() ([]byte, error) { if o.DeletePolicy != nil { toSerialize["deletePolicy"] = o.DeletePolicy } - if o.Overwrite != nil { - toSerialize["overwrite"] = o.Overwrite - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -478,20 +459,19 @@ func (o EnvironmentCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EnvironmentCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Type *EnvironmentType `json:"type"` - SchedulingConfig *SchedulingConfig `json:"schedulingConfig,omitempty"` - ProvisionConfig *ProvisionConfig `json:"provisionConfig"` - Organizations *[]string `json:"organizations"` - Provider *string `json:"provider"` - Region *string `json:"region"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName"` - Id *uuid.UUID `json:"id,omitempty"` - ExtraInfo *string `json:"extraInfo,omitempty"` - DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` - Overwrite *bool `json:"overwrite,omitempty"` + Name *string `json:"name"` + Type *EnvironmentType `json:"type"` + SchedulingConfig *SchedulingConfig `json:"schedulingConfig,omitempty"` + ProvisionConfig *ProvisionConfig `json:"provisionConfig"` + Organizations *[]string `json:"organizations"` + Provider *string `json:"provider"` + Region *string `json:"region"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName"` + Id *uuid.UUID `json:"id,omitempty"` + ExtraInfo *string `json:"extraInfo,omitempty"` + DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -519,7 +499,7 @@ func (o *EnvironmentCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "type", "schedulingConfig", "provisionConfig", "organizations", "provider", "region", "availabilityZones", "description", "displayName", "id", "extraInfo", "deletePolicy", "overwrite"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "type", "schedulingConfig", "provisionConfig", "organizations", "provider", "region", "availabilityZones", "description", "displayName", "id", "extraInfo", "deletePolicy", }) } else { return err } @@ -531,7 +511,7 @@ func (o *EnvironmentCreate) UnmarshalJSON(bytes []byte) (err error) { } else { o.Type = *all.Type } - if all.SchedulingConfig != nil && all.SchedulingConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.SchedulingConfig != nil && all.SchedulingConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.SchedulingConfig = all.SchedulingConfig @@ -547,12 +527,11 @@ func (o *EnvironmentCreate) UnmarshalJSON(bytes []byte) (err error) { o.DisplayName = *all.DisplayName o.Id = all.Id o.ExtraInfo = all.ExtraInfo - if all.DeletePolicy != nil && !all.DeletePolicy.IsValid() { + if all.DeletePolicy != nil &&!all.DeletePolicy.IsValid() { hasInvalidField = true } else { o.DeletePolicy = all.DeletePolicy } - o.Overwrite = all.Overwrite if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/kbcloud/admin/model_environment_delete.go b/api/kbcloud/admin/model_environment_delete.go index 5e4eabfe..35d8c124 100644 --- a/api/kbcloud/admin/model_environment_delete.go +++ b/api/kbcloud/admin/model_environment_delete.go @@ -2,38 +2,35 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EnvironmentDelete Environment deletion option + + +// EnvironmentDelete Environment deletion option type EnvironmentDelete struct { // clean up resources in the cloud (only valid if creation is done by role ARN) CleanCloudResources *bool `json:"cleanCloudResources,omitempty"` - // The policy to clean cloud resources, either `Delete` or `Retain` - Backup CloudResourceCleanPolicy `json:"backup"` - // The policy to clean cloud resources, either `Delete` or `Retain` - Minio CloudResourceCleanPolicy `json:"minio"` - // The policy to clean cloud resources, either `Delete` or `Retain` - VictoriaMetrics CloudResourceCleanPolicy `json:"victoriaMetrics"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentDelete instantiates a new EnvironmentDelete object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewEnvironmentDelete(backup CloudResourceCleanPolicy, minio CloudResourceCleanPolicy, victoriaMetrics CloudResourceCleanPolicy) *EnvironmentDelete { +func NewEnvironmentDelete() *EnvironmentDelete { this := EnvironmentDelete{} - this.Backup = backup - this.Minio = minio - this.VictoriaMetrics = victoriaMetrics return &this } @@ -42,15 +39,8 @@ func NewEnvironmentDelete(backup CloudResourceCleanPolicy, minio CloudResourceCl // but it doesn't guarantee that properties required by API are set. func NewEnvironmentDeleteWithDefaults() *EnvironmentDelete { this := EnvironmentDelete{} - var backup CloudResourceCleanPolicy = CloudResourceCleanPolicyRetain - this.Backup = backup - var minio CloudResourceCleanPolicy = CloudResourceCleanPolicyRetain - this.Minio = minio - var victoriaMetrics CloudResourceCleanPolicy = CloudResourceCleanPolicyRetain - this.VictoriaMetrics = victoriaMetrics return &this } - // GetCleanCloudResources returns the CleanCloudResources field value if set, zero value otherwise. func (o *EnvironmentDelete) GetCleanCloudResources() bool { if o == nil || o.CleanCloudResources == nil { @@ -79,74 +69,7 @@ func (o *EnvironmentDelete) SetCleanCloudResources(v bool) { o.CleanCloudResources = &v } -// GetBackup returns the Backup field value. -func (o *EnvironmentDelete) GetBackup() CloudResourceCleanPolicy { - if o == nil { - var ret CloudResourceCleanPolicy - return ret - } - return o.Backup -} - -// GetBackupOk returns a tuple with the Backup field value -// and a boolean to check if the value has been set. -func (o *EnvironmentDelete) GetBackupOk() (*CloudResourceCleanPolicy, bool) { - if o == nil { - return nil, false - } - return &o.Backup, true -} - -// SetBackup sets field value. -func (o *EnvironmentDelete) SetBackup(v CloudResourceCleanPolicy) { - o.Backup = v -} - -// GetMinio returns the Minio field value. -func (o *EnvironmentDelete) GetMinio() CloudResourceCleanPolicy { - if o == nil { - var ret CloudResourceCleanPolicy - return ret - } - return o.Minio -} - -// GetMinioOk returns a tuple with the Minio field value -// and a boolean to check if the value has been set. -func (o *EnvironmentDelete) GetMinioOk() (*CloudResourceCleanPolicy, bool) { - if o == nil { - return nil, false - } - return &o.Minio, true -} - -// SetMinio sets field value. -func (o *EnvironmentDelete) SetMinio(v CloudResourceCleanPolicy) { - o.Minio = v -} -// GetVictoriaMetrics returns the VictoriaMetrics field value. -func (o *EnvironmentDelete) GetVictoriaMetrics() CloudResourceCleanPolicy { - if o == nil { - var ret CloudResourceCleanPolicy - return ret - } - return o.VictoriaMetrics -} - -// GetVictoriaMetricsOk returns a tuple with the VictoriaMetrics field value -// and a boolean to check if the value has been set. -func (o *EnvironmentDelete) GetVictoriaMetricsOk() (*CloudResourceCleanPolicy, bool) { - if o == nil { - return nil, false - } - return &o.VictoriaMetrics, true -} - -// SetVictoriaMetrics sets field value. -func (o *EnvironmentDelete) SetVictoriaMetrics(v CloudResourceCleanPolicy) { - o.VictoriaMetrics = v -} // MarshalJSON serializes the struct using spec logic. func (o EnvironmentDelete) MarshalJSON() ([]byte, error) { @@ -157,9 +80,6 @@ func (o EnvironmentDelete) MarshalJSON() ([]byte, error) { if o.CleanCloudResources != nil { toSerialize["cleanCloudResources"] = o.CleanCloudResources } - toSerialize["backup"] = o.Backup - toSerialize["minio"] = o.Minio - toSerialize["victoriaMetrics"] = o.VictoriaMetrics for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -170,55 +90,22 @@ func (o EnvironmentDelete) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EnvironmentDelete) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CleanCloudResources *bool `json:"cleanCloudResources,omitempty"` - Backup *CloudResourceCleanPolicy `json:"backup"` - Minio *CloudResourceCleanPolicy `json:"minio"` - VictoriaMetrics *CloudResourceCleanPolicy `json:"victoriaMetrics"` + CleanCloudResources *bool `json:"cleanCloudResources,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } - if all.Backup == nil { - return fmt.Errorf("required field backup missing") - } - if all.Minio == nil { - return fmt.Errorf("required field minio missing") - } - if all.VictoriaMetrics == nil { - return fmt.Errorf("required field victoriaMetrics missing") - } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cleanCloudResources", "backup", "minio", "victoriaMetrics"}) + common.DeleteKeys(additionalProperties, &[]string{ "cleanCloudResources", }) } else { return err } - - hasInvalidField := false o.CleanCloudResources = all.CleanCloudResources - if !all.Backup.IsValid() { - hasInvalidField = true - } else { - o.Backup = *all.Backup - } - if !all.Minio.IsValid() { - hasInvalidField = true - } else { - o.Minio = *all.Minio - } - if !all.VictoriaMetrics.IsValid() { - hasInvalidField = true - } else { - o.VictoriaMetrics = *all.VictoriaMetrics - } if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } - if hasInvalidField { - return common.Unmarshal(bytes, &o.UnparsedObject) - } - return nil } diff --git a/api/kbcloud/admin/model_environment_delete_policy.go b/api/kbcloud/admin/model_environment_delete_policy.go index d2f17149..7d6d5a2f 100644 --- a/api/kbcloud/admin/model_environment_delete_policy.go +++ b/api/kbcloud/admin/model_environment_delete_policy.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EnvironmentDeletePolicy Environment delete policy to protect environment from false delete type EnvironmentDeletePolicy string // List of EnvironmentDeletePolicy. const ( - EnvironmentDeletePolicyDelete EnvironmentDeletePolicy = "Delete" + EnvironmentDeletePolicyDelete EnvironmentDeletePolicy = "Delete" EnvironmentDeletePolicyDoNotDelete EnvironmentDeletePolicy = "DoNotDelete" ) diff --git a/api/kbcloud/admin/model_environment_list.go b/api/kbcloud/admin/model_environment_list.go index d37da468..33db374c 100644 --- a/api/kbcloud/admin/model_environment_list.go +++ b/api/kbcloud/admin/model_environment_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EnvironmentList EnvironmentList is a list of Environments + + +// EnvironmentList EnvironmentList is a list of Environments type EnvironmentList struct { // Items is the list of Environment objects in the list Items []Environment `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentList instantiates a new EnvironmentList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewEnvironmentListWithDefaults() *EnvironmentList { this := EnvironmentList{} return &this } - // GetItems returns the Items field value. func (o *EnvironmentList) GetItems() []Environment { if o == nil { @@ -60,6 +65,8 @@ func (o *EnvironmentList) SetItems(v []Environment) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EnvironmentList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *EnvironmentList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_environment_object_storage.go b/api/kbcloud/admin/model_environment_object_storage.go deleted file mode 100644 index 03b926af..00000000 --- a/api/kbcloud/admin/model_environment_object_storage.go +++ /dev/null @@ -1,98 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package admin - -import "github.com/apecloud/kb-cloud-client-go/api/common" - -type EnvironmentObjectStorage struct { - Clusters []RawCluster `json:"clusters,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewEnvironmentObjectStorage instantiates a new EnvironmentObjectStorage object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewEnvironmentObjectStorage() *EnvironmentObjectStorage { - this := EnvironmentObjectStorage{} - return &this -} - -// NewEnvironmentObjectStorageWithDefaults instantiates a new EnvironmentObjectStorage object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewEnvironmentObjectStorageWithDefaults() *EnvironmentObjectStorage { - this := EnvironmentObjectStorage{} - return &this -} - -// GetClusters returns the Clusters field value if set, zero value otherwise. -func (o *EnvironmentObjectStorage) GetClusters() []RawCluster { - if o == nil || o.Clusters == nil { - var ret []RawCluster - return ret - } - return o.Clusters -} - -// GetClustersOk returns a tuple with the Clusters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvironmentObjectStorage) GetClustersOk() (*[]RawCluster, bool) { - if o == nil || o.Clusters == nil { - return nil, false - } - return &o.Clusters, true -} - -// HasClusters returns a boolean if a field has been set. -func (o *EnvironmentObjectStorage) HasClusters() bool { - return o != nil && o.Clusters != nil -} - -// SetClusters gets a reference to the given []RawCluster and assigns it to the Clusters field. -func (o *EnvironmentObjectStorage) SetClusters(v []RawCluster) { - o.Clusters = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o EnvironmentObjectStorage) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return common.Marshal(o.UnparsedObject) - } - if o.Clusters != nil { - toSerialize["clusters"] = o.Clusters - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return common.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *EnvironmentObjectStorage) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Clusters []RawCluster `json:"clusters,omitempty"` - }{} - if err = common.Unmarshal(bytes, &all); err != nil { - return common.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"clusters"}) - } else { - return err - } - o.Clusters = all.Clusters - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/kbcloud/admin/model_environment_register_type.go b/api/kbcloud/admin/model_environment_register_type.go index 8a8c0f31..b8a417da 100644 --- a/api/kbcloud/admin/model_environment_register_type.go +++ b/api/kbcloud/admin/model_environment_register_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EnvironmentRegisterType Configuration for privisoining environment resources type EnvironmentRegisterType string // List of EnvironmentRegisterType. const ( - EnvironmentRegisterTypeKubeconfig EnvironmentRegisterType = "kubeconfig" - EnvironmentRegisterTypeIac EnvironmentRegisterType = "iac" + EnvironmentRegisterTypeKubeconfig EnvironmentRegisterType = "kubeconfig" + EnvironmentRegisterTypeIac EnvironmentRegisterType = "iac" EnvironmentRegisterTypeConnectAgent EnvironmentRegisterType = "connect-agent" ) diff --git a/api/kbcloud/admin/model_environment_resource_stats.go b/api/kbcloud/admin/model_environment_resource_stats.go index 82066ba3..4ca261d9 100644 --- a/api/kbcloud/admin/model_environment_resource_stats.go +++ b/api/kbcloud/admin/model_environment_resource_stats.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EnvironmentResourceStats EnvironmentResourceStats holds the cpuStats for a environment. + + +// EnvironmentResourceStats EnvironmentResourceStats holds the cpuStats for a environment. type EnvironmentResourceStats struct { // ResourceStats holds the requests, limits, and available stats for a resource. CpuStats ResourceStats `json:"cpuStats"` @@ -21,10 +26,11 @@ type EnvironmentResourceStats struct { // StorageStats holds the resource stats of the volume, such as provisioned capacity, etc. StorageStats StorageStats `json:"storageStats"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentResourceStats instantiates a new EnvironmentResourceStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewEnvironmentResourceStatsWithDefaults() *EnvironmentResourceStats { this := EnvironmentResourceStats{} return &this } - // GetCpuStats returns the CpuStats field value. func (o *EnvironmentResourceStats) GetCpuStats() ResourceStats { if o == nil { @@ -69,6 +74,7 @@ func (o *EnvironmentResourceStats) SetCpuStats(v ResourceStats) { o.CpuStats = v } + // GetMemoryStats returns the MemoryStats field value. func (o *EnvironmentResourceStats) GetMemoryStats() ResourceStats { if o == nil { @@ -92,6 +98,7 @@ func (o *EnvironmentResourceStats) SetMemoryStats(v ResourceStats) { o.MemoryStats = v } + // GetName returns the Name field value. func (o *EnvironmentResourceStats) GetName() string { if o == nil { @@ -115,6 +122,7 @@ func (o *EnvironmentResourceStats) SetName(v string) { o.Name = v } + // GetStorageStats returns the StorageStats field value. func (o *EnvironmentResourceStats) GetStorageStats() StorageStats { if o == nil { @@ -138,6 +146,8 @@ func (o *EnvironmentResourceStats) SetStorageStats(v StorageStats) { o.StorageStats = v } + + // MarshalJSON serializes the struct using spec logic. func (o EnvironmentResourceStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +168,10 @@ func (o EnvironmentResourceStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EnvironmentResourceStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CpuStats *ResourceStats `json:"cpuStats"` - MemoryStats *ResourceStats `json:"memoryStats"` - Name *string `json:"name"` - StorageStats *StorageStats `json:"storageStats"` + CpuStats *ResourceStats `json:"cpuStats"` + MemoryStats *ResourceStats `json:"memoryStats"` + Name *string `json:"name"` + StorageStats *StorageStats `json:"storageStats"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *EnvironmentResourceStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cpuStats", "memoryStats", "name", "storageStats"}) + common.DeleteKeys(additionalProperties, &[]string{ "cpuStats", "memoryStats", "name", "storageStats", }) } else { return err } diff --git a/api/kbcloud/admin/model_environment_state.go b/api/kbcloud/admin/model_environment_state.go index ec2d028e..4a2fac14 100644 --- a/api/kbcloud/admin/model_environment_state.go +++ b/api/kbcloud/admin/model_environment_state.go @@ -2,29 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EnvironmentState Output only. State of the Environment resource type EnvironmentState string // List of EnvironmentState. const ( - EnvironmentStatePending EnvironmentState = "PENDING" - EnvironmentStateRegistered EnvironmentState = "REGISTERED" + EnvironmentStatePending EnvironmentState = "PENDING" + EnvironmentStateRegistered EnvironmentState = "REGISTERED" EnvironmentStateProvisioning EnvironmentState = "PROVISIONING" - EnvironmentStateNotready EnvironmentState = "NOTREADY" - EnvironmentStateReady EnvironmentState = "READY" - EnvironmentStateWarning EnvironmentState = "WARNING" - EnvironmentStateUnreachable EnvironmentState = "UNREACHABLE" - EnvironmentStateDeleting EnvironmentState = "DELETING" - EnvironmentStateOutofstock EnvironmentState = "OUTOFSTOCK" - EnvironmentStateUpdating EnvironmentState = "UPDATING" + EnvironmentStateNotready EnvironmentState = "NOTREADY" + EnvironmentStateReady EnvironmentState = "READY" + EnvironmentStateWarning EnvironmentState = "WARNING" + EnvironmentStateUnreachable EnvironmentState = "UNREACHABLE" + EnvironmentStateDeleting EnvironmentState = "DELETING" + EnvironmentStateOutofstock EnvironmentState = "OUTOFSTOCK" ) var allowedEnvironmentStateEnumValues = []EnvironmentState{ @@ -37,7 +41,6 @@ var allowedEnvironmentStateEnumValues = []EnvironmentState{ EnvironmentStateUnreachable, EnvironmentStateDeleting, EnvironmentStateOutofstock, - EnvironmentStateUpdating, } // GetAllowedValues returns the list of possible values. diff --git a/api/kbcloud/admin/model_environment_stats.go b/api/kbcloud/admin/model_environment_stats.go index 41fe4126..962a6cc2 100644 --- a/api/kbcloud/admin/model_environment_stats.go +++ b/api/kbcloud/admin/model_environment_stats.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EnvironmentStats The cumulative statistics for all environments. + + +// EnvironmentStats The cumulative statistics for all environments. type EnvironmentStats struct { // The total number of environments. EnvTotal int32 `json:"envTotal"` @@ -21,10 +26,11 @@ type EnvironmentStats struct { // The cumulative storage capacity of all environments, typically measured in bytes or GiB. StorageTotal float64 `json:"storageTotal"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentStats instantiates a new EnvironmentStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewEnvironmentStatsWithDefaults() *EnvironmentStats { this := EnvironmentStats{} return &this } - // GetEnvTotal returns the EnvTotal field value. func (o *EnvironmentStats) GetEnvTotal() int32 { if o == nil { @@ -69,6 +74,7 @@ func (o *EnvironmentStats) SetEnvTotal(v int32) { o.EnvTotal = v } + // GetCpuTotal returns the CpuTotal field value. func (o *EnvironmentStats) GetCpuTotal() float64 { if o == nil { @@ -92,6 +98,7 @@ func (o *EnvironmentStats) SetCpuTotal(v float64) { o.CpuTotal = v } + // GetMemoryTotal returns the MemoryTotal field value. func (o *EnvironmentStats) GetMemoryTotal() float64 { if o == nil { @@ -115,6 +122,7 @@ func (o *EnvironmentStats) SetMemoryTotal(v float64) { o.MemoryTotal = v } + // GetStorageTotal returns the StorageTotal field value. func (o *EnvironmentStats) GetStorageTotal() float64 { if o == nil { @@ -138,6 +146,8 @@ func (o *EnvironmentStats) SetStorageTotal(v float64) { o.StorageTotal = v } + + // MarshalJSON serializes the struct using spec logic. func (o EnvironmentStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,9 +168,9 @@ func (o EnvironmentStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EnvironmentStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EnvTotal *int32 `json:"envTotal"` - CpuTotal *float64 `json:"cpuTotal"` - MemoryTotal *float64 `json:"memoryTotal"` + EnvTotal *int32 `json:"envTotal"` + CpuTotal *float64 `json:"cpuTotal"` + MemoryTotal *float64 `json:"memoryTotal"` StorageTotal *float64 `json:"storageTotal"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -180,7 +190,7 @@ func (o *EnvironmentStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"envTotal", "cpuTotal", "memoryTotal", "storageTotal"}) + common.DeleteKeys(additionalProperties, &[]string{ "envTotal", "cpuTotal", "memoryTotal", "storageTotal", }) } else { return err } diff --git a/api/kbcloud/admin/model_environment_status.go b/api/kbcloud/admin/model_environment_status.go index 25aa9591..8e6ce78c 100644 --- a/api/kbcloud/admin/model_environment_status.go +++ b/api/kbcloud/admin/model_environment_status.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// EnvironmentStatus Environment status +// EnvironmentStatus Environment status type EnvironmentStatus struct { // Current service state of environment. Conditions []EnvironmentCondition `json:"conditions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentStatus instantiates a new EnvironmentStatus object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewEnvironmentStatusWithDefaults() *EnvironmentStatus { this := EnvironmentStatus{} return &this } - // GetConditions returns the Conditions field value if set, zero value otherwise. func (o *EnvironmentStatus) GetConditions() []EnvironmentCondition { if o == nil || o.Conditions == nil { @@ -60,6 +69,8 @@ func (o *EnvironmentStatus) SetConditions(v []EnvironmentCondition) { o.Conditions = v } + + // MarshalJSON serializes the struct using spec logic. func (o EnvironmentStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *EnvironmentStatus) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"conditions"}) + common.DeleteKeys(additionalProperties, &[]string{ "conditions", }) } else { return err } diff --git a/api/kbcloud/admin/model_environment_status_history.go b/api/kbcloud/admin/model_environment_status_history.go deleted file mode 100644 index 6beda867..00000000 --- a/api/kbcloud/admin/model_environment_status_history.go +++ /dev/null @@ -1,202 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package admin - -import ( - "fmt" - "time" - - "github.com/apecloud/kb-cloud-client-go/api/common" -) - -// EnvironmentStatusHistory EventEnvironmentState contains details for the current and previous state of the environment. -type EnvironmentStatusHistory struct { - // The current state of the environment. - CurrentState string `json:"CurrentState"` - // The previous state of the environment. - PrevState string `json:"PrevState"` - // The reason for the state transition. - Reason string `json:"Reason"` - // The timestamp of the state transition. - Timestamp time.Time `json:"Timestamp"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewEnvironmentStatusHistory instantiates a new EnvironmentStatusHistory object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewEnvironmentStatusHistory(currentState string, prevState string, reason string, timestamp time.Time) *EnvironmentStatusHistory { - this := EnvironmentStatusHistory{} - this.CurrentState = currentState - this.PrevState = prevState - this.Reason = reason - this.Timestamp = timestamp - return &this -} - -// NewEnvironmentStatusHistoryWithDefaults instantiates a new EnvironmentStatusHistory object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewEnvironmentStatusHistoryWithDefaults() *EnvironmentStatusHistory { - this := EnvironmentStatusHistory{} - return &this -} - -// GetCurrentState returns the CurrentState field value. -func (o *EnvironmentStatusHistory) GetCurrentState() string { - if o == nil { - var ret string - return ret - } - return o.CurrentState -} - -// GetCurrentStateOk returns a tuple with the CurrentState field value -// and a boolean to check if the value has been set. -func (o *EnvironmentStatusHistory) GetCurrentStateOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.CurrentState, true -} - -// SetCurrentState sets field value. -func (o *EnvironmentStatusHistory) SetCurrentState(v string) { - o.CurrentState = v -} - -// GetPrevState returns the PrevState field value. -func (o *EnvironmentStatusHistory) GetPrevState() string { - if o == nil { - var ret string - return ret - } - return o.PrevState -} - -// GetPrevStateOk returns a tuple with the PrevState field value -// and a boolean to check if the value has been set. -func (o *EnvironmentStatusHistory) GetPrevStateOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PrevState, true -} - -// SetPrevState sets field value. -func (o *EnvironmentStatusHistory) SetPrevState(v string) { - o.PrevState = v -} - -// GetReason returns the Reason field value. -func (o *EnvironmentStatusHistory) GetReason() string { - if o == nil { - var ret string - return ret - } - return o.Reason -} - -// GetReasonOk returns a tuple with the Reason field value -// and a boolean to check if the value has been set. -func (o *EnvironmentStatusHistory) GetReasonOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Reason, true -} - -// SetReason sets field value. -func (o *EnvironmentStatusHistory) SetReason(v string) { - o.Reason = v -} - -// GetTimestamp returns the Timestamp field value. -func (o *EnvironmentStatusHistory) GetTimestamp() time.Time { - if o == nil { - var ret time.Time - return ret - } - return o.Timestamp -} - -// GetTimestampOk returns a tuple with the Timestamp field value -// and a boolean to check if the value has been set. -func (o *EnvironmentStatusHistory) GetTimestampOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.Timestamp, true -} - -// SetTimestamp sets field value. -func (o *EnvironmentStatusHistory) SetTimestamp(v time.Time) { - o.Timestamp = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o EnvironmentStatusHistory) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return common.Marshal(o.UnparsedObject) - } - toSerialize["CurrentState"] = o.CurrentState - toSerialize["PrevState"] = o.PrevState - toSerialize["Reason"] = o.Reason - if o.Timestamp.Nanosecond() == 0 { - toSerialize["Timestamp"] = o.Timestamp.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["Timestamp"] = o.Timestamp.Format("2006-01-02T15:04:05.000Z07:00") - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return common.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *EnvironmentStatusHistory) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - CurrentState *string `json:"CurrentState"` - PrevState *string `json:"PrevState"` - Reason *string `json:"Reason"` - Timestamp *time.Time `json:"Timestamp"` - }{} - if err = common.Unmarshal(bytes, &all); err != nil { - return common.Unmarshal(bytes, &o.UnparsedObject) - } - if all.CurrentState == nil { - return fmt.Errorf("required field CurrentState missing") - } - if all.PrevState == nil { - return fmt.Errorf("required field PrevState missing") - } - if all.Reason == nil { - return fmt.Errorf("required field Reason missing") - } - if all.Timestamp == nil { - return fmt.Errorf("required field Timestamp missing") - } - additionalProperties := make(map[string]interface{}) - if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"CurrentState", "PrevState", "Reason", "Timestamp"}) - } else { - return err - } - o.CurrentState = *all.CurrentState - o.PrevState = *all.PrevState - o.Reason = *all.Reason - o.Timestamp = *all.Timestamp - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/kbcloud/admin/model_environment_storage.go b/api/kbcloud/admin/model_environment_storage.go index c03273e7..7a5877a6 100644 --- a/api/kbcloud/admin/model_environment_storage.go +++ b/api/kbcloud/admin/model_environment_storage.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// EnvironmentStorage Storage config +// EnvironmentStorage Storage config type EnvironmentStorage struct { // the storage name Name *string `json:"name,omitempty"` // the storage type Type *EnvironmentStorageType `json:"type,omitempty"` - // the existed cluster name for creating storage - ReusedClusterName *string `json:"reusedClusterName,omitempty"` - // the existed cluster namespace for creating storage - ReusedClusterNamespace *string `json:"reusedClusterNamespace,omitempty"` // storageCreate is the schema for the storage create request Config *StorageCreate `json:"config,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentStorage instantiates a new EnvironmentStorage object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewEnvironmentStorageWithDefaults() *EnvironmentStorage { this := EnvironmentStorage{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *EnvironmentStorage) GetName() string { if o == nil || o.Name == nil { @@ -68,6 +73,7 @@ func (o *EnvironmentStorage) SetName(v string) { o.Name = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *EnvironmentStorage) GetType() EnvironmentStorageType { if o == nil || o.Type == nil { @@ -96,61 +102,6 @@ func (o *EnvironmentStorage) SetType(v EnvironmentStorageType) { o.Type = &v } -// GetReusedClusterName returns the ReusedClusterName field value if set, zero value otherwise. -func (o *EnvironmentStorage) GetReusedClusterName() string { - if o == nil || o.ReusedClusterName == nil { - var ret string - return ret - } - return *o.ReusedClusterName -} - -// GetReusedClusterNameOk returns a tuple with the ReusedClusterName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvironmentStorage) GetReusedClusterNameOk() (*string, bool) { - if o == nil || o.ReusedClusterName == nil { - return nil, false - } - return o.ReusedClusterName, true -} - -// HasReusedClusterName returns a boolean if a field has been set. -func (o *EnvironmentStorage) HasReusedClusterName() bool { - return o != nil && o.ReusedClusterName != nil -} - -// SetReusedClusterName gets a reference to the given string and assigns it to the ReusedClusterName field. -func (o *EnvironmentStorage) SetReusedClusterName(v string) { - o.ReusedClusterName = &v -} - -// GetReusedClusterNamespace returns the ReusedClusterNamespace field value if set, zero value otherwise. -func (o *EnvironmentStorage) GetReusedClusterNamespace() string { - if o == nil || o.ReusedClusterNamespace == nil { - var ret string - return ret - } - return *o.ReusedClusterNamespace -} - -// GetReusedClusterNamespaceOk returns a tuple with the ReusedClusterNamespace field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvironmentStorage) GetReusedClusterNamespaceOk() (*string, bool) { - if o == nil || o.ReusedClusterNamespace == nil { - return nil, false - } - return o.ReusedClusterNamespace, true -} - -// HasReusedClusterNamespace returns a boolean if a field has been set. -func (o *EnvironmentStorage) HasReusedClusterNamespace() bool { - return o != nil && o.ReusedClusterNamespace != nil -} - -// SetReusedClusterNamespace gets a reference to the given string and assigns it to the ReusedClusterNamespace field. -func (o *EnvironmentStorage) SetReusedClusterNamespace(v string) { - o.ReusedClusterNamespace = &v -} // GetConfig returns the Config field value if set, zero value otherwise. func (o *EnvironmentStorage) GetConfig() StorageCreate { @@ -180,6 +131,8 @@ func (o *EnvironmentStorage) SetConfig(v StorageCreate) { o.Config = &v } + + // MarshalJSON serializes the struct using spec logic. func (o EnvironmentStorage) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -192,12 +145,6 @@ func (o EnvironmentStorage) MarshalJSON() ([]byte, error) { if o.Type != nil { toSerialize["type"] = o.Type } - if o.ReusedClusterName != nil { - toSerialize["reusedClusterName"] = o.ReusedClusterName - } - if o.ReusedClusterNamespace != nil { - toSerialize["reusedClusterNamespace"] = o.ReusedClusterNamespace - } if o.Config != nil { toSerialize["config"] = o.Config } @@ -211,32 +158,28 @@ func (o EnvironmentStorage) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EnvironmentStorage) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Type *EnvironmentStorageType `json:"type,omitempty"` - ReusedClusterName *string `json:"reusedClusterName,omitempty"` - ReusedClusterNamespace *string `json:"reusedClusterNamespace,omitempty"` - Config *StorageCreate `json:"config,omitempty"` + Name *string `json:"name,omitempty"` + Type *EnvironmentStorageType `json:"type,omitempty"` + Config *StorageCreate `json:"config,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "type", "reusedClusterName", "reusedClusterNamespace", "config"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "type", "config", }) } else { return err } hasInvalidField := false o.Name = all.Name - if all.Type != nil && !all.Type.IsValid() { + if all.Type != nil &&!all.Type.IsValid() { hasInvalidField = true } else { o.Type = all.Type } - o.ReusedClusterName = all.ReusedClusterName - o.ReusedClusterNamespace = all.ReusedClusterNamespace - if all.Config != nil && all.Config.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Config != nil && all.Config.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Config = all.Config diff --git a/api/kbcloud/admin/model_environment_storage_type.go b/api/kbcloud/admin/model_environment_storage_type.go index 9bce7a16..4a4698fb 100644 --- a/api/kbcloud/admin/model_environment_storage_type.go +++ b/api/kbcloud/admin/model_environment_storage_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EnvironmentStorageType the storage type type EnvironmentStorageType string // List of EnvironmentStorageType. const ( EnvironmentStorageTypeRemote EnvironmentStorageType = "remote" - EnvironmentStorageTypeLocal EnvironmentStorageType = "local" + EnvironmentStorageTypeLocal EnvironmentStorageType = "local" ) var allowedEnvironmentStorageTypeEnumValues = []EnvironmentStorageType{ diff --git a/api/kbcloud/admin/model_environment_type.go b/api/kbcloud/admin/model_environment_type.go index 7989b9a7..32e46849 100644 --- a/api/kbcloud/admin/model_environment_type.go +++ b/api/kbcloud/admin/model_environment_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EnvironmentType Type of this environment type EnvironmentType string // List of EnvironmentType. const ( - EnvironmentTypePublic EnvironmentType = "public" + EnvironmentTypePublic EnvironmentType = "public" EnvironmentTypePrivate EnvironmentType = "private" ) diff --git a/api/kbcloud/admin/model_environment_update.go b/api/kbcloud/admin/model_environment_update.go index beed898d..e6cf29c6 100644 --- a/api/kbcloud/admin/model_environment_update.go +++ b/api/kbcloud/admin/model_environment_update.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// EnvironmentUpdate Environment info + +// EnvironmentUpdate Environment info type EnvironmentUpdate struct { // The description of the organization Description common.NullableString `json:"description,omitempty"` @@ -37,10 +46,11 @@ type EnvironmentUpdate struct { // Environment delete policy to protect environment from false delete DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentUpdate instantiates a new EnvironmentUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -77,7 +87,6 @@ func NewEnvironmentUpdateWithDefaults() *EnvironmentUpdate { this.DeletePolicy = &deletePolicy return &this } - // GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentUpdate) GetDescription() string { if o == nil || o.Description.Get() == nil { @@ -91,7 +100,7 @@ func (o *EnvironmentUpdate) GetDescription() string { // 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 *EnvironmentUpdate) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Description.Get(), o.Description.IsSet() @@ -106,7 +115,6 @@ func (o *EnvironmentUpdate) HasDescription() bool { func (o *EnvironmentUpdate) SetDescription(v string) { o.Description.Set(&v) } - // SetDescriptionNil sets the value for Description to be an explicit nil. func (o *EnvironmentUpdate) SetDescriptionNil() { o.Description.Set(nil) @@ -117,6 +125,7 @@ func (o *EnvironmentUpdate) UnsetDescription() { o.Description.Unset() } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentUpdate) GetDisplayName() string { if o == nil || o.DisplayName.Get() == nil { @@ -130,7 +139,7 @@ func (o *EnvironmentUpdate) GetDisplayName() string { // 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 *EnvironmentUpdate) GetDisplayNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DisplayName.Get(), o.DisplayName.IsSet() @@ -145,7 +154,6 @@ func (o *EnvironmentUpdate) HasDisplayName() bool { func (o *EnvironmentUpdate) SetDisplayName(v string) { o.DisplayName.Set(&v) } - // SetDisplayNameNil sets the value for DisplayName to be an explicit nil. func (o *EnvironmentUpdate) SetDisplayNameNil() { o.DisplayName.Set(nil) @@ -156,6 +164,7 @@ func (o *EnvironmentUpdate) UnsetDisplayName() { o.DisplayName.Unset() } + // GetOrganizations returns the Organizations field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentUpdate) GetOrganizations() []string { if o == nil || o.Organizations.Get() == nil { @@ -169,7 +178,7 @@ func (o *EnvironmentUpdate) GetOrganizations() []string { // 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 *EnvironmentUpdate) GetOrganizationsOk() (*[]string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Organizations.Get(), o.Organizations.IsSet() @@ -184,7 +193,6 @@ func (o *EnvironmentUpdate) HasOrganizations() bool { func (o *EnvironmentUpdate) SetOrganizations(v []string) { o.Organizations.Set(&v) } - // SetOrganizationsNil sets the value for Organizations to be an explicit nil. func (o *EnvironmentUpdate) SetOrganizationsNil() { o.Organizations.Set(nil) @@ -195,6 +203,7 @@ func (o *EnvironmentUpdate) UnsetOrganizations() { o.Organizations.Unset() } + // GetNamespaces returns the Namespaces field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentUpdate) GetNamespaces() []string { if o == nil || o.Namespaces.Get() == nil { @@ -208,7 +217,7 @@ func (o *EnvironmentUpdate) GetNamespaces() []string { // 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 *EnvironmentUpdate) GetNamespacesOk() (*[]string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Namespaces.Get(), o.Namespaces.IsSet() @@ -223,7 +232,6 @@ func (o *EnvironmentUpdate) HasNamespaces() bool { func (o *EnvironmentUpdate) SetNamespaces(v []string) { o.Namespaces.Set(&v) } - // SetNamespacesNil sets the value for Namespaces to be an explicit nil. func (o *EnvironmentUpdate) SetNamespacesNil() { o.Namespaces.Set(nil) @@ -234,6 +242,7 @@ func (o *EnvironmentUpdate) UnsetNamespaces() { o.Namespaces.Unset() } + // GetCpuOverCommitRatio returns the CpuOverCommitRatio field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentUpdate) GetCpuOverCommitRatio() float64 { if o == nil || o.CpuOverCommitRatio.Get() == nil { @@ -247,7 +256,7 @@ func (o *EnvironmentUpdate) GetCpuOverCommitRatio() float64 { // 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 *EnvironmentUpdate) GetCpuOverCommitRatioOk() (*float64, bool) { - if o == nil { + if o == nil { return nil, false } return o.CpuOverCommitRatio.Get(), o.CpuOverCommitRatio.IsSet() @@ -262,7 +271,6 @@ func (o *EnvironmentUpdate) HasCpuOverCommitRatio() bool { func (o *EnvironmentUpdate) SetCpuOverCommitRatio(v float64) { o.CpuOverCommitRatio.Set(&v) } - // SetCpuOverCommitRatioNil sets the value for CpuOverCommitRatio to be an explicit nil. func (o *EnvironmentUpdate) SetCpuOverCommitRatioNil() { o.CpuOverCommitRatio.Set(nil) @@ -273,6 +281,7 @@ func (o *EnvironmentUpdate) UnsetCpuOverCommitRatio() { o.CpuOverCommitRatio.Unset() } + // GetMemoryOverCommitRatio returns the MemoryOverCommitRatio field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentUpdate) GetMemoryOverCommitRatio() float64 { if o == nil || o.MemoryOverCommitRatio.Get() == nil { @@ -286,7 +295,7 @@ func (o *EnvironmentUpdate) GetMemoryOverCommitRatio() float64 { // 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 *EnvironmentUpdate) GetMemoryOverCommitRatioOk() (*float64, bool) { - if o == nil { + if o == nil { return nil, false } return o.MemoryOverCommitRatio.Get(), o.MemoryOverCommitRatio.IsSet() @@ -301,7 +310,6 @@ func (o *EnvironmentUpdate) HasMemoryOverCommitRatio() bool { func (o *EnvironmentUpdate) SetMemoryOverCommitRatio(v float64) { o.MemoryOverCommitRatio.Set(&v) } - // SetMemoryOverCommitRatioNil sets the value for MemoryOverCommitRatio to be an explicit nil. func (o *EnvironmentUpdate) SetMemoryOverCommitRatioNil() { o.MemoryOverCommitRatio.Set(nil) @@ -312,6 +320,7 @@ func (o *EnvironmentUpdate) UnsetMemoryOverCommitRatio() { o.MemoryOverCommitRatio.Unset() } + // GetAutohealingConfig returns the AutohealingConfig field value if set, zero value otherwise. func (o *EnvironmentUpdate) GetAutohealingConfig() AutohealingConfig { if o == nil || o.AutohealingConfig == nil { @@ -340,6 +349,7 @@ func (o *EnvironmentUpdate) SetAutohealingConfig(v AutohealingConfig) { o.AutohealingConfig = &v } + // GetDefaultStorageClass returns the DefaultStorageClass field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentUpdate) GetDefaultStorageClass() string { if o == nil || o.DefaultStorageClass.Get() == nil { @@ -353,7 +363,7 @@ func (o *EnvironmentUpdate) GetDefaultStorageClass() string { // 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 *EnvironmentUpdate) GetDefaultStorageClassOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DefaultStorageClass.Get(), o.DefaultStorageClass.IsSet() @@ -368,7 +378,6 @@ func (o *EnvironmentUpdate) HasDefaultStorageClass() bool { func (o *EnvironmentUpdate) SetDefaultStorageClass(v string) { o.DefaultStorageClass.Set(&v) } - // SetDefaultStorageClassNil sets the value for DefaultStorageClass to be an explicit nil. func (o *EnvironmentUpdate) SetDefaultStorageClassNil() { o.DefaultStorageClass.Set(nil) @@ -379,6 +388,7 @@ func (o *EnvironmentUpdate) UnsetDefaultStorageClass() { o.DefaultStorageClass.Unset() } + // GetPodAntiAffinityEnabled returns the PodAntiAffinityEnabled field value if set, zero value otherwise. func (o *EnvironmentUpdate) GetPodAntiAffinityEnabled() bool { if o == nil || o.PodAntiAffinityEnabled == nil { @@ -407,6 +417,7 @@ func (o *EnvironmentUpdate) SetPodAntiAffinityEnabled(v bool) { o.PodAntiAffinityEnabled = &v } + // GetImageRegistry returns the ImageRegistry field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentUpdate) GetImageRegistry() string { if o == nil || o.ImageRegistry.Get() == nil { @@ -420,7 +431,7 @@ func (o *EnvironmentUpdate) GetImageRegistry() string { // 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 *EnvironmentUpdate) GetImageRegistryOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ImageRegistry.Get(), o.ImageRegistry.IsSet() @@ -435,7 +446,6 @@ func (o *EnvironmentUpdate) HasImageRegistry() bool { func (o *EnvironmentUpdate) SetImageRegistry(v string) { o.ImageRegistry.Set(&v) } - // SetImageRegistryNil sets the value for ImageRegistry to be an explicit nil. func (o *EnvironmentUpdate) SetImageRegistryNil() { o.ImageRegistry.Set(nil) @@ -446,6 +456,7 @@ func (o *EnvironmentUpdate) UnsetImageRegistry() { o.ImageRegistry.Unset() } + // GetNodePortEnabled returns the NodePortEnabled field value if set, zero value otherwise. func (o *EnvironmentUpdate) GetNodePortEnabled() bool { if o == nil || o.NodePortEnabled == nil { @@ -474,6 +485,7 @@ func (o *EnvironmentUpdate) SetNodePortEnabled(v bool) { o.NodePortEnabled = &v } + // GetLbEnabled returns the LbEnabled field value if set, zero value otherwise. func (o *EnvironmentUpdate) GetLbEnabled() bool { if o == nil || o.LbEnabled == nil { @@ -502,6 +514,7 @@ func (o *EnvironmentUpdate) SetLbEnabled(v bool) { o.LbEnabled = &v } + // GetInternetLbEnabled returns the InternetLbEnabled field value if set, zero value otherwise. func (o *EnvironmentUpdate) GetInternetLbEnabled() bool { if o == nil || o.InternetLbEnabled == nil { @@ -530,6 +543,7 @@ func (o *EnvironmentUpdate) SetInternetLbEnabled(v bool) { o.InternetLbEnabled = &v } + // GetDeletePolicy returns the DeletePolicy field value if set, zero value otherwise. func (o *EnvironmentUpdate) GetDeletePolicy() EnvironmentDeletePolicy { if o == nil || o.DeletePolicy == nil { @@ -558,6 +572,8 @@ func (o *EnvironmentUpdate) SetDeletePolicy(v EnvironmentDeletePolicy) { o.DeletePolicy = &v } + + // MarshalJSON serializes the struct using spec logic. func (o EnvironmentUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -616,27 +632,27 @@ func (o EnvironmentUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EnvironmentUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Description common.NullableString `json:"description,omitempty"` - DisplayName common.NullableString `json:"displayName,omitempty"` - Organizations common.NullableList[string] `json:"organizations,omitempty"` - Namespaces common.NullableList[string] `json:"namespaces,omitempty"` - CpuOverCommitRatio common.NullableFloat64 `json:"cpuOverCommitRatio,omitempty"` - MemoryOverCommitRatio common.NullableFloat64 `json:"memoryOverCommitRatio,omitempty"` - AutohealingConfig *AutohealingConfig `json:"autohealingConfig,omitempty"` - DefaultStorageClass common.NullableString `json:"defaultStorageClass,omitempty"` - PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` - ImageRegistry common.NullableString `json:"imageRegistry,omitempty"` - NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` - LbEnabled *bool `json:"lbEnabled,omitempty"` - InternetLbEnabled *bool `json:"internetLBEnabled,omitempty"` - DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` + Description common.NullableString `json:"description,omitempty"` + DisplayName common.NullableString `json:"displayName,omitempty"` + Organizations common.NullableList[string] `json:"organizations,omitempty"` + Namespaces common.NullableList[string] `json:"namespaces,omitempty"` + CpuOverCommitRatio common.NullableFloat64 `json:"cpuOverCommitRatio,omitempty"` + MemoryOverCommitRatio common.NullableFloat64 `json:"memoryOverCommitRatio,omitempty"` + AutohealingConfig *AutohealingConfig `json:"autohealingConfig,omitempty"` + DefaultStorageClass common.NullableString `json:"defaultStorageClass,omitempty"` + PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` + ImageRegistry common.NullableString `json:"imageRegistry,omitempty"` + NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` + LbEnabled *bool `json:"lbEnabled,omitempty"` + InternetLbEnabled *bool `json:"internetLBEnabled,omitempty"` + DeletePolicy *EnvironmentDeletePolicy `json:"deletePolicy,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "displayName", "organizations", "namespaces", "cpuOverCommitRatio", "memoryOverCommitRatio", "autohealingConfig", "defaultStorageClass", "podAntiAffinityEnabled", "imageRegistry", "nodePortEnabled", "lbEnabled", "internetLBEnabled", "deletePolicy"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "displayName", "organizations", "namespaces", "cpuOverCommitRatio", "memoryOverCommitRatio", "autohealingConfig", "defaultStorageClass", "podAntiAffinityEnabled", "imageRegistry", "nodePortEnabled", "lbEnabled", "internetLBEnabled", "deletePolicy", }) } else { return err } @@ -648,7 +664,7 @@ func (o *EnvironmentUpdate) UnmarshalJSON(bytes []byte) (err error) { o.Namespaces = all.Namespaces o.CpuOverCommitRatio = all.CpuOverCommitRatio o.MemoryOverCommitRatio = all.MemoryOverCommitRatio - if all.AutohealingConfig != nil && all.AutohealingConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.AutohealingConfig != nil && all.AutohealingConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.AutohealingConfig = all.AutohealingConfig @@ -658,7 +674,7 @@ func (o *EnvironmentUpdate) UnmarshalJSON(bytes []byte) (err error) { o.NodePortEnabled = all.NodePortEnabled o.LbEnabled = all.LbEnabled o.InternetLbEnabled = all.InternetLbEnabled - if all.DeletePolicy != nil && !all.DeletePolicy.IsValid() { + if all.DeletePolicy != nil &&!all.DeletePolicy.IsValid() { hasInvalidField = true } else { o.DeletePolicy = all.DeletePolicy diff --git a/api/kbcloud/admin/model_event.go b/api/kbcloud/admin/model_event.go index 250695d0..b7d8dbd9 100644 --- a/api/kbcloud/admin/model_event.go +++ b/api/kbcloud/admin/model_event.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Event Event related to the view + + +// Event Event related to the view type Event struct { // Group is the API group of the event. Group string `json:"group"` @@ -39,10 +44,11 @@ type Event struct { // Reason is the reason of the event. Reason *string `json:"reason,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEvent instantiates a new Event object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -64,7 +70,6 @@ func NewEventWithDefaults() *Event { this := Event{} return &this } - // GetGroup returns the Group field value. func (o *Event) GetGroup() string { if o == nil { @@ -88,6 +93,7 @@ func (o *Event) SetGroup(v string) { o.Group = v } + // GetKind returns the Kind field value. func (o *Event) GetKind() string { if o == nil { @@ -111,6 +117,7 @@ func (o *Event) SetKind(v string) { o.Kind = v } + // GetName returns the Name field value. func (o *Event) GetName() string { if o == nil { @@ -134,6 +141,7 @@ func (o *Event) SetName(v string) { o.Name = v } + // GetNamespace returns the Namespace field value. func (o *Event) GetNamespace() string { if o == nil { @@ -157,6 +165,7 @@ func (o *Event) SetNamespace(v string) { o.Namespace = v } + // GetOwners returns the Owners field value if set, zero value otherwise. func (o *Event) GetOwners() []Owner { if o == nil || o.Owners == nil { @@ -185,6 +194,7 @@ func (o *Event) SetOwners(v []Owner) { o.Owners = v } + // GetProgress returns the Progress field value if set, zero value otherwise. func (o *Event) GetProgress() string { if o == nil || o.Progress == nil { @@ -213,6 +223,7 @@ func (o *Event) SetProgress(v string) { o.Progress = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *Event) GetMessage() string { if o == nil || o.Message == nil { @@ -241,6 +252,7 @@ func (o *Event) SetMessage(v string) { o.Message = &v } + // GetResourceVersion returns the ResourceVersion field value if set, zero value otherwise. func (o *Event) GetResourceVersion() string { if o == nil || o.ResourceVersion == nil { @@ -269,6 +281,7 @@ func (o *Event) SetResourceVersion(v string) { o.ResourceVersion = &v } + // GetType returns the Type field value. func (o *Event) GetType() string { if o == nil { @@ -292,6 +305,7 @@ func (o *Event) SetType(v string) { o.Type = v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *Event) GetVersion() string { if o == nil || o.Version == nil { @@ -320,6 +334,7 @@ func (o *Event) SetVersion(v string) { o.Version = &v } + // GetTime returns the Time field value if set, zero value otherwise. func (o *Event) GetTime() string { if o == nil || o.Time == nil { @@ -348,6 +363,7 @@ func (o *Event) SetTime(v string) { o.Time = &v } + // GetLevel returns the Level field value if set, zero value otherwise. func (o *Event) GetLevel() string { if o == nil || o.Level == nil { @@ -376,6 +392,7 @@ func (o *Event) SetLevel(v string) { o.Level = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *Event) GetReason() string { if o == nil || o.Reason == nil { @@ -404,6 +421,8 @@ func (o *Event) SetReason(v string) { o.Reason = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Event) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -449,19 +468,19 @@ func (o Event) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Event) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Group *string `json:"group"` - Kind *string `json:"kind"` - Name *string `json:"name"` - Namespace *string `json:"namespace"` - Owners []Owner `json:"owners,omitempty"` - Progress *string `json:"progress,omitempty"` - Message *string `json:"message,omitempty"` + Group *string `json:"group"` + Kind *string `json:"kind"` + Name *string `json:"name"` + Namespace *string `json:"namespace"` + Owners []Owner `json:"owners,omitempty"` + Progress *string `json:"progress,omitempty"` + Message *string `json:"message,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` - Type *string `json:"type"` - Version *string `json:"version,omitempty"` - Time *string `json:"time,omitempty"` - Level *string `json:"level,omitempty"` - Reason *string `json:"reason,omitempty"` + Type *string `json:"type"` + Version *string `json:"version,omitempty"` + Time *string `json:"time,omitempty"` + Level *string `json:"level,omitempty"` + Reason *string `json:"reason,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -483,7 +502,7 @@ func (o *Event) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"group", "kind", "name", "namespace", "owners", "progress", "message", "resourceVersion", "type", "version", "time", "level", "reason"}) + common.DeleteKeys(additionalProperties, &[]string{ "group", "kind", "name", "namespace", "owners", "progress", "message", "resourceVersion", "type", "version", "time", "level", "reason", }) } else { return err } diff --git a/api/kbcloud/admin/model_event_list.go b/api/kbcloud/admin/model_event_list.go index 74771c9a..c02a1436 100644 --- a/api/kbcloud/admin/model_event_list.go +++ b/api/kbcloud/admin/model_event_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EventList EventList is a list of operation event objects + + +// EventList EventList is a list of operation event objects type EventList struct { // Items is the list of operation event objects in the list Items []Cluster_event `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEventList instantiates a new EventList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewEventListWithDefaults() *EventList { this := EventList{} return &this } - // GetItems returns the Items field value. func (o *EventList) GetItems() []Cluster_event { if o == nil { @@ -60,6 +65,8 @@ func (o *EventList) SetItems(v []Cluster_event) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EventList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *EventList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_event_resource_type.go b/api/kbcloud/admin/model_event_resource_type.go index c3987653..6663b555 100644 --- a/api/kbcloud/admin/model_event_resource_type.go +++ b/api/kbcloud/admin/model_event_resource_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EventResourceType Type of the resource type EventResourceType string // List of EventResourceType. const ( EventResourceTypeCluster EventResourceType = "cluster" - EventResourceTypeRole EventResourceType = "role" + EventResourceTypeRole EventResourceType = "role" ) var allowedEventResourceTypeEnumValues = []EventResourceType{ diff --git a/api/kbcloud/admin/model_event_result_status.go b/api/kbcloud/admin/model_event_result_status.go index 37deff7a..01cd5048 100644 --- a/api/kbcloud/admin/model_event_result_status.go +++ b/api/kbcloud/admin/model_event_result_status.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EventResultStatus result status of the operation event type EventResultStatus string // List of EventResultStatus. const ( EventResultStatusSuccess EventResultStatus = "success" - EventResultStatusFailed EventResultStatus = "failed" + EventResultStatusFailed EventResultStatus = "failed" ) var allowedEventResultStatusEnumValues = []EventResultStatus{ diff --git a/api/kbcloud/admin/model_event_source.go b/api/kbcloud/admin/model_event_source.go index bc33e62c..39696550 100644 --- a/api/kbcloud/admin/model_event_source.go +++ b/api/kbcloud/admin/model_event_source.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EventSource event source type EventSource string // List of EventSource. const ( - EventSourceUser EventSource = "user" + EventSourceUser EventSource = "user" EventSourceSystem EventSource = "system" ) diff --git a/api/kbcloud/admin/model_fault.go b/api/kbcloud/admin/model_fault.go index 3265dbbb..be2dd06b 100644 --- a/api/kbcloud/admin/model_fault.go +++ b/api/kbcloud/admin/model_fault.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Fault response of the fault + + +// Fault response of the fault type Fault struct { // id of the fault Id *string `json:"id,omitempty"` @@ -39,10 +44,11 @@ type Fault struct { // create time of the fault CreateTime *time.Time `json:"createTime,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFault instantiates a new Fault object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -59,7 +65,6 @@ func NewFaultWithDefaults() *Fault { this := Fault{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Fault) GetId() string { if o == nil || o.Id == nil { @@ -88,6 +93,7 @@ func (o *Fault) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Fault) GetName() string { if o == nil || o.Name == nil { @@ -116,6 +122,7 @@ func (o *Fault) SetName(v string) { o.Name = &v } + // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *Fault) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -144,6 +151,7 @@ func (o *Fault) SetNamespace(v string) { o.Namespace = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *Fault) GetType() string { if o == nil || o.Type == nil { @@ -172,6 +180,7 @@ func (o *Fault) SetType(v string) { o.Type = &v } + // GetAction returns the Action field value if set, zero value otherwise. func (o *Fault) GetAction() string { if o == nil || o.Action == nil { @@ -200,6 +209,7 @@ func (o *Fault) SetAction(v string) { o.Action = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Fault) GetStatus() string { if o == nil || o.Status == nil { @@ -228,6 +238,7 @@ func (o *Fault) SetStatus(v string) { o.Status = &v } + // GetDuration returns the Duration field value if set, zero value otherwise. func (o *Fault) GetDuration() string { if o == nil || o.Duration == nil { @@ -256,6 +267,7 @@ func (o *Fault) SetDuration(v string) { o.Duration = &v } + // GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. func (o *Fault) GetEnvironmentId() string { if o == nil || o.EnvironmentId == nil { @@ -284,6 +296,7 @@ func (o *Fault) SetEnvironmentId(v string) { o.EnvironmentId = &v } + // GetEnvironmentName returns the EnvironmentName field value if set, zero value otherwise. func (o *Fault) GetEnvironmentName() string { if o == nil || o.EnvironmentName == nil { @@ -312,6 +325,7 @@ func (o *Fault) SetEnvironmentName(v string) { o.EnvironmentName = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *Fault) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -340,6 +354,7 @@ func (o *Fault) SetOrgName(v string) { o.OrgName = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *Fault) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -368,6 +383,7 @@ func (o *Fault) SetClusterId(v string) { o.ClusterId = &v } + // GetClusterName returns the ClusterName field value if set, zero value otherwise. func (o *Fault) GetClusterName() string { if o == nil || o.ClusterName == nil { @@ -396,6 +412,7 @@ func (o *Fault) SetClusterName(v string) { o.ClusterName = &v } + // GetCreateTime returns the CreateTime field value if set, zero value otherwise. func (o *Fault) GetCreateTime() time.Time { if o == nil || o.CreateTime == nil { @@ -424,6 +441,8 @@ func (o *Fault) SetCreateTime(v time.Time) { o.CreateTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Fault) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -483,26 +502,26 @@ func (o Fault) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Fault) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Type *string `json:"type,omitempty"` - Action *string `json:"action,omitempty"` - Status *string `json:"status,omitempty"` - Duration *string `json:"duration,omitempty"` - EnvironmentId *string `json:"environmentID,omitempty"` - EnvironmentName *string `json:"environmentName,omitempty"` - OrgName *string `json:"orgName,omitempty"` - ClusterId *string `json:"clusterID,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - CreateTime *time.Time `json:"createTime,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Type *string `json:"type,omitempty"` + Action *string `json:"action,omitempty"` + Status *string `json:"status,omitempty"` + Duration *string `json:"duration,omitempty"` + EnvironmentId *string `json:"environmentID,omitempty"` + EnvironmentName *string `json:"environmentName,omitempty"` + OrgName *string `json:"orgName,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + CreateTime *time.Time `json:"createTime,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "namespace", "type", "action", "status", "duration", "environmentID", "environmentName", "orgName", "clusterID", "clusterName", "createTime"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "namespace", "type", "action", "status", "duration", "environmentID", "environmentName", "orgName", "clusterID", "clusterName", "createTime", }) } else { return err } diff --git a/api/kbcloud/admin/model_fault_list.go b/api/kbcloud/admin/model_fault_list.go index 79d41f0f..147fd881 100644 --- a/api/kbcloud/admin/model_fault_list.go +++ b/api/kbcloud/admin/model_fault_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// FaultList chaos list + + +// FaultList chaos list type FaultList struct { // list of chaos Items []Fault `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFaultList instantiates a new FaultList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewFaultListWithDefaults() *FaultList { this := FaultList{} return &this } - // GetItems returns the Items field value. func (o *FaultList) GetItems() []Fault { if o == nil { @@ -62,6 +67,7 @@ func (o *FaultList) SetItems(v []Fault) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *FaultList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *FaultList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o FaultList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o FaultList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *FaultList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Fault `json:"items"` + Items *[]Fault `json:"items"` PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,14 +129,14 @@ func (o *FaultList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_fault_type.go b/api/kbcloud/admin/model_fault_type.go index 31704a9a..26aef7cf 100644 --- a/api/kbcloud/admin/model_fault_type.go +++ b/api/kbcloud/admin/model_fault_type.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type FaultType string // List of FaultType. const ( - FaultTypePodChaos FaultType = "PodChaos" + FaultTypePodChaos FaultType = "PodChaos" FaultTypeNetworkChaos FaultType = "NetworkChaos" - FaultTypeIoChaos FaultType = "IoChaos" - FaultTypeTimeChaos FaultType = "TimeChaos" - FaultTypeStressChaos FaultType = "StressChaos" + FaultTypeIoChaos FaultType = "IoChaos" + FaultTypeTimeChaos FaultType = "TimeChaos" + FaultTypeStressChaos FaultType = "StressChaos" ) var allowedFaultTypeEnumValues = []FaultType{ diff --git a/api/kbcloud/admin/model_feature.go b/api/kbcloud/admin/model_feature.go index ad5c0b5b..8b5efce5 100644 --- a/api/kbcloud/admin/model_feature.go +++ b/api/kbcloud/admin/model_feature.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type Feature struct { // Name of a feature Name string `json:"name"` @@ -18,10 +23,11 @@ type Feature struct { // Indicates the maturity level of a feature PreRelease FeaturePreReleaseType `json:"preRelease"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFeature instantiates a new Feature object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewFeatureWithDefaults() *Feature { this := Feature{} return &this } - // GetName returns the Name field value. func (o *Feature) GetName() string { if o == nil { @@ -65,6 +70,7 @@ func (o *Feature) SetName(v string) { o.Name = v } + // GetEnabled returns the Enabled field value. func (o *Feature) GetEnabled() bool { if o == nil { @@ -88,6 +94,7 @@ func (o *Feature) SetEnabled(v bool) { o.Enabled = v } + // GetPreRelease returns the PreRelease field value. func (o *Feature) GetPreRelease() FeaturePreReleaseType { if o == nil { @@ -111,6 +118,8 @@ func (o *Feature) SetPreRelease(v FeaturePreReleaseType) { o.PreRelease = v } + + // MarshalJSON serializes the struct using spec logic. func (o Feature) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -130,8 +139,8 @@ func (o Feature) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Feature) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Enabled *bool `json:"enabled"` + Name *string `json:"name"` + Enabled *bool `json:"enabled"` PreRelease *FeaturePreReleaseType `json:"preRelease"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -148,7 +157,7 @@ func (o *Feature) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "enabled", "preRelease"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "enabled", "preRelease", }) } else { return err } diff --git a/api/kbcloud/admin/model_feature_list.go b/api/kbcloud/admin/model_feature_list.go index 3a45f903..5909c86b 100644 --- a/api/kbcloud/admin/model_feature_list.go +++ b/api/kbcloud/admin/model_feature_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// FeatureList A list of feature + + +// FeatureList A list of feature type FeatureList struct { // The list of feature Items []Feature `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFeatureList instantiates a new FeatureList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewFeatureListWithDefaults() *FeatureList { this := FeatureList{} return &this } - // GetItems returns the Items field value. func (o *FeatureList) GetItems() []Feature { if o == nil { @@ -60,6 +65,8 @@ func (o *FeatureList) SetItems(v []Feature) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o FeatureList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *FeatureList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_feature_pre_release_type.go b/api/kbcloud/admin/model_feature_pre_release_type.go index 4edb99b2..f276bbc1 100644 --- a/api/kbcloud/admin/model_feature_pre_release_type.go +++ b/api/kbcloud/admin/model_feature_pre_release_type.go @@ -2,22 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // FeaturePreReleaseType Indicates the maturity level of a feature type FeaturePreReleaseType string // List of FeaturePreReleaseType. const ( - FeaturePreReleaseTypeAlpha FeaturePreReleaseType = "ALPHA" - FeaturePreReleaseTypeBeta FeaturePreReleaseType = "BETA" - FeaturePreReleaseTypeEmpty FeaturePreReleaseType = "" + FeaturePreReleaseTypeAlpha FeaturePreReleaseType = "ALPHA" + FeaturePreReleaseTypeBeta FeaturePreReleaseType = "BETA" + FeaturePreReleaseTypeEmpty FeaturePreReleaseType = "" FeaturePreReleaseTypeDeprecated FeaturePreReleaseType = "DEPRECATED" ) diff --git a/api/kbcloud/admin/model_file_entry.go b/api/kbcloud/admin/model_file_entry.go index 84260df5..64bc279c 100644 --- a/api/kbcloud/admin/model_file_entry.go +++ b/api/kbcloud/admin/model_file_entry.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// FileEntry the entry of files + + +// FileEntry the entry of files type FileEntry struct { // description the entry type IsDir *bool `json:"IsDir,omitempty"` @@ -17,10 +26,11 @@ type FileEntry struct { // the size of entry Size *int64 `json:"size,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFileEntry instantiates a new FileEntry object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewFileEntryWithDefaults() *FileEntry { this := FileEntry{} return &this } - // GetIsDir returns the IsDir field value if set, zero value otherwise. func (o *FileEntry) GetIsDir() bool { if o == nil || o.IsDir == nil { @@ -66,6 +75,7 @@ func (o *FileEntry) SetIsDir(v bool) { o.IsDir = &v } + // GetFullPath returns the FullPath field value if set, zero value otherwise. func (o *FileEntry) GetFullPath() string { if o == nil || o.FullPath == nil { @@ -94,6 +104,7 @@ func (o *FileEntry) SetFullPath(v string) { o.FullPath = &v } + // GetFilename returns the Filename field value if set, zero value otherwise. func (o *FileEntry) GetFilename() string { if o == nil || o.Filename == nil { @@ -122,6 +133,7 @@ func (o *FileEntry) SetFilename(v string) { o.Filename = &v } + // GetSize returns the Size field value if set, zero value otherwise. func (o *FileEntry) GetSize() int64 { if o == nil || o.Size == nil { @@ -150,6 +162,8 @@ func (o *FileEntry) SetSize(v int64) { o.Size = &v } + + // MarshalJSON serializes the struct using spec logic. func (o FileEntry) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -178,17 +192,17 @@ func (o FileEntry) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *FileEntry) UnmarshalJSON(bytes []byte) (err error) { all := struct { - IsDir *bool `json:"IsDir,omitempty"` + IsDir *bool `json:"IsDir,omitempty"` FullPath *string `json:"fullPath,omitempty"` Filename *string `json:"filename,omitempty"` - Size *int64 `json:"size,omitempty"` + Size *int64 `json:"size,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"IsDir", "fullPath", "filename", "size"}) + common.DeleteKeys(additionalProperties, &[]string{ "IsDir", "fullPath", "filename", "size", }) } else { return err } diff --git a/api/kbcloud/admin/model_file_entry_list.go b/api/kbcloud/admin/model_file_entry_list.go index 66d9a58a..6c083a8f 100644 --- a/api/kbcloud/admin/model_file_entry_list.go +++ b/api/kbcloud/admin/model_file_entry_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// FileEntryList BackupEntryList is a list of entry + + +// FileEntryList BackupEntryList is a list of entry type FileEntryList struct { // Items is the list of backup entry Items []FileEntry `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFileEntryList instantiates a new FileEntryList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewFileEntryListWithDefaults() *FileEntryList { this := FileEntryList{} return &this } - // GetItems returns the Items field value. func (o *FileEntryList) GetItems() []FileEntry { if o == nil { @@ -62,6 +67,7 @@ func (o *FileEntryList) SetItems(v []FileEntry) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *FileEntryList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *FileEntryList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o FileEntryList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o FileEntryList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *FileEntryList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]FileEntry `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]FileEntry `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *FileEntryList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_float_option.go b/api/kbcloud/admin/model_float_option.go index 717f1256..c446c605 100644 --- a/api/kbcloud/admin/model_float_option.go +++ b/api/kbcloud/admin/model_float_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type FloatOption struct { - Min float64 `json:"min"` - Max float64 `json:"max"` + Min float64 `json:"min"` + Max float64 `json:"max"` Default float64 `json:"default"` - Step float64 `json:"step"` + Step float64 `json:"step"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFloatOption instantiates a new FloatOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewFloatOptionWithDefaults() *FloatOption { this := FloatOption{} return &this } - // GetMin returns the Min field value. func (o *FloatOption) GetMin() float64 { if o == nil { @@ -64,6 +69,7 @@ func (o *FloatOption) SetMin(v float64) { o.Min = v } + // GetMax returns the Max field value. func (o *FloatOption) GetMax() float64 { if o == nil { @@ -87,6 +93,7 @@ func (o *FloatOption) SetMax(v float64) { o.Max = v } + // GetDefault returns the Default field value. func (o *FloatOption) GetDefault() float64 { if o == nil { @@ -110,6 +117,7 @@ func (o *FloatOption) SetDefault(v float64) { o.Default = v } + // GetStep returns the Step field value. func (o *FloatOption) GetStep() float64 { if o == nil { @@ -133,6 +141,8 @@ func (o *FloatOption) SetStep(v float64) { o.Step = v } + + // MarshalJSON serializes the struct using spec logic. func (o FloatOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,10 +163,10 @@ func (o FloatOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *FloatOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Min *float64 `json:"min"` - Max *float64 `json:"max"` + Min *float64 `json:"min"` + Max *float64 `json:"max"` Default *float64 `json:"default"` - Step *float64 `json:"step"` + Step *float64 `json:"step"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -175,7 +185,7 @@ func (o *FloatOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"min", "max", "default", "step"}) + common.DeleteKeys(additionalProperties, &[]string{ "min", "max", "default", "step", }) } else { return err } diff --git a/api/kbcloud/admin/model_ha_history_response.go b/api/kbcloud/admin/model_ha_history_response.go index 09ab1be9..2f1e34e1 100644 --- a/api/kbcloud/admin/model_ha_history_response.go +++ b/api/kbcloud/admin/model_ha_history_response.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// HaHistoryResponse hahistory is the payload to get ha history of a KubeBlocks cluster +// HaHistoryResponse hahistory is the payload to get ha history of a KubeBlocks cluster type HaHistoryResponse struct { - ComponentName *string `json:"componentName,omitempty"` - Records []HaHistoryResponseRecordsItem `json:"records,omitempty"` + ComponentName *string `json:"componentName,omitempty"` + Records []HaHistoryResponseRecordsItem `json:"records,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewHaHistoryResponse instantiates a new HaHistoryResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewHaHistoryResponseWithDefaults() *HaHistoryResponse { this := HaHistoryResponse{} return &this } - // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *HaHistoryResponse) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -60,6 +69,7 @@ func (o *HaHistoryResponse) SetComponentName(v string) { o.ComponentName = &v } + // GetRecords returns the Records field value if set, zero value otherwise. func (o *HaHistoryResponse) GetRecords() []HaHistoryResponseRecordsItem { if o == nil || o.Records == nil { @@ -88,6 +98,8 @@ func (o *HaHistoryResponse) SetRecords(v []HaHistoryResponseRecordsItem) { o.Records = v } + + // MarshalJSON serializes the struct using spec logic. func (o HaHistoryResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,15 +122,15 @@ func (o HaHistoryResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *HaHistoryResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ComponentName *string `json:"componentName,omitempty"` - Records []HaHistoryResponseRecordsItem `json:"records,omitempty"` + ComponentName *string `json:"componentName,omitempty"` + Records []HaHistoryResponseRecordsItem `json:"records,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"componentName", "records"}) + common.DeleteKeys(additionalProperties, &[]string{ "componentName", "records", }) } else { return err } diff --git a/api/kbcloud/admin/model_ha_history_response_records_item.go b/api/kbcloud/admin/model_ha_history_response_records_item.go index f1839ccd..89eaab01 100644 --- a/api/kbcloud/admin/model_ha_history_response_records_item.go +++ b/api/kbcloud/admin/model_ha_history_response_records_item.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type HaHistoryResponseRecordsItem struct { - StartAt int32 `json:"StartAt"` - EndAt *int32 `json:"EndAt,omitempty"` + StartAt int32 `json:"StartAt"` + EndAt *int32 `json:"EndAt,omitempty"` OldPrimary *string `json:"OldPrimary,omitempty"` NewPrimary *string `json:"NewPrimary,omitempty"` - Reason *string `json:"Reason,omitempty"` - UserId *string `json:"UserID,omitempty"` - UserName *string `json:"UserName,omitempty"` + Reason *string `json:"Reason,omitempty"` + UserId *string `json:"UserID,omitempty"` + UserName *string `json:"UserName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewHaHistoryResponseRecordsItem instantiates a new HaHistoryResponseRecordsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewHaHistoryResponseRecordsItemWithDefaults() *HaHistoryResponseRecordsItem this := HaHistoryResponseRecordsItem{} return &this } - // GetStartAt returns the StartAt field value. func (o *HaHistoryResponseRecordsItem) GetStartAt() int32 { if o == nil { @@ -64,6 +69,7 @@ func (o *HaHistoryResponseRecordsItem) SetStartAt(v int32) { o.StartAt = v } + // GetEndAt returns the EndAt field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetEndAt() int32 { if o == nil || o.EndAt == nil { @@ -92,6 +98,7 @@ func (o *HaHistoryResponseRecordsItem) SetEndAt(v int32) { o.EndAt = &v } + // GetOldPrimary returns the OldPrimary field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetOldPrimary() string { if o == nil || o.OldPrimary == nil { @@ -120,6 +127,7 @@ func (o *HaHistoryResponseRecordsItem) SetOldPrimary(v string) { o.OldPrimary = &v } + // GetNewPrimary returns the NewPrimary field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetNewPrimary() string { if o == nil || o.NewPrimary == nil { @@ -148,6 +156,7 @@ func (o *HaHistoryResponseRecordsItem) SetNewPrimary(v string) { o.NewPrimary = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetReason() string { if o == nil || o.Reason == nil { @@ -176,6 +185,7 @@ func (o *HaHistoryResponseRecordsItem) SetReason(v string) { o.Reason = &v } + // GetUserId returns the UserId field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetUserId() string { if o == nil || o.UserId == nil { @@ -204,6 +214,7 @@ func (o *HaHistoryResponseRecordsItem) SetUserId(v string) { o.UserId = &v } + // GetUserName returns the UserName field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetUserName() string { if o == nil || o.UserName == nil { @@ -232,6 +243,8 @@ func (o *HaHistoryResponseRecordsItem) SetUserName(v string) { o.UserName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o HaHistoryResponseRecordsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -267,13 +280,13 @@ func (o HaHistoryResponseRecordsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *HaHistoryResponseRecordsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - StartAt *int32 `json:"StartAt"` - EndAt *int32 `json:"EndAt,omitempty"` + StartAt *int32 `json:"StartAt"` + EndAt *int32 `json:"EndAt,omitempty"` OldPrimary *string `json:"OldPrimary,omitempty"` NewPrimary *string `json:"NewPrimary,omitempty"` - Reason *string `json:"Reason,omitempty"` - UserId *string `json:"UserID,omitempty"` - UserName *string `json:"UserName,omitempty"` + Reason *string `json:"Reason,omitempty"` + UserId *string `json:"UserID,omitempty"` + UserName *string `json:"UserName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -283,7 +296,7 @@ func (o *HaHistoryResponseRecordsItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"StartAt", "EndAt", "OldPrimary", "NewPrimary", "Reason", "UserID", "UserName"}) + common.DeleteKeys(additionalProperties, &[]string{ "StartAt", "EndAt", "OldPrimary", "NewPrimary", "Reason", "UserID", "UserName", }) } else { return err } diff --git a/api/kbcloud/admin/model_http_body.go b/api/kbcloud/admin/model_http_body.go index 0ddae9ca..36149bd6 100644 --- a/api/kbcloud/admin/model_http_body.go +++ b/api/kbcloud/admin/model_http_body.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// HttpBody Represents an HTTP request or response body. +// HttpBody Represents an HTTP request or response body. type HttpBody struct { // The HTTP Content-Type header value specifying the content type of the body. ContentType *string `json:"contentType,omitempty"` // The HTTP request/response body as raw binary. Data *string `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewHttpBody instantiates a new HttpBody object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewHttpBodyWithDefaults() *HttpBody { this := HttpBody{} return &this } - // GetContentType returns the ContentType field value if set, zero value otherwise. func (o *HttpBody) GetContentType() string { if o == nil || o.ContentType == nil { @@ -62,6 +71,7 @@ func (o *HttpBody) SetContentType(v string) { o.ContentType = &v } + // GetData returns the Data field value if set, zero value otherwise. func (o *HttpBody) GetData() string { if o == nil || o.Data == nil { @@ -90,6 +100,8 @@ func (o *HttpBody) SetData(v string) { o.Data = &v } + + // MarshalJSON serializes the struct using spec logic. func (o HttpBody) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -113,14 +125,14 @@ func (o HttpBody) MarshalJSON() ([]byte, error) { func (o *HttpBody) UnmarshalJSON(bytes []byte) (err error) { all := struct { ContentType *string `json:"contentType,omitempty"` - Data *string `json:"data,omitempty"` + Data *string `json:"data,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"contentType", "data"}) + common.DeleteKeys(additionalProperties, &[]string{ "contentType", "data", }) } else { return err } diff --git a/api/kbcloud/admin/model_iac.go b/api/kbcloud/admin/model_iac.go index d2484b37..aacdfa94 100644 --- a/api/kbcloud/admin/model_iac.go +++ b/api/kbcloud/admin/model_iac.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Iac Create environment by IaC + + +// Iac Create environment by IaC type Iac struct { // Role used to do AssumeRole action Role string `json:"role"` @@ -19,10 +24,11 @@ type Iac struct { // Computing instance type InstanceType *string `json:"instanceType,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewIac instantiates a new Iac object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewIacWithDefaults() *Iac { this := Iac{} return &this } - // GetRole returns the Role field value. func (o *Iac) GetRole() string { if o == nil { @@ -64,6 +69,7 @@ func (o *Iac) SetRole(v string) { o.Role = v } + // GetDesiredNodeSize returns the DesiredNodeSize field value if set, zero value otherwise. func (o *Iac) GetDesiredNodeSize() int32 { if o == nil || o.DesiredNodeSize == nil { @@ -92,6 +98,7 @@ func (o *Iac) SetDesiredNodeSize(v int32) { o.DesiredNodeSize = &v } + // GetInstanceType returns the InstanceType field value if set, zero value otherwise. func (o *Iac) GetInstanceType() string { if o == nil || o.InstanceType == nil { @@ -120,6 +127,8 @@ func (o *Iac) SetInstanceType(v string) { o.InstanceType = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Iac) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,9 +152,9 @@ func (o Iac) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Iac) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Role *string `json:"role"` - DesiredNodeSize *int32 `json:"desiredNodeSize,omitempty"` - InstanceType *string `json:"instanceType,omitempty"` + Role *string `json:"role"` + DesiredNodeSize *int32 `json:"desiredNodeSize,omitempty"` + InstanceType *string `json:"instanceType,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -155,7 +164,7 @@ func (o *Iac) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"role", "desiredNodeSize", "instanceType"}) + common.DeleteKeys(additionalProperties, &[]string{ "role", "desiredNodeSize", "instanceType", }) } else { return err } diff --git a/api/kbcloud/admin/model_image_registry.go b/api/kbcloud/admin/model_image_registry.go index ce27e07a..7130c533 100644 --- a/api/kbcloud/admin/model_image_registry.go +++ b/api/kbcloud/admin/model_image_registry.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ImageRegistry Represents an image registry. + + +// ImageRegistry Represents an image registry. type ImageRegistry struct { // The name of the image registry. Name string `json:"name"` @@ -28,10 +32,11 @@ type ImageRegistry struct { // The date and time when the image registry was last updated. UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewImageRegistry instantiates a new ImageRegistry object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -50,7 +55,6 @@ func NewImageRegistryWithDefaults() *ImageRegistry { this := ImageRegistry{} return &this } - // GetName returns the Name field value. func (o *ImageRegistry) GetName() string { if o == nil { @@ -74,6 +78,7 @@ func (o *ImageRegistry) SetName(v string) { o.Name = v } + // GetUrl returns the Url field value. func (o *ImageRegistry) GetUrl() string { if o == nil { @@ -97,6 +102,7 @@ func (o *ImageRegistry) SetUrl(v string) { o.Url = v } + // GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageRegistry) GetUsername() string { if o == nil || o.Username.Get() == nil { @@ -110,7 +116,7 @@ func (o *ImageRegistry) GetUsername() string { // 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 *ImageRegistry) GetUsernameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Username.Get(), o.Username.IsSet() @@ -125,7 +131,6 @@ func (o *ImageRegistry) HasUsername() bool { func (o *ImageRegistry) SetUsername(v string) { o.Username.Set(&v) } - // SetUsernameNil sets the value for Username to be an explicit nil. func (o *ImageRegistry) SetUsernameNil() { o.Username.Set(nil) @@ -136,6 +141,7 @@ func (o *ImageRegistry) UnsetUsername() { o.Username.Unset() } + // GetPassword returns the Password field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageRegistry) GetPassword() string { if o == nil || o.Password.Get() == nil { @@ -149,7 +155,7 @@ func (o *ImageRegistry) GetPassword() string { // 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 *ImageRegistry) GetPasswordOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Password.Get(), o.Password.IsSet() @@ -164,7 +170,6 @@ func (o *ImageRegistry) HasPassword() bool { func (o *ImageRegistry) SetPassword(v string) { o.Password.Set(&v) } - // SetPasswordNil sets the value for Password to be an explicit nil. func (o *ImageRegistry) SetPasswordNil() { o.Password.Set(nil) @@ -175,6 +180,7 @@ func (o *ImageRegistry) UnsetPassword() { o.Password.Unset() } + // GetId returns the Id field value if set, zero value otherwise. func (o *ImageRegistry) GetId() string { if o == nil || o.Id == nil { @@ -203,6 +209,7 @@ func (o *ImageRegistry) SetId(v string) { o.Id = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *ImageRegistry) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -231,6 +238,7 @@ func (o *ImageRegistry) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *ImageRegistry) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -259,6 +267,8 @@ func (o *ImageRegistry) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ImageRegistry) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -300,13 +310,13 @@ func (o ImageRegistry) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ImageRegistry) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Url *string `json:"url"` - Username common.NullableString `json:"username,omitempty"` - Password common.NullableString `json:"password,omitempty"` - Id *string `json:"id,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Name *string `json:"name"` + Url *string `json:"url"` + Username common.NullableString `json:"username,omitempty"` + Password common.NullableString `json:"password,omitempty"` + Id *string `json:"id,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -319,7 +329,7 @@ func (o *ImageRegistry) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "url", "username", "password", "id", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "url", "username", "password", "id", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_image_registry_list.go b/api/kbcloud/admin/model_image_registry_list.go index 4fce6536..50accdc0 100644 --- a/api/kbcloud/admin/model_image_registry_list.go +++ b/api/kbcloud/admin/model_image_registry_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ImageRegistryList imageRegistryList is a list of imageRegistry + + +// ImageRegistryList imageRegistryList is a list of imageRegistry type ImageRegistryList struct { // Items is the list of imageRegistry objects in the list Items []ImageRegistry `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewImageRegistryList instantiates a new ImageRegistryList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewImageRegistryListWithDefaults() *ImageRegistryList { this := ImageRegistryList{} return &this } - // GetItems returns the Items field value. func (o *ImageRegistryList) GetItems() []ImageRegistry { if o == nil { @@ -60,6 +65,8 @@ func (o *ImageRegistryList) SetItems(v []ImageRegistry) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ImageRegistryList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *ImageRegistryList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_init_options_item.go b/api/kbcloud/admin/model_init_options_item.go index 1e98cd19..d2503853 100644 --- a/api/kbcloud/admin/model_init_options_item.go +++ b/api/kbcloud/admin/model_init_options_item.go @@ -2,23 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type InitOptionsItem struct { // component type, refer to componentDef and support NamePrefix' Component *string `json:"component,omitempty"` // component type, refer to componentDef and support NamePrefix, Deprecated - ComponentDefRef *string `json:"componentDefRef,omitempty"` - InitParams map[string]string `json:"initParams,omitempty"` + ComponentDefRef *string `json:"componentDefRef,omitempty"` + InitParams map[string]string `json:"initParams,omitempty"` // config spec name SpecName *string `json:"specName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInitOptionsItem instantiates a new InitOptionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewInitOptionsItemWithDefaults() *InitOptionsItem { this := InitOptionsItem{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *InitOptionsItem) GetComponent() string { if o == nil || o.Component == nil { @@ -64,6 +73,7 @@ func (o *InitOptionsItem) SetComponent(v string) { o.Component = &v } + // GetComponentDefRef returns the ComponentDefRef field value if set, zero value otherwise. func (o *InitOptionsItem) GetComponentDefRef() string { if o == nil || o.ComponentDefRef == nil { @@ -92,6 +102,7 @@ func (o *InitOptionsItem) SetComponentDefRef(v string) { o.ComponentDefRef = &v } + // GetInitParams returns the InitParams field value if set, zero value otherwise. func (o *InitOptionsItem) GetInitParams() map[string]string { if o == nil || o.InitParams == nil { @@ -120,6 +131,7 @@ func (o *InitOptionsItem) SetInitParams(v map[string]string) { o.InitParams = v } + // GetSpecName returns the SpecName field value if set, zero value otherwise. func (o *InitOptionsItem) GetSpecName() string { if o == nil || o.SpecName == nil { @@ -148,6 +160,8 @@ func (o *InitOptionsItem) SetSpecName(v string) { o.SpecName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InitOptionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -176,17 +190,17 @@ func (o InitOptionsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InitOptionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - ComponentDefRef *string `json:"componentDefRef,omitempty"` - InitParams map[string]string `json:"initParams,omitempty"` - SpecName *string `json:"specName,omitempty"` + Component *string `json:"component,omitempty"` + ComponentDefRef *string `json:"componentDefRef,omitempty"` + InitParams map[string]string `json:"initParams,omitempty"` + SpecName *string `json:"specName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "componentDefRef", "initParams", "specName"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "componentDefRef", "initParams", "specName", }) } else { return err } diff --git a/api/kbcloud/admin/model_inspection.go b/api/kbcloud/admin/model_inspection.go index 9c6177a8..72d6f85d 100644 --- a/api/kbcloud/admin/model_inspection.go +++ b/api/kbcloud/admin/model_inspection.go @@ -2,38 +2,44 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Inspection inspection + + +// Inspection inspection type Inspection struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Creator *string `json:"creator,omitempty"` - ClusterId *string `json:"clusterID,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - ClusterEngine *string `json:"clusterEngine,omitempty"` - Result *string `json:"result,omitempty"` - Severity *string `json:"severity,omitempty"` - Status *string `json:"status,omitempty"` - IsAuto *bool `json:"isAuto,omitempty"` - ScriptId *int32 `json:"scriptID,omitempty"` - ScriptName *string `json:"scriptName,omitempty"` - ScriptCategory *string `json:"scriptCategory,omitempty"` - Reason *string `json:"reason,omitempty"` - Suggestion *string `json:"suggestion,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Creator *string `json:"creator,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + ClusterEngine *string `json:"clusterEngine,omitempty"` + Result *string `json:"result,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + IsAuto *bool `json:"isAuto,omitempty"` + ScriptId *int32 `json:"scriptID,omitempty"` + ScriptName *string `json:"scriptName,omitempty"` + ScriptCategory *string `json:"scriptCategory,omitempty"` + Reason *string `json:"reason,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInspection instantiates a new Inspection object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -50,7 +56,6 @@ func NewInspectionWithDefaults() *Inspection { this := Inspection{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Inspection) GetId() int32 { if o == nil || o.Id == nil { @@ -79,6 +84,7 @@ func (o *Inspection) SetId(v int32) { o.Id = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *Inspection) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -107,6 +113,7 @@ func (o *Inspection) SetOrgName(v string) { o.OrgName = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Inspection) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -135,6 +142,7 @@ func (o *Inspection) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Inspection) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -163,6 +171,7 @@ func (o *Inspection) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetCreator returns the Creator field value if set, zero value otherwise. func (o *Inspection) GetCreator() string { if o == nil || o.Creator == nil { @@ -191,6 +200,7 @@ func (o *Inspection) SetCreator(v string) { o.Creator = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *Inspection) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -219,6 +229,7 @@ func (o *Inspection) SetClusterId(v string) { o.ClusterId = &v } + // GetClusterName returns the ClusterName field value if set, zero value otherwise. func (o *Inspection) GetClusterName() string { if o == nil || o.ClusterName == nil { @@ -247,6 +258,7 @@ func (o *Inspection) SetClusterName(v string) { o.ClusterName = &v } + // GetClusterEngine returns the ClusterEngine field value if set, zero value otherwise. func (o *Inspection) GetClusterEngine() string { if o == nil || o.ClusterEngine == nil { @@ -275,6 +287,7 @@ func (o *Inspection) SetClusterEngine(v string) { o.ClusterEngine = &v } + // GetResult returns the Result field value if set, zero value otherwise. func (o *Inspection) GetResult() string { if o == nil || o.Result == nil { @@ -303,6 +316,7 @@ func (o *Inspection) SetResult(v string) { o.Result = &v } + // GetSeverity returns the Severity field value if set, zero value otherwise. func (o *Inspection) GetSeverity() string { if o == nil || o.Severity == nil { @@ -331,6 +345,7 @@ func (o *Inspection) SetSeverity(v string) { o.Severity = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Inspection) GetStatus() string { if o == nil || o.Status == nil { @@ -359,6 +374,7 @@ func (o *Inspection) SetStatus(v string) { o.Status = &v } + // GetIsAuto returns the IsAuto field value if set, zero value otherwise. func (o *Inspection) GetIsAuto() bool { if o == nil || o.IsAuto == nil { @@ -387,6 +403,7 @@ func (o *Inspection) SetIsAuto(v bool) { o.IsAuto = &v } + // GetScriptId returns the ScriptId field value if set, zero value otherwise. func (o *Inspection) GetScriptId() int32 { if o == nil || o.ScriptId == nil { @@ -415,6 +432,7 @@ func (o *Inspection) SetScriptId(v int32) { o.ScriptId = &v } + // GetScriptName returns the ScriptName field value if set, zero value otherwise. func (o *Inspection) GetScriptName() string { if o == nil || o.ScriptName == nil { @@ -443,6 +461,7 @@ func (o *Inspection) SetScriptName(v string) { o.ScriptName = &v } + // GetScriptCategory returns the ScriptCategory field value if set, zero value otherwise. func (o *Inspection) GetScriptCategory() string { if o == nil || o.ScriptCategory == nil { @@ -471,6 +490,7 @@ func (o *Inspection) SetScriptCategory(v string) { o.ScriptCategory = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *Inspection) GetReason() string { if o == nil || o.Reason == nil { @@ -499,6 +519,7 @@ func (o *Inspection) SetReason(v string) { o.Reason = &v } + // GetSuggestion returns the Suggestion field value if set, zero value otherwise. func (o *Inspection) GetSuggestion() string { if o == nil || o.Suggestion == nil { @@ -527,6 +548,8 @@ func (o *Inspection) SetSuggestion(v string) { o.Suggestion = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Inspection) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -602,30 +625,30 @@ func (o Inspection) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Inspection) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Creator *string `json:"creator,omitempty"` - ClusterId *string `json:"clusterID,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - ClusterEngine *string `json:"clusterEngine,omitempty"` - Result *string `json:"result,omitempty"` - Severity *string `json:"severity,omitempty"` - Status *string `json:"status,omitempty"` - IsAuto *bool `json:"isAuto,omitempty"` - ScriptId *int32 `json:"scriptID,omitempty"` - ScriptName *string `json:"scriptName,omitempty"` - ScriptCategory *string `json:"scriptCategory,omitempty"` - Reason *string `json:"reason,omitempty"` - Suggestion *string `json:"suggestion,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Creator *string `json:"creator,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + ClusterEngine *string `json:"clusterEngine,omitempty"` + Result *string `json:"result,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + IsAuto *bool `json:"isAuto,omitempty"` + ScriptId *int32 `json:"scriptID,omitempty"` + ScriptName *string `json:"scriptName,omitempty"` + ScriptCategory *string `json:"scriptCategory,omitempty"` + Reason *string `json:"reason,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "orgName", "updatedAt", "createdAt", "creator", "clusterID", "clusterName", "clusterEngine", "result", "severity", "status", "isAuto", "scriptID", "scriptName", "scriptCategory", "reason", "suggestion"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "orgName", "updatedAt", "createdAt", "creator", "clusterID", "clusterName", "clusterEngine", "result", "severity", "status", "isAuto", "scriptID", "scriptName", "scriptCategory", "reason", "suggestion", }) } else { return err } diff --git a/api/kbcloud/admin/model_inspection_script.go b/api/kbcloud/admin/model_inspection_script.go index 1c4fa8cd..51e10bf7 100644 --- a/api/kbcloud/admin/model_inspection_script.go +++ b/api/kbcloud/admin/model_inspection_script.go @@ -2,29 +2,39 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type InspectionScript struct { - Id *int32 `json:"id,omitempty"` - Engine *string `json:"engine,omitempty"` - Name *string `json:"name,omitempty"` - Category *string `json:"category,omitempty"` - Type *string `json:"type,omitempty"` - ScriptType *string `json:"scriptType,omitempty"` - Reason *string `json:"reason,omitempty"` - Suggestion *string `json:"suggestion,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - ScriptName *string `json:"scriptName,omitempty"` - Script *string `json:"script,omitempty"` + Id *int32 `json:"id,omitempty"` + Engine *string `json:"engine,omitempty"` + Name *string `json:"name,omitempty"` + Category *string `json:"category,omitempty"` + Type *string `json:"type,omitempty"` + ScriptType *string `json:"scriptType,omitempty"` + Reason *string `json:"reason,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ScriptName *string `json:"scriptName,omitempty"` + Script *string `json:"script,omitempty"` StatusCheckName *string `json:"statusCheckName,omitempty"` - StatusCheck *string `json:"statusCheck,omitempty"` + StatusCheck *string `json:"statusCheck,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInspectionScript instantiates a new InspectionScript object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +51,6 @@ func NewInspectionScriptWithDefaults() *InspectionScript { this := InspectionScript{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *InspectionScript) GetId() int32 { if o == nil || o.Id == nil { @@ -70,6 +79,7 @@ func (o *InspectionScript) SetId(v int32) { o.Id = &v } + // GetEngine returns the Engine field value if set, zero value otherwise. func (o *InspectionScript) GetEngine() string { if o == nil || o.Engine == nil { @@ -98,6 +108,7 @@ func (o *InspectionScript) SetEngine(v string) { o.Engine = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *InspectionScript) GetName() string { if o == nil || o.Name == nil { @@ -126,6 +137,7 @@ func (o *InspectionScript) SetName(v string) { o.Name = &v } + // GetCategory returns the Category field value if set, zero value otherwise. func (o *InspectionScript) GetCategory() string { if o == nil || o.Category == nil { @@ -154,6 +166,7 @@ func (o *InspectionScript) SetCategory(v string) { o.Category = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *InspectionScript) GetType() string { if o == nil || o.Type == nil { @@ -182,6 +195,7 @@ func (o *InspectionScript) SetType(v string) { o.Type = &v } + // GetScriptType returns the ScriptType field value if set, zero value otherwise. func (o *InspectionScript) GetScriptType() string { if o == nil || o.ScriptType == nil { @@ -210,6 +224,7 @@ func (o *InspectionScript) SetScriptType(v string) { o.ScriptType = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *InspectionScript) GetReason() string { if o == nil || o.Reason == nil { @@ -238,6 +253,7 @@ func (o *InspectionScript) SetReason(v string) { o.Reason = &v } + // GetSuggestion returns the Suggestion field value if set, zero value otherwise. func (o *InspectionScript) GetSuggestion() string { if o == nil || o.Suggestion == nil { @@ -266,6 +282,7 @@ func (o *InspectionScript) SetSuggestion(v string) { o.Suggestion = &v } + // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *InspectionScript) GetEnabled() bool { if o == nil || o.Enabled == nil { @@ -294,6 +311,7 @@ func (o *InspectionScript) SetEnabled(v bool) { o.Enabled = &v } + // GetScriptName returns the ScriptName field value if set, zero value otherwise. func (o *InspectionScript) GetScriptName() string { if o == nil || o.ScriptName == nil { @@ -322,6 +340,7 @@ func (o *InspectionScript) SetScriptName(v string) { o.ScriptName = &v } + // GetScript returns the Script field value if set, zero value otherwise. func (o *InspectionScript) GetScript() string { if o == nil || o.Script == nil { @@ -350,6 +369,7 @@ func (o *InspectionScript) SetScript(v string) { o.Script = &v } + // GetStatusCheckName returns the StatusCheckName field value if set, zero value otherwise. func (o *InspectionScript) GetStatusCheckName() string { if o == nil || o.StatusCheckName == nil { @@ -378,6 +398,7 @@ func (o *InspectionScript) SetStatusCheckName(v string) { o.StatusCheckName = &v } + // GetStatusCheck returns the StatusCheck field value if set, zero value otherwise. func (o *InspectionScript) GetStatusCheck() string { if o == nil || o.StatusCheck == nil { @@ -406,6 +427,8 @@ func (o *InspectionScript) SetStatusCheck(v string) { o.StatusCheck = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InspectionScript) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -461,26 +484,26 @@ func (o InspectionScript) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InspectionScript) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - Engine *string `json:"engine,omitempty"` - Name *string `json:"name,omitempty"` - Category *string `json:"category,omitempty"` - Type *string `json:"type,omitempty"` - ScriptType *string `json:"scriptType,omitempty"` - Reason *string `json:"reason,omitempty"` - Suggestion *string `json:"suggestion,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - ScriptName *string `json:"scriptName,omitempty"` - Script *string `json:"script,omitempty"` + Id *int32 `json:"id,omitempty"` + Engine *string `json:"engine,omitempty"` + Name *string `json:"name,omitempty"` + Category *string `json:"category,omitempty"` + Type *string `json:"type,omitempty"` + ScriptType *string `json:"scriptType,omitempty"` + Reason *string `json:"reason,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ScriptName *string `json:"scriptName,omitempty"` + Script *string `json:"script,omitempty"` StatusCheckName *string `json:"statusCheckName,omitempty"` - StatusCheck *string `json:"statusCheck,omitempty"` + StatusCheck *string `json:"statusCheck,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "engine", "name", "category", "type", "scriptType", "reason", "suggestion", "enabled", "scriptName", "script", "statusCheckName", "statusCheck"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "engine", "name", "category", "type", "scriptType", "reason", "suggestion", "enabled", "scriptName", "script", "statusCheckName", "statusCheck", }) } else { return err } diff --git a/api/kbcloud/admin/model_instance.go b/api/kbcloud/admin/model_instance.go index 82582e2a..094e7dea 100644 --- a/api/kbcloud/admin/model_instance.go +++ b/api/kbcloud/admin/model_instance.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Instance Instance is the information of KubeBlocks cluster instances + + +// Instance Instance is the information of KubeBlocks cluster instances type Instance struct { // Access mode for instance AccessMode string `json:"accessMode"` @@ -45,10 +50,11 @@ type Instance struct { // Available zone for instance Zone string `json:"zone"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstance instantiates a new Instance object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -79,7 +85,6 @@ func NewInstanceWithDefaults() *Instance { this := Instance{} return &this } - // GetAccessMode returns the AccessMode field value. func (o *Instance) GetAccessMode() string { if o == nil { @@ -103,6 +108,7 @@ func (o *Instance) SetAccessMode(v string) { o.AccessMode = v } + // GetCloud returns the Cloud field value. func (o *Instance) GetCloud() string { if o == nil { @@ -126,6 +132,7 @@ func (o *Instance) SetCloud(v string) { o.Cloud = v } + // GetCluster returns the Cluster field value. func (o *Instance) GetCluster() string { if o == nil { @@ -149,6 +156,7 @@ func (o *Instance) SetCluster(v string) { o.Cluster = v } + // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *Instance) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -177,6 +185,7 @@ func (o *Instance) SetComponentName(v string) { o.ComponentName = &v } + // GetComponentDef returns the ComponentDef field value if set, zero value otherwise. func (o *Instance) GetComponentDef() string { if o == nil || o.ComponentDef == nil { @@ -205,6 +214,7 @@ func (o *Instance) SetComponentDef(v string) { o.ComponentDef = &v } + // GetComponent returns the Component field value. func (o *Instance) GetComponent() string { if o == nil { @@ -228,6 +238,7 @@ func (o *Instance) SetComponent(v string) { o.Component = v } + // GetCpu returns the Cpu field value. func (o *Instance) GetCpu() string { if o == nil { @@ -251,6 +262,7 @@ func (o *Instance) SetCpu(v string) { o.Cpu = v } + // GetCreatedAt returns the CreatedAt field value. func (o *Instance) GetCreatedAt() string { if o == nil { @@ -274,6 +286,7 @@ func (o *Instance) SetCreatedAt(v string) { o.CreatedAt = v } + // GetMemory returns the Memory field value. func (o *Instance) GetMemory() string { if o == nil { @@ -297,6 +310,7 @@ func (o *Instance) SetMemory(v string) { o.Memory = v } + // GetName returns the Name field value. func (o *Instance) GetName() string { if o == nil { @@ -320,6 +334,7 @@ func (o *Instance) SetName(v string) { o.Name = v } + // GetNode returns the Node field value. func (o *Instance) GetNode() string { if o == nil { @@ -343,6 +358,7 @@ func (o *Instance) SetNode(v string) { o.Node = v } + // GetRegion returns the Region field value. func (o *Instance) GetRegion() string { if o == nil { @@ -366,6 +382,7 @@ func (o *Instance) SetRegion(v string) { o.Region = v } + // GetRole returns the Role field value. func (o *Instance) GetRole() string { if o == nil { @@ -389,6 +406,7 @@ func (o *Instance) SetRole(v string) { o.Role = v } + // GetStatus returns the Status field value. func (o *Instance) GetStatus() InstanceStatus { if o == nil { @@ -412,6 +430,7 @@ func (o *Instance) SetStatus(v InstanceStatus) { o.Status = v } + // GetStorage returns the Storage field value. func (o *Instance) GetStorage() []InstanceStorageItem { if o == nil { @@ -435,6 +454,7 @@ func (o *Instance) SetStorage(v []InstanceStorageItem) { o.Storage = v } + // GetZone returns the Zone field value. func (o *Instance) GetZone() string { if o == nil { @@ -458,6 +478,8 @@ func (o *Instance) SetZone(v string) { o.Zone = v } + + // MarshalJSON serializes the struct using spec logic. func (o Instance) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -494,22 +516,22 @@ func (o Instance) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Instance) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AccessMode *string `json:"accessMode"` - Cloud *string `json:"cloud"` - Cluster *string `json:"cluster"` - ComponentName *string `json:"componentName,omitempty"` - ComponentDef *string `json:"componentDef,omitempty"` - Component *string `json:"component"` - Cpu *string `json:"cpu"` - CreatedAt *string `json:"createdAt"` - Memory *string `json:"memory"` - Name *string `json:"name"` - Node *string `json:"node"` - Region *string `json:"region"` - Role *string `json:"role"` - Status *InstanceStatus `json:"status"` - Storage *[]InstanceStorageItem `json:"storage"` - Zone *string `json:"zone"` + AccessMode *string `json:"accessMode"` + Cloud *string `json:"cloud"` + Cluster *string `json:"cluster"` + ComponentName *string `json:"componentName,omitempty"` + ComponentDef *string `json:"componentDef,omitempty"` + Component *string `json:"component"` + Cpu *string `json:"cpu"` + CreatedAt *string `json:"createdAt"` + Memory *string `json:"memory"` + Name *string `json:"name"` + Node *string `json:"node"` + Region *string `json:"region"` + Role *string `json:"role"` + Status *InstanceStatus `json:"status"` + Storage *[]InstanceStorageItem `json:"storage"` + Zone *string `json:"zone"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -558,7 +580,7 @@ func (o *Instance) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accessMode", "cloud", "cluster", "componentName", "componentDef", "component", "cpu", "createdAt", "memory", "name", "node", "region", "role", "status", "storage", "zone"}) + common.DeleteKeys(additionalProperties, &[]string{ "accessMode", "cloud", "cluster", "componentName", "componentDef", "component", "cpu", "createdAt", "memory", "name", "node", "region", "role", "status", "storage", "zone", }) } else { return err } diff --git a/api/kbcloud/admin/model_instance_list.go b/api/kbcloud/admin/model_instance_list.go index e2a41dde..9b707b5f 100644 --- a/api/kbcloud/admin/model_instance_list.go +++ b/api/kbcloud/admin/model_instance_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceList ClusterList is a list of KubeBlocks clusters + + +// InstanceList ClusterList is a list of KubeBlocks clusters type InstanceList struct { // Items is the list of KubeBlocks cluster objects in the list Items []Instance `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceList instantiates a new InstanceList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewInstanceListWithDefaults() *InstanceList { this := InstanceList{} return &this } - // GetItems returns the Items field value. func (o *InstanceList) GetItems() []Instance { if o == nil { @@ -60,6 +65,8 @@ func (o *InstanceList) SetItems(v []Instance) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *InstanceList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_instance_metrics.go b/api/kbcloud/admin/model_instance_metrics.go index 98ff74e2..d25d580d 100644 --- a/api/kbcloud/admin/model_instance_metrics.go +++ b/api/kbcloud/admin/model_instance_metrics.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceMetrics instance metrics + + +// InstanceMetrics instance metrics type InstanceMetrics struct { // the name of the instance InstanceName string `json:"instanceName"` @@ -21,10 +26,11 @@ type InstanceMetrics struct { // disk with uint Gi. DiskUsage string `json:"diskUsage"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceMetrics instantiates a new InstanceMetrics object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewInstanceMetricsWithDefaults() *InstanceMetrics { this := InstanceMetrics{} return &this } - // GetInstanceName returns the InstanceName field value. func (o *InstanceMetrics) GetInstanceName() string { if o == nil { @@ -69,6 +74,7 @@ func (o *InstanceMetrics) SetInstanceName(v string) { o.InstanceName = v } + // GetCpuUsage returns the CpuUsage field value. func (o *InstanceMetrics) GetCpuUsage() string { if o == nil { @@ -92,6 +98,7 @@ func (o *InstanceMetrics) SetCpuUsage(v string) { o.CpuUsage = v } + // GetMemoryUsage returns the MemoryUsage field value. func (o *InstanceMetrics) GetMemoryUsage() string { if o == nil { @@ -115,6 +122,7 @@ func (o *InstanceMetrics) SetMemoryUsage(v string) { o.MemoryUsage = v } + // GetDiskUsage returns the DiskUsage field value. func (o *InstanceMetrics) GetDiskUsage() string { if o == nil { @@ -138,6 +146,8 @@ func (o *InstanceMetrics) SetDiskUsage(v string) { o.DiskUsage = v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceMetrics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -159,9 +169,9 @@ func (o InstanceMetrics) MarshalJSON() ([]byte, error) { func (o *InstanceMetrics) UnmarshalJSON(bytes []byte) (err error) { all := struct { InstanceName *string `json:"instanceName"` - CpuUsage *string `json:"cpuUsage"` - MemoryUsage *string `json:"memoryUsage"` - DiskUsage *string `json:"diskUsage"` + CpuUsage *string `json:"cpuUsage"` + MemoryUsage *string `json:"memoryUsage"` + DiskUsage *string `json:"diskUsage"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *InstanceMetrics) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"instanceName", "cpuUsage", "memoryUsage", "diskUsage"}) + common.DeleteKeys(additionalProperties, &[]string{ "instanceName", "cpuUsage", "memoryUsage", "diskUsage", }) } else { return err } diff --git a/api/kbcloud/admin/model_instance_metrics_list.go b/api/kbcloud/admin/model_instance_metrics_list.go index 82f0dbbe..01d17f7f 100644 --- a/api/kbcloud/admin/model_instance_metrics_list.go +++ b/api/kbcloud/admin/model_instance_metrics_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceMetricsList instance metrics list + + +// InstanceMetricsList instance metrics list type InstanceMetricsList struct { // instanceMetrics list Items []InstanceMetrics `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceMetricsList instantiates a new InstanceMetricsList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewInstanceMetricsListWithDefaults() *InstanceMetricsList { this := InstanceMetricsList{} return &this } - // GetItems returns the Items field value. func (o *InstanceMetricsList) GetItems() []InstanceMetrics { if o == nil { @@ -60,6 +65,8 @@ func (o *InstanceMetricsList) SetItems(v []InstanceMetrics) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceMetricsList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *InstanceMetricsList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_instance_resource_stats.go b/api/kbcloud/admin/model_instance_resource_stats.go index 5daa0386..f1352afc 100644 --- a/api/kbcloud/admin/model_instance_resource_stats.go +++ b/api/kbcloud/admin/model_instance_resource_stats.go @@ -2,31 +2,35 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceResourceStats InstanceResourceStats holds the requests, limits, and available stats for an instance. + + +// InstanceResourceStats InstanceResourceStats holds the requests, limits, and available stats for an instance. type InstanceResourceStats struct { // ResourceStats holds the requests, limits, and available stats for a resource. CpuStats ResourceStats `json:"cpuStats"` // ResourceStats holds the requests, limits, and available stats for a resource. MemoryStats ResourceStats `json:"memoryStats"` - // ResourceStats holds the requests, limits, and available stats for a resource. - EphemeralStorageStats *ResourceStats `json:"ephemeralStorageStats,omitempty"` // Name of the instance. Name string `json:"name"` // Type of the instance, choose cluster or system Type *ResourceStatsInstanceType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceResourceStats instantiates a new InstanceResourceStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +50,6 @@ func NewInstanceResourceStatsWithDefaults() *InstanceResourceStats { this := InstanceResourceStats{} return &this } - // GetCpuStats returns the CpuStats field value. func (o *InstanceResourceStats) GetCpuStats() ResourceStats { if o == nil { @@ -70,6 +73,7 @@ func (o *InstanceResourceStats) SetCpuStats(v ResourceStats) { o.CpuStats = v } + // GetMemoryStats returns the MemoryStats field value. func (o *InstanceResourceStats) GetMemoryStats() ResourceStats { if o == nil { @@ -93,33 +97,6 @@ func (o *InstanceResourceStats) SetMemoryStats(v ResourceStats) { o.MemoryStats = v } -// GetEphemeralStorageStats returns the EphemeralStorageStats field value if set, zero value otherwise. -func (o *InstanceResourceStats) GetEphemeralStorageStats() ResourceStats { - if o == nil || o.EphemeralStorageStats == nil { - var ret ResourceStats - return ret - } - return *o.EphemeralStorageStats -} - -// GetEphemeralStorageStatsOk returns a tuple with the EphemeralStorageStats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceResourceStats) GetEphemeralStorageStatsOk() (*ResourceStats, bool) { - if o == nil || o.EphemeralStorageStats == nil { - return nil, false - } - return o.EphemeralStorageStats, true -} - -// HasEphemeralStorageStats returns a boolean if a field has been set. -func (o *InstanceResourceStats) HasEphemeralStorageStats() bool { - return o != nil && o.EphemeralStorageStats != nil -} - -// SetEphemeralStorageStats gets a reference to the given ResourceStats and assigns it to the EphemeralStorageStats field. -func (o *InstanceResourceStats) SetEphemeralStorageStats(v ResourceStats) { - o.EphemeralStorageStats = &v -} // GetName returns the Name field value. func (o *InstanceResourceStats) GetName() string { @@ -144,6 +121,7 @@ func (o *InstanceResourceStats) SetName(v string) { o.Name = v } + // GetType returns the Type field value if set, zero value otherwise. func (o *InstanceResourceStats) GetType() ResourceStatsInstanceType { if o == nil || o.Type == nil { @@ -172,6 +150,8 @@ func (o *InstanceResourceStats) SetType(v ResourceStatsInstanceType) { o.Type = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceResourceStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -180,9 +160,6 @@ func (o InstanceResourceStats) MarshalJSON() ([]byte, error) { } toSerialize["cpuStats"] = o.CpuStats toSerialize["memoryStats"] = o.MemoryStats - if o.EphemeralStorageStats != nil { - toSerialize["ephemeralStorageStats"] = o.EphemeralStorageStats - } toSerialize["name"] = o.Name if o.Type != nil { toSerialize["type"] = o.Type @@ -197,11 +174,10 @@ func (o InstanceResourceStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InstanceResourceStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CpuStats *ResourceStats `json:"cpuStats"` - MemoryStats *ResourceStats `json:"memoryStats"` - EphemeralStorageStats *ResourceStats `json:"ephemeralStorageStats,omitempty"` - Name *string `json:"name"` - Type *ResourceStatsInstanceType `json:"type,omitempty"` + CpuStats *ResourceStats `json:"cpuStats"` + MemoryStats *ResourceStats `json:"memoryStats"` + Name *string `json:"name"` + Type *ResourceStatsInstanceType `json:"type,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -217,7 +193,7 @@ func (o *InstanceResourceStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cpuStats", "memoryStats", "ephemeralStorageStats", "name", "type"}) + common.DeleteKeys(additionalProperties, &[]string{ "cpuStats", "memoryStats", "name", "type", }) } else { return err } @@ -231,12 +207,8 @@ func (o *InstanceResourceStats) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField = true } o.MemoryStats = *all.MemoryStats - if all.EphemeralStorageStats != nil && all.EphemeralStorageStats.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.EphemeralStorageStats = all.EphemeralStorageStats o.Name = *all.Name - if all.Type != nil && !all.Type.IsValid() { + if all.Type != nil &&!all.Type.IsValid() { hasInvalidField = true } else { o.Type = all.Type diff --git a/api/kbcloud/admin/model_instance_resource_stats_list.go b/api/kbcloud/admin/model_instance_resource_stats_list.go index b610688c..e3d057e2 100644 --- a/api/kbcloud/admin/model_instance_resource_stats_list.go +++ b/api/kbcloud/admin/model_instance_resource_stats_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceResourceStatsList InstanceResourceStatsList is a list of InstanceResourceStats + + +// InstanceResourceStatsList InstanceResourceStatsList is a list of InstanceResourceStats type InstanceResourceStatsList struct { // Items is the list of InstanceResourceStats objects in the list Items []InstanceResourceStats `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceResourceStatsList instantiates a new InstanceResourceStatsList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewInstanceResourceStatsListWithDefaults() *InstanceResourceStatsList { this := InstanceResourceStatsList{} return &this } - // GetItems returns the Items field value. func (o *InstanceResourceStatsList) GetItems() []InstanceResourceStats { if o == nil { @@ -60,6 +65,8 @@ func (o *InstanceResourceStatsList) SetItems(v []InstanceResourceStats) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceResourceStatsList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *InstanceResourceStatsList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_instance_status.go b/api/kbcloud/admin/model_instance_status.go index b0a0bf3f..f99954c4 100644 --- a/api/kbcloud/admin/model_instance_status.go +++ b/api/kbcloud/admin/model_instance_status.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceStatus Status for instance + + +// InstanceStatus Status for instance type InstanceStatus struct { // The current phase of the cluster Phase string `json:"phase"` @@ -19,10 +24,11 @@ type InstanceStatus struct { // A human-readable message indicating details about the cluster's current phase Message *string `json:"message,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceStatus instantiates a new InstanceStatus object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewInstanceStatusWithDefaults() *InstanceStatus { this := InstanceStatus{} return &this } - // GetPhase returns the Phase field value. func (o *InstanceStatus) GetPhase() string { if o == nil { @@ -64,6 +69,7 @@ func (o *InstanceStatus) SetPhase(v string) { o.Phase = v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *InstanceStatus) GetReason() string { if o == nil || o.Reason == nil { @@ -92,6 +98,7 @@ func (o *InstanceStatus) SetReason(v string) { o.Reason = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *InstanceStatus) GetMessage() string { if o == nil || o.Message == nil { @@ -120,6 +127,8 @@ func (o *InstanceStatus) SetMessage(v string) { o.Message = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o InstanceStatus) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InstanceStatus) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Phase *string `json:"phase"` - Reason *string `json:"reason,omitempty"` + Phase *string `json:"phase"` + Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *InstanceStatus) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"phase", "reason", "message"}) + common.DeleteKeys(additionalProperties, &[]string{ "phase", "reason", "message", }) } else { return err } diff --git a/api/kbcloud/admin/model_instance_storage_item.go b/api/kbcloud/admin/model_instance_storage_item.go index 30e38828..3f0be40d 100644 --- a/api/kbcloud/admin/model_instance_storage_item.go +++ b/api/kbcloud/admin/model_instance_storage_item.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceStorageItem Instance storage information + + +// InstanceStorageItem Instance storage information type InstanceStorageItem struct { // Specify the name of storage, which must be unique. Name string `json:"name"` @@ -19,10 +24,11 @@ type InstanceStorageItem struct { // The name of StorageClass in use StorageClass *string `json:"storageClass,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceStorageItem instantiates a new InstanceStorageItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewInstanceStorageItemWithDefaults() *InstanceStorageItem { this := InstanceStorageItem{} return &this } - // GetName returns the Name field value. func (o *InstanceStorageItem) GetName() string { if o == nil { @@ -65,6 +70,7 @@ func (o *InstanceStorageItem) SetName(v string) { o.Name = v } + // GetSize returns the Size field value. func (o *InstanceStorageItem) GetSize() string { if o == nil { @@ -88,6 +94,7 @@ func (o *InstanceStorageItem) SetSize(v string) { o.Size = v } + // GetStorageClass returns the StorageClass field value if set, zero value otherwise. func (o *InstanceStorageItem) GetStorageClass() string { if o == nil || o.StorageClass == nil { @@ -116,6 +123,8 @@ func (o *InstanceStorageItem) SetStorageClass(v string) { o.StorageClass = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceStorageItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -137,8 +146,8 @@ func (o InstanceStorageItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InstanceStorageItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Size *string `json:"size"` + Name *string `json:"name"` + Size *string `json:"size"` StorageClass *string `json:"storageClass,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -152,7 +161,7 @@ func (o *InstanceStorageItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "size", "storageClass"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "size", "storageClass", }) } else { return err } diff --git a/api/kbcloud/admin/model_integer_option.go b/api/kbcloud/admin/model_integer_option.go index e6caf113..edf07837 100644 --- a/api/kbcloud/admin/model_integer_option.go +++ b/api/kbcloud/admin/model_integer_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type IntegerOption struct { - Min int32 `json:"min"` - Max int32 `json:"max"` + Min int32 `json:"min"` + Max int32 `json:"max"` Default int32 `json:"default"` - Step int32 `json:"step"` + Step int32 `json:"step"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewIntegerOption instantiates a new IntegerOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewIntegerOptionWithDefaults() *IntegerOption { this := IntegerOption{} return &this } - // GetMin returns the Min field value. func (o *IntegerOption) GetMin() int32 { if o == nil { @@ -64,6 +69,7 @@ func (o *IntegerOption) SetMin(v int32) { o.Min = v } + // GetMax returns the Max field value. func (o *IntegerOption) GetMax() int32 { if o == nil { @@ -87,6 +93,7 @@ func (o *IntegerOption) SetMax(v int32) { o.Max = v } + // GetDefault returns the Default field value. func (o *IntegerOption) GetDefault() int32 { if o == nil { @@ -110,6 +117,7 @@ func (o *IntegerOption) SetDefault(v int32) { o.Default = v } + // GetStep returns the Step field value. func (o *IntegerOption) GetStep() int32 { if o == nil { @@ -133,6 +141,8 @@ func (o *IntegerOption) SetStep(v int32) { o.Step = v } + + // MarshalJSON serializes the struct using spec logic. func (o IntegerOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,10 +163,10 @@ func (o IntegerOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *IntegerOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Min *int32 `json:"min"` - Max *int32 `json:"max"` + Min *int32 `json:"min"` + Max *int32 `json:"max"` Default *int32 `json:"default"` - Step *int32 `json:"step"` + Step *int32 `json:"step"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -175,7 +185,7 @@ func (o *IntegerOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"min", "max", "default", "step"}) + common.DeleteKeys(additionalProperties, &[]string{ "min", "max", "default", "step", }) } else { return err } diff --git a/api/kbcloud/admin/model_invitation.go b/api/kbcloud/admin/model_invitation.go index b8031fc1..07d5ca05 100644 --- a/api/kbcloud/admin/model_invitation.go +++ b/api/kbcloud/admin/model_invitation.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Invitation Invitation info + + +// Invitation Invitation info type Invitation struct { // User has accepted or not Accepted bool `json:"accepted"` @@ -36,10 +40,11 @@ type Invitation struct { // the updated time of the invitation UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInvitation instantiates a new Invitation object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -64,7 +69,6 @@ func NewInvitationWithDefaults() *Invitation { this := Invitation{} return &this } - // GetAccepted returns the Accepted field value. func (o *Invitation) GetAccepted() bool { if o == nil { @@ -88,6 +92,7 @@ func (o *Invitation) SetAccepted(v bool) { o.Accepted = v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Invitation) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -116,6 +121,7 @@ func (o *Invitation) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetEmail returns the Email field value. func (o *Invitation) GetEmail() string { if o == nil { @@ -139,6 +145,7 @@ func (o *Invitation) SetEmail(v string) { o.Email = v } + // GetExpireTime returns the ExpireTime field value. func (o *Invitation) GetExpireTime() time.Time { if o == nil { @@ -162,6 +169,7 @@ func (o *Invitation) SetExpireTime(v time.Time) { o.ExpireTime = v } + // GetId returns the Id field value. func (o *Invitation) GetId() string { if o == nil { @@ -185,6 +193,7 @@ func (o *Invitation) SetId(v string) { o.Id = v } + // GetLastEmailTime returns the LastEmailTime field value. func (o *Invitation) GetLastEmailTime() time.Time { if o == nil { @@ -208,6 +217,7 @@ func (o *Invitation) SetLastEmailTime(v time.Time) { o.LastEmailTime = v } + // GetOrgName returns the OrgName field value. func (o *Invitation) GetOrgName() string { if o == nil { @@ -231,6 +241,7 @@ func (o *Invitation) SetOrgName(v string) { o.OrgName = v } + // GetRoleName returns the RoleName field value. func (o *Invitation) GetRoleName() string { if o == nil { @@ -254,6 +265,7 @@ func (o *Invitation) SetRoleName(v string) { o.RoleName = v } + // GetSender returns the Sender field value if set, zero value otherwise. func (o *Invitation) GetSender() InvitationSender { if o == nil || o.Sender == nil { @@ -282,6 +294,7 @@ func (o *Invitation) SetSender(v InvitationSender) { o.Sender = &v } + // GetToken returns the Token field value. func (o *Invitation) GetToken() string { if o == nil { @@ -305,6 +318,7 @@ func (o *Invitation) SetToken(v string) { o.Token = v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Invitation) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -333,6 +347,8 @@ func (o *Invitation) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Invitation) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -382,17 +398,17 @@ func (o Invitation) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Invitation) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Accepted *bool `json:"accepted"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Email *string `json:"email"` - ExpireTime *time.Time `json:"expireTime"` - Id *string `json:"id"` - LastEmailTime *time.Time `json:"lastEmailTime"` - OrgName *string `json:"orgName"` - RoleName *string `json:"roleName"` - Sender *InvitationSender `json:"sender,omitempty"` - Token *string `json:"token"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Accepted *bool `json:"accepted"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Email *string `json:"email"` + ExpireTime *time.Time `json:"expireTime"` + Id *string `json:"id"` + LastEmailTime *time.Time `json:"lastEmailTime"` + OrgName *string `json:"orgName"` + RoleName *string `json:"roleName"` + Sender *InvitationSender `json:"sender,omitempty"` + Token *string `json:"token"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -423,7 +439,7 @@ func (o *Invitation) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accepted", "createdAt", "email", "expireTime", "id", "lastEmailTime", "orgName", "roleName", "sender", "token", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "accepted", "createdAt", "email", "expireTime", "id", "lastEmailTime", "orgName", "roleName", "sender", "token", "updatedAt", }) } else { return err } @@ -437,7 +453,7 @@ func (o *Invitation) UnmarshalJSON(bytes []byte) (err error) { o.LastEmailTime = *all.LastEmailTime o.OrgName = *all.OrgName o.RoleName = *all.RoleName - if all.Sender != nil && all.Sender.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Sender != nil && all.Sender.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Sender = all.Sender diff --git a/api/kbcloud/admin/model_invitation_list.go b/api/kbcloud/admin/model_invitation_list.go index 907a2a53..e0357d22 100644 --- a/api/kbcloud/admin/model_invitation_list.go +++ b/api/kbcloud/admin/model_invitation_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InvitationList InvitationList is a list of invitations + + +// InvitationList InvitationList is a list of invitations type InvitationList struct { // Items is the list of Invitation objects in the list Items []Invitation `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInvitationList instantiates a new InvitationList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewInvitationListWithDefaults() *InvitationList { this := InvitationList{} return &this } - // GetItems returns the Items field value. func (o *InvitationList) GetItems() []Invitation { if o == nil { @@ -62,6 +67,7 @@ func (o *InvitationList) SetItems(v []Invitation) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *InvitationList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *InvitationList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InvitationList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o InvitationList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InvitationList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Invitation `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]Invitation `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *InvitationList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_invitation_sender.go b/api/kbcloud/admin/model_invitation_sender.go index 9041e070..feb0f426 100644 --- a/api/kbcloud/admin/model_invitation_sender.go +++ b/api/kbcloud/admin/model_invitation_sender.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// InvitationSender InvitationSender is the User who send the Invitation + + +// InvitationSender InvitationSender is the User who send the Invitation type InvitationSender struct { // The email of the User Email *string `json:"email,omitempty"` @@ -15,10 +24,11 @@ type InvitationSender struct { // The name of the User Name *string `json:"name,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInvitationSender instantiates a new InvitationSender object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewInvitationSenderWithDefaults() *InvitationSender { this := InvitationSender{} return &this } - // GetEmail returns the Email field value if set, zero value otherwise. func (o *InvitationSender) GetEmail() string { if o == nil || o.Email == nil { @@ -64,6 +73,7 @@ func (o *InvitationSender) SetEmail(v string) { o.Email = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *InvitationSender) GetId() string { if o == nil || o.Id == nil { @@ -92,6 +102,7 @@ func (o *InvitationSender) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *InvitationSender) GetName() string { if o == nil || o.Name == nil { @@ -120,6 +131,8 @@ func (o *InvitationSender) SetName(v string) { o.Name = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InvitationSender) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -146,15 +159,15 @@ func (o InvitationSender) MarshalJSON() ([]byte, error) { func (o *InvitationSender) UnmarshalJSON(bytes []byte) (err error) { all := struct { Email *string `json:"email,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"email", "id", "name"}) + common.DeleteKeys(additionalProperties, &[]string{ "email", "id", "name", }) } else { return err } diff --git a/api/kbcloud/admin/model_ip_whitelist.go b/api/kbcloud/admin/model_ip_whitelist.go index d6db1f22..4b4536ef 100644 --- a/api/kbcloud/admin/model_ip_whitelist.go +++ b/api/kbcloud/admin/model_ip_whitelist.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// IpWhitelist whitelist + + +// IpWhitelist whitelist type IpWhitelist struct { // ID of the whitelist Id string `json:"id"` @@ -30,10 +34,11 @@ type IpWhitelist struct { // Populated by the system. Read-only. Null for lists UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewIpWhitelist instantiates a new IpWhitelist object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +58,6 @@ func NewIpWhitelistWithDefaults() *IpWhitelist { this := IpWhitelist{} return &this } - // GetId returns the Id field value. func (o *IpWhitelist) GetId() string { if o == nil { @@ -77,6 +81,7 @@ func (o *IpWhitelist) SetId(v string) { o.Id = v } + // GetName returns the Name field value. func (o *IpWhitelist) GetName() string { if o == nil { @@ -100,6 +105,7 @@ func (o *IpWhitelist) SetName(v string) { o.Name = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *IpWhitelist) GetDescription() string { if o == nil || o.Description == nil { @@ -128,6 +134,7 @@ func (o *IpWhitelist) SetDescription(v string) { o.Description = &v } + // GetAddresses returns the Addresses field value. func (o *IpWhitelist) GetAddresses() []string { if o == nil { @@ -151,6 +158,7 @@ func (o *IpWhitelist) SetAddresses(v []string) { o.Addresses = v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *IpWhitelist) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -179,6 +187,7 @@ func (o *IpWhitelist) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *IpWhitelist) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -207,6 +216,8 @@ func (o *IpWhitelist) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o IpWhitelist) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -243,12 +254,12 @@ func (o IpWhitelist) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *IpWhitelist) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Name *string `json:"name"` - Description *string `json:"description,omitempty"` - Addresses *[]string `json:"addresses"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Id *string `json:"id"` + Name *string `json:"name"` + Description *string `json:"description,omitempty"` + Addresses *[]string `json:"addresses"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -264,7 +275,7 @@ func (o *IpWhitelist) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "description", "addresses", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "description", "addresses", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_ip_whitelist_list.go b/api/kbcloud/admin/model_ip_whitelist_list.go index f4bbba04..e5e4a83d 100644 --- a/api/kbcloud/admin/model_ip_whitelist_list.go +++ b/api/kbcloud/admin/model_ip_whitelist_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type IpWhitelistList struct { // Items is the list of whitelist objects in the Cluster Items []IpWhitelist `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewIpWhitelistList instantiates a new IpWhitelistList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewIpWhitelistListWithDefaults() *IpWhitelistList { this := IpWhitelistList{} return &this } - // GetItems returns the Items field value. func (o *IpWhitelistList) GetItems() []IpWhitelist { if o == nil { @@ -59,6 +64,8 @@ func (o *IpWhitelistList) SetItems(v []IpWhitelist) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o IpWhitelistList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *IpWhitelistList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_kubeconfig.go b/api/kbcloud/admin/model_kubeconfig.go index a66c56a1..69a14b19 100644 --- a/api/kbcloud/admin/model_kubeconfig.go +++ b/api/kbcloud/admin/model_kubeconfig.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type Kubeconfig struct { // The base64 encoded kubeconfig file contents to connect to this Kubernetes Kubeconfig string `json:"kubeconfig"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewKubeconfig instantiates a new Kubeconfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewKubeconfigWithDefaults() *Kubeconfig { this := Kubeconfig{} return &this } - // GetKubeconfig returns the Kubeconfig field value. func (o *Kubeconfig) GetKubeconfig() string { if o == nil { @@ -59,6 +64,8 @@ func (o *Kubeconfig) SetKubeconfig(v string) { o.Kubeconfig = v } + + // MarshalJSON serializes the struct using spec logic. func (o Kubeconfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *Kubeconfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"kubeconfig"}) + common.DeleteKeys(additionalProperties, &[]string{ "kubeconfig", }) } else { return err } diff --git a/api/kbcloud/admin/model_kubernetes_manifest_list.go b/api/kbcloud/admin/model_kubernetes_manifest_list.go index d664d1f3..9b4ed95c 100644 --- a/api/kbcloud/admin/model_kubernetes_manifest_list.go +++ b/api/kbcloud/admin/model_kubernetes_manifest_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// KubernetesManifestList KubernetesManifestList is the list of Kubernetes objects in the list +// KubernetesManifestList KubernetesManifestList is the list of Kubernetes objects in the list type KubernetesManifestList struct { // Items is the list of Kubernetes objects in the list KubernetesManifests []map[string]interface{} `json:"kubernetesManifests,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewKubernetesManifestList instantiates a new KubernetesManifestList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewKubernetesManifestListWithDefaults() *KubernetesManifestList { this := KubernetesManifestList{} return &this } - // GetKubernetesManifests returns the KubernetesManifests field value if set, zero value otherwise. func (o *KubernetesManifestList) GetKubernetesManifests() []map[string]interface{} { if o == nil || o.KubernetesManifests == nil { @@ -60,6 +69,8 @@ func (o *KubernetesManifestList) SetKubernetesManifests(v []map[string]interface o.KubernetesManifests = v } + + // MarshalJSON serializes the struct using spec logic. func (o KubernetesManifestList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *KubernetesManifestList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"kubernetesManifests"}) + common.DeleteKeys(additionalProperties, &[]string{ "kubernetesManifests", }) } else { return err } diff --git a/api/kbcloud/admin/model_license.go b/api/kbcloud/admin/model_license.go index f0e69bc7..f05ce2e1 100644 --- a/api/kbcloud/admin/model_license.go +++ b/api/kbcloud/admin/model_license.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// License License info + + +// License License info type License struct { // The kubernetes cluster ID ClusterId *string `json:"clusterID,omitempty"` @@ -35,10 +40,11 @@ type License struct { // The license mode Mode *string `json:"mode,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLicense instantiates a new License object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +61,6 @@ func NewLicenseWithDefaults() *License { this := License{} return &this } - // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *License) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -84,6 +89,7 @@ func (o *License) SetClusterId(v string) { o.ClusterId = &v } + // GetEmail returns the Email field value if set, zero value otherwise. func (o *License) GetEmail() string { if o == nil || o.Email == nil { @@ -112,6 +118,7 @@ func (o *License) SetEmail(v string) { o.Email = &v } + // GetUserName returns the UserName field value if set, zero value otherwise. func (o *License) GetUserName() string { if o == nil || o.UserName == nil { @@ -140,6 +147,7 @@ func (o *License) SetUserName(v string) { o.UserName = &v } + // GetUnit returns the Unit field value if set, zero value otherwise. func (o *License) GetUnit() string { if o == nil || o.Unit == nil { @@ -168,6 +176,7 @@ func (o *License) SetUnit(v string) { o.Unit = &v } + // GetQuantity returns the Quantity field value if set, zero value otherwise. func (o *License) GetQuantity() string { if o == nil || o.Quantity == nil { @@ -196,6 +205,7 @@ func (o *License) SetQuantity(v string) { o.Quantity = &v } + // GetEngines returns the Engines field value if set, zero value otherwise. func (o *License) GetEngines() []string { if o == nil || o.Engines == nil { @@ -224,6 +234,7 @@ func (o *License) SetEngines(v []string) { o.Engines = v } + // GetNotAfter returns the NotAfter field value if set, zero value otherwise. func (o *License) GetNotAfter() time.Time { if o == nil || o.NotAfter == nil { @@ -252,6 +263,7 @@ func (o *License) SetNotAfter(v time.Time) { o.NotAfter = &v } + // GetNotBefore returns the NotBefore field value if set, zero value otherwise. func (o *License) GetNotBefore() time.Time { if o == nil || o.NotBefore == nil { @@ -280,6 +292,7 @@ func (o *License) SetNotBefore(v time.Time) { o.NotBefore = &v } + // GetUsed returns the Used field value if set, zero value otherwise. func (o *License) GetUsed() float64 { if o == nil || o.Used == nil { @@ -308,6 +321,7 @@ func (o *License) SetUsed(v float64) { o.Used = &v } + // GetLicense returns the License field value if set, zero value otherwise. func (o *License) GetLicense() string { if o == nil || o.License == nil { @@ -336,6 +350,7 @@ func (o *License) SetLicense(v string) { o.License = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *License) GetMode() string { if o == nil || o.Mode == nil { @@ -364,6 +379,8 @@ func (o *License) SetMode(v string) { o.Mode = &v } + + // MarshalJSON serializes the struct using spec logic. func (o License) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -421,24 +438,24 @@ func (o License) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *License) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ClusterId *string `json:"clusterID,omitempty"` - Email *string `json:"email,omitempty"` - UserName *string `json:"userName,omitempty"` - Unit *string `json:"unit,omitempty"` - Quantity *string `json:"quantity,omitempty"` - Engines []string `json:"engines,omitempty"` - NotAfter *time.Time `json:"notAfter,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + Email *string `json:"email,omitempty"` + UserName *string `json:"userName,omitempty"` + Unit *string `json:"unit,omitempty"` + Quantity *string `json:"quantity,omitempty"` + Engines []string `json:"engines,omitempty"` + NotAfter *time.Time `json:"notAfter,omitempty"` NotBefore *time.Time `json:"notBefore,omitempty"` - Used *float64 `json:"used,omitempty"` - License *string `json:"license,omitempty"` - Mode *string `json:"mode,omitempty"` + Used *float64 `json:"used,omitempty"` + License *string `json:"license,omitempty"` + Mode *string `json:"mode,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"clusterID", "email", "userName", "unit", "quantity", "engines", "notAfter", "notBefore", "used", "license", "mode"}) + common.DeleteKeys(additionalProperties, &[]string{ "clusterID", "email", "userName", "unit", "quantity", "engines", "notAfter", "notBefore", "used", "license", "mode", }) } else { return err } diff --git a/api/kbcloud/admin/model_license_option.go b/api/kbcloud/admin/model_license_option.go index 3c72e7c1..f0404382 100644 --- a/api/kbcloud/admin/model_license_option.go +++ b/api/kbcloud/admin/model_license_option.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type LicenseOption struct { - Component string `json:"component"` + Component string `json:"component"` OpsDefName string `json:"opsDefName"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLicenseOption instantiates a new LicenseOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewLicenseOptionWithDefaults() *LicenseOption { this := LicenseOption{} return &this } - // GetComponent returns the Component field value. func (o *LicenseOption) GetComponent() string { if o == nil { @@ -60,6 +65,7 @@ func (o *LicenseOption) SetComponent(v string) { o.Component = v } + // GetOpsDefName returns the OpsDefName field value. func (o *LicenseOption) GetOpsDefName() string { if o == nil { @@ -83,6 +89,8 @@ func (o *LicenseOption) SetOpsDefName(v string) { o.OpsDefName = v } + + // MarshalJSON serializes the struct using spec logic. func (o LicenseOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -101,7 +109,7 @@ func (o LicenseOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *LicenseOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` + Component *string `json:"component"` OpsDefName *string `json:"opsDefName"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -115,7 +123,7 @@ func (o *LicenseOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "opsDefName"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "opsDefName", }) } else { return err } diff --git a/api/kbcloud/admin/model_license_request.go b/api/kbcloud/admin/model_license_request.go index dc7c2671..62880e62 100644 --- a/api/kbcloud/admin/model_license_request.go +++ b/api/kbcloud/admin/model_license_request.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type LicenseRequest struct { // License key Key *string `json:"key,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLicenseRequest instantiates a new LicenseRequest object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewLicenseRequestWithDefaults() *LicenseRequest { this := LicenseRequest{} return &this } - // GetKey returns the Key field value if set, zero value otherwise. func (o *LicenseRequest) GetKey() string { if o == nil || o.Key == nil { @@ -59,6 +68,8 @@ func (o *LicenseRequest) SetKey(v string) { o.Key = &v } + + // MarshalJSON serializes the struct using spec logic. func (o LicenseRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *LicenseRequest) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"key"}) + common.DeleteKeys(additionalProperties, &[]string{ "key", }) } else { return err } diff --git a/api/kbcloud/admin/model_list_kubernetes_node_op_type.go b/api/kbcloud/admin/model_list_kubernetes_node_op_type.go index bb44b827..0437a42e 100644 --- a/api/kbcloud/admin/model_list_kubernetes_node_op_type.go +++ b/api/kbcloud/admin/model_list_kubernetes_node_op_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // ListKubernetesNodeOpType operation for list nodes, either `in` or `notin` type ListKubernetesNodeOpType string // List of ListKubernetesNodeOpType. const ( - ListKubernetesNodeOpTypeIn ListKubernetesNodeOpType = "in" + ListKubernetesNodeOpTypeIn ListKubernetesNodeOpType = "in" ListKubernetesNodeOpTypeNotin ListKubernetesNodeOpType = "notin" ) diff --git a/api/kbcloud/admin/model_llm.go b/api/kbcloud/admin/model_llm.go index ba0807a3..3559716f 100644 --- a/api/kbcloud/admin/model_llm.go +++ b/api/kbcloud/admin/model_llm.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Llm llm + + +// Llm llm type Llm struct { // ID of the llm Id string `json:"id"` @@ -32,10 +36,11 @@ type Llm struct { // Populated by the system. Read-only. Null for lists UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLlm instantiates a new Llm object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -57,7 +62,6 @@ func NewLlmWithDefaults() *Llm { this := Llm{} return &this } - // GetId returns the Id field value. func (o *Llm) GetId() string { if o == nil { @@ -81,6 +85,7 @@ func (o *Llm) SetId(v string) { o.Id = v } + // GetName returns the Name field value. func (o *Llm) GetName() string { if o == nil { @@ -104,6 +109,7 @@ func (o *Llm) SetName(v string) { o.Name = v } + // GetType returns the Type field value. func (o *Llm) GetType() string { if o == nil { @@ -127,6 +133,7 @@ func (o *Llm) SetType(v string) { o.Type = v } + // GetEnabled returns the Enabled field value. func (o *Llm) GetEnabled() bool { if o == nil { @@ -150,6 +157,7 @@ func (o *Llm) SetEnabled(v bool) { o.Enabled = v } + // GetConfig returns the Config field value. func (o *Llm) GetConfig() map[string]interface{} { if o == nil { @@ -173,6 +181,7 @@ func (o *Llm) SetConfig(v map[string]interface{}) { o.Config = v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Llm) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -201,6 +210,7 @@ func (o *Llm) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Llm) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -229,6 +239,8 @@ func (o *Llm) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Llm) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -264,13 +276,13 @@ func (o Llm) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Llm) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Name *string `json:"name"` - Type *string `json:"type"` - Enabled *bool `json:"enabled"` - Config *map[string]interface{} `json:"config"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Id *string `json:"id"` + Name *string `json:"name"` + Type *string `json:"type"` + Enabled *bool `json:"enabled"` + Config *map[string]interface{} `json:"config"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -292,7 +304,7 @@ func (o *Llm) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "type", "enabled", "config", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "type", "enabled", "config", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_llm_list.go b/api/kbcloud/admin/model_llm_list.go index c7c4b2e0..b690f0e4 100644 --- a/api/kbcloud/admin/model_llm_list.go +++ b/api/kbcloud/admin/model_llm_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type LlmList struct { // Items is the list of llm objects Items []Llm `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLlmList instantiates a new LlmList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewLlmListWithDefaults() *LlmList { this := LlmList{} return &this } - // GetItems returns the Items field value. func (o *LlmList) GetItems() []Llm { if o == nil { @@ -59,6 +64,8 @@ func (o *LlmList) SetItems(v []Llm) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o LlmList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *LlmList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_load_balancer.go b/api/kbcloud/admin/model_load_balancer.go index 18439a53..a6901746 100644 --- a/api/kbcloud/admin/model_load_balancer.go +++ b/api/kbcloud/admin/model_load_balancer.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// LoadBalancer The load balancer info + + +// LoadBalancer The load balancer info type LoadBalancer struct { // Version of the load balancer Version *string `json:"version,omitempty"` @@ -27,10 +32,11 @@ type LoadBalancer struct { // Whether the ipam is enabled. Ipam *LoadBalancerIpamStatus `json:"ipam,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // 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 @@ -48,7 +54,6 @@ func NewLoadBalancerWithDefaults() *LoadBalancer { this := LoadBalancer{} return &this } - // GetVersion returns the Version field value if set, zero value otherwise. func (o *LoadBalancer) GetVersion() string { if o == nil || o.Version == nil { @@ -77,6 +82,7 @@ func (o *LoadBalancer) SetVersion(v string) { o.Version = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *LoadBalancer) GetType() string { if o == nil || o.Type == nil { @@ -105,6 +111,7 @@ func (o *LoadBalancer) SetType(v string) { o.Type = &v } + // GetStatus returns the Status field value. func (o *LoadBalancer) GetStatus() LoadBalancerStatus { if o == nil { @@ -128,6 +135,7 @@ func (o *LoadBalancer) SetStatus(v LoadBalancerStatus) { o.Status = v } + // GetAvailable returns the Available field value if set, zero value otherwise. func (o *LoadBalancer) GetAvailable() LoadBalancerAvailableType { if o == nil || o.Available == nil { @@ -156,6 +164,7 @@ func (o *LoadBalancer) SetAvailable(v LoadBalancerAvailableType) { o.Available = &v } + // GetClass returns the Class field value if set, zero value otherwise. func (o *LoadBalancer) GetClass() string { if o == nil || o.Class == nil { @@ -184,6 +193,7 @@ func (o *LoadBalancer) SetClass(v string) { o.Class = &v } + // GetChargeType returns the ChargeType field value if set, zero value otherwise. func (o *LoadBalancer) GetChargeType() string { if o == nil || o.ChargeType == nil { @@ -212,6 +222,7 @@ func (o *LoadBalancer) SetChargeType(v string) { o.ChargeType = &v } + // GetIpam returns the Ipam field value if set, zero value otherwise. func (o *LoadBalancer) GetIpam() LoadBalancerIpamStatus { if o == nil || o.Ipam == nil { @@ -240,6 +251,8 @@ func (o *LoadBalancer) SetIpam(v LoadBalancerIpamStatus) { o.Ipam = &v } + + // MarshalJSON serializes the struct using spec logic. func (o LoadBalancer) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -275,13 +288,13 @@ func (o LoadBalancer) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *LoadBalancer) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Version *string `json:"version,omitempty"` - Type *string `json:"type,omitempty"` - Status *LoadBalancerStatus `json:"status"` - Available *LoadBalancerAvailableType `json:"available,omitempty"` - Class *string `json:"class,omitempty"` - ChargeType *string `json:"chargeType,omitempty"` - Ipam *LoadBalancerIpamStatus `json:"ipam,omitempty"` + Version *string `json:"version,omitempty"` + Type *string `json:"type,omitempty"` + Status *LoadBalancerStatus `json:"status"` + Available *LoadBalancerAvailableType `json:"available,omitempty"` + Class *string `json:"class,omitempty"` + ChargeType *string `json:"chargeType,omitempty"` + Ipam *LoadBalancerIpamStatus `json:"ipam,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -291,7 +304,7 @@ func (o *LoadBalancer) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"version", "type", "status", "available", "class", "chargeType", "ipam"}) + common.DeleteKeys(additionalProperties, &[]string{ "version", "type", "status", "available", "class", "chargeType", "ipam", }) } else { return err } @@ -304,14 +317,14 @@ func (o *LoadBalancer) UnmarshalJSON(bytes []byte) (err error) { } else { o.Status = *all.Status } - if all.Available != nil && !all.Available.IsValid() { + if all.Available != nil &&!all.Available.IsValid() { hasInvalidField = true } else { o.Available = all.Available } o.Class = all.Class o.ChargeType = all.ChargeType - if all.Ipam != nil && !all.Ipam.IsValid() { + if all.Ipam != nil &&!all.Ipam.IsValid() { hasInvalidField = true } else { o.Ipam = all.Ipam diff --git a/api/kbcloud/admin/model_load_balancer_available_type.go b/api/kbcloud/admin/model_load_balancer_available_type.go index 4df4698a..d9f1021a 100644 --- a/api/kbcloud/admin/model_load_balancer_available_type.go +++ b/api/kbcloud/admin/model_load_balancer_available_type.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // LoadBalancerAvailableType Whether the loadbalancer is available in the environment. type LoadBalancerAvailableType string // List of LoadBalancerAvailableType. const ( - LoadBalancerAvailableTypeAvailable LoadBalancerAvailableType = "Available" + LoadBalancerAvailableTypeAvailable LoadBalancerAvailableType = "Available" LoadBalancerAvailableTypeUnavailable LoadBalancerAvailableType = "Unavailable" - LoadBalancerAvailableTypeChecking LoadBalancerAvailableType = "Checking" - LoadBalancerAvailableTypeUnknown LoadBalancerAvailableType = "Unknown" + LoadBalancerAvailableTypeChecking LoadBalancerAvailableType = "Checking" + LoadBalancerAvailableTypeUnknown LoadBalancerAvailableType = "Unknown" ) var allowedLoadBalancerAvailableTypeEnumValues = []LoadBalancerAvailableType{ diff --git a/api/kbcloud/admin/model_load_balancer_install.go b/api/kbcloud/admin/model_load_balancer_install.go index c1fd9064..9e11be53 100644 --- a/api/kbcloud/admin/model_load_balancer_install.go +++ b/api/kbcloud/admin/model_load_balancer_install.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// LoadBalancerInstall Install the load balancer in the environment + + +// LoadBalancerInstall Install the load balancer in the environment type LoadBalancerInstall struct { // Type of the load balancer Type LoadBalancerType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLoadBalancerInstall instantiates a new LoadBalancerInstall object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewLoadBalancerInstallWithDefaults() *LoadBalancerInstall { this := LoadBalancerInstall{} return &this } - // GetType returns the Type field value. func (o *LoadBalancerInstall) GetType() LoadBalancerType { if o == nil { @@ -60,6 +65,8 @@ func (o *LoadBalancerInstall) SetType(v LoadBalancerType) { o.Type = v } + + // MarshalJSON serializes the struct using spec logic. func (o LoadBalancerInstall) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *LoadBalancerInstall) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"type"}) + common.DeleteKeys(additionalProperties, &[]string{ "type", }) } else { return err } diff --git a/api/kbcloud/admin/model_load_balancer_ipam_status.go b/api/kbcloud/admin/model_load_balancer_ipam_status.go index 0375798b..9f309ec9 100644 --- a/api/kbcloud/admin/model_load_balancer_ipam_status.go +++ b/api/kbcloud/admin/model_load_balancer_ipam_status.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // LoadBalancerIpamStatus Whether the ipam is enabled. type LoadBalancerIpamStatus string // List of LoadBalancerIpamStatus. const ( - LoadBalancerIpamStatusEnabled LoadBalancerIpamStatus = "Enabled" + LoadBalancerIpamStatusEnabled LoadBalancerIpamStatus = "Enabled" LoadBalancerIpamStatusDisabled LoadBalancerIpamStatus = "Disabled" ) diff --git a/api/kbcloud/admin/model_load_balancer_status.go b/api/kbcloud/admin/model_load_balancer_status.go index 15a907c9..1e69f0c1 100644 --- a/api/kbcloud/admin/model_load_balancer_status.go +++ b/api/kbcloud/admin/model_load_balancer_status.go @@ -2,24 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // LoadBalancerStatus Status of the load balancer type LoadBalancerStatus string // List of LoadBalancerStatus. const ( - LoadBalancerStatusEnabling LoadBalancerStatus = "Enabling" - LoadBalancerStatusEnabled LoadBalancerStatus = "Enabled" + LoadBalancerStatusEnabling LoadBalancerStatus = "Enabling" + LoadBalancerStatusEnabled LoadBalancerStatus = "Enabled" LoadBalancerStatusDisabling LoadBalancerStatus = "Disabling" - LoadBalancerStatusDisabled LoadBalancerStatus = "Disabled" - LoadBalancerStatusFailed LoadBalancerStatus = "Failed" + LoadBalancerStatusDisabled LoadBalancerStatus = "Disabled" + LoadBalancerStatusFailed LoadBalancerStatus = "Failed" ) var allowedLoadBalancerStatusEnumValues = []LoadBalancerStatus{ diff --git a/api/kbcloud/admin/model_load_balancer_type.go b/api/kbcloud/admin/model_load_balancer_type.go index 6d38bfb4..44abf279 100644 --- a/api/kbcloud/admin/model_load_balancer_type.go +++ b/api/kbcloud/admin/model_load_balancer_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // LoadBalancerType Type of the load balancer type LoadBalancerType string // List of LoadBalancerType. const ( - LoadBalancerTypeF5 LoadBalancerType = "f5" + LoadBalancerTypeF5 LoadBalancerType = "f5" LoadBalancerTypeMetallb LoadBalancerType = "metallb" ) diff --git a/api/kbcloud/admin/model_localized_description.go b/api/kbcloud/admin/model_localized_description.go index 7eb3b47e..b451e153 100644 --- a/api/kbcloud/admin/model_localized_description.go +++ b/api/kbcloud/admin/model_localized_description.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type LocalizedDescription struct { ZhCn string `json:"zh-CN"` EnUs string `json:"en-US"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLocalizedDescription instantiates a new LocalizedDescription object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewLocalizedDescriptionWithDefaults() *LocalizedDescription { this := LocalizedDescription{} return &this } - // GetZhCn returns the ZhCn field value. func (o *LocalizedDescription) GetZhCn() string { if o == nil { @@ -60,6 +65,7 @@ func (o *LocalizedDescription) SetZhCn(v string) { o.ZhCn = v } + // GetEnUs returns the EnUs field value. func (o *LocalizedDescription) GetEnUs() string { if o == nil { @@ -83,6 +89,8 @@ func (o *LocalizedDescription) SetEnUs(v string) { o.EnUs = v } + + // MarshalJSON serializes the struct using spec logic. func (o LocalizedDescription) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -115,7 +123,7 @@ func (o *LocalizedDescription) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"zh-CN", "en-US"}) + common.DeleteKeys(additionalProperties, &[]string{ "zh-CN", "en-US", }) } else { return err } diff --git a/api/kbcloud/admin/model_log_disk.go b/api/kbcloud/admin/model_log_disk.go index c52c3a42..f141098e 100644 --- a/api/kbcloud/admin/model_log_disk.go +++ b/api/kbcloud/admin/model_log_disk.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type LogDisk struct { LogDiskCapacity *string `json:"log_disk_capacity,omitempty"` LogDiskAssigned *string `json:"log_disk_assigned,omitempty"` - LogDiskInUse *string `json:"log_disk_in_use,omitempty"` + LogDiskInUse *string `json:"log_disk_in_use,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLogDisk instantiates a new LogDisk object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewLogDiskWithDefaults() *LogDisk { this := LogDisk{} return &this } - // GetLogDiskCapacity returns the LogDiskCapacity field value if set, zero value otherwise. func (o *LogDisk) GetLogDiskCapacity() string { if o == nil || o.LogDiskCapacity == nil { @@ -60,6 +69,7 @@ func (o *LogDisk) SetLogDiskCapacity(v string) { o.LogDiskCapacity = &v } + // GetLogDiskAssigned returns the LogDiskAssigned field value if set, zero value otherwise. func (o *LogDisk) GetLogDiskAssigned() string { if o == nil || o.LogDiskAssigned == nil { @@ -88,6 +98,7 @@ func (o *LogDisk) SetLogDiskAssigned(v string) { o.LogDiskAssigned = &v } + // GetLogDiskInUse returns the LogDiskInUse field value if set, zero value otherwise. func (o *LogDisk) GetLogDiskInUse() string { if o == nil || o.LogDiskInUse == nil { @@ -116,6 +127,8 @@ func (o *LogDisk) SetLogDiskInUse(v string) { o.LogDiskInUse = &v } + + // MarshalJSON serializes the struct using spec logic. func (o LogDisk) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,14 +156,14 @@ func (o *LogDisk) UnmarshalJSON(bytes []byte) (err error) { all := struct { LogDiskCapacity *string `json:"log_disk_capacity,omitempty"` LogDiskAssigned *string `json:"log_disk_assigned,omitempty"` - LogDiskInUse *string `json:"log_disk_in_use,omitempty"` + LogDiskInUse *string `json:"log_disk_in_use,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"log_disk_capacity", "log_disk_assigned", "log_disk_in_use"}) + common.DeleteKeys(additionalProperties, &[]string{ "log_disk_capacity", "log_disk_assigned", "log_disk_in_use", }) } else { return err } diff --git a/api/kbcloud/admin/model_log_option.go b/api/kbcloud/admin/model_log_option.go index f1e230ac..4a9a528f 100644 --- a/api/kbcloud/admin/model_log_option.go +++ b/api/kbcloud/admin/model_log_option.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type LogOption struct { Component string `json:"component"` - Error bool `json:"error"` - Slow bool `json:"slow"` - Audit bool `json:"audit"` - Running bool `json:"running"` + Error bool `json:"error"` + Slow bool `json:"slow"` + Audit bool `json:"audit"` + Running bool `json:"running"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLogOption instantiates a new LogOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewLogOptionWithDefaults() *LogOption { this := LogOption{} return &this } - // GetComponent returns the Component field value. func (o *LogOption) GetComponent() string { if o == nil { @@ -66,6 +71,7 @@ func (o *LogOption) SetComponent(v string) { o.Component = v } + // GetError returns the Error field value. func (o *LogOption) GetError() bool { if o == nil { @@ -89,6 +95,7 @@ func (o *LogOption) SetError(v bool) { o.Error = v } + // GetSlow returns the Slow field value. func (o *LogOption) GetSlow() bool { if o == nil { @@ -112,6 +119,7 @@ func (o *LogOption) SetSlow(v bool) { o.Slow = v } + // GetAudit returns the Audit field value. func (o *LogOption) GetAudit() bool { if o == nil { @@ -135,6 +143,7 @@ func (o *LogOption) SetAudit(v bool) { o.Audit = v } + // GetRunning returns the Running field value. func (o *LogOption) GetRunning() bool { if o == nil { @@ -158,6 +167,8 @@ func (o *LogOption) SetRunning(v bool) { o.Running = v } + + // MarshalJSON serializes the struct using spec logic. func (o LogOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -180,10 +191,10 @@ func (o LogOption) MarshalJSON() ([]byte, error) { func (o *LogOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { Component *string `json:"component"` - Error *bool `json:"error"` - Slow *bool `json:"slow"` - Audit *bool `json:"audit"` - Running *bool `json:"running"` + Error *bool `json:"error"` + Slow *bool `json:"slow"` + Audit *bool `json:"audit"` + Running *bool `json:"running"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -205,7 +216,7 @@ func (o *LogOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "error", "slow", "audit", "running"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "error", "slow", "audit", "running", }) } else { return err } diff --git a/api/kbcloud/admin/model_manifest_type.go b/api/kbcloud/admin/model_manifest_type.go index bd6337d1..b4063b40 100644 --- a/api/kbcloud/admin/model_manifest_type.go +++ b/api/kbcloud/admin/model_manifest_type.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ManifestType string // List of ManifestType. const ( - ManifestTypeService ManifestType = "service" - ManifestTypeConfigmap ManifestType = "configmap" - ManifestTypeSecret ManifestType = "secret" - ManifestTypeEvent ManifestType = "event" - ManifestTypeOpsrequest ManifestType = "opsrequest" + ManifestTypeService ManifestType = "service" + ManifestTypeConfigmap ManifestType = "configmap" + ManifestTypeSecret ManifestType = "secret" + ManifestTypeEvent ManifestType = "event" + ManifestTypeOpsrequest ManifestType = "opsrequest" ManifestTypeConfigconstraint ManifestType = "configconstraint" ) diff --git a/api/kbcloud/admin/model_memory.go b/api/kbcloud/admin/model_memory.go index 6505e55b..cfd69e49 100644 --- a/api/kbcloud/admin/model_memory.go +++ b/api/kbcloud/admin/model_memory.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Memory struct { MemCapacity *string `json:"mem_capacity,omitempty"` MemoryLimit *string `json:"memory_limit,omitempty"` MemAssigned *string `json:"mem_assigned,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMemory instantiates a new Memory object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewMemoryWithDefaults() *Memory { this := Memory{} return &this } - // GetMemCapacity returns the MemCapacity field value if set, zero value otherwise. func (o *Memory) GetMemCapacity() string { if o == nil || o.MemCapacity == nil { @@ -60,6 +69,7 @@ func (o *Memory) SetMemCapacity(v string) { o.MemCapacity = &v } + // GetMemoryLimit returns the MemoryLimit field value if set, zero value otherwise. func (o *Memory) GetMemoryLimit() string { if o == nil || o.MemoryLimit == nil { @@ -88,6 +98,7 @@ func (o *Memory) SetMemoryLimit(v string) { o.MemoryLimit = &v } + // GetMemAssigned returns the MemAssigned field value if set, zero value otherwise. func (o *Memory) GetMemAssigned() string { if o == nil || o.MemAssigned == nil { @@ -116,6 +127,8 @@ func (o *Memory) SetMemAssigned(v string) { o.MemAssigned = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Memory) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -150,7 +163,7 @@ func (o *Memory) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"mem_capacity", "memory_limit", "mem_assigned"}) + common.DeleteKeys(additionalProperties, &[]string{ "mem_capacity", "memory_limit", "mem_assigned", }) } else { return err } diff --git a/api/kbcloud/admin/model_metadb_backup.go b/api/kbcloud/admin/model_metadb_backup.go index 150b9571..9d68f794 100644 --- a/api/kbcloud/admin/model_metadb_backup.go +++ b/api/kbcloud/admin/model_metadb_backup.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type Metadb_backup struct { // the path of storaging backups Path *string `json:"path,omitempty"` @@ -22,10 +27,11 @@ type Metadb_backup struct { // name of the backup Name string `json:"name"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetadb_backup instantiates a new Metadb_backup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +52,6 @@ func NewMetadb_backupWithDefaults() *Metadb_backup { this := Metadb_backup{} return &this } - // GetPath returns the Path field value if set, zero value otherwise. func (o *Metadb_backup) GetPath() string { if o == nil || o.Path == nil { @@ -75,6 +80,7 @@ func (o *Metadb_backup) SetPath(v string) { o.Path = &v } + // GetCompletionTimestamp returns the CompletionTimestamp field value. func (o *Metadb_backup) GetCompletionTimestamp() string { if o == nil { @@ -98,6 +104,7 @@ func (o *Metadb_backup) SetCompletionTimestamp(v string) { o.CompletionTimestamp = v } + // GetCreationTimestamp returns the CreationTimestamp field value. func (o *Metadb_backup) GetCreationTimestamp() string { if o == nil { @@ -121,6 +128,7 @@ func (o *Metadb_backup) SetCreationTimestamp(v string) { o.CreationTimestamp = v } + // GetDuration returns the Duration field value. func (o *Metadb_backup) GetDuration() string { if o == nil { @@ -144,6 +152,7 @@ func (o *Metadb_backup) SetDuration(v string) { o.Duration = v } + // GetName returns the Name field value. func (o *Metadb_backup) GetName() string { if o == nil { @@ -167,6 +176,8 @@ func (o *Metadb_backup) SetName(v string) { o.Name = v } + + // MarshalJSON serializes the struct using spec logic. func (o Metadb_backup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -190,11 +201,11 @@ func (o Metadb_backup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Metadb_backup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Path *string `json:"path,omitempty"` + Path *string `json:"path,omitempty"` CompletionTimestamp *string `json:"completionTimestamp"` - CreationTimestamp *string `json:"creationTimestamp"` - Duration *string `json:"duration"` - Name *string `json:"name"` + CreationTimestamp *string `json:"creationTimestamp"` + Duration *string `json:"duration"` + Name *string `json:"name"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -213,7 +224,7 @@ func (o *Metadb_backup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"path", "completionTimestamp", "creationTimestamp", "duration", "name"}) + common.DeleteKeys(additionalProperties, &[]string{ "path", "completionTimestamp", "creationTimestamp", "duration", "name", }) } else { return err } diff --git a/api/kbcloud/admin/model_metadb_backup_list.go b/api/kbcloud/admin/model_metadb_backup_list.go index a6add06d..73d00e45 100644 --- a/api/kbcloud/admin/model_metadb_backup_list.go +++ b/api/kbcloud/admin/model_metadb_backup_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Metadb_backupList BackupList is a list of backups + + +// Metadb_backupList BackupList is a list of backups type Metadb_backupList struct { // Items is the list of backup objects in the list Items []Metadb_backup `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetadb_backupList instantiates a new Metadb_backupList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewMetadb_backupListWithDefaults() *Metadb_backupList { this := Metadb_backupList{} return &this } - // GetItems returns the Items field value. func (o *Metadb_backupList) GetItems() []Metadb_backup { if o == nil { @@ -60,6 +65,8 @@ func (o *Metadb_backupList) SetItems(v []Metadb_backup) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o Metadb_backupList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *Metadb_backupList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_metadb_instance.go b/api/kbcloud/admin/model_metadb_instance.go index 005510fb..7c1eeff6 100644 --- a/api/kbcloud/admin/model_metadb_instance.go +++ b/api/kbcloud/admin/model_metadb_instance.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Metadb_instance Instance is the information of metadb cluster instances + + +// Metadb_instance Instance is the information of metadb cluster instances type Metadb_instance struct { // Cluster name Cluster string `json:"cluster"` @@ -25,10 +30,11 @@ type Metadb_instance struct { // Role for instance Role string `json:"role"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetadb_instance instantiates a new Metadb_instance object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -51,7 +57,6 @@ func NewMetadb_instanceWithDefaults() *Metadb_instance { this := Metadb_instance{} return &this } - // GetCluster returns the Cluster field value. func (o *Metadb_instance) GetCluster() string { if o == nil { @@ -75,6 +80,7 @@ func (o *Metadb_instance) SetCluster(v string) { o.Cluster = v } + // GetCpu returns the Cpu field value. func (o *Metadb_instance) GetCpu() string { if o == nil { @@ -98,6 +104,7 @@ func (o *Metadb_instance) SetCpu(v string) { o.Cpu = v } + // GetMemory returns the Memory field value. func (o *Metadb_instance) GetMemory() string { if o == nil { @@ -121,6 +128,7 @@ func (o *Metadb_instance) SetMemory(v string) { o.Memory = v } + // GetName returns the Name field value. func (o *Metadb_instance) GetName() string { if o == nil { @@ -144,6 +152,7 @@ func (o *Metadb_instance) SetName(v string) { o.Name = v } + // GetNode returns the Node field value. func (o *Metadb_instance) GetNode() string { if o == nil { @@ -167,6 +176,7 @@ func (o *Metadb_instance) SetNode(v string) { o.Node = v } + // GetRole returns the Role field value. func (o *Metadb_instance) GetRole() string { if o == nil { @@ -190,6 +200,8 @@ func (o *Metadb_instance) SetRole(v string) { o.Role = v } + + // MarshalJSON serializes the struct using spec logic. func (o Metadb_instance) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -213,11 +225,11 @@ func (o Metadb_instance) MarshalJSON() ([]byte, error) { func (o *Metadb_instance) UnmarshalJSON(bytes []byte) (err error) { all := struct { Cluster *string `json:"cluster"` - Cpu *string `json:"cpu"` - Memory *string `json:"memory"` - Name *string `json:"name"` - Node *string `json:"node"` - Role *string `json:"role"` + Cpu *string `json:"cpu"` + Memory *string `json:"memory"` + Name *string `json:"name"` + Node *string `json:"node"` + Role *string `json:"role"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -242,7 +254,7 @@ func (o *Metadb_instance) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cluster", "cpu", "memory", "name", "node", "role"}) + common.DeleteKeys(additionalProperties, &[]string{ "cluster", "cpu", "memory", "name", "node", "role", }) } else { return err } diff --git a/api/kbcloud/admin/model_metadb_instance_list.go b/api/kbcloud/admin/model_metadb_instance_list.go index b0e4f959..47fc94ae 100644 --- a/api/kbcloud/admin/model_metadb_instance_list.go +++ b/api/kbcloud/admin/model_metadb_instance_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Metadb_instanceList ClusterList is a list of metadb cluster + + +// Metadb_instanceList ClusterList is a list of metadb cluster type Metadb_instanceList struct { // Items is the list of metadb cluster objects in the list Items []Metadb_instance `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetadb_instanceList instantiates a new Metadb_instanceList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewMetadb_instanceListWithDefaults() *Metadb_instanceList { this := Metadb_instanceList{} return &this } - // GetItems returns the Items field value. func (o *Metadb_instanceList) GetItems() []Metadb_instance { if o == nil { @@ -60,6 +65,8 @@ func (o *Metadb_instanceList) SetItems(v []Metadb_instance) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o Metadb_instanceList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *Metadb_instanceList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_metadb_instance_metrics.go b/api/kbcloud/admin/model_metadb_instance_metrics.go index 1fd97d6f..fcbb36e1 100644 --- a/api/kbcloud/admin/model_metadb_instance_metrics.go +++ b/api/kbcloud/admin/model_metadb_instance_metrics.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Metadb_instanceMetrics instance metrics + + +// Metadb_instanceMetrics instance metrics type Metadb_instanceMetrics struct { // the name of the instance InstanceName string `json:"instanceName"` @@ -19,10 +24,11 @@ type Metadb_instanceMetrics struct { // memory with uint Gi. MemoryUsage string `json:"memoryUsage"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetadb_instanceMetrics instantiates a new Metadb_instanceMetrics object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewMetadb_instanceMetricsWithDefaults() *Metadb_instanceMetrics { this := Metadb_instanceMetrics{} return &this } - // GetInstanceName returns the InstanceName field value. func (o *Metadb_instanceMetrics) GetInstanceName() string { if o == nil { @@ -66,6 +71,7 @@ func (o *Metadb_instanceMetrics) SetInstanceName(v string) { o.InstanceName = v } + // GetCpuUsage returns the CpuUsage field value. func (o *Metadb_instanceMetrics) GetCpuUsage() string { if o == nil { @@ -89,6 +95,7 @@ func (o *Metadb_instanceMetrics) SetCpuUsage(v string) { o.CpuUsage = v } + // GetMemoryUsage returns the MemoryUsage field value. func (o *Metadb_instanceMetrics) GetMemoryUsage() string { if o == nil { @@ -112,6 +119,8 @@ func (o *Metadb_instanceMetrics) SetMemoryUsage(v string) { o.MemoryUsage = v } + + // MarshalJSON serializes the struct using spec logic. func (o Metadb_instanceMetrics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -132,8 +141,8 @@ func (o Metadb_instanceMetrics) MarshalJSON() ([]byte, error) { func (o *Metadb_instanceMetrics) UnmarshalJSON(bytes []byte) (err error) { all := struct { InstanceName *string `json:"instanceName"` - CpuUsage *string `json:"cpuUsage"` - MemoryUsage *string `json:"memoryUsage"` + CpuUsage *string `json:"cpuUsage"` + MemoryUsage *string `json:"memoryUsage"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,7 +158,7 @@ func (o *Metadb_instanceMetrics) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"instanceName", "cpuUsage", "memoryUsage"}) + common.DeleteKeys(additionalProperties, &[]string{ "instanceName", "cpuUsage", "memoryUsage", }) } else { return err } diff --git a/api/kbcloud/admin/model_metadb_instance_metrics_list.go b/api/kbcloud/admin/model_metadb_instance_metrics_list.go index bdbfd3f4..2bf5d2d6 100644 --- a/api/kbcloud/admin/model_metadb_instance_metrics_list.go +++ b/api/kbcloud/admin/model_metadb_instance_metrics_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Metadb_instanceMetricsList instance metrics list + + +// Metadb_instanceMetricsList instance metrics list type Metadb_instanceMetricsList struct { // instanceMetrics list Items []Metadb_instanceMetrics `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetadb_instanceMetricsList instantiates a new Metadb_instanceMetricsList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewMetadb_instanceMetricsListWithDefaults() *Metadb_instanceMetricsList { this := Metadb_instanceMetricsList{} return &this } - // GetItems returns the Items field value. func (o *Metadb_instanceMetricsList) GetItems() []Metadb_instanceMetrics { if o == nil { @@ -60,6 +65,8 @@ func (o *Metadb_instanceMetricsList) SetItems(v []Metadb_instanceMetrics) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o Metadb_instanceMetricsList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *Metadb_instanceMetricsList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_metadb_restore.go b/api/kbcloud/admin/model_metadb_restore.go index dd53d134..265545e6 100644 --- a/api/kbcloud/admin/model_metadb_restore.go +++ b/api/kbcloud/admin/model_metadb_restore.go @@ -2,15 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type Metadb_restore struct { // the namespace of new cluster, default value is original namespace Namespace *string `json:"namespace,omitempty"` @@ -23,19 +27,22 @@ type Metadb_restore struct { // the duration time of restore execution Duration *string `json:"duration,omitempty"` // completion time - CompletionTimestamp *time.Time `json:"completionTimestamp,omitempty"` + CompletionTimestamp *string `json:"completionTimestamp,omitempty"` // start time - StartTimestamp *time.Time `json:"startTimestamp,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *float64 `json:"storage,omitempty"` + StartTimestamp *string `json:"startTimestamp,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *float64 `json:"storage,omitempty"` // the number of postgresql pods Replicas *int32 `json:"replicas,omitempty"` + // whether pods are ready + Ready *string `json:"ready,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetadb_restore instantiates a new Metadb_restore object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +60,6 @@ func NewMetadb_restoreWithDefaults() *Metadb_restore { this := Metadb_restore{} return &this } - // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *Metadb_restore) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -82,6 +88,7 @@ func (o *Metadb_restore) SetNamespace(v string) { o.Namespace = &v } + // GetBackupName returns the BackupName field value if set, zero value otherwise. func (o *Metadb_restore) GetBackupName() string { if o == nil || o.BackupName == nil { @@ -110,6 +117,7 @@ func (o *Metadb_restore) SetBackupName(v string) { o.BackupName = &v } + // GetClusterName returns the ClusterName field value. func (o *Metadb_restore) GetClusterName() string { if o == nil { @@ -133,6 +141,7 @@ func (o *Metadb_restore) SetClusterName(v string) { o.ClusterName = v } + // GetTimestamp returns the Timestamp field value if set, zero value otherwise. func (o *Metadb_restore) GetTimestamp() string { if o == nil || o.Timestamp == nil { @@ -161,6 +170,7 @@ func (o *Metadb_restore) SetTimestamp(v string) { o.Timestamp = &v } + // GetDuration returns the Duration field value if set, zero value otherwise. func (o *Metadb_restore) GetDuration() string { if o == nil || o.Duration == nil { @@ -189,10 +199,11 @@ func (o *Metadb_restore) SetDuration(v string) { o.Duration = &v } + // GetCompletionTimestamp returns the CompletionTimestamp field value if set, zero value otherwise. -func (o *Metadb_restore) GetCompletionTimestamp() time.Time { +func (o *Metadb_restore) GetCompletionTimestamp() string { if o == nil || o.CompletionTimestamp == nil { - var ret time.Time + var ret string return ret } return *o.CompletionTimestamp @@ -200,7 +211,7 @@ func (o *Metadb_restore) GetCompletionTimestamp() time.Time { // GetCompletionTimestampOk returns a tuple with the CompletionTimestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Metadb_restore) GetCompletionTimestampOk() (*time.Time, bool) { +func (o *Metadb_restore) GetCompletionTimestampOk() (*string, bool) { if o == nil || o.CompletionTimestamp == nil { return nil, false } @@ -212,15 +223,16 @@ func (o *Metadb_restore) HasCompletionTimestamp() bool { return o != nil && o.CompletionTimestamp != nil } -// SetCompletionTimestamp gets a reference to the given time.Time and assigns it to the CompletionTimestamp field. -func (o *Metadb_restore) SetCompletionTimestamp(v time.Time) { +// SetCompletionTimestamp gets a reference to the given string and assigns it to the CompletionTimestamp field. +func (o *Metadb_restore) SetCompletionTimestamp(v string) { o.CompletionTimestamp = &v } + // GetStartTimestamp returns the StartTimestamp field value if set, zero value otherwise. -func (o *Metadb_restore) GetStartTimestamp() time.Time { +func (o *Metadb_restore) GetStartTimestamp() string { if o == nil || o.StartTimestamp == nil { - var ret time.Time + var ret string return ret } return *o.StartTimestamp @@ -228,7 +240,7 @@ func (o *Metadb_restore) GetStartTimestamp() time.Time { // GetStartTimestampOk returns a tuple with the StartTimestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Metadb_restore) GetStartTimestampOk() (*time.Time, bool) { +func (o *Metadb_restore) GetStartTimestampOk() (*string, bool) { if o == nil || o.StartTimestamp == nil { return nil, false } @@ -240,11 +252,12 @@ func (o *Metadb_restore) HasStartTimestamp() bool { return o != nil && o.StartTimestamp != nil } -// SetStartTimestamp gets a reference to the given time.Time and assigns it to the StartTimestamp field. -func (o *Metadb_restore) SetStartTimestamp(v time.Time) { +// SetStartTimestamp gets a reference to the given string and assigns it to the StartTimestamp field. +func (o *Metadb_restore) SetStartTimestamp(v string) { o.StartTimestamp = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *Metadb_restore) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -273,6 +286,7 @@ func (o *Metadb_restore) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *Metadb_restore) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -301,6 +315,7 @@ func (o *Metadb_restore) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *Metadb_restore) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -329,6 +344,7 @@ func (o *Metadb_restore) SetStorage(v float64) { o.Storage = &v } + // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *Metadb_restore) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -357,6 +373,37 @@ func (o *Metadb_restore) SetReplicas(v int32) { o.Replicas = &v } + +// GetReady returns the Ready field value if set, zero value otherwise. +func (o *Metadb_restore) GetReady() string { + if o == nil || o.Ready == nil { + var ret string + return ret + } + return *o.Ready +} + +// GetReadyOk returns a tuple with the Ready field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadb_restore) GetReadyOk() (*string, bool) { + if o == nil || o.Ready == nil { + return nil, false + } + return o.Ready, true +} + +// HasReady returns a boolean if a field has been set. +func (o *Metadb_restore) HasReady() bool { + return o != nil && o.Ready != nil +} + +// SetReady gets a reference to the given string and assigns it to the Ready field. +func (o *Metadb_restore) SetReady(v string) { + o.Ready = &v +} + + + // MarshalJSON serializes the struct using spec logic. func (o Metadb_restore) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -377,18 +424,10 @@ func (o Metadb_restore) MarshalJSON() ([]byte, error) { toSerialize["duration"] = o.Duration } if o.CompletionTimestamp != nil { - if o.CompletionTimestamp.Nanosecond() == 0 { - toSerialize["completionTimestamp"] = o.CompletionTimestamp.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["completionTimestamp"] = o.CompletionTimestamp.Format("2006-01-02T15:04:05.000Z07:00") - } + toSerialize["completionTimestamp"] = o.CompletionTimestamp } if o.StartTimestamp != nil { - if o.StartTimestamp.Nanosecond() == 0 { - toSerialize["startTimestamp"] = o.StartTimestamp.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["startTimestamp"] = o.StartTimestamp.Format("2006-01-02T15:04:05.000Z07:00") - } + toSerialize["startTimestamp"] = o.StartTimestamp } if o.Cpu != nil { toSerialize["cpu"] = o.Cpu @@ -402,6 +441,9 @@ func (o Metadb_restore) MarshalJSON() ([]byte, error) { if o.Replicas != nil { toSerialize["replicas"] = o.Replicas } + if o.Ready != nil { + toSerialize["ready"] = o.Ready + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -412,17 +454,18 @@ func (o Metadb_restore) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Metadb_restore) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Namespace *string `json:"namespace,omitempty"` - BackupName *string `json:"backupName,omitempty"` - ClusterName *string `json:"clusterName"` - Timestamp *string `json:"timestamp,omitempty"` - Duration *string `json:"duration,omitempty"` - CompletionTimestamp *time.Time `json:"completionTimestamp,omitempty"` - StartTimestamp *time.Time `json:"startTimestamp,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *float64 `json:"storage,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` + Namespace *string `json:"namespace,omitempty"` + BackupName *string `json:"backupName,omitempty"` + ClusterName *string `json:"clusterName"` + Timestamp *string `json:"timestamp,omitempty"` + Duration *string `json:"duration,omitempty"` + CompletionTimestamp *string `json:"completionTimestamp,omitempty"` + StartTimestamp *string `json:"startTimestamp,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *float64 `json:"storage,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Ready *string `json:"ready,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -432,7 +475,7 @@ func (o *Metadb_restore) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"namespace", "backupName", "clusterName", "timestamp", "duration", "completionTimestamp", "startTimestamp", "cpu", "memory", "storage", "replicas"}) + common.DeleteKeys(additionalProperties, &[]string{ "namespace", "backupName", "clusterName", "timestamp", "duration", "completionTimestamp", "startTimestamp", "cpu", "memory", "storage", "replicas", "ready", }) } else { return err } @@ -447,6 +490,7 @@ func (o *Metadb_restore) UnmarshalJSON(bytes []byte) (err error) { o.Memory = all.Memory o.Storage = all.Storage o.Replicas = all.Replicas + o.Ready = all.Ready if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/kbcloud/admin/model_metrics_option.go b/api/kbcloud/admin/model_metrics_option.go index 1648868c..1fc72058 100644 --- a/api/kbcloud/admin/model_metrics_option.go +++ b/api/kbcloud/admin/model_metrics_option.go @@ -2,17 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type MetricsOption struct { ReplicationLag *MetricsOptionReplicationLag `json:"replicationLag,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetricsOption instantiates a new MetricsOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -29,7 +39,6 @@ func NewMetricsOptionWithDefaults() *MetricsOption { this := MetricsOption{} return &this } - // GetReplicationLag returns the ReplicationLag field value if set, zero value otherwise. func (o *MetricsOption) GetReplicationLag() MetricsOptionReplicationLag { if o == nil || o.ReplicationLag == nil { @@ -58,6 +67,8 @@ func (o *MetricsOption) SetReplicationLag(v MetricsOptionReplicationLag) { o.ReplicationLag = &v } + + // MarshalJSON serializes the struct using spec logic. func (o MetricsOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -84,13 +95,13 @@ func (o *MetricsOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"replicationLag"}) + common.DeleteKeys(additionalProperties, &[]string{ "replicationLag", }) } else { return err } hasInvalidField := false - if all.ReplicationLag != nil && all.ReplicationLag.UnparsedObject != nil && o.UnparsedObject == nil { + if all.ReplicationLag != nil && all.ReplicationLag.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.ReplicationLag = all.ReplicationLag diff --git a/api/kbcloud/admin/model_metrics_option_replication_lag.go b/api/kbcloud/admin/model_metrics_option_replication_lag.go index a69940d6..4f806434 100644 --- a/api/kbcloud/admin/model_metrics_option_replication_lag.go +++ b/api/kbcloud/admin/model_metrics_option_replication_lag.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type MetricsOptionReplicationLag struct { QueryPattern *string `json:"queryPattern,omitempty"` // Specifies the type of metrics query to be performed. @@ -13,10 +22,11 @@ type MetricsOptionReplicationLag struct { // QueryType *EngineOptionsMetricsQueryType `json:"queryType,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetricsOptionReplicationLag instantiates a new MetricsOptionReplicationLag object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewMetricsOptionReplicationLagWithDefaults() *MetricsOptionReplicationLag { this := MetricsOptionReplicationLag{} return &this } - // GetQueryPattern returns the QueryPattern field value if set, zero value otherwise. func (o *MetricsOptionReplicationLag) GetQueryPattern() string { if o == nil || o.QueryPattern == nil { @@ -62,6 +71,7 @@ func (o *MetricsOptionReplicationLag) SetQueryPattern(v string) { o.QueryPattern = &v } + // GetQueryType returns the QueryType field value if set, zero value otherwise. func (o *MetricsOptionReplicationLag) GetQueryType() EngineOptionsMetricsQueryType { if o == nil || o.QueryType == nil { @@ -90,6 +100,8 @@ func (o *MetricsOptionReplicationLag) SetQueryType(v EngineOptionsMetricsQueryTy o.QueryType = &v } + + // MarshalJSON serializes the struct using spec logic. func (o MetricsOptionReplicationLag) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,22 +124,22 @@ func (o MetricsOptionReplicationLag) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *MetricsOptionReplicationLag) UnmarshalJSON(bytes []byte) (err error) { all := struct { - QueryPattern *string `json:"queryPattern,omitempty"` - QueryType *EngineOptionsMetricsQueryType `json:"queryType,omitempty"` + QueryPattern *string `json:"queryPattern,omitempty"` + QueryType *EngineOptionsMetricsQueryType `json:"queryType,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"queryPattern", "queryType"}) + common.DeleteKeys(additionalProperties, &[]string{ "queryPattern", "queryType", }) } else { return err } hasInvalidField := false o.QueryPattern = all.QueryPattern - if all.QueryType != nil && !all.QueryType.IsValid() { + if all.QueryType != nil &&!all.QueryType.IsValid() { hasInvalidField = true } else { o.QueryType = all.QueryType diff --git a/api/kbcloud/admin/model_metrics_query_type.go b/api/kbcloud/admin/model_metrics_query_type.go index 015dd411..d18c775d 100644 --- a/api/kbcloud/admin/model_metrics_query_type.go +++ b/api/kbcloud/admin/model_metrics_query_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type MetricsQueryType string // List of MetricsQueryType. const ( MetricsQueryTypeInstant MetricsQueryType = "instant" - MetricsQueryTypeRange MetricsQueryType = "range" + MetricsQueryTypeRange MetricsQueryType = "range" ) var allowedMetricsQueryTypeEnumValues = []MetricsQueryType{ diff --git a/api/kbcloud/admin/model_mode_component.go b/api/kbcloud/admin/model_mode_component.go index d0cde82e..75c6e43a 100644 --- a/api/kbcloud/admin/model_mode_component.go +++ b/api/kbcloud/admin/model_mode_component.go @@ -2,28 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ModeComponent struct { - Component string `json:"component"` - Shards *IntegerOption `json:"shards,omitempty"` - Replicas IntegerOption `json:"replicas"` - Cpu FloatOption `json:"cpu"` - Memory FloatOption `json:"memory"` - HideEnpoints bool `json:"hideEnpoints"` - HideOnCreate bool `json:"hideOnCreate"` - Storages []StorageOption `json:"storages"` + Component string `json:"component"` + Shards *IntegerOption `json:"shards,omitempty"` + Replicas IntegerOption `json:"replicas"` + Cpu FloatOption `json:"cpu"` + Memory FloatOption `json:"memory"` + HideEnpoints bool `json:"hideEnpoints"` + HideOnCreate bool `json:"hideOnCreate"` + Storages []StorageOption `json:"storages"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewModeComponent instantiates a new ModeComponent object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +53,6 @@ func NewModeComponentWithDefaults() *ModeComponent { this := ModeComponent{} return &this } - // GetComponent returns the Component field value. func (o *ModeComponent) GetComponent() string { if o == nil { @@ -71,6 +76,7 @@ func (o *ModeComponent) SetComponent(v string) { o.Component = v } + // GetShards returns the Shards field value if set, zero value otherwise. func (o *ModeComponent) GetShards() IntegerOption { if o == nil || o.Shards == nil { @@ -99,6 +105,7 @@ func (o *ModeComponent) SetShards(v IntegerOption) { o.Shards = &v } + // GetReplicas returns the Replicas field value. func (o *ModeComponent) GetReplicas() IntegerOption { if o == nil { @@ -122,6 +129,7 @@ func (o *ModeComponent) SetReplicas(v IntegerOption) { o.Replicas = v } + // GetCpu returns the Cpu field value. func (o *ModeComponent) GetCpu() FloatOption { if o == nil { @@ -145,6 +153,7 @@ func (o *ModeComponent) SetCpu(v FloatOption) { o.Cpu = v } + // GetMemory returns the Memory field value. func (o *ModeComponent) GetMemory() FloatOption { if o == nil { @@ -168,6 +177,7 @@ func (o *ModeComponent) SetMemory(v FloatOption) { o.Memory = v } + // GetHideEnpoints returns the HideEnpoints field value. func (o *ModeComponent) GetHideEnpoints() bool { if o == nil { @@ -191,6 +201,7 @@ func (o *ModeComponent) SetHideEnpoints(v bool) { o.HideEnpoints = v } + // GetHideOnCreate returns the HideOnCreate field value. func (o *ModeComponent) GetHideOnCreate() bool { if o == nil { @@ -214,6 +225,7 @@ func (o *ModeComponent) SetHideOnCreate(v bool) { o.HideOnCreate = v } + // GetStorages returns the Storages field value. func (o *ModeComponent) GetStorages() []StorageOption { if o == nil { @@ -237,6 +249,8 @@ func (o *ModeComponent) SetStorages(v []StorageOption) { o.Storages = v } + + // MarshalJSON serializes the struct using spec logic. func (o ModeComponent) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -263,14 +277,14 @@ func (o ModeComponent) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ModeComponent) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` - Shards *IntegerOption `json:"shards,omitempty"` - Replicas *IntegerOption `json:"replicas"` - Cpu *FloatOption `json:"cpu"` - Memory *FloatOption `json:"memory"` - HideEnpoints *bool `json:"hideEnpoints"` - HideOnCreate *bool `json:"hideOnCreate"` - Storages *[]StorageOption `json:"storages"` + Component *string `json:"component"` + Shards *IntegerOption `json:"shards,omitempty"` + Replicas *IntegerOption `json:"replicas"` + Cpu *FloatOption `json:"cpu"` + Memory *FloatOption `json:"memory"` + HideEnpoints *bool `json:"hideEnpoints"` + HideOnCreate *bool `json:"hideOnCreate"` + Storages *[]StorageOption `json:"storages"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -298,14 +312,14 @@ func (o *ModeComponent) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "shards", "replicas", "cpu", "memory", "hideEnpoints", "hideOnCreate", "storages"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "shards", "replicas", "cpu", "memory", "hideEnpoints", "hideOnCreate", "storages", }) } else { return err } hasInvalidField := false o.Component = *all.Component - if all.Shards != nil && all.Shards.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Shards != nil && all.Shards.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Shards = all.Shards diff --git a/api/kbcloud/admin/model_mode_option.go b/api/kbcloud/admin/model_mode_option.go index c7d8c530..857fe59d 100644 --- a/api/kbcloud/admin/model_mode_option.go +++ b/api/kbcloud/admin/model_mode_option.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ModeOption struct { - Name string `json:"name"` - Title LocalizedDescription `json:"title"` - Description LocalizedDescription `json:"description"` - Components []ModeComponent `json:"components"` - Proxy *ModeOptionProxy `json:"proxy,omitempty"` - Extra map[string]interface{} `json:"extra,omitempty"` + Name string `json:"name"` + Title LocalizedDescription `json:"title"` + Description LocalizedDescription `json:"description"` + Components []ModeComponent `json:"components"` + Proxy *ModeOptionProxy `json:"proxy,omitempty"` + Extra map[string]interface{} `json:"extra,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewModeOption instantiates a new ModeOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewModeOptionWithDefaults() *ModeOption { this := ModeOption{} return &this } - // GetName returns the Name field value. func (o *ModeOption) GetName() string { if o == nil { @@ -66,6 +71,7 @@ func (o *ModeOption) SetName(v string) { o.Name = v } + // GetTitle returns the Title field value. func (o *ModeOption) GetTitle() LocalizedDescription { if o == nil { @@ -89,6 +95,7 @@ func (o *ModeOption) SetTitle(v LocalizedDescription) { o.Title = v } + // GetDescription returns the Description field value. func (o *ModeOption) GetDescription() LocalizedDescription { if o == nil { @@ -112,6 +119,7 @@ func (o *ModeOption) SetDescription(v LocalizedDescription) { o.Description = v } + // GetComponents returns the Components field value. func (o *ModeOption) GetComponents() []ModeComponent { if o == nil { @@ -135,6 +143,7 @@ func (o *ModeOption) SetComponents(v []ModeComponent) { o.Components = v } + // GetProxy returns the Proxy field value if set, zero value otherwise. func (o *ModeOption) GetProxy() ModeOptionProxy { if o == nil || o.Proxy == nil { @@ -163,6 +172,7 @@ func (o *ModeOption) SetProxy(v ModeOptionProxy) { o.Proxy = &v } + // GetExtra returns the Extra field value if set, zero value otherwise. func (o *ModeOption) GetExtra() map[string]interface{} { if o == nil || o.Extra == nil { @@ -191,6 +201,8 @@ func (o *ModeOption) SetExtra(v map[string]interface{}) { o.Extra = v } + + // MarshalJSON serializes the struct using spec logic. func (o ModeOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -217,12 +229,12 @@ func (o ModeOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ModeOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Title *LocalizedDescription `json:"title"` - Description *LocalizedDescription `json:"description"` - Components *[]ModeComponent `json:"components"` - Proxy *ModeOptionProxy `json:"proxy,omitempty"` - Extra map[string]interface{} `json:"extra,omitempty"` + Name *string `json:"name"` + Title *LocalizedDescription `json:"title"` + Description *LocalizedDescription `json:"description"` + Components *[]ModeComponent `json:"components"` + Proxy *ModeOptionProxy `json:"proxy,omitempty"` + Extra map[string]interface{} `json:"extra,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -241,7 +253,7 @@ func (o *ModeOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "title", "description", "components", "proxy", "extra"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "title", "description", "components", "proxy", "extra", }) } else { return err } @@ -257,7 +269,7 @@ func (o *ModeOption) UnmarshalJSON(bytes []byte) (err error) { } o.Description = *all.Description o.Components = *all.Components - if all.Proxy != nil && all.Proxy.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Proxy != nil && all.Proxy.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Proxy = all.Proxy diff --git a/api/kbcloud/admin/model_mode_option_proxy.go b/api/kbcloud/admin/model_mode_option_proxy.go index a050506b..964779b9 100644 --- a/api/kbcloud/admin/model_mode_option_proxy.go +++ b/api/kbcloud/admin/model_mode_option_proxy.go @@ -2,17 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ModeOptionProxy struct { Enabled *bool `json:"enabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewModeOptionProxy instantiates a new ModeOptionProxy object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -29,7 +39,6 @@ func NewModeOptionProxyWithDefaults() *ModeOptionProxy { this := ModeOptionProxy{} return &this } - // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *ModeOptionProxy) GetEnabled() bool { if o == nil || o.Enabled == nil { @@ -58,6 +67,8 @@ func (o *ModeOptionProxy) SetEnabled(v bool) { o.Enabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ModeOptionProxy) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -84,7 +95,7 @@ func (o *ModeOptionProxy) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_monitor_data_sink.go b/api/kbcloud/admin/model_monitor_data_sink.go index b8766899..06468057 100644 --- a/api/kbcloud/admin/model_monitor_data_sink.go +++ b/api/kbcloud/admin/model_monitor_data_sink.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// MonitorDataSink MonitorDataSink + + +// MonitorDataSink MonitorDataSink type MonitorDataSink struct { // MonitorDataSink ID Id string `json:"id"` @@ -23,10 +28,11 @@ type MonitorDataSink struct { // type of monitor data sink(logs or metrics) MonitorDataSinkType string `json:"monitorDataSinkType"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMonitorDataSink instantiates a new MonitorDataSink object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +53,6 @@ func NewMonitorDataSinkWithDefaults() *MonitorDataSink { this := MonitorDataSink{} return &this } - // GetId returns the Id field value. func (o *MonitorDataSink) GetId() string { if o == nil { @@ -71,6 +76,7 @@ func (o *MonitorDataSink) SetId(v string) { o.Id = v } + // GetExporterUrl returns the ExporterUrl field value. func (o *MonitorDataSink) GetExporterUrl() string { if o == nil { @@ -94,6 +100,7 @@ func (o *MonitorDataSink) SetExporterUrl(v string) { o.ExporterUrl = v } + // GetEnvironmentId returns the EnvironmentId field value. func (o *MonitorDataSink) GetEnvironmentId() string { if o == nil { @@ -117,6 +124,7 @@ func (o *MonitorDataSink) SetEnvironmentId(v string) { o.EnvironmentId = v } + // GetIndexName returns the IndexName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSink) GetIndexName() string { if o == nil || o.IndexName.Get() == nil { @@ -130,7 +138,7 @@ func (o *MonitorDataSink) GetIndexName() string { // 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 *MonitorDataSink) GetIndexNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.IndexName.Get(), o.IndexName.IsSet() @@ -145,7 +153,6 @@ func (o *MonitorDataSink) HasIndexName() bool { func (o *MonitorDataSink) SetIndexName(v string) { o.IndexName.Set(&v) } - // SetIndexNameNil sets the value for IndexName to be an explicit nil. func (o *MonitorDataSink) SetIndexNameNil() { o.IndexName.Set(nil) @@ -156,6 +163,7 @@ func (o *MonitorDataSink) UnsetIndexName() { o.IndexName.Unset() } + // GetMonitorDataSinkType returns the MonitorDataSinkType field value. func (o *MonitorDataSink) GetMonitorDataSinkType() string { if o == nil { @@ -179,6 +187,8 @@ func (o *MonitorDataSink) SetMonitorDataSinkType(v string) { o.MonitorDataSinkType = v } + + // MarshalJSON serializes the struct using spec logic. func (o MonitorDataSink) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -202,11 +212,11 @@ func (o MonitorDataSink) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *MonitorDataSink) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - ExporterUrl *string `json:"exporterUrl"` - EnvironmentId *string `json:"environmentID"` - IndexName common.NullableString `json:"indexName,omitempty"` - MonitorDataSinkType *string `json:"monitorDataSinkType"` + Id *string `json:"id"` + ExporterUrl *string `json:"exporterUrl"` + EnvironmentId *string `json:"environmentID"` + IndexName common.NullableString `json:"indexName,omitempty"` + MonitorDataSinkType *string `json:"monitorDataSinkType"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -225,7 +235,7 @@ func (o *MonitorDataSink) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "exporterUrl", "environmentID", "indexName", "monitorDataSinkType"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "exporterUrl", "environmentID", "indexName", "monitorDataSinkType", }) } else { return err } diff --git a/api/kbcloud/admin/model_monitor_data_sink_create.go b/api/kbcloud/admin/model_monitor_data_sink_create.go index 35d3cda5..031a3f94 100644 --- a/api/kbcloud/admin/model_monitor_data_sink_create.go +++ b/api/kbcloud/admin/model_monitor_data_sink_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// MonitorDataSinkCreate External Endpoint create option + + +// MonitorDataSinkCreate External Endpoint create option type MonitorDataSinkCreate struct { // url for exporter(eg. url for ElasticSearch) ExporterUrl string `json:"exporterUrl"` @@ -27,10 +32,11 @@ type MonitorDataSinkCreate struct { // indexName for ElasticSearch IndexName common.NullableString `json:"indexName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMonitorDataSinkCreate instantiates a new MonitorDataSinkCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -50,7 +56,6 @@ func NewMonitorDataSinkCreateWithDefaults() *MonitorDataSinkCreate { this := MonitorDataSinkCreate{} return &this } - // GetExporterUrl returns the ExporterUrl field value. func (o *MonitorDataSinkCreate) GetExporterUrl() string { if o == nil { @@ -74,6 +79,7 @@ func (o *MonitorDataSinkCreate) SetExporterUrl(v string) { o.ExporterUrl = v } + // GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkCreate) GetUsername() string { if o == nil || o.Username.Get() == nil { @@ -87,7 +93,7 @@ func (o *MonitorDataSinkCreate) GetUsername() string { // 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 *MonitorDataSinkCreate) GetUsernameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Username.Get(), o.Username.IsSet() @@ -102,7 +108,6 @@ func (o *MonitorDataSinkCreate) HasUsername() bool { func (o *MonitorDataSinkCreate) SetUsername(v string) { o.Username.Set(&v) } - // SetUsernameNil sets the value for Username to be an explicit nil. func (o *MonitorDataSinkCreate) SetUsernameNil() { o.Username.Set(nil) @@ -113,6 +118,7 @@ func (o *MonitorDataSinkCreate) UnsetUsername() { o.Username.Unset() } + // GetEnvironmentName returns the EnvironmentName field value. func (o *MonitorDataSinkCreate) GetEnvironmentName() string { if o == nil { @@ -136,6 +142,7 @@ func (o *MonitorDataSinkCreate) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetMonitorDataSinkType returns the MonitorDataSinkType field value. func (o *MonitorDataSinkCreate) GetMonitorDataSinkType() string { if o == nil { @@ -159,6 +166,7 @@ func (o *MonitorDataSinkCreate) SetMonitorDataSinkType(v string) { o.MonitorDataSinkType = v } + // GetPassword returns the Password field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkCreate) GetPassword() string { if o == nil || o.Password.Get() == nil { @@ -172,7 +180,7 @@ func (o *MonitorDataSinkCreate) GetPassword() string { // 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 *MonitorDataSinkCreate) GetPasswordOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Password.Get(), o.Password.IsSet() @@ -187,7 +195,6 @@ func (o *MonitorDataSinkCreate) HasPassword() bool { func (o *MonitorDataSinkCreate) SetPassword(v string) { o.Password.Set(&v) } - // SetPasswordNil sets the value for Password to be an explicit nil. func (o *MonitorDataSinkCreate) SetPasswordNil() { o.Password.Set(nil) @@ -198,6 +205,7 @@ func (o *MonitorDataSinkCreate) UnsetPassword() { o.Password.Unset() } + // GetApiKey returns the ApiKey field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkCreate) GetApiKey() string { if o == nil || o.ApiKey.Get() == nil { @@ -211,7 +219,7 @@ func (o *MonitorDataSinkCreate) GetApiKey() string { // 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 *MonitorDataSinkCreate) GetApiKeyOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ApiKey.Get(), o.ApiKey.IsSet() @@ -226,7 +234,6 @@ func (o *MonitorDataSinkCreate) HasApiKey() bool { func (o *MonitorDataSinkCreate) SetApiKey(v string) { o.ApiKey.Set(&v) } - // SetApiKeyNil sets the value for ApiKey to be an explicit nil. func (o *MonitorDataSinkCreate) SetApiKeyNil() { o.ApiKey.Set(nil) @@ -237,6 +244,7 @@ func (o *MonitorDataSinkCreate) UnsetApiKey() { o.ApiKey.Unset() } + // GetIndexName returns the IndexName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkCreate) GetIndexName() string { if o == nil || o.IndexName.Get() == nil { @@ -250,7 +258,7 @@ func (o *MonitorDataSinkCreate) GetIndexName() string { // 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 *MonitorDataSinkCreate) GetIndexNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.IndexName.Get(), o.IndexName.IsSet() @@ -265,7 +273,6 @@ func (o *MonitorDataSinkCreate) HasIndexName() bool { func (o *MonitorDataSinkCreate) SetIndexName(v string) { o.IndexName.Set(&v) } - // SetIndexNameNil sets the value for IndexName to be an explicit nil. func (o *MonitorDataSinkCreate) SetIndexNameNil() { o.IndexName.Set(nil) @@ -276,6 +283,8 @@ func (o *MonitorDataSinkCreate) UnsetIndexName() { o.IndexName.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o MonitorDataSinkCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -307,13 +316,13 @@ func (o MonitorDataSinkCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *MonitorDataSinkCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ExporterUrl *string `json:"exporterUrl"` - Username common.NullableString `json:"username,omitempty"` - EnvironmentName *string `json:"environmentName"` - MonitorDataSinkType *string `json:"monitorDataSinkType"` - Password common.NullableString `json:"password,omitempty"` - ApiKey common.NullableString `json:"apiKey,omitempty"` - IndexName common.NullableString `json:"indexName,omitempty"` + ExporterUrl *string `json:"exporterUrl"` + Username common.NullableString `json:"username,omitempty"` + EnvironmentName *string `json:"environmentName"` + MonitorDataSinkType *string `json:"monitorDataSinkType"` + Password common.NullableString `json:"password,omitempty"` + ApiKey common.NullableString `json:"apiKey,omitempty"` + IndexName common.NullableString `json:"indexName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -329,7 +338,7 @@ func (o *MonitorDataSinkCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"exporterUrl", "username", "environmentName", "monitorDataSinkType", "password", "apiKey", "indexName"}) + common.DeleteKeys(additionalProperties, &[]string{ "exporterUrl", "username", "environmentName", "monitorDataSinkType", "password", "apiKey", "indexName", }) } else { return err } diff --git a/api/kbcloud/admin/model_monitor_data_sink_list.go b/api/kbcloud/admin/model_monitor_data_sink_list.go index 44e0489f..76b30292 100644 --- a/api/kbcloud/admin/model_monitor_data_sink_list.go +++ b/api/kbcloud/admin/model_monitor_data_sink_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// MonitorDataSinkList External Endpoint list + + +// MonitorDataSinkList External Endpoint list type MonitorDataSinkList struct { Items []MonitorDataSink `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMonitorDataSinkList instantiates a new MonitorDataSinkList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewMonitorDataSinkListWithDefaults() *MonitorDataSinkList { this := MonitorDataSinkList{} return &this } - // GetItems returns the Items field value. func (o *MonitorDataSinkList) GetItems() []MonitorDataSink { if o == nil { @@ -59,6 +64,8 @@ func (o *MonitorDataSinkList) SetItems(v []MonitorDataSink) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o MonitorDataSinkList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *MonitorDataSinkList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_monitor_data_sink_update.go b/api/kbcloud/admin/model_monitor_data_sink_update.go index 7ace4cbd..e6a4637e 100644 --- a/api/kbcloud/admin/model_monitor_data_sink_update.go +++ b/api/kbcloud/admin/model_monitor_data_sink_update.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// MonitorDataSinkUpdate External Endpoint update option + + +// MonitorDataSinkUpdate External Endpoint update option type MonitorDataSinkUpdate struct { // type of monitor data sink(logs or metrics) MonitorDataSinkType common.NullableString `json:"monitorDataSinkType"` @@ -29,10 +34,11 @@ type MonitorDataSinkUpdate struct { // indexName for ElasticSearch IndexName common.NullableString `json:"indexName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMonitorDataSinkUpdate instantiates a new MonitorDataSinkUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -51,7 +57,6 @@ func NewMonitorDataSinkUpdateWithDefaults() *MonitorDataSinkUpdate { this := MonitorDataSinkUpdate{} return &this } - // GetMonitorDataSinkType returns the MonitorDataSinkType field value. // If the value is explicit nil, the zero value for string will be returned. func (o *MonitorDataSinkUpdate) GetMonitorDataSinkType() string { @@ -77,6 +82,7 @@ func (o *MonitorDataSinkUpdate) SetMonitorDataSinkType(v string) { o.MonitorDataSinkType.Set(&v) } + // GetEnvironmentName returns the EnvironmentName field value. func (o *MonitorDataSinkUpdate) GetEnvironmentName() string { if o == nil { @@ -100,6 +106,7 @@ func (o *MonitorDataSinkUpdate) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetExporterUrl returns the ExporterUrl field value if set, zero value otherwise. func (o *MonitorDataSinkUpdate) GetExporterUrl() string { if o == nil || o.ExporterUrl == nil { @@ -128,6 +135,7 @@ func (o *MonitorDataSinkUpdate) SetExporterUrl(v string) { o.ExporterUrl = &v } + // GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkUpdate) GetName() string { if o == nil || o.Name.Get() == nil { @@ -141,7 +149,7 @@ func (o *MonitorDataSinkUpdate) GetName() string { // 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 *MonitorDataSinkUpdate) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Name.Get(), o.Name.IsSet() @@ -156,7 +164,6 @@ func (o *MonitorDataSinkUpdate) HasName() bool { func (o *MonitorDataSinkUpdate) SetName(v string) { o.Name.Set(&v) } - // SetNameNil sets the value for Name to be an explicit nil. func (o *MonitorDataSinkUpdate) SetNameNil() { o.Name.Set(nil) @@ -167,6 +174,7 @@ func (o *MonitorDataSinkUpdate) UnsetName() { o.Name.Unset() } + // GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkUpdate) GetUsername() string { if o == nil || o.Username.Get() == nil { @@ -180,7 +188,7 @@ func (o *MonitorDataSinkUpdate) GetUsername() string { // 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 *MonitorDataSinkUpdate) GetUsernameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Username.Get(), o.Username.IsSet() @@ -195,7 +203,6 @@ func (o *MonitorDataSinkUpdate) HasUsername() bool { func (o *MonitorDataSinkUpdate) SetUsername(v string) { o.Username.Set(&v) } - // SetUsernameNil sets the value for Username to be an explicit nil. func (o *MonitorDataSinkUpdate) SetUsernameNil() { o.Username.Set(nil) @@ -206,6 +213,7 @@ func (o *MonitorDataSinkUpdate) UnsetUsername() { o.Username.Unset() } + // GetPassword returns the Password field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkUpdate) GetPassword() string { if o == nil || o.Password.Get() == nil { @@ -219,7 +227,7 @@ func (o *MonitorDataSinkUpdate) GetPassword() string { // 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 *MonitorDataSinkUpdate) GetPasswordOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Password.Get(), o.Password.IsSet() @@ -234,7 +242,6 @@ func (o *MonitorDataSinkUpdate) HasPassword() bool { func (o *MonitorDataSinkUpdate) SetPassword(v string) { o.Password.Set(&v) } - // SetPasswordNil sets the value for Password to be an explicit nil. func (o *MonitorDataSinkUpdate) SetPasswordNil() { o.Password.Set(nil) @@ -245,6 +252,7 @@ func (o *MonitorDataSinkUpdate) UnsetPassword() { o.Password.Unset() } + // GetApiKey returns the ApiKey field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkUpdate) GetApiKey() string { if o == nil || o.ApiKey.Get() == nil { @@ -258,7 +266,7 @@ func (o *MonitorDataSinkUpdate) GetApiKey() string { // 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 *MonitorDataSinkUpdate) GetApiKeyOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ApiKey.Get(), o.ApiKey.IsSet() @@ -273,7 +281,6 @@ func (o *MonitorDataSinkUpdate) HasApiKey() bool { func (o *MonitorDataSinkUpdate) SetApiKey(v string) { o.ApiKey.Set(&v) } - // SetApiKeyNil sets the value for ApiKey to be an explicit nil. func (o *MonitorDataSinkUpdate) SetApiKeyNil() { o.ApiKey.Set(nil) @@ -284,6 +291,7 @@ func (o *MonitorDataSinkUpdate) UnsetApiKey() { o.ApiKey.Unset() } + // GetIndexName returns the IndexName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MonitorDataSinkUpdate) GetIndexName() string { if o == nil || o.IndexName.Get() == nil { @@ -297,7 +305,7 @@ func (o *MonitorDataSinkUpdate) GetIndexName() string { // 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 *MonitorDataSinkUpdate) GetIndexNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.IndexName.Get(), o.IndexName.IsSet() @@ -312,7 +320,6 @@ func (o *MonitorDataSinkUpdate) HasIndexName() bool { func (o *MonitorDataSinkUpdate) SetIndexName(v string) { o.IndexName.Set(&v) } - // SetIndexNameNil sets the value for IndexName to be an explicit nil. func (o *MonitorDataSinkUpdate) SetIndexNameNil() { o.IndexName.Set(nil) @@ -323,6 +330,8 @@ func (o *MonitorDataSinkUpdate) UnsetIndexName() { o.IndexName.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o MonitorDataSinkUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -360,13 +369,13 @@ func (o MonitorDataSinkUpdate) MarshalJSON() ([]byte, error) { func (o *MonitorDataSinkUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { MonitorDataSinkType common.NullableString `json:"monitorDataSinkType"` - EnvironmentName *string `json:"environmentName"` - ExporterUrl *string `json:"exporterUrl,omitempty"` - Name common.NullableString `json:"name,omitempty"` - Username common.NullableString `json:"username,omitempty"` - Password common.NullableString `json:"password,omitempty"` - ApiKey common.NullableString `json:"apiKey,omitempty"` - IndexName common.NullableString `json:"indexName,omitempty"` + EnvironmentName *string `json:"environmentName"` + ExporterUrl *string `json:"exporterUrl,omitempty"` + Name common.NullableString `json:"name,omitempty"` + Username common.NullableString `json:"username,omitempty"` + Password common.NullableString `json:"password,omitempty"` + ApiKey common.NullableString `json:"apiKey,omitempty"` + IndexName common.NullableString `json:"indexName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -379,7 +388,7 @@ func (o *MonitorDataSinkUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"monitorDataSinkType", "environmentName", "exporterUrl", "name", "username", "password", "apiKey", "indexName"}) + common.DeleteKeys(additionalProperties, &[]string{ "monitorDataSinkType", "environmentName", "exporterUrl", "name", "username", "password", "apiKey", "indexName", }) } else { return err } diff --git a/api/kbcloud/admin/model_namespace_info.go b/api/kbcloud/admin/model_namespace_info.go index eafcad96..490c4077 100644 --- a/api/kbcloud/admin/model_namespace_info.go +++ b/api/kbcloud/admin/model_namespace_info.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// NamespaceInfo Namespace info + + +// NamespaceInfo Namespace info type NamespaceInfo struct { // Namespace Namespace string `json:"namespace"` // Clusters in the namespace Clusters int32 `json:"clusters"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNamespaceInfo instantiates a new NamespaceInfo object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewNamespaceInfoWithDefaults() *NamespaceInfo { this := NamespaceInfo{} return &this } - // GetNamespace returns the Namespace field value. func (o *NamespaceInfo) GetNamespace() string { if o == nil { @@ -63,6 +68,7 @@ func (o *NamespaceInfo) SetNamespace(v string) { o.Namespace = v } + // GetClusters returns the Clusters field value. func (o *NamespaceInfo) GetClusters() int32 { if o == nil { @@ -86,6 +92,8 @@ func (o *NamespaceInfo) SetClusters(v int32) { o.Clusters = v } + + // MarshalJSON serializes the struct using spec logic. func (o NamespaceInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -105,7 +113,7 @@ func (o NamespaceInfo) MarshalJSON() ([]byte, error) { func (o *NamespaceInfo) UnmarshalJSON(bytes []byte) (err error) { all := struct { Namespace *string `json:"namespace"` - Clusters *int32 `json:"clusters"` + Clusters *int32 `json:"clusters"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *NamespaceInfo) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"namespace", "clusters"}) + common.DeleteKeys(additionalProperties, &[]string{ "namespace", "clusters", }) } else { return err } diff --git a/api/kbcloud/admin/model_namespace_stat_list.go b/api/kbcloud/admin/model_namespace_stat_list.go index d7203f87..361fa996 100644 --- a/api/kbcloud/admin/model_namespace_stat_list.go +++ b/api/kbcloud/admin/model_namespace_stat_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// NamespaceStatList NamespaceStatList stands for stats for environment namespaces + + +// NamespaceStatList NamespaceStatList stands for stats for environment namespaces type NamespaceStatList struct { Items []NamespaceInfo `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNamespaceStatList instantiates a new NamespaceStatList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewNamespaceStatListWithDefaults() *NamespaceStatList { this := NamespaceStatList{} return &this } - // GetItems returns the Items field value. func (o *NamespaceStatList) GetItems() []NamespaceInfo { if o == nil { @@ -59,6 +64,8 @@ func (o *NamespaceStatList) SetItems(v []NamespaceInfo) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o NamespaceStatList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *NamespaceStatList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_network_chaos.go b/api/kbcloud/admin/model_network_chaos.go index 72be2767..c800fe17 100644 --- a/api/kbcloud/admin/model_network_chaos.go +++ b/api/kbcloud/admin/model_network_chaos.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type NetworkChaos struct { // Specifies the mode of network chaos to be applied. This determines how the chaos is distributed among the target pods. Mode NetworkChaosMode `json:"mode"` // the id of cluster to perform chaos - ClusterId string `json:"clusterID"` - Value *string `json:"value,omitempty"` + ClusterId string `json:"clusterID"` + Value *string `json:"value,omitempty"` // Specifies the type of network chaos action to be performed. Options include introducing delay, packet loss, duplication, corruption, network partition, or bandwidth limitation. Action NetworkChaosAction `json:"action"` // Specifies the direction of network chaos effects. 'to' affects outgoing traffic, 'from' affects incoming traffic, and 'both' affects traffic in both directions. @@ -27,10 +32,11 @@ type NetworkChaos struct { // specify the loss in the chaos action Loss *NetworkChaosLoss `json:"loss,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNetworkChaos instantiates a new NetworkChaos object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -50,7 +56,6 @@ func NewNetworkChaosWithDefaults() *NetworkChaos { this := NetworkChaos{} return &this } - // GetMode returns the Mode field value. func (o *NetworkChaos) GetMode() NetworkChaosMode { if o == nil { @@ -74,6 +79,7 @@ func (o *NetworkChaos) SetMode(v NetworkChaosMode) { o.Mode = v } + // GetClusterId returns the ClusterId field value. func (o *NetworkChaos) GetClusterId() string { if o == nil { @@ -97,6 +103,7 @@ func (o *NetworkChaos) SetClusterId(v string) { o.ClusterId = v } + // GetValue returns the Value field value if set, zero value otherwise. func (o *NetworkChaos) GetValue() string { if o == nil || o.Value == nil { @@ -125,6 +132,7 @@ func (o *NetworkChaos) SetValue(v string) { o.Value = &v } + // GetAction returns the Action field value. func (o *NetworkChaos) GetAction() NetworkChaosAction { if o == nil { @@ -148,6 +156,7 @@ func (o *NetworkChaos) SetAction(v NetworkChaosAction) { o.Action = v } + // GetDirection returns the Direction field value if set, zero value otherwise. func (o *NetworkChaos) GetDirection() NetworkChaosDirection { if o == nil || o.Direction == nil { @@ -176,6 +185,7 @@ func (o *NetworkChaos) SetDirection(v NetworkChaosDirection) { o.Direction = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *NetworkChaos) GetName() string { if o == nil || o.Name == nil { @@ -204,6 +214,7 @@ func (o *NetworkChaos) SetName(v string) { o.Name = &v } + // GetDelay returns the Delay field value if set, zero value otherwise. func (o *NetworkChaos) GetDelay() NetworkChaosDelay { if o == nil || o.Delay == nil { @@ -232,6 +243,7 @@ func (o *NetworkChaos) SetDelay(v NetworkChaosDelay) { o.Delay = &v } + // GetLoss returns the Loss field value if set, zero value otherwise. func (o *NetworkChaos) GetLoss() NetworkChaosLoss { if o == nil || o.Loss == nil { @@ -260,6 +272,8 @@ func (o *NetworkChaos) SetLoss(v NetworkChaosLoss) { o.Loss = &v } + + // MarshalJSON serializes the struct using spec logic. func (o NetworkChaos) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -294,14 +308,14 @@ func (o NetworkChaos) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NetworkChaos) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Mode *NetworkChaosMode `json:"mode"` - ClusterId *string `json:"clusterID"` - Value *string `json:"value,omitempty"` - Action *NetworkChaosAction `json:"action"` + Mode *NetworkChaosMode `json:"mode"` + ClusterId *string `json:"clusterID"` + Value *string `json:"value,omitempty"` + Action *NetworkChaosAction `json:"action"` Direction *NetworkChaosDirection `json:"direction,omitempty"` - Name *string `json:"name,omitempty"` - Delay *NetworkChaosDelay `json:"delay,omitempty"` - Loss *NetworkChaosLoss `json:"loss,omitempty"` + Name *string `json:"name,omitempty"` + Delay *NetworkChaosDelay `json:"delay,omitempty"` + Loss *NetworkChaosLoss `json:"loss,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -317,7 +331,7 @@ func (o *NetworkChaos) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"mode", "clusterID", "value", "action", "direction", "name", "delay", "loss"}) + common.DeleteKeys(additionalProperties, &[]string{ "mode", "clusterID", "value", "action", "direction", "name", "delay", "loss", }) } else { return err } @@ -335,17 +349,17 @@ func (o *NetworkChaos) UnmarshalJSON(bytes []byte) (err error) { } else { o.Action = *all.Action } - if all.Direction != nil && !all.Direction.IsValid() { + if all.Direction != nil &&!all.Direction.IsValid() { hasInvalidField = true } else { o.Direction = all.Direction } o.Name = all.Name - if all.Delay != nil && all.Delay.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Delay != nil && all.Delay.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Delay = all.Delay - if all.Loss != nil && all.Loss.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Loss != nil && all.Loss.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Loss = all.Loss diff --git a/api/kbcloud/admin/model_network_chaos_action.go b/api/kbcloud/admin/model_network_chaos_action.go index 3287e2de..b3ed220c 100644 --- a/api/kbcloud/admin/model_network_chaos_action.go +++ b/api/kbcloud/admin/model_network_chaos_action.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // NetworkChaosAction Specifies the type of network chaos action to be performed. Options include introducing delay, packet loss, duplication, corruption, network partition, or bandwidth limitation. type NetworkChaosAction string // List of NetworkChaosAction. const ( - NetworkChaosActionDelay NetworkChaosAction = "delay" - NetworkChaosActionLoss NetworkChaosAction = "loss" + NetworkChaosActionDelay NetworkChaosAction = "delay" + NetworkChaosActionLoss NetworkChaosAction = "loss" NetworkChaosActionDuplicate NetworkChaosAction = "duplicate" - NetworkChaosActionCorrupt NetworkChaosAction = "corrupt" + NetworkChaosActionCorrupt NetworkChaosAction = "corrupt" NetworkChaosActionPartition NetworkChaosAction = "partition" NetworkChaosActionBandwidth NetworkChaosAction = "bandwidth" ) diff --git a/api/kbcloud/admin/model_network_chaos_delay.go b/api/kbcloud/admin/model_network_chaos_delay.go index 0f7ecdd7..efb0aabb 100644 --- a/api/kbcloud/admin/model_network_chaos_delay.go +++ b/api/kbcloud/admin/model_network_chaos_delay.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// NetworkChaosDelay specify the delay in the chaos action + + +// NetworkChaosDelay specify the delay in the chaos action type NetworkChaosDelay struct { // specify the latency in the chaos action Latency *string `json:"latency,omitempty"` @@ -15,10 +24,11 @@ type NetworkChaosDelay struct { // specify the jitter in the chaos action Jitter *string `json:"jitter,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNetworkChaosDelay instantiates a new NetworkChaosDelay object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewNetworkChaosDelayWithDefaults() *NetworkChaosDelay { this := NetworkChaosDelay{} return &this } - // GetLatency returns the Latency field value if set, zero value otherwise. func (o *NetworkChaosDelay) GetLatency() string { if o == nil || o.Latency == nil { @@ -64,6 +73,7 @@ func (o *NetworkChaosDelay) SetLatency(v string) { o.Latency = &v } + // GetCorrelation returns the Correlation field value if set, zero value otherwise. func (o *NetworkChaosDelay) GetCorrelation() string { if o == nil || o.Correlation == nil { @@ -92,6 +102,7 @@ func (o *NetworkChaosDelay) SetCorrelation(v string) { o.Correlation = &v } + // GetJitter returns the Jitter field value if set, zero value otherwise. func (o *NetworkChaosDelay) GetJitter() string { if o == nil || o.Jitter == nil { @@ -120,6 +131,8 @@ func (o *NetworkChaosDelay) SetJitter(v string) { o.Jitter = &v } + + // MarshalJSON serializes the struct using spec logic. func (o NetworkChaosDelay) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -145,16 +158,16 @@ func (o NetworkChaosDelay) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NetworkChaosDelay) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Latency *string `json:"latency,omitempty"` + Latency *string `json:"latency,omitempty"` Correlation *string `json:"correlation,omitempty"` - Jitter *string `json:"jitter,omitempty"` + Jitter *string `json:"jitter,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"latency", "correlation", "jitter"}) + common.DeleteKeys(additionalProperties, &[]string{ "latency", "correlation", "jitter", }) } else { return err } diff --git a/api/kbcloud/admin/model_network_chaos_direction.go b/api/kbcloud/admin/model_network_chaos_direction.go index 01f989ef..e04fcaa1 100644 --- a/api/kbcloud/admin/model_network_chaos_direction.go +++ b/api/kbcloud/admin/model_network_chaos_direction.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // NetworkChaosDirection Specifies the direction of network chaos effects. 'to' affects outgoing traffic, 'from' affects incoming traffic, and 'both' affects traffic in both directions. type NetworkChaosDirection string // List of NetworkChaosDirection. const ( - NetworkChaosDirectionTo NetworkChaosDirection = "to" + NetworkChaosDirectionTo NetworkChaosDirection = "to" NetworkChaosDirectionFrom NetworkChaosDirection = "from" NetworkChaosDirectionBoth NetworkChaosDirection = "both" ) diff --git a/api/kbcloud/admin/model_network_chaos_loss.go b/api/kbcloud/admin/model_network_chaos_loss.go index e069468f..a0dbbee3 100644 --- a/api/kbcloud/admin/model_network_chaos_loss.go +++ b/api/kbcloud/admin/model_network_chaos_loss.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// NetworkChaosLoss specify the loss in the chaos action +// NetworkChaosLoss specify the loss in the chaos action type NetworkChaosLoss struct { // specify the loss in the chaos action Loss *string `json:"loss,omitempty"` // specify the correlation in the chaos action Correlation *string `json:"correlation,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNetworkChaosLoss instantiates a new NetworkChaosLoss object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewNetworkChaosLossWithDefaults() *NetworkChaosLoss { this := NetworkChaosLoss{} return &this } - // GetLoss returns the Loss field value if set, zero value otherwise. func (o *NetworkChaosLoss) GetLoss() string { if o == nil || o.Loss == nil { @@ -62,6 +71,7 @@ func (o *NetworkChaosLoss) SetLoss(v string) { o.Loss = &v } + // GetCorrelation returns the Correlation field value if set, zero value otherwise. func (o *NetworkChaosLoss) GetCorrelation() string { if o == nil || o.Correlation == nil { @@ -90,6 +100,8 @@ func (o *NetworkChaosLoss) SetCorrelation(v string) { o.Correlation = &v } + + // MarshalJSON serializes the struct using spec logic. func (o NetworkChaosLoss) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,7 +124,7 @@ func (o NetworkChaosLoss) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NetworkChaosLoss) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Loss *string `json:"loss,omitempty"` + Loss *string `json:"loss,omitempty"` Correlation *string `json:"correlation,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -120,7 +132,7 @@ func (o *NetworkChaosLoss) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"loss", "correlation"}) + common.DeleteKeys(additionalProperties, &[]string{ "loss", "correlation", }) } else { return err } diff --git a/api/kbcloud/admin/model_network_chaos_mode.go b/api/kbcloud/admin/model_network_chaos_mode.go index ac6b47e1..721753e7 100644 --- a/api/kbcloud/admin/model_network_chaos_mode.go +++ b/api/kbcloud/admin/model_network_chaos_mode.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // NetworkChaosMode Specifies the mode of network chaos to be applied. This determines how the chaos is distributed among the target pods. type NetworkChaosMode string // List of NetworkChaosMode. const ( - NetworkChaosModeOne NetworkChaosMode = "one" - NetworkChaosModeAll NetworkChaosMode = "all" - NetworkChaosModeFixed NetworkChaosMode = "fixed" - NetworkChaosModeFixedPercent NetworkChaosMode = "fixed-percent" + NetworkChaosModeOne NetworkChaosMode = "one" + NetworkChaosModeAll NetworkChaosMode = "all" + NetworkChaosModeFixed NetworkChaosMode = "fixed" + NetworkChaosModeFixedPercent NetworkChaosMode = "fixed-percent" NetworkChaosModeRandomMaxPercent NetworkChaosMode = "random-max-percent" ) diff --git a/api/kbcloud/admin/model_network_config.go b/api/kbcloud/admin/model_network_config.go index 0aae94fd..512eb362 100644 --- a/api/kbcloud/admin/model_network_config.go +++ b/api/kbcloud/admin/model_network_config.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// NetworkConfig Configuration of networking for this environment + + +// NetworkConfig Configuration of networking for this environment type NetworkConfig struct { // Enable node port service for this environment NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` @@ -15,10 +24,11 @@ type NetworkConfig struct { // Enable the Internet load balancer service for this environment InternetLbEnabled *bool `json:"internetLBEnabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNetworkConfig instantiates a new NetworkConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +57,6 @@ func NewNetworkConfigWithDefaults() *NetworkConfig { this.InternetLbEnabled = &internetLbEnabled return &this } - // GetNodePortEnabled returns the NodePortEnabled field value if set, zero value otherwise. func (o *NetworkConfig) GetNodePortEnabled() bool { if o == nil || o.NodePortEnabled == nil { @@ -76,6 +85,7 @@ func (o *NetworkConfig) SetNodePortEnabled(v bool) { o.NodePortEnabled = &v } + // GetLbEnabled returns the LbEnabled field value if set, zero value otherwise. func (o *NetworkConfig) GetLbEnabled() bool { if o == nil || o.LbEnabled == nil { @@ -104,6 +114,7 @@ func (o *NetworkConfig) SetLbEnabled(v bool) { o.LbEnabled = &v } + // GetInternetLbEnabled returns the InternetLbEnabled field value if set, zero value otherwise. func (o *NetworkConfig) GetInternetLbEnabled() bool { if o == nil || o.InternetLbEnabled == nil { @@ -132,6 +143,8 @@ func (o *NetworkConfig) SetInternetLbEnabled(v bool) { o.InternetLbEnabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o NetworkConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -157,8 +170,8 @@ func (o NetworkConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NetworkConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` - LbEnabled *bool `json:"lbEnabled,omitempty"` + NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` + LbEnabled *bool `json:"lbEnabled,omitempty"` InternetLbEnabled *bool `json:"internetLBEnabled,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -166,7 +179,7 @@ func (o *NetworkConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"nodePortEnabled", "lbEnabled", "internetLBEnabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "nodePortEnabled", "lbEnabled", "internetLBEnabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_node.go b/api/kbcloud/admin/model_node.go index eabec72c..b3d131ec 100644 --- a/api/kbcloud/admin/model_node.go +++ b/api/kbcloud/admin/model_node.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Node node info + + +// Node node info type Node struct { // CPU cores of the node Cpu *int64 `json:"cpu,omitempty"` @@ -44,10 +48,11 @@ type Node struct { // node is in data plane DataPlane *bool `json:"dataPlane,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNode instantiates a new Node object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -67,7 +72,6 @@ func NewNodeWithDefaults() *Node { this := Node{} return &this } - // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *Node) GetCpu() int64 { if o == nil || o.Cpu == nil { @@ -96,6 +100,7 @@ func (o *Node) SetCpu(v int64) { o.Cpu = &v } + // GetCpuStats returns the CpuStats field value if set, zero value otherwise. func (o *Node) GetCpuStats() ResourceStats { if o == nil || o.CpuStats == nil { @@ -124,6 +129,7 @@ func (o *Node) SetCpuStats(v ResourceStats) { o.CpuStats = &v } + // GetCreatedAt returns the CreatedAt field value. func (o *Node) GetCreatedAt() time.Time { if o == nil { @@ -147,6 +153,7 @@ func (o *Node) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetHostName returns the HostName field value. func (o *Node) GetHostName() string { if o == nil { @@ -170,6 +177,7 @@ func (o *Node) SetHostName(v string) { o.HostName = v } + // GetInstanceType returns the InstanceType field value if set, zero value otherwise. func (o *Node) GetInstanceType() string { if o == nil || o.InstanceType == nil { @@ -198,6 +206,7 @@ func (o *Node) SetInstanceType(v string) { o.InstanceType = &v } + // GetIp returns the Ip field value. func (o *Node) GetIp() string { if o == nil { @@ -221,6 +230,7 @@ func (o *Node) SetIp(v string) { o.Ip = v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *Node) GetMemory() int64 { if o == nil || o.Memory == nil { @@ -249,6 +259,7 @@ func (o *Node) SetMemory(v int64) { o.Memory = &v } + // GetMemoryStats returns the MemoryStats field value if set, zero value otherwise. func (o *Node) GetMemoryStats() ResourceStats { if o == nil || o.MemoryStats == nil { @@ -277,6 +288,7 @@ func (o *Node) SetMemoryStats(v ResourceStats) { o.MemoryStats = &v } + // GetZone returns the Zone field value if set, zero value otherwise. func (o *Node) GetZone() string { if o == nil || o.Zone == nil { @@ -305,6 +317,7 @@ func (o *Node) SetZone(v string) { o.Zone = &v } + // GetRegion returns the Region field value if set, zero value otherwise. func (o *Node) GetRegion() string { if o == nil || o.Region == nil { @@ -333,6 +346,7 @@ func (o *Node) SetRegion(v string) { o.Region = &v } + // GetUnschedulable returns the Unschedulable field value if set, zero value otherwise. func (o *Node) GetUnschedulable() bool { if o == nil || o.Unschedulable == nil { @@ -361,6 +375,7 @@ func (o *Node) SetUnschedulable(v bool) { o.Unschedulable = &v } + // GetNodeGroup returns the NodeGroup field value if set, zero value otherwise. func (o *Node) GetNodeGroup() string { if o == nil || o.NodeGroup == nil { @@ -389,6 +404,7 @@ func (o *Node) SetNodeGroup(v string) { o.NodeGroup = &v } + // GetControlPlane returns the ControlPlane field value if set, zero value otherwise. func (o *Node) GetControlPlane() bool { if o == nil || o.ControlPlane == nil { @@ -417,6 +433,7 @@ func (o *Node) SetControlPlane(v bool) { o.ControlPlane = &v } + // GetDataPlane returns the DataPlane field value if set, zero value otherwise. func (o *Node) GetDataPlane() bool { if o == nil || o.DataPlane == nil { @@ -445,6 +462,8 @@ func (o *Node) SetDataPlane(v bool) { o.DataPlane = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Node) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -501,20 +520,20 @@ func (o Node) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Node) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Cpu *int64 `json:"cpu,omitempty"` - CpuStats *ResourceStats `json:"cpuStats,omitempty"` - CreatedAt *time.Time `json:"createdAt"` - HostName *string `json:"hostName"` - InstanceType *string `json:"instanceType,omitempty"` - Ip *string `json:"ip"` - Memory *int64 `json:"memory,omitempty"` - MemoryStats *ResourceStats `json:"memoryStats,omitempty"` - Zone *string `json:"zone,omitempty"` - Region *string `json:"region,omitempty"` - Unschedulable *bool `json:"unschedulable,omitempty"` - NodeGroup *string `json:"nodeGroup,omitempty"` - ControlPlane *bool `json:"controlPlane,omitempty"` - DataPlane *bool `json:"dataPlane,omitempty"` + Cpu *int64 `json:"cpu,omitempty"` + CpuStats *ResourceStats `json:"cpuStats,omitempty"` + CreatedAt *time.Time `json:"createdAt"` + HostName *string `json:"hostName"` + InstanceType *string `json:"instanceType,omitempty"` + Ip *string `json:"ip"` + Memory *int64 `json:"memory,omitempty"` + MemoryStats *ResourceStats `json:"memoryStats,omitempty"` + Zone *string `json:"zone,omitempty"` + Region *string `json:"region,omitempty"` + Unschedulable *bool `json:"unschedulable,omitempty"` + NodeGroup *string `json:"nodeGroup,omitempty"` + ControlPlane *bool `json:"controlPlane,omitempty"` + DataPlane *bool `json:"dataPlane,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -530,14 +549,14 @@ func (o *Node) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cpu", "cpuStats", "createdAt", "hostName", "instanceType", "ip", "memory", "memoryStats", "zone", "region", "unschedulable", "nodeGroup", "controlPlane", "dataPlane"}) + common.DeleteKeys(additionalProperties, &[]string{ "cpu", "cpuStats", "createdAt", "hostName", "instanceType", "ip", "memory", "memoryStats", "zone", "region", "unschedulable", "nodeGroup", "controlPlane", "dataPlane", }) } else { return err } hasInvalidField := false o.Cpu = all.Cpu - if all.CpuStats != nil && all.CpuStats.UnparsedObject != nil && o.UnparsedObject == nil { + if all.CpuStats != nil && all.CpuStats.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.CpuStats = all.CpuStats @@ -546,7 +565,7 @@ func (o *Node) UnmarshalJSON(bytes []byte) (err error) { o.InstanceType = all.InstanceType o.Ip = *all.Ip o.Memory = all.Memory - if all.MemoryStats != nil && all.MemoryStats.UnparsedObject != nil && o.UnparsedObject == nil { + if all.MemoryStats != nil && all.MemoryStats.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.MemoryStats = all.MemoryStats diff --git a/api/kbcloud/admin/model_node_group.go b/api/kbcloud/admin/model_node_group.go index 3c14e303..3145ccc1 100644 --- a/api/kbcloud/admin/model_node_group.go +++ b/api/kbcloud/admin/model_node_group.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// NodeGroup NodeGroup creation info + + +// NodeGroup NodeGroup creation info type NodeGroup struct { // The full, unique name of this Object, name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc' Name string `json:"name"` @@ -19,10 +24,11 @@ type NodeGroup struct { // the nodes of the node group Nodes []string `json:"nodes"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNodeGroup instantiates a new NodeGroup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewNodeGroupWithDefaults() *NodeGroup { this := NodeGroup{} return &this } - // GetName returns the Name field value. func (o *NodeGroup) GetName() string { if o == nil { @@ -65,6 +70,7 @@ func (o *NodeGroup) SetName(v string) { o.Name = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *NodeGroup) GetDescription() string { if o == nil || o.Description == nil { @@ -93,6 +99,7 @@ func (o *NodeGroup) SetDescription(v string) { o.Description = &v } + // GetNodes returns the Nodes field value. func (o *NodeGroup) GetNodes() []string { if o == nil { @@ -116,6 +123,8 @@ func (o *NodeGroup) SetNodes(v []string) { o.Nodes = v } + + // MarshalJSON serializes the struct using spec logic. func (o NodeGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -137,9 +146,9 @@ func (o NodeGroup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NodeGroup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Description *string `json:"description,omitempty"` - Nodes *[]string `json:"nodes"` + Name *string `json:"name"` + Description *string `json:"description,omitempty"` + Nodes *[]string `json:"nodes"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -152,7 +161,7 @@ func (o *NodeGroup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "description", "nodes"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "description", "nodes", }) } else { return err } diff --git a/api/kbcloud/admin/model_node_group_update.go b/api/kbcloud/admin/model_node_group_update.go index 4860690f..df6ecb8a 100644 --- a/api/kbcloud/admin/model_node_group_update.go +++ b/api/kbcloud/admin/model_node_group_update.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// NodeGroupUpdate NodeGroup patch info + + +// NodeGroupUpdate NodeGroup patch info type NodeGroupUpdate struct { // NodeGroup description Description common.NullableString `json:"description,omitempty"` - Nodes []NodeOperation `json:"nodes,omitempty"` + Nodes []NodeOperation `json:"nodes,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNodeGroupUpdate instantiates a new NodeGroupUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewNodeGroupUpdateWithDefaults() *NodeGroupUpdate { this := NodeGroupUpdate{} return &this } - // GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NodeGroupUpdate) GetDescription() string { if o == nil || o.Description.Get() == nil { @@ -46,7 +55,7 @@ func (o *NodeGroupUpdate) GetDescription() string { // 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 *NodeGroupUpdate) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Description.Get(), o.Description.IsSet() @@ -61,7 +70,6 @@ func (o *NodeGroupUpdate) HasDescription() bool { func (o *NodeGroupUpdate) SetDescription(v string) { o.Description.Set(&v) } - // SetDescriptionNil sets the value for Description to be an explicit nil. func (o *NodeGroupUpdate) SetDescriptionNil() { o.Description.Set(nil) @@ -72,6 +80,7 @@ func (o *NodeGroupUpdate) UnsetDescription() { o.Description.Unset() } + // GetNodes returns the Nodes field value if set, zero value otherwise. func (o *NodeGroupUpdate) GetNodes() []NodeOperation { if o == nil || o.Nodes == nil { @@ -100,6 +109,8 @@ func (o *NodeGroupUpdate) SetNodes(v []NodeOperation) { o.Nodes = v } + + // MarshalJSON serializes the struct using spec logic. func (o NodeGroupUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -123,14 +134,14 @@ func (o NodeGroupUpdate) MarshalJSON() ([]byte, error) { func (o *NodeGroupUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { Description common.NullableString `json:"description,omitempty"` - Nodes []NodeOperation `json:"nodes,omitempty"` + Nodes []NodeOperation `json:"nodes,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "nodes"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "nodes", }) } else { return err } diff --git a/api/kbcloud/admin/model_node_list.go b/api/kbcloud/admin/model_node_list.go index 318ee222..f690fb83 100644 --- a/api/kbcloud/admin/model_node_list.go +++ b/api/kbcloud/admin/model_node_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// NodeList nodeList is a list of nodes + + +// NodeList nodeList is a list of nodes type NodeList struct { // Items is the list of Org objects in the list Items []Node `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNodeList instantiates a new NodeList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewNodeListWithDefaults() *NodeList { this := NodeList{} return &this } - // GetItems returns the Items field value. func (o *NodeList) GetItems() []Node { if o == nil { @@ -60,6 +65,8 @@ func (o *NodeList) SetItems(v []Node) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o NodeList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *NodeList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_node_operation.go b/api/kbcloud/admin/model_node_operation.go index 1fe42375..b9c51781 100644 --- a/api/kbcloud/admin/model_node_operation.go +++ b/api/kbcloud/admin/model_node_operation.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type NodeOperation struct { // Node name (e.g. 'MyName', or 'my.name', or '123-abc') Name *string `json:"name,omitempty"` // operation for node, either `add` or `del` Op *NodeOperationType `json:"op,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNodeOperation instantiates a new NodeOperation object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewNodeOperationWithDefaults() *NodeOperation { this := NodeOperation{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *NodeOperation) GetName() string { if o == nil || o.Name == nil { @@ -61,6 +70,7 @@ func (o *NodeOperation) SetName(v string) { o.Name = &v } + // GetOp returns the Op field value if set, zero value otherwise. func (o *NodeOperation) GetOp() NodeOperationType { if o == nil || o.Op == nil { @@ -89,6 +99,8 @@ func (o *NodeOperation) SetOp(v NodeOperationType) { o.Op = &v } + + // MarshalJSON serializes the struct using spec logic. func (o NodeOperation) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,22 +123,22 @@ func (o NodeOperation) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NodeOperation) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Op *NodeOperationType `json:"op,omitempty"` + Name *string `json:"name,omitempty"` + Op *NodeOperationType `json:"op,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "op"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "op", }) } else { return err } hasInvalidField := false o.Name = all.Name - if all.Op != nil && !all.Op.IsValid() { + if all.Op != nil &&!all.Op.IsValid() { hasInvalidField = true } else { o.Op = all.Op diff --git a/api/kbcloud/admin/model_node_operation_type.go b/api/kbcloud/admin/model_node_operation_type.go index 48acde0b..6e45762d 100644 --- a/api/kbcloud/admin/model_node_operation_type.go +++ b/api/kbcloud/admin/model_node_operation_type.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // NodeOperationType operation for node, either `add` or `del` type NodeOperationType string diff --git a/api/kbcloud/admin/model_node_pool_node.go b/api/kbcloud/admin/model_node_pool_node.go index 4a82d82c..075dd452 100644 --- a/api/kbcloud/admin/model_node_pool_node.go +++ b/api/kbcloud/admin/model_node_pool_node.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// NodePoolNode Node info for environment + + +// NodePoolNode Node info for environment type NodePoolNode struct { - Name string `json:"name"` + Name string `json:"name"` AvailabilityZone string `json:"availabilityZone"` - MarkControlPlane *bool `json:"markControlPlane,omitempty"` + MarkControlPlane *bool `json:"markControlPlane,omitempty"` // Mark the node as a data plane, which will always be true when markControlPlane is not specified MarkDataPlane *bool `json:"markDataPlane,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNodePoolNode instantiates a new NodePoolNode object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -48,7 +54,6 @@ func NewNodePoolNodeWithDefaults() *NodePoolNode { this.MarkDataPlane = &markDataPlane return &this } - // GetName returns the Name field value. func (o *NodePoolNode) GetName() string { if o == nil { @@ -72,6 +77,7 @@ func (o *NodePoolNode) SetName(v string) { o.Name = v } + // GetAvailabilityZone returns the AvailabilityZone field value. func (o *NodePoolNode) GetAvailabilityZone() string { if o == nil { @@ -95,6 +101,7 @@ func (o *NodePoolNode) SetAvailabilityZone(v string) { o.AvailabilityZone = v } + // GetMarkControlPlane returns the MarkControlPlane field value if set, zero value otherwise. func (o *NodePoolNode) GetMarkControlPlane() bool { if o == nil || o.MarkControlPlane == nil { @@ -123,6 +130,7 @@ func (o *NodePoolNode) SetMarkControlPlane(v bool) { o.MarkControlPlane = &v } + // GetMarkDataPlane returns the MarkDataPlane field value if set, zero value otherwise. func (o *NodePoolNode) GetMarkDataPlane() bool { if o == nil || o.MarkDataPlane == nil { @@ -151,6 +159,8 @@ func (o *NodePoolNode) SetMarkDataPlane(v bool) { o.MarkDataPlane = &v } + + // MarshalJSON serializes the struct using spec logic. func (o NodePoolNode) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -175,10 +185,10 @@ func (o NodePoolNode) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NodePoolNode) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` AvailabilityZone *string `json:"availabilityZone"` - MarkControlPlane *bool `json:"markControlPlane,omitempty"` - MarkDataPlane *bool `json:"markDataPlane,omitempty"` + MarkControlPlane *bool `json:"markControlPlane,omitempty"` + MarkDataPlane *bool `json:"markDataPlane,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -191,7 +201,7 @@ func (o *NodePoolNode) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "availabilityZone", "markControlPlane", "markDataPlane"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "availabilityZone", "markControlPlane", "markDataPlane", }) } else { return err } diff --git a/api/kbcloud/admin/model_node_resource_stats.go b/api/kbcloud/admin/model_node_resource_stats.go index 8245a674..2a5d0586 100644 --- a/api/kbcloud/admin/model_node_resource_stats.go +++ b/api/kbcloud/admin/model_node_resource_stats.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// NodeResourceStats ResourceStats holds the requests, limits, and available stats for a resource. + + +// NodeResourceStats ResourceStats holds the requests, limits, and available stats for a resource. type NodeResourceStats struct { // ResourceStats holds the requests, limits, and available stats for a resource. CpuStats ResourceStats `json:"cpuStats"` @@ -21,10 +26,11 @@ type NodeResourceStats struct { // Name of the node. Name string `json:"name"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNodeResourceStats instantiates a new NodeResourceStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewNodeResourceStatsWithDefaults() *NodeResourceStats { this := NodeResourceStats{} return &this } - // GetCpuStats returns the CpuStats field value. func (o *NodeResourceStats) GetCpuStats() ResourceStats { if o == nil { @@ -69,6 +74,7 @@ func (o *NodeResourceStats) SetCpuStats(v ResourceStats) { o.CpuStats = v } + // GetMemoryStats returns the MemoryStats field value. func (o *NodeResourceStats) GetMemoryStats() ResourceStats { if o == nil { @@ -92,6 +98,7 @@ func (o *NodeResourceStats) SetMemoryStats(v ResourceStats) { o.MemoryStats = v } + // GetEphemeralStorageStats returns the EphemeralStorageStats field value. func (o *NodeResourceStats) GetEphemeralStorageStats() ResourceStats { if o == nil { @@ -115,6 +122,7 @@ func (o *NodeResourceStats) SetEphemeralStorageStats(v ResourceStats) { o.EphemeralStorageStats = v } + // GetName returns the Name field value. func (o *NodeResourceStats) GetName() string { if o == nil { @@ -138,6 +146,8 @@ func (o *NodeResourceStats) SetName(v string) { o.Name = v } + + // MarshalJSON serializes the struct using spec logic. func (o NodeResourceStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +168,10 @@ func (o NodeResourceStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NodeResourceStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CpuStats *ResourceStats `json:"cpuStats"` - MemoryStats *ResourceStats `json:"memoryStats"` + CpuStats *ResourceStats `json:"cpuStats"` + MemoryStats *ResourceStats `json:"memoryStats"` EphemeralStorageStats *ResourceStats `json:"ephemeralStorageStats"` - Name *string `json:"name"` + Name *string `json:"name"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *NodeResourceStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cpuStats", "memoryStats", "ephemeralStorageStats", "name"}) + common.DeleteKeys(additionalProperties, &[]string{ "cpuStats", "memoryStats", "ephemeralStorageStats", "name", }) } else { return err } diff --git a/api/kbcloud/admin/model_node_resource_stats_list.go b/api/kbcloud/admin/model_node_resource_stats_list.go index fa4f9017..38b818dd 100644 --- a/api/kbcloud/admin/model_node_resource_stats_list.go +++ b/api/kbcloud/admin/model_node_resource_stats_list.go @@ -2,26 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// NodeResourceStatsList NodeResourceStatsList is a list of NodeResourceStats + + +// NodeResourceStatsList NodeResourceStatsList is a list of NodeResourceStats type NodeResourceStatsList struct { // Items is the list of NodeResourceStats objects in the list Items []NodeResourceStats `json:"items"` // UpdatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNodeResourceStatsList instantiates a new NodeResourceStatsList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +45,6 @@ func NewNodeResourceStatsListWithDefaults() *NodeResourceStatsList { this := NodeResourceStatsList{} return &this } - // GetItems returns the Items field value. func (o *NodeResourceStatsList) GetItems() []NodeResourceStats { if o == nil { @@ -64,6 +68,7 @@ func (o *NodeResourceStatsList) SetItems(v []NodeResourceStats) { o.Items = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *NodeResourceStatsList) GetUpdatedAt() time.Time { if o == nil { @@ -87,6 +92,8 @@ func (o *NodeResourceStatsList) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o NodeResourceStatsList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,8 +116,8 @@ func (o NodeResourceStatsList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NodeResourceStatsList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]NodeResourceStats `json:"items"` - UpdatedAt *time.Time `json:"updatedAt"` + Items *[]NodeResourceStats `json:"items"` + UpdatedAt *time.Time `json:"updatedAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -123,7 +130,7 @@ func (o *NodeResourceStatsList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_ob_parameter.go b/api/kbcloud/admin/model_ob_parameter.go index e11af4d7..36d369fa 100644 --- a/api/kbcloud/admin/model_ob_parameter.go +++ b/api/kbcloud/admin/model_ob_parameter.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ObParameter struct { // The name of the parameter Name string `json:"name"` @@ -34,10 +39,11 @@ type ObParameter struct { // Whether the parameter is read-only ReadOnly bool `json:"readOnly"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewObParameter instantiates a new ObParameter object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -62,7 +68,6 @@ func NewObParameterWithDefaults() *ObParameter { this := ObParameter{} return &this } - // GetName returns the Name field value. func (o *ObParameter) GetName() string { if o == nil { @@ -86,6 +91,7 @@ func (o *ObParameter) SetName(v string) { o.Name = v } + // GetValue returns the Value field value. func (o *ObParameter) GetValue() string { if o == nil { @@ -109,6 +115,7 @@ func (o *ObParameter) SetValue(v string) { o.Value = v } + // GetDataType returns the DataType field value. func (o *ObParameter) GetDataType() string { if o == nil { @@ -132,6 +139,7 @@ func (o *ObParameter) SetDataType(v string) { o.DataType = v } + // GetDescription returns the Description field value. func (o *ObParameter) GetDescription() string { if o == nil { @@ -155,6 +163,7 @@ func (o *ObParameter) SetDescription(v string) { o.Description = v } + // GetEnum returns the Enum field value. func (o *ObParameter) GetEnum() []map[string]interface{} { if o == nil { @@ -178,6 +187,7 @@ func (o *ObParameter) SetEnum(v []map[string]interface{}) { o.Enum = v } + // GetMaximum returns the Maximum field value. func (o *ObParameter) GetMaximum() float64 { if o == nil { @@ -201,6 +211,7 @@ func (o *ObParameter) SetMaximum(v float64) { o.Maximum = v } + // GetMinimum returns the Minimum field value. func (o *ObParameter) GetMinimum() float64 { if o == nil { @@ -224,6 +235,7 @@ func (o *ObParameter) SetMinimum(v float64) { o.Minimum = v } + // GetImmutable returns the Immutable field value if set, zero value otherwise. func (o *ObParameter) GetImmutable() bool { if o == nil || o.Immutable == nil { @@ -252,6 +264,7 @@ func (o *ObParameter) SetImmutable(v bool) { o.Immutable = &v } + // GetIsVariable returns the IsVariable field value if set, zero value otherwise. func (o *ObParameter) GetIsVariable() bool { if o == nil || o.IsVariable == nil { @@ -280,6 +293,7 @@ func (o *ObParameter) SetIsVariable(v bool) { o.IsVariable = &v } + // GetEditLevel returns the EditLevel field value if set, zero value otherwise. func (o *ObParameter) GetEditLevel() string { if o == nil || o.EditLevel == nil { @@ -308,6 +322,7 @@ func (o *ObParameter) SetEditLevel(v string) { o.EditLevel = &v } + // GetReadOnly returns the ReadOnly field value. func (o *ObParameter) GetReadOnly() bool { if o == nil { @@ -331,6 +346,8 @@ func (o *ObParameter) SetReadOnly(v bool) { o.ReadOnly = v } + + // MarshalJSON serializes the struct using spec logic. func (o ObParameter) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -364,17 +381,17 @@ func (o ObParameter) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ObParameter) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Value *string `json:"value"` - DataType *string `json:"dataType"` - Description *string `json:"description"` - Enum *[]map[string]interface{} `json:"enum"` - Maximum *float64 `json:"maximum"` - Minimum *float64 `json:"minimum"` - Immutable *bool `json:"immutable,omitempty"` - IsVariable *bool `json:"isVariable,omitempty"` - EditLevel *string `json:"editLevel,omitempty"` - ReadOnly *bool `json:"readOnly"` + Name *string `json:"name"` + Value *string `json:"value"` + DataType *string `json:"dataType"` + Description *string `json:"description"` + Enum *[]map[string]interface{} `json:"enum"` + Maximum *float64 `json:"maximum"` + Minimum *float64 `json:"minimum"` + Immutable *bool `json:"immutable,omitempty"` + IsVariable *bool `json:"isVariable,omitempty"` + EditLevel *string `json:"editLevel,omitempty"` + ReadOnly *bool `json:"readOnly"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -405,7 +422,7 @@ func (o *ObParameter) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "value", "dataType", "description", "enum", "maximum", "minimum", "immutable", "isVariable", "editLevel", "readOnly"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "value", "dataType", "description", "enum", "maximum", "minimum", "immutable", "isVariable", "editLevel", "readOnly", }) } else { return err } diff --git a/api/kbcloud/admin/model_ob_session.go b/api/kbcloud/admin/model_ob_session.go index dbf3ab0f..6ee9e8b8 100644 --- a/api/kbcloud/admin/model_ob_session.go +++ b/api/kbcloud/admin/model_ob_session.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ObSession struct { // session id Id *string `json:"id,omitempty"` @@ -30,10 +39,11 @@ type ObSession struct { // port Port *string `json:"port,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewObSession instantiates a new ObSession object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -50,7 +60,6 @@ func NewObSessionWithDefaults() *ObSession { this := ObSession{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *ObSession) GetId() string { if o == nil || o.Id == nil { @@ -79,6 +88,7 @@ func (o *ObSession) SetId(v string) { o.Id = &v } + // GetUser returns the User field value if set, zero value otherwise. func (o *ObSession) GetUser() string { if o == nil || o.User == nil { @@ -107,6 +117,7 @@ func (o *ObSession) SetUser(v string) { o.User = &v } + // GetTenant returns the Tenant field value if set, zero value otherwise. func (o *ObSession) GetTenant() string { if o == nil || o.Tenant == nil { @@ -135,6 +146,7 @@ func (o *ObSession) SetTenant(v string) { o.Tenant = &v } + // GetHost returns the Host field value if set, zero value otherwise. func (o *ObSession) GetHost() string { if o == nil || o.Host == nil { @@ -163,6 +175,7 @@ func (o *ObSession) SetHost(v string) { o.Host = &v } + // GetDb returns the Db field value if set, zero value otherwise. func (o *ObSession) GetDb() string { if o == nil || o.Db == nil { @@ -191,6 +204,7 @@ func (o *ObSession) SetDb(v string) { o.Db = &v } + // GetCommand returns the Command field value if set, zero value otherwise. func (o *ObSession) GetCommand() string { if o == nil || o.Command == nil { @@ -219,6 +233,7 @@ func (o *ObSession) SetCommand(v string) { o.Command = &v } + // GetTime returns the Time field value if set, zero value otherwise. func (o *ObSession) GetTime() string { if o == nil || o.Time == nil { @@ -247,6 +262,7 @@ func (o *ObSession) SetTime(v string) { o.Time = &v } + // GetState returns the State field value if set, zero value otherwise. func (o *ObSession) GetState() string { if o == nil || o.State == nil { @@ -275,6 +291,7 @@ func (o *ObSession) SetState(v string) { o.State = &v } + // GetInfo returns the Info field value if set, zero value otherwise. func (o *ObSession) GetInfo() string { if o == nil || o.Info == nil { @@ -303,6 +320,7 @@ func (o *ObSession) SetInfo(v string) { o.Info = &v } + // GetIp returns the Ip field value if set, zero value otherwise. func (o *ObSession) GetIp() string { if o == nil || o.Ip == nil { @@ -331,6 +349,7 @@ func (o *ObSession) SetIp(v string) { o.Ip = &v } + // GetPort returns the Port field value if set, zero value otherwise. func (o *ObSession) GetPort() string { if o == nil || o.Port == nil { @@ -359,6 +378,8 @@ func (o *ObSession) SetPort(v string) { o.Port = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ObSession) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -408,24 +429,24 @@ func (o ObSession) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ObSession) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - User *string `json:"user,omitempty"` - Tenant *string `json:"tenant,omitempty"` - Host *string `json:"host,omitempty"` - Db *string `json:"db,omitempty"` + Id *string `json:"id,omitempty"` + User *string `json:"user,omitempty"` + Tenant *string `json:"tenant,omitempty"` + Host *string `json:"host,omitempty"` + Db *string `json:"db,omitempty"` Command *string `json:"command,omitempty"` - Time *string `json:"time,omitempty"` - State *string `json:"state,omitempty"` - Info *string `json:"info,omitempty"` - Ip *string `json:"ip,omitempty"` - Port *string `json:"port,omitempty"` + Time *string `json:"time,omitempty"` + State *string `json:"state,omitempty"` + Info *string `json:"info,omitempty"` + Ip *string `json:"ip,omitempty"` + Port *string `json:"port,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "user", "tenant", "host", "db", "command", "time", "state", "info", "ip", "port"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "user", "tenant", "host", "db", "command", "time", "state", "info", "ip", "port", }) } else { return err } diff --git a/api/kbcloud/admin/model_object.go b/api/kbcloud/admin/model_object.go index cd15e2ba..53c7ab31 100644 --- a/api/kbcloud/admin/model_object.go +++ b/api/kbcloud/admin/model_object.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Object struct { // Type is the type of db object, like 'Table', 'Views', 'Functions' Type *string `json:"type,omitempty"` // Count is the number of each object Count *int64 `json:"count,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewObject instantiates a new Object object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewObjectWithDefaults() *Object { this := Object{} return &this } - // GetType returns the Type field value if set, zero value otherwise. func (o *Object) GetType() string { if o == nil || o.Type == nil { @@ -61,6 +70,7 @@ func (o *Object) SetType(v string) { o.Type = &v } + // GetCount returns the Count field value if set, zero value otherwise. func (o *Object) GetCount() int64 { if o == nil || o.Count == nil { @@ -89,6 +99,8 @@ func (o *Object) SetCount(v int64) { o.Count = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Object) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,15 +123,15 @@ func (o Object) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Object) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Type *string `json:"type,omitempty"` - Count *int64 `json:"count,omitempty"` + Type *string `json:"type,omitempty"` + Count *int64 `json:"count,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"type", "count"}) + common.DeleteKeys(additionalProperties, &[]string{ "type", "count", }) } else { return err } diff --git a/api/kbcloud/admin/model_object_response.go b/api/kbcloud/admin/model_object_response.go index e01ccb84..e1bf3515 100644 --- a/api/kbcloud/admin/model_object_response.go +++ b/api/kbcloud/admin/model_object_response.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ObjectResponse struct { // The data of the Object Data map[string]interface{} `json:"data,omitempty"` // The type of the Object Type *string `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewObjectResponse instantiates a new ObjectResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewObjectResponseWithDefaults() *ObjectResponse { this := ObjectResponse{} return &this } - // GetData returns the Data field value if set, zero value otherwise. func (o *ObjectResponse) GetData() map[string]interface{} { if o == nil || o.Data == nil { @@ -61,6 +70,7 @@ func (o *ObjectResponse) SetData(v map[string]interface{}) { o.Data = v } + // GetType returns the Type field value if set, zero value otherwise. func (o *ObjectResponse) GetType() string { if o == nil || o.Type == nil { @@ -89,6 +99,8 @@ func (o *ObjectResponse) SetType(v string) { o.Type = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ObjectResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,14 +124,14 @@ func (o ObjectResponse) MarshalJSON() ([]byte, error) { func (o *ObjectResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { Data map[string]interface{} `json:"data,omitempty"` - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"data", "type"}) + common.DeleteKeys(additionalProperties, &[]string{ "data", "type", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_expose.go b/api/kbcloud/admin/model_ops_expose.go index 58ffaab4..2fdb32d4 100644 --- a/api/kbcloud/admin/model_ops_expose.go +++ b/api/kbcloud/admin/model_ops_expose.go @@ -2,28 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsExpose OpsExpose is the payload to expose a KubeBlocks cluster + + +// OpsExpose OpsExpose is the payload to expose a KubeBlocks cluster type OpsExpose struct { Component *string `json:"component,omitempty"` - Enable bool `json:"enable"` + Enable bool `json:"enable"` // Specifies the type of exposure for the KubeBlocks cluster. Type OpsExposeType `json:"type"` // Specifies the type of service for the KubeBlocks cluster. - VpcServiceType *OpsExposeVPCServiceType `json:"vpcServiceType,omitempty"` - PortsMapping []OpsExposePortsMappingItem `json:"portsMapping,omitempty"` + VpcServiceType *OpsExposeVPCServiceType `json:"vpcServiceType,omitempty"` + PortsMapping []OpsExposePortsMappingItem `json:"portsMapping,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsExpose instantiates a new OpsExpose object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +52,6 @@ func NewOpsExposeWithDefaults() *OpsExpose { this.VpcServiceType = &vpcServiceType return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsExpose) GetComponent() string { if o == nil || o.Component == nil { @@ -75,6 +80,7 @@ func (o *OpsExpose) SetComponent(v string) { o.Component = &v } + // GetEnable returns the Enable field value. func (o *OpsExpose) GetEnable() bool { if o == nil { @@ -98,6 +104,7 @@ func (o *OpsExpose) SetEnable(v bool) { o.Enable = v } + // GetType returns the Type field value. func (o *OpsExpose) GetType() OpsExposeType { if o == nil { @@ -121,6 +128,7 @@ func (o *OpsExpose) SetType(v OpsExposeType) { o.Type = v } + // GetVpcServiceType returns the VpcServiceType field value if set, zero value otherwise. func (o *OpsExpose) GetVpcServiceType() OpsExposeVPCServiceType { if o == nil || o.VpcServiceType == nil { @@ -149,6 +157,7 @@ func (o *OpsExpose) SetVpcServiceType(v OpsExposeVPCServiceType) { o.VpcServiceType = &v } + // GetPortsMapping returns the PortsMapping field value if set, zero value otherwise. func (o *OpsExpose) GetPortsMapping() []OpsExposePortsMappingItem { if o == nil || o.PortsMapping == nil { @@ -177,6 +186,8 @@ func (o *OpsExpose) SetPortsMapping(v []OpsExposePortsMappingItem) { o.PortsMapping = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsExpose) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -204,11 +215,11 @@ func (o OpsExpose) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsExpose) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - Enable *bool `json:"enable"` - Type *OpsExposeType `json:"type"` - VpcServiceType *OpsExposeVPCServiceType `json:"vpcServiceType,omitempty"` - PortsMapping []OpsExposePortsMappingItem `json:"portsMapping,omitempty"` + Component *string `json:"component,omitempty"` + Enable *bool `json:"enable"` + Type *OpsExposeType `json:"type"` + VpcServiceType *OpsExposeVPCServiceType `json:"vpcServiceType,omitempty"` + PortsMapping []OpsExposePortsMappingItem `json:"portsMapping,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -221,7 +232,7 @@ func (o *OpsExpose) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "enable", "type", "vpcServiceType", "portsMapping"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "enable", "type", "vpcServiceType", "portsMapping", }) } else { return err } @@ -234,7 +245,7 @@ func (o *OpsExpose) UnmarshalJSON(bytes []byte) (err error) { } else { o.Type = *all.Type } - if all.VpcServiceType != nil && !all.VpcServiceType.IsValid() { + if all.VpcServiceType != nil &&!all.VpcServiceType.IsValid() { hasInvalidField = true } else { o.VpcServiceType = all.VpcServiceType diff --git a/api/kbcloud/admin/model_ops_expose_ports_mapping_item.go b/api/kbcloud/admin/model_ops_expose_ports_mapping_item.go index 1dab7f99..9f48223a 100644 --- a/api/kbcloud/admin/model_ops_expose_ports_mapping_item.go +++ b/api/kbcloud/admin/model_ops_expose_ports_mapping_item.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type OpsExposePortsMappingItem struct { Old *int32 `json:"old,omitempty"` New *int32 `json:"new,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsExposePortsMappingItem instantiates a new OpsExposePortsMappingItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewOpsExposePortsMappingItemWithDefaults() *OpsExposePortsMappingItem { this := OpsExposePortsMappingItem{} return &this } - // GetOld returns the Old field value if set, zero value otherwise. func (o *OpsExposePortsMappingItem) GetOld() int32 { if o == nil || o.Old == nil { @@ -59,6 +68,7 @@ func (o *OpsExposePortsMappingItem) SetOld(v int32) { o.Old = &v } + // GetNew returns the New field value if set, zero value otherwise. func (o *OpsExposePortsMappingItem) GetNew() int32 { if o == nil || o.New == nil { @@ -87,6 +97,8 @@ func (o *OpsExposePortsMappingItem) SetNew(v int32) { o.New = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsExposePortsMappingItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -117,7 +129,7 @@ func (o *OpsExposePortsMappingItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"old", "new"}) + common.DeleteKeys(additionalProperties, &[]string{ "old", "new", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_expose_type.go b/api/kbcloud/admin/model_ops_expose_type.go index 66787467..46a77550 100644 --- a/api/kbcloud/admin/model_ops_expose_type.go +++ b/api/kbcloud/admin/model_ops_expose_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // OpsExposeType Specifies the type of exposure for the KubeBlocks cluster. type OpsExposeType string // List of OpsExposeType. const ( - OpsExposeTypeVpc OpsExposeType = "vpc" + OpsExposeTypeVpc OpsExposeType = "vpc" OpsExposeTypeInternet OpsExposeType = "internet" ) diff --git a/api/kbcloud/admin/model_ops_expose_vpc_service_type.go b/api/kbcloud/admin/model_ops_expose_vpc_service_type.go index 310e5c35..5924f47f 100644 --- a/api/kbcloud/admin/model_ops_expose_vpc_service_type.go +++ b/api/kbcloud/admin/model_ops_expose_vpc_service_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // OpsExposeVPCServiceType Specifies the type of service for the KubeBlocks cluster. type OpsExposeVPCServiceType string // List of OpsExposeVPCServiceType. const ( OpsExposeVPCServiceTypeLoadBalancer OpsExposeVPCServiceType = "LoadBalancer" - OpsExposeVPCServiceTypeNodePort OpsExposeVPCServiceType = "NodePort" + OpsExposeVPCServiceTypeNodePort OpsExposeVPCServiceType = "NodePort" ) var allowedOpsExposeVPCServiceTypeEnumValues = []OpsExposeVPCServiceType{ diff --git a/api/kbcloud/admin/model_ops_h_scale.go b/api/kbcloud/admin/model_ops_h_scale.go index d3c4acb8..c6f3dcb6 100644 --- a/api/kbcloud/admin/model_ops_h_scale.go +++ b/api/kbcloud/admin/model_ops_h_scale.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsHScale OpsHScale is the payload to horizontally scale a KubeBlocks cluster + + +// OpsHScale OpsHScale is the payload to horizontally scale a KubeBlocks cluster type OpsHScale struct { // component type Component *string `json:"component,omitempty"` // number of replicas Replicas int32 `json:"replicas"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsHScale instantiates a new OpsHScale object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOpsHScaleWithDefaults() *OpsHScale { this := OpsHScale{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsHScale) GetComponent() string { if o == nil || o.Component == nil { @@ -67,6 +72,7 @@ func (o *OpsHScale) SetComponent(v string) { o.Component = &v } + // GetReplicas returns the Replicas field value. func (o *OpsHScale) GetReplicas() int32 { if o == nil { @@ -90,6 +96,8 @@ func (o *OpsHScale) SetReplicas(v int32) { o.Replicas = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsHScale) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +119,7 @@ func (o OpsHScale) MarshalJSON() ([]byte, error) { func (o *OpsHScale) UnmarshalJSON(bytes []byte) (err error) { all := struct { Component *string `json:"component,omitempty"` - Replicas *int32 `json:"replicas"` + Replicas *int32 `json:"replicas"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,7 +129,7 @@ func (o *OpsHScale) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "replicas"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "replicas", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_license.go b/api/kbcloud/admin/model_ops_license.go index bcfdc1f4..6624f677 100644 --- a/api/kbcloud/admin/model_ops_license.go +++ b/api/kbcloud/admin/model_ops_license.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsLicense OpsLicense is the payload to update a KubeBlocks cluster license + + +// OpsLicense OpsLicense is the payload to update a KubeBlocks cluster license type OpsLicense struct { // component type Component string `json:"component"` // license ID LicenseId string `json:"licenseId"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsLicense instantiates a new OpsLicense object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewOpsLicenseWithDefaults() *OpsLicense { this := OpsLicense{} return &this } - // GetComponent returns the Component field value. func (o *OpsLicense) GetComponent() string { if o == nil { @@ -63,6 +68,7 @@ func (o *OpsLicense) SetComponent(v string) { o.Component = v } + // GetLicenseId returns the LicenseId field value. func (o *OpsLicense) GetLicenseId() string { if o == nil { @@ -86,6 +92,8 @@ func (o *OpsLicense) SetLicenseId(v string) { o.LicenseId = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsLicense) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -118,7 +126,7 @@ func (o *OpsLicense) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "licenseId"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "licenseId", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_promote.go b/api/kbcloud/admin/model_ops_promote.go index 3cced3c0..ca1a33aa 100644 --- a/api/kbcloud/admin/model_ops_promote.go +++ b/api/kbcloud/admin/model_ops_promote.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OpsPromote OpsPromote is the payload to promote a KubeBlocks cluster +// OpsPromote OpsPromote is the payload to promote a KubeBlocks cluster type OpsPromote struct { ComponentName *string `json:"componentName,omitempty"` - InstanceName *string `json:"instanceName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsPromote instantiates a new OpsPromote object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewOpsPromoteWithDefaults() *OpsPromote { this := OpsPromote{} return &this } - // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *OpsPromote) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -60,6 +69,7 @@ func (o *OpsPromote) SetComponentName(v string) { o.ComponentName = &v } + // GetInstanceName returns the InstanceName field value if set, zero value otherwise. func (o *OpsPromote) GetInstanceName() string { if o == nil || o.InstanceName == nil { @@ -88,6 +98,8 @@ func (o *OpsPromote) SetInstanceName(v string) { o.InstanceName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsPromote) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,14 +123,14 @@ func (o OpsPromote) MarshalJSON() ([]byte, error) { func (o *OpsPromote) UnmarshalJSON(bytes []byte) (err error) { all := struct { ComponentName *string `json:"componentName,omitempty"` - InstanceName *string `json:"instanceName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"componentName", "instanceName"}) + common.DeleteKeys(additionalProperties, &[]string{ "componentName", "instanceName", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_rebuild_instance.go b/api/kbcloud/admin/model_ops_rebuild_instance.go index 05274249..db3e0114 100644 --- a/api/kbcloud/admin/model_ops_rebuild_instance.go +++ b/api/kbcloud/admin/model_ops_rebuild_instance.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OpsRebuildInstance rebuild the instances of the cluster. +// OpsRebuildInstance rebuild the instances of the cluster. type OpsRebuildInstance struct { // will ignore role check during rebuilding instance. - IgnoreRoleCheck *bool `json:"ignoreRoleCheck,omitempty"` - Requests []OpsRebuildInstanceRequestsItem `json:"requests,omitempty"` + IgnoreRoleCheck *bool `json:"ignoreRoleCheck,omitempty"` + Requests []OpsRebuildInstanceRequestsItem `json:"requests,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRebuildInstance instantiates a new OpsRebuildInstance object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewOpsRebuildInstanceWithDefaults() *OpsRebuildInstance { this := OpsRebuildInstance{} return &this } - // GetIgnoreRoleCheck returns the IgnoreRoleCheck field value if set, zero value otherwise. func (o *OpsRebuildInstance) GetIgnoreRoleCheck() bool { if o == nil || o.IgnoreRoleCheck == nil { @@ -61,6 +70,7 @@ func (o *OpsRebuildInstance) SetIgnoreRoleCheck(v bool) { o.IgnoreRoleCheck = &v } + // GetRequests returns the Requests field value if set, zero value otherwise. func (o *OpsRebuildInstance) GetRequests() []OpsRebuildInstanceRequestsItem { if o == nil || o.Requests == nil { @@ -89,6 +99,8 @@ func (o *OpsRebuildInstance) SetRequests(v []OpsRebuildInstanceRequestsItem) { o.Requests = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRebuildInstance) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,15 +123,15 @@ func (o OpsRebuildInstance) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsRebuildInstance) UnmarshalJSON(bytes []byte) (err error) { all := struct { - IgnoreRoleCheck *bool `json:"ignoreRoleCheck,omitempty"` - Requests []OpsRebuildInstanceRequestsItem `json:"requests,omitempty"` + IgnoreRoleCheck *bool `json:"ignoreRoleCheck,omitempty"` + Requests []OpsRebuildInstanceRequestsItem `json:"requests,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"ignoreRoleCheck", "requests"}) + common.DeleteKeys(additionalProperties, &[]string{ "ignoreRoleCheck", "requests", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_rebuild_instance_instance_param.go b/api/kbcloud/admin/model_ops_rebuild_instance_instance_param.go index e1fdacc1..9b66e072 100644 --- a/api/kbcloud/admin/model_ops_rebuild_instance_instance_param.go +++ b/api/kbcloud/admin/model_ops_rebuild_instance_instance_param.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsRebuildInstanceInstanceParam instance params for RebuildInstance ops + + +// OpsRebuildInstanceInstanceParam instance params for RebuildInstance ops type OpsRebuildInstanceInstanceParam struct { // Pod name of the instance Name string `json:"name"` // The instance will rebuild on the specified node. If not set, it will rebuild on a random node. TargetNodeName *string `json:"targetNodeName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRebuildInstanceInstanceParam instantiates a new OpsRebuildInstanceInstanceParam object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOpsRebuildInstanceInstanceParamWithDefaults() *OpsRebuildInstanceInstanc this := OpsRebuildInstanceInstanceParam{} return &this } - // GetName returns the Name field value. func (o *OpsRebuildInstanceInstanceParam) GetName() string { if o == nil { @@ -62,6 +67,7 @@ func (o *OpsRebuildInstanceInstanceParam) SetName(v string) { o.Name = v } + // GetTargetNodeName returns the TargetNodeName field value if set, zero value otherwise. func (o *OpsRebuildInstanceInstanceParam) GetTargetNodeName() string { if o == nil || o.TargetNodeName == nil { @@ -90,6 +96,8 @@ func (o *OpsRebuildInstanceInstanceParam) SetTargetNodeName(v string) { o.TargetNodeName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRebuildInstanceInstanceParam) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o OpsRebuildInstanceInstanceParam) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsRebuildInstanceInstanceParam) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` TargetNodeName *string `json:"targetNodeName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,7 +129,7 @@ func (o *OpsRebuildInstanceInstanceParam) UnmarshalJSON(bytes []byte) (err error } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "targetNodeName"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "targetNodeName", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_rebuild_instance_requests_item.go b/api/kbcloud/admin/model_ops_rebuild_instance_requests_item.go index 0bc91c08..445eafd0 100644 --- a/api/kbcloud/admin/model_ops_rebuild_instance_requests_item.go +++ b/api/kbcloud/admin/model_ops_rebuild_instance_requests_item.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type OpsRebuildInstanceRequestsItem struct { - BackupName *string `json:"backupName,omitempty"` - Instances []OpsRebuildInstanceInstanceParam `json:"instances"` + BackupName *string `json:"backupName,omitempty"` + Instances []OpsRebuildInstanceInstanceParam `json:"instances"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRebuildInstanceRequestsItem instantiates a new OpsRebuildInstanceRequestsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewOpsRebuildInstanceRequestsItemWithDefaults() *OpsRebuildInstanceRequests this := OpsRebuildInstanceRequestsItem{} return &this } - // GetBackupName returns the BackupName field value if set, zero value otherwise. func (o *OpsRebuildInstanceRequestsItem) GetBackupName() string { if o == nil || o.BackupName == nil { @@ -64,6 +69,7 @@ func (o *OpsRebuildInstanceRequestsItem) SetBackupName(v string) { o.BackupName = &v } + // GetInstances returns the Instances field value. func (o *OpsRebuildInstanceRequestsItem) GetInstances() []OpsRebuildInstanceInstanceParam { if o == nil { @@ -87,6 +93,8 @@ func (o *OpsRebuildInstanceRequestsItem) SetInstances(v []OpsRebuildInstanceInst o.Instances = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRebuildInstanceRequestsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -107,8 +115,8 @@ func (o OpsRebuildInstanceRequestsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsRebuildInstanceRequestsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - BackupName *string `json:"backupName,omitempty"` - Instances *[]OpsRebuildInstanceInstanceParam `json:"instances"` + BackupName *string `json:"backupName,omitempty"` + Instances *[]OpsRebuildInstanceInstanceParam `json:"instances"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *OpsRebuildInstanceRequestsItem) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"backupName", "instances"}) + common.DeleteKeys(additionalProperties, &[]string{ "backupName", "instances", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_request_name.go b/api/kbcloud/admin/model_ops_request_name.go index bac5c0f6..81923818 100644 --- a/api/kbcloud/admin/model_ops_request_name.go +++ b/api/kbcloud/admin/model_ops_request_name.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsRequestName OpsRequestName is the name of a KubeBlocks OpsRequest + + +// OpsRequestName OpsRequestName is the name of a KubeBlocks OpsRequest type OpsRequestName struct { - OpsRequestName string `json:"opsRequestName"` + OpsRequestName string `json:"opsRequestName"` DependentOpsName *string `json:"dependentOpsName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRequestName instantiates a new OpsRequestName object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewOpsRequestNameWithDefaults() *OpsRequestName { this := OpsRequestName{} return &this } - // GetOpsRequestName returns the OpsRequestName field value. func (o *OpsRequestName) GetOpsRequestName() string { if o == nil { @@ -60,6 +65,7 @@ func (o *OpsRequestName) SetOpsRequestName(v string) { o.OpsRequestName = v } + // GetDependentOpsName returns the DependentOpsName field value if set, zero value otherwise. func (o *OpsRequestName) GetDependentOpsName() string { if o == nil || o.DependentOpsName == nil { @@ -88,6 +94,8 @@ func (o *OpsRequestName) SetDependentOpsName(v string) { o.DependentOpsName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRequestName) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -108,7 +116,7 @@ func (o OpsRequestName) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsRequestName) UnmarshalJSON(bytes []byte) (err error) { all := struct { - OpsRequestName *string `json:"opsRequestName"` + OpsRequestName *string `json:"opsRequestName"` DependentOpsName *string `json:"dependentOpsName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +127,7 @@ func (o *OpsRequestName) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"opsRequestName", "dependentOpsName"}) + common.DeleteKeys(additionalProperties, &[]string{ "opsRequestName", "dependentOpsName", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_restart.go b/api/kbcloud/admin/model_ops_restart.go index e4b22026..05c6d051 100644 --- a/api/kbcloud/admin/model_ops_restart.go +++ b/api/kbcloud/admin/model_ops_restart.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OpsRestart OpsRestart is the payload to restart a KubeBlocks cluster +// OpsRestart OpsRestart is the payload to restart a KubeBlocks cluster type OpsRestart struct { // component type Component *string `json:"component,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRestart instantiates a new OpsRestart object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewOpsRestartWithDefaults() *OpsRestart { this := OpsRestart{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsRestart) GetComponent() string { if o == nil || o.Component == nil { @@ -60,6 +69,8 @@ func (o *OpsRestart) SetComponent(v string) { o.Component = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRestart) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *OpsRestart) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_type.go b/api/kbcloud/admin/model_ops_type.go index 255b7c1d..bda4e0fb 100644 --- a/api/kbcloud/admin/model_ops_type.go +++ b/api/kbcloud/admin/model_ops_type.go @@ -2,29 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type OpsType string // List of OpsType. const ( - OpsTypeVerticalScaling OpsType = "VerticalScaling" + OpsTypeVerticalScaling OpsType = "VerticalScaling" OpsTypeHorizontalScaling OpsType = "HorizontalScaling" - OpsTypeVolumeExpansion OpsType = "VolumeExpansion" - OpsTypeUpgrade OpsType = "Upgrade" - OpsTypeReconfiguring OpsType = "Reconfiguring" - OpsTypeSwitchover OpsType = "Switchover" - OpsTypeRestart OpsType = "Restart" - OpsTypeStop OpsType = "Stop" - OpsTypeStart OpsType = "Start" - OpsTypeExpose OpsType = "Expose" - OpsTypeDataScript OpsType = "DataScript" + OpsTypeVolumeExpansion OpsType = "VolumeExpansion" + OpsTypeUpgrade OpsType = "Upgrade" + OpsTypeReconfiguring OpsType = "Reconfiguring" + OpsTypeSwitchover OpsType = "Switchover" + OpsTypeRestart OpsType = "Restart" + OpsTypeStop OpsType = "Stop" + OpsTypeStart OpsType = "Start" + OpsTypeExpose OpsType = "Expose" + OpsTypeDataScript OpsType = "DataScript" ) var allowedOpsTypeEnumValues = []OpsType{ diff --git a/api/kbcloud/admin/model_ops_upgrade.go b/api/kbcloud/admin/model_ops_upgrade.go index 72e928a1..a83f53fa 100644 --- a/api/kbcloud/admin/model_ops_upgrade.go +++ b/api/kbcloud/admin/model_ops_upgrade.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsUpgrade OpsUpgrade is the payload to upgrade a KubeBlocks cluster + + +// OpsUpgrade OpsUpgrade is the payload to upgrade a KubeBlocks cluster type OpsUpgrade struct { - Version string `json:"version"` + Version string `json:"version"` Component *string `json:"component,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsUpgrade instantiates a new OpsUpgrade object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewOpsUpgradeWithDefaults() *OpsUpgrade { this := OpsUpgrade{} return &this } - // GetVersion returns the Version field value. func (o *OpsUpgrade) GetVersion() string { if o == nil { @@ -60,6 +65,7 @@ func (o *OpsUpgrade) SetVersion(v string) { o.Version = v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsUpgrade) GetComponent() string { if o == nil || o.Component == nil { @@ -88,6 +94,8 @@ func (o *OpsUpgrade) SetComponent(v string) { o.Component = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsUpgrade) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -108,7 +116,7 @@ func (o OpsUpgrade) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsUpgrade) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Version *string `json:"version"` + Version *string `json:"version"` Component *string `json:"component,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +127,7 @@ func (o *OpsUpgrade) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"version", "component"}) + common.DeleteKeys(additionalProperties, &[]string{ "version", "component", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_v_scale.go b/api/kbcloud/admin/model_ops_v_scale.go index d54e46b0..c73a1d24 100644 --- a/api/kbcloud/admin/model_ops_v_scale.go +++ b/api/kbcloud/admin/model_ops_v_scale.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// OpsVScale OpsVScale is the payload to vertically scale a KubeBlocks cluster + + +// OpsVScale OpsVScale is the payload to vertically scale a KubeBlocks cluster type OpsVScale struct { // component type Component *string `json:"component,omitempty"` @@ -17,10 +26,11 @@ type OpsVScale struct { // class code of the cluster ClassCode *string `json:"classCode,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsVScale instantiates a new OpsVScale object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewOpsVScaleWithDefaults() *OpsVScale { this := OpsVScale{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsVScale) GetComponent() string { if o == nil || o.Component == nil { @@ -66,6 +75,7 @@ func (o *OpsVScale) SetComponent(v string) { o.Component = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *OpsVScale) GetCpu() string { if o == nil || o.Cpu == nil { @@ -94,6 +104,7 @@ func (o *OpsVScale) SetCpu(v string) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *OpsVScale) GetMemory() string { if o == nil || o.Memory == nil { @@ -122,6 +133,7 @@ func (o *OpsVScale) SetMemory(v string) { o.Memory = &v } + // GetClassCode returns the ClassCode field value if set, zero value otherwise. func (o *OpsVScale) GetClassCode() string { if o == nil || o.ClassCode == nil { @@ -150,6 +162,8 @@ func (o *OpsVScale) SetClassCode(v string) { o.ClassCode = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsVScale) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -179,8 +193,8 @@ func (o OpsVScale) MarshalJSON() ([]byte, error) { func (o *OpsVScale) UnmarshalJSON(bytes []byte) (err error) { all := struct { Component *string `json:"component,omitempty"` - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` + Cpu *string `json:"cpu,omitempty"` + Memory *string `json:"memory,omitempty"` ClassCode *string `json:"classCode,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -188,7 +202,7 @@ func (o *OpsVScale) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "cpu", "memory", "classCode"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "cpu", "memory", "classCode", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_volume_expand.go b/api/kbcloud/admin/model_ops_volume_expand.go index 88f6e080..9fb974a7 100644 --- a/api/kbcloud/admin/model_ops_volume_expand.go +++ b/api/kbcloud/admin/model_ops_volume_expand.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsVolumeExpand OpsVolumeExpand is the payload to expand volume for a KubeBlocks cluster + + +// OpsVolumeExpand OpsVolumeExpand is the payload to expand volume for a KubeBlocks cluster type OpsVolumeExpand struct { - Component *string `json:"component,omitempty"` - Volumes []OpsVolumeExpandVolumesItem `json:"volumes"` + Component *string `json:"component,omitempty"` + Volumes []OpsVolumeExpandVolumesItem `json:"volumes"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsVolumeExpand instantiates a new OpsVolumeExpand object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewOpsVolumeExpandWithDefaults() *OpsVolumeExpand { this := OpsVolumeExpand{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsVolumeExpand) GetComponent() string { if o == nil || o.Component == nil { @@ -65,6 +70,7 @@ func (o *OpsVolumeExpand) SetComponent(v string) { o.Component = &v } + // GetVolumes returns the Volumes field value. func (o *OpsVolumeExpand) GetVolumes() []OpsVolumeExpandVolumesItem { if o == nil { @@ -88,6 +94,8 @@ func (o *OpsVolumeExpand) SetVolumes(v []OpsVolumeExpandVolumesItem) { o.Volumes = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsVolumeExpand) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -108,8 +116,8 @@ func (o OpsVolumeExpand) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsVolumeExpand) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - Volumes *[]OpsVolumeExpandVolumesItem `json:"volumes"` + Component *string `json:"component,omitempty"` + Volumes *[]OpsVolumeExpandVolumesItem `json:"volumes"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -119,7 +127,7 @@ func (o *OpsVolumeExpand) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "volumes"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "volumes", }) } else { return err } diff --git a/api/kbcloud/admin/model_ops_volume_expand_volumes_item.go b/api/kbcloud/admin/model_ops_volume_expand_volumes_item.go index 9d342d88..b4ccc96a 100644 --- a/api/kbcloud/admin/model_ops_volume_expand_volumes_item.go +++ b/api/kbcloud/admin/model_ops_volume_expand_volumes_item.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type OpsVolumeExpandVolumesItem struct { // volume name Name string `json:"name"` // Storage size, the unit is Gi. Storage string `json:"storage"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsVolumeExpandVolumesItem instantiates a new OpsVolumeExpandVolumesItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOpsVolumeExpandVolumesItemWithDefaults() *OpsVolumeExpandVolumesItem { this := OpsVolumeExpandVolumesItem{} return &this } - // GetName returns the Name field value. func (o *OpsVolumeExpandVolumesItem) GetName() string { if o == nil { @@ -62,6 +67,7 @@ func (o *OpsVolumeExpandVolumesItem) SetName(v string) { o.Name = v } + // GetStorage returns the Storage field value. func (o *OpsVolumeExpandVolumesItem) GetStorage() string { if o == nil { @@ -85,6 +91,8 @@ func (o *OpsVolumeExpandVolumesItem) SetStorage(v string) { o.Storage = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsVolumeExpandVolumesItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -103,7 +111,7 @@ func (o OpsVolumeExpandVolumesItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsVolumeExpandVolumesItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` Storage *string `json:"storage"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +125,7 @@ func (o *OpsVolumeExpandVolumesItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "storage"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "storage", }) } else { return err } diff --git a/api/kbcloud/admin/model_org.go b/api/kbcloud/admin/model_org.go index 2a810abe..614412d2 100644 --- a/api/kbcloud/admin/model_org.go +++ b/api/kbcloud/admin/model_org.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Org Org info + + +// Org Org info type Org struct { // CreatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. // @@ -32,10 +36,11 @@ type Org struct { // return true if the organization is enabled Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrg instantiates a new Org object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +61,6 @@ func NewOrgWithDefaults() *Org { this := Org{} return &this } - // GetCreatedAt returns the CreatedAt field value. func (o *Org) GetCreatedAt() time.Time { if o == nil { @@ -80,6 +84,7 @@ func (o *Org) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Org) GetDescription() string { if o == nil || o.Description == nil { @@ -108,6 +113,7 @@ func (o *Org) SetDescription(v string) { o.Description = &v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *Org) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -136,6 +142,7 @@ func (o *Org) SetDisplayName(v string) { o.DisplayName = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *Org) GetId() string { if o == nil || o.Id == nil { @@ -164,6 +171,7 @@ func (o *Org) SetId(v string) { o.Id = &v } + // GetName returns the Name field value. func (o *Org) GetName() string { if o == nil { @@ -187,6 +195,7 @@ func (o *Org) SetName(v string) { o.Name = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Org) GetUpdatedAt() time.Time { if o == nil { @@ -210,6 +219,7 @@ func (o *Org) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetEnabled returns the Enabled field value. func (o *Org) GetEnabled() bool { if o == nil { @@ -233,6 +243,8 @@ func (o *Org) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o Org) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -270,13 +282,13 @@ func (o Org) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Org) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CreatedAt *time.Time `json:"createdAt"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name"` - UpdatedAt *time.Time `json:"updatedAt"` - Enabled *bool `json:"enabled"` + CreatedAt *time.Time `json:"createdAt"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name"` + UpdatedAt *time.Time `json:"updatedAt"` + Enabled *bool `json:"enabled"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -295,7 +307,7 @@ func (o *Org) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"createdAt", "description", "displayName", "id", "name", "updatedAt", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "createdAt", "description", "displayName", "id", "name", "updatedAt", "enabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_org_member.go b/api/kbcloud/admin/model_org_member.go index d1010419..700b881b 100644 --- a/api/kbcloud/admin/model_org_member.go +++ b/api/kbcloud/admin/model_org_member.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgMember Org Member info + + +// OrgMember Org Member info type OrgMember struct { // The display name of User. Read-Only DisplayName *string `json:"displayName,omitempty"` @@ -23,10 +28,11 @@ type OrgMember struct { // Return true if the member is freezed in the organization Freezed bool `json:"freezed"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgMember instantiates a new OrgMember object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +53,6 @@ func NewOrgMemberWithDefaults() *OrgMember { this := OrgMember{} return &this } - // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *OrgMember) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -76,6 +81,7 @@ func (o *OrgMember) SetDisplayName(v string) { o.DisplayName = &v } + // GetEmail returns the Email field value. func (o *OrgMember) GetEmail() string { if o == nil { @@ -99,6 +105,7 @@ func (o *OrgMember) SetEmail(v string) { o.Email = v } + // GetRole returns the Role field value. func (o *OrgMember) GetRole() OrgMemberRole { if o == nil { @@ -122,6 +129,7 @@ func (o *OrgMember) SetRole(v OrgMemberRole) { o.Role = v } + // GetUserId returns the UserId field value. func (o *OrgMember) GetUserId() string { if o == nil { @@ -145,6 +153,7 @@ func (o *OrgMember) SetUserId(v string) { o.UserId = v } + // GetFreezed returns the Freezed field value. func (o *OrgMember) GetFreezed() bool { if o == nil { @@ -168,6 +177,8 @@ func (o *OrgMember) SetFreezed(v bool) { o.Freezed = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgMember) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -191,11 +202,11 @@ func (o OrgMember) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgMember) UnmarshalJSON(bytes []byte) (err error) { all := struct { - DisplayName *string `json:"displayName,omitempty"` - Email *string `json:"email"` - Role *OrgMemberRole `json:"role"` - UserId *string `json:"userId"` - Freezed *bool `json:"freezed"` + DisplayName *string `json:"displayName,omitempty"` + Email *string `json:"email"` + Role *OrgMemberRole `json:"role"` + UserId *string `json:"userId"` + Freezed *bool `json:"freezed"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -214,7 +225,7 @@ func (o *OrgMember) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"displayName", "email", "role", "userId", "freezed"}) + common.DeleteKeys(additionalProperties, &[]string{ "displayName", "email", "role", "userId", "freezed", }) } else { return err } diff --git a/api/kbcloud/admin/model_org_member_add.go b/api/kbcloud/admin/model_org_member_add.go index ca4c7ade..57f3342e 100644 --- a/api/kbcloud/admin/model_org_member_add.go +++ b/api/kbcloud/admin/model_org_member_add.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgMemberAdd MemberAdd is the payload for adding organization member + + +// OrgMemberAdd MemberAdd is the payload for adding organization member type OrgMemberAdd struct { // The name of the role in the organization Role string `json:"role"` // The ID of the user UserId string `json:"userId"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgMemberAdd instantiates a new OrgMemberAdd object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewOrgMemberAddWithDefaults() *OrgMemberAdd { this := OrgMemberAdd{} return &this } - // GetRole returns the Role field value. func (o *OrgMemberAdd) GetRole() string { if o == nil { @@ -63,6 +68,7 @@ func (o *OrgMemberAdd) SetRole(v string) { o.Role = v } + // GetUserId returns the UserId field value. func (o *OrgMemberAdd) GetUserId() string { if o == nil { @@ -86,6 +92,8 @@ func (o *OrgMemberAdd) SetUserId(v string) { o.UserId = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgMemberAdd) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,7 +112,7 @@ func (o OrgMemberAdd) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgMemberAdd) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Role *string `json:"role"` + Role *string `json:"role"` UserId *string `json:"userId"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,7 +126,7 @@ func (o *OrgMemberAdd) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"role", "userId"}) + common.DeleteKeys(additionalProperties, &[]string{ "role", "userId", }) } else { return err } diff --git a/api/kbcloud/admin/model_org_member_list.go b/api/kbcloud/admin/model_org_member_list.go index 4899bb08..e650ac08 100644 --- a/api/kbcloud/admin/model_org_member_list.go +++ b/api/kbcloud/admin/model_org_member_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgMemberList OrgMemberList is org member list + + +// OrgMemberList OrgMemberList is org member list type OrgMemberList struct { // Items is the list of OrgMember objects in the list Items []OrgMember `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgMemberList instantiates a new OrgMemberList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOrgMemberListWithDefaults() *OrgMemberList { this := OrgMemberList{} return &this } - // GetItems returns the Items field value. func (o *OrgMemberList) GetItems() []OrgMember { if o == nil { @@ -62,6 +67,7 @@ func (o *OrgMemberList) SetItems(v []OrgMember) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *OrgMemberList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *OrgMemberList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgMemberList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o OrgMemberList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgMemberList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]OrgMember `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]OrgMember `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *OrgMemberList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_org_member_role.go b/api/kbcloud/admin/model_org_member_role.go index 5170a83f..04f0e516 100644 --- a/api/kbcloud/admin/model_org_member_role.go +++ b/api/kbcloud/admin/model_org_member_role.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // OrgMemberRole The role of the User in the Org. Required type OrgMemberRole string // List of OrgMemberRole. const ( - OrgMemberRoleAdmin OrgMemberRole = "admin" + OrgMemberRoleAdmin OrgMemberRole = "admin" OrgMemberRoleDeveloper OrgMemberRole = "developer" ) diff --git a/api/kbcloud/admin/model_org_member_update.go b/api/kbcloud/admin/model_org_member_update.go index dd405f99..c1aea782 100644 --- a/api/kbcloud/admin/model_org_member_update.go +++ b/api/kbcloud/admin/model_org_member_update.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgMemberUpdate Org Member update + + +// OrgMemberUpdate Org Member update type OrgMemberUpdate struct { // The role of the User in the Org. Required Role string `json:"role"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgMemberUpdate instantiates a new OrgMemberUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewOrgMemberUpdateWithDefaults() *OrgMemberUpdate { this := OrgMemberUpdate{} return &this } - // GetRole returns the Role field value. func (o *OrgMemberUpdate) GetRole() string { if o == nil { @@ -60,6 +65,8 @@ func (o *OrgMemberUpdate) SetRole(v string) { o.Role = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgMemberUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *OrgMemberUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"role"}) + common.DeleteKeys(additionalProperties, &[]string{ "role", }) } else { return err } diff --git a/api/kbcloud/admin/model_org_tags_list.go b/api/kbcloud/admin/model_org_tags_list.go index 22e4056a..6e576826 100644 --- a/api/kbcloud/admin/model_org_tags_list.go +++ b/api/kbcloud/admin/model_org_tags_list.go @@ -2,21 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type OrgTagsList struct { Items []Tag `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgTagsList instantiates a new OrgTagsList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +40,6 @@ func NewOrgTagsListWithDefaults() *OrgTagsList { this := OrgTagsList{} return &this } - // GetItems returns the Items field value. func (o *OrgTagsList) GetItems() []Tag { if o == nil { @@ -58,6 +63,8 @@ func (o *OrgTagsList) SetItems(v []Tag) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgTagsList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +92,7 @@ func (o *OrgTagsList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_org_update.go b/api/kbcloud/admin/model_org_update.go index 88810278..9b055266 100644 --- a/api/kbcloud/admin/model_org_update.go +++ b/api/kbcloud/admin/model_org_update.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OrgUpdate Organization update +// OrgUpdate Organization update type OrgUpdate struct { // The description of the organization Description *string `json:"description,omitempty"` // The display name of the organization DisplayName *string `json:"displayName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgUpdate instantiates a new OrgUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewOrgUpdateWithDefaults() *OrgUpdate { this := OrgUpdate{} return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *OrgUpdate) GetDescription() string { if o == nil || o.Description == nil { @@ -62,6 +71,7 @@ func (o *OrgUpdate) SetDescription(v string) { o.Description = &v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *OrgUpdate) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -90,6 +100,8 @@ func (o *OrgUpdate) SetDisplayName(v string) { o.DisplayName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -120,7 +132,7 @@ func (o *OrgUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "displayName"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "displayName", }) } else { return err } diff --git a/api/kbcloud/admin/model_organization_item.go b/api/kbcloud/admin/model_organization_item.go index badf2688..81dbe16d 100644 --- a/api/kbcloud/admin/model_organization_item.go +++ b/api/kbcloud/admin/model_organization_item.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrganizationItem Organization items. + + +// OrganizationItem Organization items. type OrganizationItem struct { // The name of the organization. Name string `json:"name"` @@ -26,10 +30,11 @@ type OrganizationItem struct { // The time the organization was created. CreatedAt time.Time `json:"createdAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrganizationItem instantiates a new OrganizationItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +57,6 @@ func NewOrganizationItemWithDefaults() *OrganizationItem { this := OrganizationItem{} return &this } - // GetName returns the Name field value. func (o *OrganizationItem) GetName() string { if o == nil { @@ -76,6 +80,7 @@ func (o *OrganizationItem) SetName(v string) { o.Name = v } + // GetDisplayName returns the DisplayName field value. func (o *OrganizationItem) GetDisplayName() string { if o == nil { @@ -99,6 +104,7 @@ func (o *OrganizationItem) SetDisplayName(v string) { o.DisplayName = v } + // GetCreator returns the Creator field value. func (o *OrganizationItem) GetCreator() string { if o == nil { @@ -122,6 +128,7 @@ func (o *OrganizationItem) SetCreator(v string) { o.Creator = v } + // GetCreatorId returns the CreatorId field value. func (o *OrganizationItem) GetCreatorId() string { if o == nil { @@ -145,6 +152,7 @@ func (o *OrganizationItem) SetCreatorId(v string) { o.CreatorId = v } + // GetClusterTotal returns the ClusterTotal field value. func (o *OrganizationItem) GetClusterTotal() int32 { if o == nil { @@ -168,6 +176,7 @@ func (o *OrganizationItem) SetClusterTotal(v int32) { o.ClusterTotal = v } + // GetCreatedAt returns the CreatedAt field value. func (o *OrganizationItem) GetCreatedAt() time.Time { if o == nil { @@ -191,6 +200,8 @@ func (o *OrganizationItem) SetCreatedAt(v time.Time) { o.CreatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrganizationItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -217,12 +228,12 @@ func (o OrganizationItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrganizationItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - DisplayName *string `json:"displayName"` - Creator *string `json:"creator"` - CreatorId *string `json:"creatorID"` - ClusterTotal *int32 `json:"clusterTotal"` - CreatedAt *time.Time `json:"createdAt"` + Name *string `json:"name"` + DisplayName *string `json:"displayName"` + Creator *string `json:"creator"` + CreatorId *string `json:"creatorID"` + ClusterTotal *int32 `json:"clusterTotal"` + CreatedAt *time.Time `json:"createdAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -247,7 +258,7 @@ func (o *OrganizationItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "displayName", "creator", "creatorID", "clusterTotal", "createdAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "displayName", "creator", "creatorID", "clusterTotal", "createdAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_organization_list.go b/api/kbcloud/admin/model_organization_list.go index 61989ec8..b5573516 100644 --- a/api/kbcloud/admin/model_organization_list.go +++ b/api/kbcloud/admin/model_organization_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OrganizationList Organization list. +// OrganizationList Organization list. type OrganizationList struct { // The list of organizations. Items []OrganizationItem `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrganizationList instantiates a new OrganizationList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewOrganizationListWithDefaults() *OrganizationList { this := OrganizationList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *OrganizationList) GetItems() []OrganizationItem { if o == nil || o.Items == nil { @@ -60,6 +69,8 @@ func (o *OrganizationList) SetItems(v []OrganizationItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrganizationList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *OrganizationList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_owner.go b/api/kbcloud/admin/model_owner.go index 89ecc1dd..836716e2 100644 --- a/api/kbcloud/admin/model_owner.go +++ b/api/kbcloud/admin/model_owner.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// Owner Owner related to the Event + + +// Owner Owner related to the Event type Owner struct { // APIVersion is the API version of the owner. ApiVersion *string `json:"apiVersion,omitempty"` @@ -17,10 +26,11 @@ type Owner struct { // UID is the unique identifier of the owner. Uid *string `json:"uid,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOwner instantiates a new Owner object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewOwnerWithDefaults() *Owner { this := Owner{} return &this } - // GetApiVersion returns the ApiVersion field value if set, zero value otherwise. func (o *Owner) GetApiVersion() string { if o == nil || o.ApiVersion == nil { @@ -66,6 +75,7 @@ func (o *Owner) SetApiVersion(v string) { o.ApiVersion = &v } + // GetKind returns the Kind field value if set, zero value otherwise. func (o *Owner) GetKind() string { if o == nil || o.Kind == nil { @@ -94,6 +104,7 @@ func (o *Owner) SetKind(v string) { o.Kind = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Owner) GetName() string { if o == nil || o.Name == nil { @@ -122,6 +133,7 @@ func (o *Owner) SetName(v string) { o.Name = &v } + // GetUid returns the Uid field value if set, zero value otherwise. func (o *Owner) GetUid() string { if o == nil || o.Uid == nil { @@ -150,6 +162,8 @@ func (o *Owner) SetUid(v string) { o.Uid = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Owner) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -179,16 +193,16 @@ func (o Owner) MarshalJSON() ([]byte, error) { func (o *Owner) UnmarshalJSON(bytes []byte) (err error) { all := struct { ApiVersion *string `json:"apiVersion,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - Uid *string `json:"uid,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Uid *string `json:"uid,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"apiVersion", "kind", "name", "uid"}) + common.DeleteKeys(additionalProperties, &[]string{ "apiVersion", "kind", "name", "uid", }) } else { return err } diff --git a/api/kbcloud/admin/model_page_result.go b/api/kbcloud/admin/model_page_result.go index 89bd33ab..b7e7a8e0 100644 --- a/api/kbcloud/admin/model_page_result.go +++ b/api/kbcloud/admin/model_page_result.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// PageResult PageResult info + +// PageResult PageResult info type PageResult struct { // a link to the first page of results. This link is optional for collections that cannot be indexed directly to a given page First *string `json:"first,omitempty"` @@ -19,10 +28,11 @@ type PageResult struct { // the total count of items in the list irrespective of pagination TotalSize *int64 `json:"totalSize,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPageResult instantiates a new PageResult object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewPageResultWithDefaults() *PageResult { this := PageResult{} return &this } - // GetFirst returns the First field value if set, zero value otherwise. func (o *PageResult) GetFirst() string { if o == nil || o.First == nil { @@ -68,6 +77,7 @@ func (o *PageResult) SetFirst(v string) { o.First = &v } + // GetLast returns the Last field value if set, zero value otherwise. func (o *PageResult) GetLast() string { if o == nil || o.Last == nil { @@ -96,6 +106,7 @@ func (o *PageResult) SetLast(v string) { o.Last = &v } + // GetNext returns the Next field value if set, zero value otherwise. func (o *PageResult) GetNext() string { if o == nil || o.Next == nil { @@ -124,6 +135,7 @@ func (o *PageResult) SetNext(v string) { o.Next = &v } + // GetPrev returns the Prev field value if set, zero value otherwise. func (o *PageResult) GetPrev() string { if o == nil || o.Prev == nil { @@ -152,6 +164,7 @@ func (o *PageResult) SetPrev(v string) { o.Prev = &v } + // GetTotalSize returns the TotalSize field value if set, zero value otherwise. func (o *PageResult) GetTotalSize() int64 { if o == nil || o.TotalSize == nil { @@ -180,6 +193,8 @@ func (o *PageResult) SetTotalSize(v int64) { o.TotalSize = &v } + + // MarshalJSON serializes the struct using spec logic. func (o PageResult) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,18 +226,18 @@ func (o PageResult) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PageResult) UnmarshalJSON(bytes []byte) (err error) { all := struct { - First *string `json:"first,omitempty"` - Last *string `json:"last,omitempty"` - Next *string `json:"next,omitempty"` - Prev *string `json:"prev,omitempty"` - TotalSize *int64 `json:"totalSize,omitempty"` + First *string `json:"first,omitempty"` + Last *string `json:"last,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` + TotalSize *int64 `json:"totalSize,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"first", "last", "next", "prev", "totalSize"}) + common.DeleteKeys(additionalProperties, &[]string{ "first", "last", "next", "prev", "totalSize", }) } else { return err } diff --git a/api/kbcloud/admin/model_pagination.go b/api/kbcloud/admin/model_pagination.go index 2190aa16..a5e6e54c 100644 --- a/api/kbcloud/admin/model_pagination.go +++ b/api/kbcloud/admin/model_pagination.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Pagination struct { - RowsCount *int32 `json:"rows_count,omitempty"` - Page *int32 `json:"page,omitempty"` + RowsCount *int32 `json:"rows_count,omitempty"` + Page *int32 `json:"page,omitempty"` PagesCount *int32 `json:"pages_count,omitempty"` - PerPage *int32 `json:"per_page,omitempty"` + PerPage *int32 `json:"per_page,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPagination instantiates a new Pagination object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewPaginationWithDefaults() *Pagination { this := Pagination{} return &this } - // GetRowsCount returns the RowsCount field value if set, zero value otherwise. func (o *Pagination) GetRowsCount() int32 { if o == nil || o.RowsCount == nil { @@ -61,6 +70,7 @@ func (o *Pagination) SetRowsCount(v int32) { o.RowsCount = &v } + // GetPage returns the Page field value if set, zero value otherwise. func (o *Pagination) GetPage() int32 { if o == nil || o.Page == nil { @@ -89,6 +99,7 @@ func (o *Pagination) SetPage(v int32) { o.Page = &v } + // GetPagesCount returns the PagesCount field value if set, zero value otherwise. func (o *Pagination) GetPagesCount() int32 { if o == nil || o.PagesCount == nil { @@ -117,6 +128,7 @@ func (o *Pagination) SetPagesCount(v int32) { o.PagesCount = &v } + // GetPerPage returns the PerPage field value if set, zero value otherwise. func (o *Pagination) GetPerPage() int32 { if o == nil || o.PerPage == nil { @@ -145,6 +157,8 @@ func (o *Pagination) SetPerPage(v int32) { o.PerPage = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Pagination) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -173,17 +187,17 @@ func (o Pagination) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Pagination) UnmarshalJSON(bytes []byte) (err error) { all := struct { - RowsCount *int32 `json:"rows_count,omitempty"` - Page *int32 `json:"page,omitempty"` + RowsCount *int32 `json:"rows_count,omitempty"` + Page *int32 `json:"page,omitempty"` PagesCount *int32 `json:"pages_count,omitempty"` - PerPage *int32 `json:"per_page,omitempty"` + PerPage *int32 `json:"per_page,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"rows_count", "page", "pages_count", "per_page"}) + common.DeleteKeys(additionalProperties, &[]string{ "rows_count", "page", "pages_count", "per_page", }) } else { return err } diff --git a/api/kbcloud/admin/model_param_tpl_appl_to_cluster_list.go b/api/kbcloud/admin/model_param_tpl_appl_to_cluster_list.go index 22c10b93..2dc33076 100644 --- a/api/kbcloud/admin/model_param_tpl_appl_to_cluster_list.go +++ b/api/kbcloud/admin/model_param_tpl_appl_to_cluster_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplApplToClusterList paramTplAPPLToClusterList is a list of parameter templates applicable to the cluster + + +// ParamTplApplToClusterList paramTplAPPLToClusterList is a list of parameter templates applicable to the cluster type ParamTplApplToClusterList struct { // Items is the list of parameter templates applicable to the cluster objects in the list Items []ParamTplApplToClusterListItem `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplApplToClusterList instantiates a new ParamTplApplToClusterList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewParamTplApplToClusterListWithDefaults() *ParamTplApplToClusterList { this := ParamTplApplToClusterList{} return &this } - // GetItems returns the Items field value. func (o *ParamTplApplToClusterList) GetItems() []ParamTplApplToClusterListItem { if o == nil { @@ -62,6 +67,7 @@ func (o *ParamTplApplToClusterList) SetItems(v []ParamTplApplToClusterListItem) o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *ParamTplApplToClusterList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *ParamTplApplToClusterList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplApplToClusterList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o ParamTplApplToClusterList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplApplToClusterList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]ParamTplApplToClusterListItem `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]ParamTplApplToClusterListItem `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *ParamTplApplToClusterList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_param_tpl_appl_to_cluster_list_item.go b/api/kbcloud/admin/model_param_tpl_appl_to_cluster_list_item.go index a03884ee..86f8fa1b 100644 --- a/api/kbcloud/admin/model_param_tpl_appl_to_cluster_list_item.go +++ b/api/kbcloud/admin/model_param_tpl_appl_to_cluster_list_item.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplApplToClusterListItem parameter template applicable to the cluster information + + +// ParamTplApplToClusterListItem parameter template applicable to the cluster information type ParamTplApplToClusterListItem struct { // The number of parameters in the parameter template Count int32 `json:"count"` @@ -21,10 +26,11 @@ type ParamTplApplToClusterListItem struct { // the template partition Partition string `json:"partition"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplApplToClusterListItem instantiates a new ParamTplApplToClusterListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewParamTplApplToClusterListItemWithDefaults() *ParamTplApplToClusterListIt this := ParamTplApplToClusterListItem{} return &this } - // GetCount returns the Count field value. func (o *ParamTplApplToClusterListItem) GetCount() int32 { if o == nil { @@ -69,6 +74,7 @@ func (o *ParamTplApplToClusterListItem) SetCount(v int32) { o.Count = v } + // GetName returns the Name field value. func (o *ParamTplApplToClusterListItem) GetName() string { if o == nil { @@ -92,6 +98,7 @@ func (o *ParamTplApplToClusterListItem) SetName(v string) { o.Name = v } + // GetNeedRestart returns the NeedRestart field value. func (o *ParamTplApplToClusterListItem) GetNeedRestart() bool { if o == nil { @@ -115,6 +122,7 @@ func (o *ParamTplApplToClusterListItem) SetNeedRestart(v bool) { o.NeedRestart = v } + // GetPartition returns the Partition field value. func (o *ParamTplApplToClusterListItem) GetPartition() string { if o == nil { @@ -138,6 +146,8 @@ func (o *ParamTplApplToClusterListItem) SetPartition(v string) { o.Partition = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplApplToClusterListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +168,10 @@ func (o ParamTplApplToClusterListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplApplToClusterListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Count *int32 `json:"count"` - Name *string `json:"name"` - NeedRestart *bool `json:"needRestart"` - Partition *string `json:"partition"` + Count *int32 `json:"count"` + Name *string `json:"name"` + NeedRestart *bool `json:"needRestart"` + Partition *string `json:"partition"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *ParamTplApplToClusterListItem) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"count", "name", "needRestart", "partition"}) + common.DeleteKeys(additionalProperties, &[]string{ "count", "name", "needRestart", "partition", }) } else { return err } diff --git a/api/kbcloud/admin/model_param_tpl_create.go b/api/kbcloud/admin/model_param_tpl_create.go index 42846a7e..38d91b08 100644 --- a/api/kbcloud/admin/model_param_tpl_create.go +++ b/api/kbcloud/admin/model_param_tpl_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplCreate parameter template create + + +// ParamTplCreate parameter template create type ParamTplCreate struct { // Description of parameter template Description string `json:"description"` @@ -23,10 +28,11 @@ type ParamTplCreate struct { // Determines whether the user can see this parameter template IsPrivate *bool `json:"isPrivate,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplCreate instantiates a new ParamTplCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +52,6 @@ func NewParamTplCreateWithDefaults() *ParamTplCreate { this := ParamTplCreate{} return &this } - // GetDescription returns the Description field value. func (o *ParamTplCreate) GetDescription() string { if o == nil { @@ -70,6 +75,7 @@ func (o *ParamTplCreate) SetDescription(v string) { o.Description = v } + // GetFamily returns the Family field value. func (o *ParamTplCreate) GetFamily() string { if o == nil { @@ -93,6 +99,7 @@ func (o *ParamTplCreate) SetFamily(v string) { o.Family = v } + // GetName returns the Name field value. func (o *ParamTplCreate) GetName() string { if o == nil { @@ -116,6 +123,7 @@ func (o *ParamTplCreate) SetName(v string) { o.Name = v } + // GetCustomName returns the CustomName field value if set, zero value otherwise. func (o *ParamTplCreate) GetCustomName() string { if o == nil || o.CustomName == nil { @@ -144,6 +152,7 @@ func (o *ParamTplCreate) SetCustomName(v string) { o.CustomName = &v } + // GetIsPrivate returns the IsPrivate field value if set, zero value otherwise. func (o *ParamTplCreate) GetIsPrivate() bool { if o == nil || o.IsPrivate == nil { @@ -172,6 +181,8 @@ func (o *ParamTplCreate) SetIsPrivate(v bool) { o.IsPrivate = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -198,10 +209,10 @@ func (o ParamTplCreate) MarshalJSON() ([]byte, error) { func (o *ParamTplCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { Description *string `json:"description"` - Family *string `json:"family"` - Name *string `json:"name"` - CustomName *string `json:"customName,omitempty"` - IsPrivate *bool `json:"isPrivate,omitempty"` + Family *string `json:"family"` + Name *string `json:"name"` + CustomName *string `json:"customName,omitempty"` + IsPrivate *bool `json:"isPrivate,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -217,7 +228,7 @@ func (o *ParamTplCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "family", "name", "customName", "isPrivate"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "family", "name", "customName", "isPrivate", }) } else { return err } diff --git a/api/kbcloud/admin/model_param_tpl_create_from_cluster.go b/api/kbcloud/admin/model_param_tpl_create_from_cluster.go index ffb257b9..9a4e53f3 100644 --- a/api/kbcloud/admin/model_param_tpl_create_from_cluster.go +++ b/api/kbcloud/admin/model_param_tpl_create_from_cluster.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplCreateFromCluster parameter template create + + +// ParamTplCreateFromCluster parameter template create type ParamTplCreateFromCluster struct { // Description of parameter template Description string `json:"description"` @@ -21,10 +26,11 @@ type ParamTplCreateFromCluster struct { // database engine Version EngineVersion *string `json:"engineVersion,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplCreateFromCluster instantiates a new ParamTplCreateFromCluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +49,6 @@ func NewParamTplCreateFromClusterWithDefaults() *ParamTplCreateFromCluster { this := ParamTplCreateFromCluster{} return &this } - // GetDescription returns the Description field value. func (o *ParamTplCreateFromCluster) GetDescription() string { if o == nil { @@ -67,6 +72,7 @@ func (o *ParamTplCreateFromCluster) SetDescription(v string) { o.Description = v } + // GetName returns the Name field value. func (o *ParamTplCreateFromCluster) GetName() string { if o == nil { @@ -90,6 +96,7 @@ func (o *ParamTplCreateFromCluster) SetName(v string) { o.Name = v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ParamTplCreateFromCluster) GetComponent() string { if o == nil || o.Component == nil { @@ -118,6 +125,7 @@ func (o *ParamTplCreateFromCluster) SetComponent(v string) { o.Component = &v } + // GetEngineVersion returns the EngineVersion field value if set, zero value otherwise. func (o *ParamTplCreateFromCluster) GetEngineVersion() string { if o == nil || o.EngineVersion == nil { @@ -146,6 +154,8 @@ func (o *ParamTplCreateFromCluster) SetEngineVersion(v string) { o.EngineVersion = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplCreateFromCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -170,9 +180,9 @@ func (o ParamTplCreateFromCluster) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplCreateFromCluster) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Description *string `json:"description"` - Name *string `json:"name"` - Component *string `json:"component,omitempty"` + Description *string `json:"description"` + Name *string `json:"name"` + Component *string `json:"component,omitempty"` EngineVersion *string `json:"engineVersion,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -186,7 +196,7 @@ func (o *ParamTplCreateFromCluster) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "name", "component", "engineVersion"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "name", "component", "engineVersion", }) } else { return err } diff --git a/api/kbcloud/admin/model_param_tpl_get.go b/api/kbcloud/admin/model_param_tpl_get.go index dd777b8a..b6e4b367 100644 --- a/api/kbcloud/admin/model_param_tpl_get.go +++ b/api/kbcloud/admin/model_param_tpl_get.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ParamTplGet paramTplGet is the response of get parameter template request +// ParamTplGet paramTplGet is the response of get parameter template request type ParamTplGet struct { Items []ParamTplGetItem `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplGet instantiates a new ParamTplGet object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewParamTplGetWithDefaults() *ParamTplGet { this := ParamTplGet{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ParamTplGet) GetItems() []ParamTplGetItem { if o == nil || o.Items == nil { @@ -59,6 +68,8 @@ func (o *ParamTplGet) SetItems(v []ParamTplGetItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplGet) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *ParamTplGet) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_param_tpl_get_item.go b/api/kbcloud/admin/model_param_tpl_get_item.go index bd639caf..38ffaac4 100644 --- a/api/kbcloud/admin/model_param_tpl_get_item.go +++ b/api/kbcloud/admin/model_param_tpl_get_item.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplGetItem paramTplGetItem is a list of get parameter template and parameterSpec + + +// ParamTplGetItem paramTplGetItem is a list of get parameter template and parameterSpec type ParamTplGetItem struct { // The name of the configuration spec SpecName string `json:"specName"` @@ -19,10 +24,11 @@ type ParamTplGetItem struct { // With the list of parameterSpecs and the configuration file name ParameterSpec ParameterSpecListItem `json:"parameterSpec"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplGetItem instantiates a new ParamTplGetItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewParamTplGetItemWithDefaults() *ParamTplGetItem { this := ParamTplGetItem{} return &this } - // GetSpecName returns the SpecName field value. func (o *ParamTplGetItem) GetSpecName() string { if o == nil { @@ -66,6 +71,7 @@ func (o *ParamTplGetItem) SetSpecName(v string) { o.SpecName = v } + // GetConfig returns the Config field value. func (o *ParamTplGetItem) GetConfig() ConfigurationWithRegex { if o == nil { @@ -89,6 +95,7 @@ func (o *ParamTplGetItem) SetConfig(v ConfigurationWithRegex) { o.Config = v } + // GetParameterSpec returns the ParameterSpec field value. func (o *ParamTplGetItem) GetParameterSpec() ParameterSpecListItem { if o == nil { @@ -112,6 +119,8 @@ func (o *ParamTplGetItem) SetParameterSpec(v ParameterSpecListItem) { o.ParameterSpec = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplGetItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -131,9 +140,9 @@ func (o ParamTplGetItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplGetItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - SpecName *string `json:"specName"` - Config *ConfigurationWithRegex `json:"config"` - ParameterSpec *ParameterSpecListItem `json:"parameterSpec"` + SpecName *string `json:"specName"` + Config *ConfigurationWithRegex `json:"config"` + ParameterSpec *ParameterSpecListItem `json:"parameterSpec"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,7 +158,7 @@ func (o *ParamTplGetItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"specName", "config", "parameterSpec"}) + common.DeleteKeys(additionalProperties, &[]string{ "specName", "config", "parameterSpec", }) } else { return err } diff --git a/api/kbcloud/admin/model_param_tpl_list.go b/api/kbcloud/admin/model_param_tpl_list.go index c72e96d0..96240538 100644 --- a/api/kbcloud/admin/model_param_tpl_list.go +++ b/api/kbcloud/admin/model_param_tpl_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplList paramTplList is a list of parameter templates + + +// ParamTplList paramTplList is a list of parameter templates type ParamTplList struct { // Items is the list of parameter templates objects in the list Items []ParamTplListItem `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplList instantiates a new ParamTplList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewParamTplListWithDefaults() *ParamTplList { this := ParamTplList{} return &this } - // GetItems returns the Items field value. func (o *ParamTplList) GetItems() []ParamTplListItem { if o == nil { @@ -62,6 +67,7 @@ func (o *ParamTplList) SetItems(v []ParamTplListItem) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *ParamTplList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *ParamTplList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o ParamTplList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]ParamTplListItem `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]ParamTplListItem `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *ParamTplList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/admin/model_param_tpl_list_item.go b/api/kbcloud/admin/model_param_tpl_list_item.go index b3eacebb..e6a5d1d2 100644 --- a/api/kbcloud/admin/model_param_tpl_list_item.go +++ b/api/kbcloud/admin/model_param_tpl_list_item.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplListItem parameter template information + + +// ParamTplListItem parameter template information type ParamTplListItem struct { // Name of the organization OrgName *string `json:"orgName,omitempty"` @@ -32,10 +36,11 @@ type ParamTplListItem struct { // Populated by the system. Read-only. Null for lists UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplListItem instantiates a new ParamTplListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +61,6 @@ func NewParamTplListItemWithDefaults() *ParamTplListItem { this := ParamTplListItem{} return &this } - // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *ParamTplListItem) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -85,6 +89,7 @@ func (o *ParamTplListItem) SetOrgName(v string) { o.OrgName = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *ParamTplListItem) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -113,6 +118,7 @@ func (o *ParamTplListItem) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetDescription returns the Description field value. func (o *ParamTplListItem) GetDescription() string { if o == nil { @@ -136,6 +142,7 @@ func (o *ParamTplListItem) SetDescription(v string) { o.Description = v } + // GetFamily returns the Family field value. func (o *ParamTplListItem) GetFamily() string { if o == nil { @@ -159,6 +166,7 @@ func (o *ParamTplListItem) SetFamily(v string) { o.Family = v } + // GetName returns the Name field value. func (o *ParamTplListItem) GetName() string { if o == nil { @@ -182,6 +190,7 @@ func (o *ParamTplListItem) SetName(v string) { o.Name = v } + // GetPartition returns the Partition field value. func (o *ParamTplListItem) GetPartition() string { if o == nil { @@ -205,6 +214,7 @@ func (o *ParamTplListItem) SetPartition(v string) { o.Partition = v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *ParamTplListItem) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -233,6 +243,8 @@ func (o *ParamTplListItem) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -270,13 +282,13 @@ func (o ParamTplListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - OrgName *string `json:"orgName,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Description *string `json:"description"` - Family *string `json:"family"` - Name *string `json:"name"` - Partition *string `json:"partition"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + OrgName *string `json:"orgName,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Description *string `json:"description"` + Family *string `json:"family"` + Name *string `json:"name"` + Partition *string `json:"partition"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -295,7 +307,7 @@ func (o *ParamTplListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"orgName", "createdAt", "description", "family", "name", "partition", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "orgName", "createdAt", "description", "family", "name", "partition", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_param_tpl_partition.go b/api/kbcloud/admin/model_param_tpl_partition.go index 4a468558..d5a00555 100644 --- a/api/kbcloud/admin/model_param_tpl_partition.go +++ b/api/kbcloud/admin/model_param_tpl_partition.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ParamTplPartition string // List of ParamTplPartition. const ( ParamTplPartitionDefault ParamTplPartition = "default" - ParamTplPartitionCustom ParamTplPartition = "custom" + ParamTplPartitionCustom ParamTplPartition = "custom" ) var allowedParamTplPartitionEnumValues = []ParamTplPartition{ diff --git a/api/kbcloud/admin/model_param_tpl_update.go b/api/kbcloud/admin/model_param_tpl_update.go index b8f075a7..f8b94069 100644 --- a/api/kbcloud/admin/model_param_tpl_update.go +++ b/api/kbcloud/admin/model_param_tpl_update.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// ParamTplUpdate paramTplUpdate is the payload to update a parameter template + + +// ParamTplUpdate paramTplUpdate is the payload to update a parameter template type ParamTplUpdate struct { // Specify parameters belongs to which spec SpecName *string `json:"specName,omitempty"` @@ -15,10 +24,11 @@ type ParamTplUpdate struct { // Specify parameters list to be updated Parameters map[string]string `json:"parameters,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplUpdate instantiates a new ParamTplUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewParamTplUpdateWithDefaults() *ParamTplUpdate { this := ParamTplUpdate{} return &this } - // GetSpecName returns the SpecName field value if set, zero value otherwise. func (o *ParamTplUpdate) GetSpecName() string { if o == nil || o.SpecName == nil { @@ -64,6 +73,7 @@ func (o *ParamTplUpdate) SetSpecName(v string) { o.SpecName = &v } + // GetConfigFile returns the ConfigFile field value if set, zero value otherwise. func (o *ParamTplUpdate) GetConfigFile() string { if o == nil || o.ConfigFile == nil { @@ -92,6 +102,7 @@ func (o *ParamTplUpdate) SetConfigFile(v string) { o.ConfigFile = &v } + // GetParameters returns the Parameters field value if set, zero value otherwise. func (o *ParamTplUpdate) GetParameters() map[string]string { if o == nil || o.Parameters == nil { @@ -120,6 +131,8 @@ func (o *ParamTplUpdate) SetParameters(v map[string]string) { o.Parameters = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -145,8 +158,8 @@ func (o ParamTplUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - SpecName *string `json:"specName,omitempty"` - ConfigFile *string `json:"configFile,omitempty"` + SpecName *string `json:"specName,omitempty"` + ConfigFile *string `json:"configFile,omitempty"` Parameters map[string]string `json:"parameters,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -154,7 +167,7 @@ func (o *ParamTplUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"specName", "configFile", "parameters"}) + common.DeleteKeys(additionalProperties, &[]string{ "specName", "configFile", "parameters", }) } else { return err } diff --git a/api/kbcloud/admin/model_param_tpls_item.go b/api/kbcloud/admin/model_param_tpls_item.go index 17ac8a2f..adb1fdfa 100644 --- a/api/kbcloud/admin/model_param_tpls_item.go +++ b/api/kbcloud/admin/model_param_tpls_item.go @@ -2,24 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// ParamTplsItem the item of the parameter template + + +// ParamTplsItem the item of the parameter template type ParamTplsItem struct { // component type, refer to componentDef and support NamePrefix, Deprecated. ComponentDefRef *string `json:"componentDefRef,omitempty"` // component type, refer to componentDef and support NamePrefix Component *string `json:"component,omitempty"` // name of assigned parameter template - ParamTplName *string `json:"paramTplName,omitempty"` + ParamTplName *string `json:"paramTplName,omitempty"` ParamTplPartition *ParamTplPartition `json:"paramTplPartition,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplsItem instantiates a new ParamTplsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +46,6 @@ func NewParamTplsItemWithDefaults() *ParamTplsItem { this := ParamTplsItem{} return &this } - // GetComponentDefRef returns the ComponentDefRef field value if set, zero value otherwise. func (o *ParamTplsItem) GetComponentDefRef() string { if o == nil || o.ComponentDefRef == nil { @@ -65,6 +74,7 @@ func (o *ParamTplsItem) SetComponentDefRef(v string) { o.ComponentDefRef = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ParamTplsItem) GetComponent() string { if o == nil || o.Component == nil { @@ -93,6 +103,7 @@ func (o *ParamTplsItem) SetComponent(v string) { o.Component = &v } + // GetParamTplName returns the ParamTplName field value if set, zero value otherwise. func (o *ParamTplsItem) GetParamTplName() string { if o == nil || o.ParamTplName == nil { @@ -121,6 +132,7 @@ func (o *ParamTplsItem) SetParamTplName(v string) { o.ParamTplName = &v } + // GetParamTplPartition returns the ParamTplPartition field value if set, zero value otherwise. func (o *ParamTplsItem) GetParamTplPartition() ParamTplPartition { if o == nil || o.ParamTplPartition == nil { @@ -149,6 +161,8 @@ func (o *ParamTplsItem) SetParamTplPartition(v ParamTplPartition) { o.ParamTplPartition = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -177,9 +191,9 @@ func (o ParamTplsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ComponentDefRef *string `json:"componentDefRef,omitempty"` - Component *string `json:"component,omitempty"` - ParamTplName *string `json:"paramTplName,omitempty"` + ComponentDefRef *string `json:"componentDefRef,omitempty"` + Component *string `json:"component,omitempty"` + ParamTplName *string `json:"paramTplName,omitempty"` ParamTplPartition *ParamTplPartition `json:"paramTplPartition,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -187,7 +201,7 @@ func (o *ParamTplsItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"componentDefRef", "component", "paramTplName", "paramTplPartition"}) + common.DeleteKeys(additionalProperties, &[]string{ "componentDefRef", "component", "paramTplName", "paramTplPartition", }) } else { return err } @@ -196,7 +210,7 @@ func (o *ParamTplsItem) UnmarshalJSON(bytes []byte) (err error) { o.ComponentDefRef = all.ComponentDefRef o.Component = all.Component o.ParamTplName = all.ParamTplName - if all.ParamTplPartition != nil && !all.ParamTplPartition.IsValid() { + if all.ParamTplPartition != nil &&!all.ParamTplPartition.IsValid() { hasInvalidField = true } else { o.ParamTplPartition = all.ParamTplPartition diff --git a/api/kbcloud/admin/model_parameter_config.go b/api/kbcloud/admin/model_parameter_config.go index 817a7daa..a12c0d8d 100644 --- a/api/kbcloud/admin/model_parameter_config.go +++ b/api/kbcloud/admin/model_parameter_config.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ParameterConfig struct { - ConfigName string `json:"configName"` - SpecName string `json:"specName"` - Constraint string `json:"constraint"` - Regex string `json:"regex"` - ConfigTplName string `json:"configTplName"` - InitOptions map[string]interface{} `json:"initOptions,omitempty"` + ConfigName string `json:"configName"` + SpecName string `json:"specName"` + Constraint string `json:"constraint"` + Regex string `json:"regex"` + ConfigTplName string `json:"configTplName"` + InitOptions map[string]interface{} `json:"initOptions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterConfig instantiates a new ParameterConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +49,6 @@ func NewParameterConfigWithDefaults() *ParameterConfig { this := ParameterConfig{} return &this } - // GetConfigName returns the ConfigName field value. func (o *ParameterConfig) GetConfigName() string { if o == nil { @@ -67,6 +72,7 @@ func (o *ParameterConfig) SetConfigName(v string) { o.ConfigName = v } + // GetSpecName returns the SpecName field value. func (o *ParameterConfig) GetSpecName() string { if o == nil { @@ -90,6 +96,7 @@ func (o *ParameterConfig) SetSpecName(v string) { o.SpecName = v } + // GetConstraint returns the Constraint field value. func (o *ParameterConfig) GetConstraint() string { if o == nil { @@ -113,6 +120,7 @@ func (o *ParameterConfig) SetConstraint(v string) { o.Constraint = v } + // GetRegex returns the Regex field value. func (o *ParameterConfig) GetRegex() string { if o == nil { @@ -136,6 +144,7 @@ func (o *ParameterConfig) SetRegex(v string) { o.Regex = v } + // GetConfigTplName returns the ConfigTplName field value. func (o *ParameterConfig) GetConfigTplName() string { if o == nil { @@ -159,6 +168,7 @@ func (o *ParameterConfig) SetConfigTplName(v string) { o.ConfigTplName = v } + // GetInitOptions returns the InitOptions field value if set, zero value otherwise. func (o *ParameterConfig) GetInitOptions() map[string]interface{} { if o == nil || o.InitOptions == nil { @@ -187,6 +197,8 @@ func (o *ParameterConfig) SetInitOptions(v map[string]interface{}) { o.InitOptions = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,12 +223,12 @@ func (o ParameterConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ConfigName *string `json:"configName"` - SpecName *string `json:"specName"` - Constraint *string `json:"constraint"` - Regex *string `json:"regex"` - ConfigTplName *string `json:"configTplName"` - InitOptions map[string]interface{} `json:"initOptions,omitempty"` + ConfigName *string `json:"configName"` + SpecName *string `json:"specName"` + Constraint *string `json:"constraint"` + Regex *string `json:"regex"` + ConfigTplName *string `json:"configTplName"` + InitOptions map[string]interface{} `json:"initOptions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -238,7 +250,7 @@ func (o *ParameterConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"configName", "specName", "constraint", "regex", "configTplName", "initOptions"}) + common.DeleteKeys(additionalProperties, &[]string{ "configName", "specName", "constraint", "regex", "configTplName", "initOptions", }) } else { return err } diff --git a/api/kbcloud/admin/model_parameter_history.go b/api/kbcloud/admin/model_parameter_history.go index 9ca4c2b7..3cc7a497 100644 --- a/api/kbcloud/admin/model_parameter_history.go +++ b/api/kbcloud/admin/model_parameter_history.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParameterHistory The history of a parameter + + +// ParameterHistory The history of a parameter type ParameterHistory struct { // The name of the parameter ParameterName string `json:"parameterName"` @@ -22,10 +26,11 @@ type ParameterHistory struct { // The date and time the parameter was last updated UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterHistory instantiates a new ParameterHistory object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +51,6 @@ func NewParameterHistoryWithDefaults() *ParameterHistory { this := ParameterHistory{} return &this } - // GetParameterName returns the ParameterName field value. func (o *ParameterHistory) GetParameterName() string { if o == nil { @@ -70,6 +74,7 @@ func (o *ParameterHistory) SetParameterName(v string) { o.ParameterName = v } + // GetOldValue returns the OldValue field value. func (o *ParameterHistory) GetOldValue() string { if o == nil { @@ -93,6 +98,7 @@ func (o *ParameterHistory) SetOldValue(v string) { o.OldValue = v } + // GetNewValue returns the NewValue field value. func (o *ParameterHistory) GetNewValue() string { if o == nil { @@ -116,6 +122,7 @@ func (o *ParameterHistory) SetNewValue(v string) { o.NewValue = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *ParameterHistory) GetUpdatedAt() time.Time { if o == nil { @@ -139,6 +146,8 @@ func (o *ParameterHistory) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterHistory) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -163,10 +172,10 @@ func (o ParameterHistory) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterHistory) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ParameterName *string `json:"parameterName"` - OldValue *string `json:"oldValue"` - NewValue *string `json:"newValue"` - UpdatedAt *time.Time `json:"updatedAt"` + ParameterName *string `json:"parameterName"` + OldValue *string `json:"oldValue"` + NewValue *string `json:"newValue"` + UpdatedAt *time.Time `json:"updatedAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -185,7 +194,7 @@ func (o *ParameterHistory) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"parameterName", "oldValue", "newValue", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "parameterName", "oldValue", "newValue", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_parameter_history_list.go b/api/kbcloud/admin/model_parameter_history_list.go index 16ecfa1d..e8af14ed 100644 --- a/api/kbcloud/admin/model_parameter_history_list.go +++ b/api/kbcloud/admin/model_parameter_history_list.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ParameterHistoryList A list of parameter history +// ParameterHistoryList A list of parameter history type ParameterHistoryList struct { Items []ParameterHistory `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterHistoryList instantiates a new ParameterHistoryList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewParameterHistoryListWithDefaults() *ParameterHistoryList { this := ParameterHistoryList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ParameterHistoryList) GetItems() []ParameterHistory { if o == nil || o.Items == nil { @@ -59,6 +68,8 @@ func (o *ParameterHistoryList) SetItems(v []ParameterHistory) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterHistoryList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *ParameterHistoryList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_parameter_option.go b/api/kbcloud/admin/model_parameter_option.go index 49b03b1b..5976ad5c 100644 --- a/api/kbcloud/admin/model_parameter_option.go +++ b/api/kbcloud/admin/model_parameter_option.go @@ -2,32 +2,38 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ParameterOption struct { - Component string `json:"component"` - Configs []ParameterConfig `json:"configs"` + Component string `json:"component"` + Configs []ParameterConfig `json:"configs"` // deprecated - Versions []string `json:"versions"` - ExportTpl bool `json:"exportTpl"` + Versions []string `json:"versions"` + ExportTpl bool `json:"exportTpl"` // a alias with major version. Family string `json:"family"` // match the major version - MajorVersion *string `json:"majorVersion,omitempty"` - DefaultTplName string `json:"defaultTplName"` + MajorVersion *string `json:"majorVersion,omitempty"` + DefaultTplName string `json:"defaultTplName"` DefaultTplDescription LocalizedDescription `json:"defaultTplDescription"` - DisableHa *bool `json:"disableHA,omitempty"` + DisableHa *bool `json:"disableHA,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterOption instantiates a new ParameterOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +61,6 @@ func NewParameterOptionWithDefaults() *ParameterOption { this.DisableHa = &disableHa return &this } - // GetComponent returns the Component field value. func (o *ParameterOption) GetComponent() string { if o == nil { @@ -79,6 +84,7 @@ func (o *ParameterOption) SetComponent(v string) { o.Component = v } + // GetConfigs returns the Configs field value. func (o *ParameterOption) GetConfigs() []ParameterConfig { if o == nil { @@ -102,6 +108,7 @@ func (o *ParameterOption) SetConfigs(v []ParameterConfig) { o.Configs = v } + // GetVersions returns the Versions field value. func (o *ParameterOption) GetVersions() []string { if o == nil { @@ -125,6 +132,7 @@ func (o *ParameterOption) SetVersions(v []string) { o.Versions = v } + // GetExportTpl returns the ExportTpl field value. func (o *ParameterOption) GetExportTpl() bool { if o == nil { @@ -148,6 +156,7 @@ func (o *ParameterOption) SetExportTpl(v bool) { o.ExportTpl = v } + // GetFamily returns the Family field value. func (o *ParameterOption) GetFamily() string { if o == nil { @@ -171,6 +180,7 @@ func (o *ParameterOption) SetFamily(v string) { o.Family = v } + // GetMajorVersion returns the MajorVersion field value if set, zero value otherwise. func (o *ParameterOption) GetMajorVersion() string { if o == nil || o.MajorVersion == nil { @@ -199,6 +209,7 @@ func (o *ParameterOption) SetMajorVersion(v string) { o.MajorVersion = &v } + // GetDefaultTplName returns the DefaultTplName field value. func (o *ParameterOption) GetDefaultTplName() string { if o == nil { @@ -222,6 +233,7 @@ func (o *ParameterOption) SetDefaultTplName(v string) { o.DefaultTplName = v } + // GetDefaultTplDescription returns the DefaultTplDescription field value. func (o *ParameterOption) GetDefaultTplDescription() LocalizedDescription { if o == nil { @@ -245,6 +257,7 @@ func (o *ParameterOption) SetDefaultTplDescription(v LocalizedDescription) { o.DefaultTplDescription = v } + // GetDisableHa returns the DisableHa field value if set, zero value otherwise. func (o *ParameterOption) GetDisableHa() bool { if o == nil || o.DisableHa == nil { @@ -273,6 +286,8 @@ func (o *ParameterOption) SetDisableHa(v bool) { o.DisableHa = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -302,15 +317,15 @@ func (o ParameterOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` - Configs *[]ParameterConfig `json:"configs"` - Versions *[]string `json:"versions"` - ExportTpl *bool `json:"exportTpl"` - Family *string `json:"family"` - MajorVersion *string `json:"majorVersion,omitempty"` - DefaultTplName *string `json:"defaultTplName"` + Component *string `json:"component"` + Configs *[]ParameterConfig `json:"configs"` + Versions *[]string `json:"versions"` + ExportTpl *bool `json:"exportTpl"` + Family *string `json:"family"` + MajorVersion *string `json:"majorVersion,omitempty"` + DefaultTplName *string `json:"defaultTplName"` DefaultTplDescription *LocalizedDescription `json:"defaultTplDescription"` - DisableHa *bool `json:"disableHA,omitempty"` + DisableHa *bool `json:"disableHA,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -338,7 +353,7 @@ func (o *ParameterOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "configs", "versions", "exportTpl", "family", "majorVersion", "defaultTplName", "defaultTplDescription", "disableHA"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "configs", "versions", "exportTpl", "family", "majorVersion", "defaultTplName", "defaultTplDescription", "disableHA", }) } else { return err } diff --git a/api/kbcloud/admin/model_parameter_spec.go b/api/kbcloud/admin/model_parameter_spec.go index 6535830f..d4f0f777 100644 --- a/api/kbcloud/admin/model_parameter_spec.go +++ b/api/kbcloud/admin/model_parameter_spec.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParameterSpec Cluster parameter specification + + +// ParameterSpec Cluster parameter specification type ParameterSpec struct { // The name of the parameter Name string `json:"name"` @@ -31,10 +36,11 @@ type ParameterSpec struct { // The value options of the parameter Enum []map[string]interface{} `json:"enum"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterSpec instantiates a new ParameterSpec object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -60,7 +66,6 @@ func NewParameterSpecWithDefaults() *ParameterSpec { this := ParameterSpec{} return &this } - // GetName returns the Name field value. func (o *ParameterSpec) GetName() string { if o == nil { @@ -84,6 +89,7 @@ func (o *ParameterSpec) SetName(v string) { o.Name = v } + // GetDescription returns the Description field value. func (o *ParameterSpec) GetDescription() string { if o == nil { @@ -107,6 +113,7 @@ func (o *ParameterSpec) SetDescription(v string) { o.Description = v } + // GetType returns the Type field value. func (o *ParameterSpec) GetType() string { if o == nil { @@ -130,6 +137,7 @@ func (o *ParameterSpec) SetType(v string) { o.Type = v } + // GetDefault returns the Default field value. func (o *ParameterSpec) GetDefault() map[string]interface{} { if o == nil { @@ -153,6 +161,7 @@ func (o *ParameterSpec) SetDefault(v map[string]interface{}) { o.Default = v } + // GetNeedRestart returns the NeedRestart field value. func (o *ParameterSpec) GetNeedRestart() bool { if o == nil { @@ -176,6 +185,7 @@ func (o *ParameterSpec) SetNeedRestart(v bool) { o.NeedRestart = v } + // GetImmutable returns the Immutable field value. func (o *ParameterSpec) GetImmutable() bool { if o == nil { @@ -199,6 +209,7 @@ func (o *ParameterSpec) SetImmutable(v bool) { o.Immutable = v } + // GetMaximum returns the Maximum field value. func (o *ParameterSpec) GetMaximum() float64 { if o == nil { @@ -222,6 +233,7 @@ func (o *ParameterSpec) SetMaximum(v float64) { o.Maximum = v } + // GetMinimum returns the Minimum field value. func (o *ParameterSpec) GetMinimum() float64 { if o == nil { @@ -245,6 +257,7 @@ func (o *ParameterSpec) SetMinimum(v float64) { o.Minimum = v } + // GetEnum returns the Enum field value. func (o *ParameterSpec) GetEnum() []map[string]interface{} { if o == nil { @@ -268,6 +281,8 @@ func (o *ParameterSpec) SetEnum(v []map[string]interface{}) { o.Enum = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterSpec) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -293,15 +308,15 @@ func (o ParameterSpec) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterSpec) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Description *string `json:"description"` - Type *string `json:"type"` - Default *map[string]interface{} `json:"default"` - NeedRestart *bool `json:"needRestart"` - Immutable *bool `json:"immutable"` - Maximum *float64 `json:"maximum"` - Minimum *float64 `json:"minimum"` - Enum *[]map[string]interface{} `json:"enum"` + Name *string `json:"name"` + Description *string `json:"description"` + Type *string `json:"type"` + Default *map[string]interface{} `json:"default"` + NeedRestart *bool `json:"needRestart"` + Immutable *bool `json:"immutable"` + Maximum *float64 `json:"maximum"` + Minimum *float64 `json:"minimum"` + Enum *[]map[string]interface{} `json:"enum"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -335,7 +350,7 @@ func (o *ParameterSpec) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "description", "type", "default", "needRestart", "immutable", "maximum", "minimum", "enum"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "description", "type", "default", "needRestart", "immutable", "maximum", "minimum", "enum", }) } else { return err } diff --git a/api/kbcloud/admin/model_parameter_spec_list.go b/api/kbcloud/admin/model_parameter_spec_list.go index 6de50080..aa323561 100644 --- a/api/kbcloud/admin/model_parameter_spec_list.go +++ b/api/kbcloud/admin/model_parameter_spec_list.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ParameterSpecList A list of cluster parameterSpecs +// ParameterSpecList A list of cluster parameterSpecs type ParameterSpecList struct { Items []ParameterSpecListItem `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterSpecList instantiates a new ParameterSpecList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewParameterSpecListWithDefaults() *ParameterSpecList { this := ParameterSpecList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ParameterSpecList) GetItems() []ParameterSpecListItem { if o == nil || o.Items == nil { @@ -59,6 +68,8 @@ func (o *ParameterSpecList) SetItems(v []ParameterSpecListItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterSpecList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *ParameterSpecList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_parameter_spec_list_item.go b/api/kbcloud/admin/model_parameter_spec_list_item.go index 7b656064..164de978 100644 --- a/api/kbcloud/admin/model_parameter_spec_list_item.go +++ b/api/kbcloud/admin/model_parameter_spec_list_item.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ParameterSpecListItem With the list of parameterSpecs and the configuration file name +// ParameterSpecListItem With the list of parameterSpecs and the configuration file name type ParameterSpecListItem struct { Specs []ParameterSpec `json:"specs,omitempty"` // The name of the configuration file FileName *string `json:"fileName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterSpecListItem instantiates a new ParameterSpecListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewParameterSpecListItemWithDefaults() *ParameterSpecListItem { this := ParameterSpecListItem{} return &this } - // GetSpecs returns the Specs field value if set, zero value otherwise. func (o *ParameterSpecListItem) GetSpecs() []ParameterSpec { if o == nil || o.Specs == nil { @@ -61,6 +70,7 @@ func (o *ParameterSpecListItem) SetSpecs(v []ParameterSpec) { o.Specs = v } + // GetFileName returns the FileName field value if set, zero value otherwise. func (o *ParameterSpecListItem) GetFileName() string { if o == nil || o.FileName == nil { @@ -89,6 +99,8 @@ func (o *ParameterSpecListItem) SetFileName(v string) { o.FileName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterSpecListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,15 +123,15 @@ func (o ParameterSpecListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterSpecListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Specs []ParameterSpec `json:"specs,omitempty"` - FileName *string `json:"fileName,omitempty"` + Specs []ParameterSpec `json:"specs,omitempty"` + FileName *string `json:"fileName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"specs", "fileName"}) + common.DeleteKeys(additionalProperties, &[]string{ "specs", "fileName", }) } else { return err } diff --git a/api/kbcloud/admin/model_permission.go b/api/kbcloud/admin/model_permission.go index 9759281a..ba4d81df 100644 --- a/api/kbcloud/admin/model_permission.go +++ b/api/kbcloud/admin/model_permission.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// Permission Permission information + + +// Permission Permission information type Permission struct { // The name of the permission Name *string `json:"name,omitempty"` @@ -15,10 +24,11 @@ type Permission struct { // The description of the permission Description *string `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPermission instantiates a new Permission object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewPermissionWithDefaults() *Permission { this := Permission{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *Permission) GetName() string { if o == nil || o.Name == nil { @@ -64,6 +73,7 @@ func (o *Permission) SetName(v string) { o.Name = &v } + // GetGroup returns the Group field value if set, zero value otherwise. func (o *Permission) GetGroup() string { if o == nil || o.Group == nil { @@ -92,6 +102,7 @@ func (o *Permission) SetGroup(v string) { o.Group = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Permission) GetDescription() string { if o == nil || o.Description == nil { @@ -120,6 +131,8 @@ func (o *Permission) SetDescription(v string) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Permission) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -145,8 +158,8 @@ func (o Permission) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Permission) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Group *string `json:"group,omitempty"` + Name *string `json:"name,omitempty"` + Group *string `json:"group,omitempty"` Description *string `json:"description,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -154,7 +167,7 @@ func (o *Permission) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "group", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "group", "description", }) } else { return err } diff --git a/api/kbcloud/admin/model_permission_list.go b/api/kbcloud/admin/model_permission_list.go index b7d0266a..4a5f112f 100644 --- a/api/kbcloud/admin/model_permission_list.go +++ b/api/kbcloud/admin/model_permission_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PermissionList PermissionList is a list of Permissions + + +// PermissionList PermissionList is a list of Permissions type PermissionList struct { // Items is the list of Permission objects in the list Items []Permission `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPermissionList instantiates a new PermissionList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewPermissionListWithDefaults() *PermissionList { this := PermissionList{} return &this } - // GetItems returns the Items field value. func (o *PermissionList) GetItems() []Permission { if o == nil { @@ -60,6 +65,8 @@ func (o *PermissionList) SetItems(v []Permission) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o PermissionList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *PermissionList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_persistent_volume_claim.go b/api/kbcloud/admin/model_persistent_volume_claim.go index b8cc5576..8e9d12c3 100644 --- a/api/kbcloud/admin/model_persistent_volume_claim.go +++ b/api/kbcloud/admin/model_persistent_volume_claim.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PersistentVolumeClaim persistentVolumeClaim provides detailed information about the PVC . + + +// PersistentVolumeClaim persistentVolumeClaim provides detailed information about the PVC . type PersistentVolumeClaim struct { // the namespace of the PVC NameSpace string `json:"nameSpace"` @@ -27,10 +32,11 @@ type PersistentVolumeClaim struct { // the node of the PVC Node string `json:"node"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPersistentVolumeClaim instantiates a new PersistentVolumeClaim object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -54,7 +60,6 @@ func NewPersistentVolumeClaimWithDefaults() *PersistentVolumeClaim { this := PersistentVolumeClaim{} return &this } - // GetNameSpace returns the NameSpace field value. func (o *PersistentVolumeClaim) GetNameSpace() string { if o == nil { @@ -78,6 +83,7 @@ func (o *PersistentVolumeClaim) SetNameSpace(v string) { o.NameSpace = v } + // GetName returns the Name field value. func (o *PersistentVolumeClaim) GetName() string { if o == nil { @@ -101,6 +107,7 @@ func (o *PersistentVolumeClaim) SetName(v string) { o.Name = v } + // GetPhase returns the Phase field value. func (o *PersistentVolumeClaim) GetPhase() string { if o == nil { @@ -124,6 +131,7 @@ func (o *PersistentVolumeClaim) SetPhase(v string) { o.Phase = v } + // GetCapacity returns the Capacity field value. func (o *PersistentVolumeClaim) GetCapacity() string { if o == nil { @@ -147,6 +155,7 @@ func (o *PersistentVolumeClaim) SetCapacity(v string) { o.Capacity = v } + // GetAccessMode returns the AccessMode field value. func (o *PersistentVolumeClaim) GetAccessMode() string { if o == nil { @@ -170,6 +179,7 @@ func (o *PersistentVolumeClaim) SetAccessMode(v string) { o.AccessMode = v } + // GetVolumeName returns the VolumeName field value. func (o *PersistentVolumeClaim) GetVolumeName() string { if o == nil { @@ -193,6 +203,7 @@ func (o *PersistentVolumeClaim) SetVolumeName(v string) { o.VolumeName = v } + // GetNode returns the Node field value. func (o *PersistentVolumeClaim) GetNode() string { if o == nil { @@ -216,6 +227,8 @@ func (o *PersistentVolumeClaim) SetNode(v string) { o.Node = v } + + // MarshalJSON serializes the struct using spec logic. func (o PersistentVolumeClaim) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -239,13 +252,13 @@ func (o PersistentVolumeClaim) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PersistentVolumeClaim) UnmarshalJSON(bytes []byte) (err error) { all := struct { - NameSpace *string `json:"nameSpace"` - Name *string `json:"name"` - Phase *string `json:"phase"` - Capacity *string `json:"capacity"` + NameSpace *string `json:"nameSpace"` + Name *string `json:"name"` + Phase *string `json:"phase"` + Capacity *string `json:"capacity"` AccessMode *string `json:"accessMode"` VolumeName *string `json:"volumeName"` - Node *string `json:"node"` + Node *string `json:"node"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -273,7 +286,7 @@ func (o *PersistentVolumeClaim) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"nameSpace", "name", "phase", "capacity", "accessMode", "volumeName", "node"}) + common.DeleteKeys(additionalProperties, &[]string{ "nameSpace", "name", "phase", "capacity", "accessMode", "volumeName", "node", }) } else { return err } diff --git a/api/kbcloud/admin/model_persistent_volume_claim_list.go b/api/kbcloud/admin/model_persistent_volume_claim_list.go index be8e40ce..915e852f 100644 --- a/api/kbcloud/admin/model_persistent_volume_claim_list.go +++ b/api/kbcloud/admin/model_persistent_volume_claim_list.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PersistentVolumeClaimList the List stands for stats for persistentvolumeclaims. + + +// PersistentVolumeClaimList the List stands for stats for persistentvolumeclaims. type PersistentVolumeClaimList struct { Items []PersistentVolumeClaim `json:"items"` // the current page number @@ -20,10 +25,11 @@ type PersistentVolumeClaimList struct { // the page size PageSize int64 `json:"pageSize"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPersistentVolumeClaimList instantiates a new PersistentVolumeClaimList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewPersistentVolumeClaimListWithDefaults() *PersistentVolumeClaimList { this := PersistentVolumeClaimList{} return &this } - // GetItems returns the Items field value. func (o *PersistentVolumeClaimList) GetItems() []PersistentVolumeClaim { if o == nil { @@ -68,6 +73,7 @@ func (o *PersistentVolumeClaimList) SetItems(v []PersistentVolumeClaim) { o.Items = v } + // GetCurrentPage returns the CurrentPage field value. func (o *PersistentVolumeClaimList) GetCurrentPage() int64 { if o == nil { @@ -91,6 +97,7 @@ func (o *PersistentVolumeClaimList) SetCurrentPage(v int64) { o.CurrentPage = v } + // GetTotalPage returns the TotalPage field value. func (o *PersistentVolumeClaimList) GetTotalPage() int64 { if o == nil { @@ -114,6 +121,7 @@ func (o *PersistentVolumeClaimList) SetTotalPage(v int64) { o.TotalPage = v } + // GetPageSize returns the PageSize field value. func (o *PersistentVolumeClaimList) GetPageSize() int64 { if o == nil { @@ -137,6 +145,8 @@ func (o *PersistentVolumeClaimList) SetPageSize(v int64) { o.PageSize = v } + + // MarshalJSON serializes the struct using spec logic. func (o PersistentVolumeClaimList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -157,10 +167,10 @@ func (o PersistentVolumeClaimList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PersistentVolumeClaimList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]PersistentVolumeClaim `json:"items"` - CurrentPage *int64 `json:"currentPage"` - TotalPage *int64 `json:"totalPage"` - PageSize *int64 `json:"pageSize"` + Items *[]PersistentVolumeClaim `json:"items"` + CurrentPage *int64 `json:"currentPage"` + TotalPage *int64 `json:"totalPage"` + PageSize *int64 `json:"pageSize"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -179,7 +189,7 @@ func (o *PersistentVolumeClaimList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "currentPage", "totalPage", "pageSize"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "currentPage", "totalPage", "pageSize", }) } else { return err } diff --git a/api/kbcloud/admin/model_platform_parameter.go b/api/kbcloud/admin/model_platform_parameter.go index c2b9b13b..afe422af 100644 --- a/api/kbcloud/admin/model_platform_parameter.go +++ b/api/kbcloud/admin/model_platform_parameter.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PlatformParameter platformParameter item + + +// PlatformParameter platformParameter item type PlatformParameter struct { // platformParameter ID Id string `json:"id"` @@ -27,10 +32,11 @@ type PlatformParameter struct { // platformParameter description Description string `json:"description"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPlatformParameter instantiates a new PlatformParameter object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +59,6 @@ func NewPlatformParameterWithDefaults() *PlatformParameter { this := PlatformParameter{} return &this } - // GetId returns the Id field value. func (o *PlatformParameter) GetId() string { if o == nil { @@ -77,6 +82,7 @@ func (o *PlatformParameter) SetId(v string) { o.Id = v } + // GetName returns the Name field value. func (o *PlatformParameter) GetName() string { if o == nil { @@ -100,6 +106,7 @@ func (o *PlatformParameter) SetName(v string) { o.Name = v } + // GetCategory returns the Category field value. func (o *PlatformParameter) GetCategory() PlatformParameterCategory { if o == nil { @@ -123,6 +130,7 @@ func (o *PlatformParameter) SetCategory(v PlatformParameterCategory) { o.Category = v } + // GetType returns the Type field value. func (o *PlatformParameter) GetType() string { if o == nil { @@ -146,6 +154,7 @@ func (o *PlatformParameter) SetType(v string) { o.Type = v } + // GetConstraints returns the Constraints field value. func (o *PlatformParameter) GetConstraints() PlatformParameterConstraints { if o == nil { @@ -169,6 +178,7 @@ func (o *PlatformParameter) SetConstraints(v PlatformParameterConstraints) { o.Constraints = v } + // GetValue returns the Value field value if set, zero value otherwise. func (o *PlatformParameter) GetValue() string { if o == nil || o.Value == nil { @@ -197,6 +207,7 @@ func (o *PlatformParameter) SetValue(v string) { o.Value = &v } + // GetDescription returns the Description field value. func (o *PlatformParameter) GetDescription() string { if o == nil { @@ -220,6 +231,8 @@ func (o *PlatformParameter) SetDescription(v string) { o.Description = v } + + // MarshalJSON serializes the struct using spec logic. func (o PlatformParameter) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -245,13 +258,13 @@ func (o PlatformParameter) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PlatformParameter) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Name *string `json:"name"` - Category *PlatformParameterCategory `json:"category"` - Type *string `json:"type"` + Id *string `json:"id"` + Name *string `json:"name"` + Category *PlatformParameterCategory `json:"category"` + Type *string `json:"type"` Constraints *PlatformParameterConstraints `json:"constraints"` - Value *string `json:"value,omitempty"` - Description *string `json:"description"` + Value *string `json:"value,omitempty"` + Description *string `json:"description"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -276,7 +289,7 @@ func (o *PlatformParameter) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "category", "type", "constraints", "value", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "category", "type", "constraints", "value", "description", }) } else { return err } diff --git a/api/kbcloud/admin/model_platform_parameter_category.go b/api/kbcloud/admin/model_platform_parameter_category.go index ed07113a..e4693651 100644 --- a/api/kbcloud/admin/model_platform_parameter_category.go +++ b/api/kbcloud/admin/model_platform_parameter_category.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // PlatformParameterCategory platformParameter category, representing the platformParameter group, such as 'recycle bin' type PlatformParameterCategory string diff --git a/api/kbcloud/admin/model_platform_parameter_constraints.go b/api/kbcloud/admin/model_platform_parameter_constraints.go index 08d8ece1..55da59c7 100644 --- a/api/kbcloud/admin/model_platform_parameter_constraints.go +++ b/api/kbcloud/admin/model_platform_parameter_constraints.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// PlatformParameterConstraints platformParameter constraints including min, max, enum, default value + + +// PlatformParameterConstraints platformParameter constraints including min, max, enum, default value type PlatformParameterConstraints struct { // platformParameter min value Min *string `json:"min,omitempty"` @@ -17,10 +26,11 @@ type PlatformParameterConstraints struct { // platformParameter default value Default *string `json:"default,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPlatformParameterConstraints instantiates a new PlatformParameterConstraints object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewPlatformParameterConstraintsWithDefaults() *PlatformParameterConstraints this := PlatformParameterConstraints{} return &this } - // GetMin returns the Min field value if set, zero value otherwise. func (o *PlatformParameterConstraints) GetMin() string { if o == nil || o.Min == nil { @@ -66,6 +75,7 @@ func (o *PlatformParameterConstraints) SetMin(v string) { o.Min = &v } + // GetMax returns the Max field value if set, zero value otherwise. func (o *PlatformParameterConstraints) GetMax() string { if o == nil || o.Max == nil { @@ -94,6 +104,7 @@ func (o *PlatformParameterConstraints) SetMax(v string) { o.Max = &v } + // GetEnum returns the Enum field value if set, zero value otherwise. func (o *PlatformParameterConstraints) GetEnum() []string { if o == nil || o.Enum == nil { @@ -122,6 +133,7 @@ func (o *PlatformParameterConstraints) SetEnum(v []string) { o.Enum = v } + // GetDefault returns the Default field value if set, zero value otherwise. func (o *PlatformParameterConstraints) GetDefault() string { if o == nil || o.Default == nil { @@ -150,6 +162,8 @@ func (o *PlatformParameterConstraints) SetDefault(v string) { o.Default = &v } + + // MarshalJSON serializes the struct using spec logic. func (o PlatformParameterConstraints) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -178,17 +192,17 @@ func (o PlatformParameterConstraints) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PlatformParameterConstraints) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Min *string `json:"min,omitempty"` - Max *string `json:"max,omitempty"` - Enum []string `json:"enum,omitempty"` - Default *string `json:"default,omitempty"` + Min *string `json:"min,omitempty"` + Max *string `json:"max,omitempty"` + Enum []string `json:"enum,omitempty"` + Default *string `json:"default,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"min", "max", "enum", "default"}) + common.DeleteKeys(additionalProperties, &[]string{ "min", "max", "enum", "default", }) } else { return err } diff --git a/api/kbcloud/admin/model_platform_parameter_list.go b/api/kbcloud/admin/model_platform_parameter_list.go index 3add72cf..0c491151 100644 --- a/api/kbcloud/admin/model_platform_parameter_list.go +++ b/api/kbcloud/admin/model_platform_parameter_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PlatformParameterList platformParameter list + + +// PlatformParameterList platformParameter list type PlatformParameterList struct { Items []PlatformParameter `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPlatformParameterList instantiates a new PlatformParameterList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewPlatformParameterListWithDefaults() *PlatformParameterList { this := PlatformParameterList{} return &this } - // GetItems returns the Items field value. func (o *PlatformParameterList) GetItems() []PlatformParameter { if o == nil { @@ -59,6 +64,8 @@ func (o *PlatformParameterList) SetItems(v []PlatformParameter) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o PlatformParameterList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *PlatformParameterList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_platform_parameter_update.go b/api/kbcloud/admin/model_platform_parameter_update.go index 0a1406e4..596a7777 100644 --- a/api/kbcloud/admin/model_platform_parameter_update.go +++ b/api/kbcloud/admin/model_platform_parameter_update.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PlatformParameterUpdate platformParameter update + + +// PlatformParameterUpdate platformParameter update type PlatformParameterUpdate struct { // platformParameter name Name string `json:"name"` // platformParameter value Value string `json:"value"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPlatformParameterUpdate instantiates a new PlatformParameterUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewPlatformParameterUpdateWithDefaults() *PlatformParameterUpdate { this := PlatformParameterUpdate{} return &this } - // GetName returns the Name field value. func (o *PlatformParameterUpdate) GetName() string { if o == nil { @@ -63,6 +68,7 @@ func (o *PlatformParameterUpdate) SetName(v string) { o.Name = v } + // GetValue returns the Value field value. func (o *PlatformParameterUpdate) GetValue() string { if o == nil { @@ -86,6 +92,8 @@ func (o *PlatformParameterUpdate) SetValue(v string) { o.Value = v } + + // MarshalJSON serializes the struct using spec logic. func (o PlatformParameterUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,7 +112,7 @@ func (o PlatformParameterUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PlatformParameterUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` Value *string `json:"value"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,7 +126,7 @@ func (o *PlatformParameterUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "value", }) } else { return err } diff --git a/api/kbcloud/admin/model_pod_chaos.go b/api/kbcloud/admin/model_pod_chaos.go index 8b17f4a5..64e49649 100644 --- a/api/kbcloud/admin/model_pod_chaos.go +++ b/api/kbcloud/admin/model_pod_chaos.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type PodChaos struct { // specify the mode of chaos Mode PodChaosMode `json:"mode"` // the id of cluster to perform chaos - ClusterId string `json:"clusterID"` - Value *string `json:"value,omitempty"` + ClusterId string `json:"clusterID"` + Value *string `json:"value,omitempty"` // specify the action to be performed Action PodChaosAction `json:"action"` // specify the duration of the chaos action @@ -25,10 +30,11 @@ type PodChaos struct { // the name of the pod to perform the chaos Name *string `json:"name,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPodChaos instantiates a new PodChaos object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -48,7 +54,6 @@ func NewPodChaosWithDefaults() *PodChaos { this := PodChaos{} return &this } - // GetMode returns the Mode field value. func (o *PodChaos) GetMode() PodChaosMode { if o == nil { @@ -72,6 +77,7 @@ func (o *PodChaos) SetMode(v PodChaosMode) { o.Mode = v } + // GetClusterId returns the ClusterId field value. func (o *PodChaos) GetClusterId() string { if o == nil { @@ -95,6 +101,7 @@ func (o *PodChaos) SetClusterId(v string) { o.ClusterId = v } + // GetValue returns the Value field value if set, zero value otherwise. func (o *PodChaos) GetValue() string { if o == nil || o.Value == nil { @@ -123,6 +130,7 @@ func (o *PodChaos) SetValue(v string) { o.Value = &v } + // GetAction returns the Action field value. func (o *PodChaos) GetAction() PodChaosAction { if o == nil { @@ -146,6 +154,7 @@ func (o *PodChaos) SetAction(v PodChaosAction) { o.Action = v } + // GetDuration returns the Duration field value if set, zero value otherwise. func (o *PodChaos) GetDuration() string { if o == nil || o.Duration == nil { @@ -174,6 +183,7 @@ func (o *PodChaos) SetDuration(v string) { o.Duration = &v } + // GetGracePeriod returns the GracePeriod field value if set, zero value otherwise. func (o *PodChaos) GetGracePeriod() int32 { if o == nil || o.GracePeriod == nil { @@ -202,6 +212,7 @@ func (o *PodChaos) SetGracePeriod(v int32) { o.GracePeriod = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *PodChaos) GetName() string { if o == nil || o.Name == nil { @@ -230,6 +241,8 @@ func (o *PodChaos) SetName(v string) { o.Name = &v } + + // MarshalJSON serializes the struct using spec logic. func (o PodChaos) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -261,13 +274,13 @@ func (o PodChaos) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PodChaos) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Mode *PodChaosMode `json:"mode"` - ClusterId *string `json:"clusterID"` - Value *string `json:"value,omitempty"` - Action *PodChaosAction `json:"action"` - Duration *string `json:"duration,omitempty"` - GracePeriod *int32 `json:"gracePeriod,omitempty"` - Name *string `json:"name,omitempty"` + Mode *PodChaosMode `json:"mode"` + ClusterId *string `json:"clusterID"` + Value *string `json:"value,omitempty"` + Action *PodChaosAction `json:"action"` + Duration *string `json:"duration,omitempty"` + GracePeriod *int32 `json:"gracePeriod,omitempty"` + Name *string `json:"name,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -283,7 +296,7 @@ func (o *PodChaos) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"mode", "clusterID", "value", "action", "duration", "gracePeriod", "name"}) + common.DeleteKeys(additionalProperties, &[]string{ "mode", "clusterID", "value", "action", "duration", "gracePeriod", "name", }) } else { return err } diff --git a/api/kbcloud/admin/model_pod_chaos_action.go b/api/kbcloud/admin/model_pod_chaos_action.go index 5920b840..e1608cfd 100644 --- a/api/kbcloud/admin/model_pod_chaos_action.go +++ b/api/kbcloud/admin/model_pod_chaos_action.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // PodChaosAction specify the action to be performed type PodChaosAction string // List of PodChaosAction. const ( PodChaosActionPodFailure PodChaosAction = "pod-failure" - PodChaosActionPodKill PodChaosAction = "pod-kill" + PodChaosActionPodKill PodChaosAction = "pod-kill" ) var allowedPodChaosActionEnumValues = []PodChaosAction{ diff --git a/api/kbcloud/admin/model_pod_chaos_mode.go b/api/kbcloud/admin/model_pod_chaos_mode.go index 9bf766b4..38cacefa 100644 --- a/api/kbcloud/admin/model_pod_chaos_mode.go +++ b/api/kbcloud/admin/model_pod_chaos_mode.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // PodChaosMode specify the mode of chaos type PodChaosMode string // List of PodChaosMode. const ( - PodChaosModeOne PodChaosMode = "one" - PodChaosModeAll PodChaosMode = "all" - PodChaosModeFixed PodChaosMode = "fixed" - PodChaosModeFixedPercent PodChaosMode = "fixed-percent" + PodChaosModeOne PodChaosMode = "one" + PodChaosModeAll PodChaosMode = "all" + PodChaosModeFixed PodChaosMode = "fixed" + PodChaosModeFixedPercent PodChaosMode = "fixed-percent" PodChaosModeRandomMaxPercent PodChaosMode = "random-max-percent" ) diff --git a/api/kbcloud/admin/model_preflight.go b/api/kbcloud/admin/model_preflight.go index 299f1daa..fffaf668 100644 --- a/api/kbcloud/admin/model_preflight.go +++ b/api/kbcloud/admin/model_preflight.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// Preflight The result of preflight check +// Preflight The result of preflight check type Preflight struct { - Title *string `json:"title,omitempty"` + Title *string `json:"title,omitempty"` Message *string `json:"message,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPreflight instantiates a new Preflight object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewPreflightWithDefaults() *Preflight { this := Preflight{} return &this } - // GetTitle returns the Title field value if set, zero value otherwise. func (o *Preflight) GetTitle() string { if o == nil || o.Title == nil { @@ -60,6 +69,7 @@ func (o *Preflight) SetTitle(v string) { o.Title = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *Preflight) GetMessage() string { if o == nil || o.Message == nil { @@ -88,6 +98,8 @@ func (o *Preflight) SetMessage(v string) { o.Message = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Preflight) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +122,7 @@ func (o Preflight) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Preflight) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Title *string `json:"title,omitempty"` + Title *string `json:"title,omitempty"` Message *string `json:"message,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,7 +130,7 @@ func (o *Preflight) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"title", "message"}) + common.DeleteKeys(additionalProperties, &[]string{ "title", "message", }) } else { return err } diff --git a/api/kbcloud/admin/model_preflight_list.go b/api/kbcloud/admin/model_preflight_list.go index 2f0ff957..e29727b9 100644 --- a/api/kbcloud/admin/model_preflight_list.go +++ b/api/kbcloud/admin/model_preflight_list.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// PreflightList The preflight results + + +// PreflightList The preflight results type PreflightList struct { Pass []Preflight `json:"pass,omitempty"` Warn []Preflight `json:"warn,omitempty"` Fail []Preflight `json:"fail,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPreflightList instantiates a new PreflightList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewPreflightListWithDefaults() *PreflightList { this := PreflightList{} return &this } - // GetPass returns the Pass field value if set, zero value otherwise. func (o *PreflightList) GetPass() []Preflight { if o == nil || o.Pass == nil { @@ -61,6 +70,7 @@ func (o *PreflightList) SetPass(v []Preflight) { o.Pass = v } + // GetWarn returns the Warn field value if set, zero value otherwise. func (o *PreflightList) GetWarn() []Preflight { if o == nil || o.Warn == nil { @@ -89,6 +99,7 @@ func (o *PreflightList) SetWarn(v []Preflight) { o.Warn = v } + // GetFail returns the Fail field value if set, zero value otherwise. func (o *PreflightList) GetFail() []Preflight { if o == nil || o.Fail == nil { @@ -117,6 +128,8 @@ func (o *PreflightList) SetFail(v []Preflight) { o.Fail = v } + + // MarshalJSON serializes the struct using spec logic. func (o PreflightList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -151,7 +164,7 @@ func (o *PreflightList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"pass", "warn", "fail"}) + common.DeleteKeys(additionalProperties, &[]string{ "pass", "warn", "fail", }) } else { return err } diff --git a/api/kbcloud/admin/model_privilege_list_item.go b/api/kbcloud/admin/model_privilege_list_item.go index 1ad72195..3e439ed8 100644 --- a/api/kbcloud/admin/model_privilege_list_item.go +++ b/api/kbcloud/admin/model_privilege_list_item.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PrivilegeListItem Database and its assigned privileges. + + +// PrivilegeListItem Database and its assigned privileges. type PrivilegeListItem struct { // The name of the database. DatabaseName *string `json:"databaseName,omitempty"` // The type of privilege. Privileges string `json:"privileges"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPrivilegeListItem instantiates a new PrivilegeListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewPrivilegeListItemWithDefaults() *PrivilegeListItem { this := PrivilegeListItem{} return &this } - // GetDatabaseName returns the DatabaseName field value if set, zero value otherwise. func (o *PrivilegeListItem) GetDatabaseName() string { if o == nil || o.DatabaseName == nil { @@ -67,6 +72,7 @@ func (o *PrivilegeListItem) SetDatabaseName(v string) { o.DatabaseName = &v } + // GetPrivileges returns the Privileges field value. func (o *PrivilegeListItem) GetPrivileges() string { if o == nil { @@ -90,6 +96,8 @@ func (o *PrivilegeListItem) SetPrivileges(v string) { o.Privileges = v } + + // MarshalJSON serializes the struct using spec logic. func (o PrivilegeListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +119,7 @@ func (o PrivilegeListItem) MarshalJSON() ([]byte, error) { func (o *PrivilegeListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { DatabaseName *string `json:"databaseName,omitempty"` - Privileges *string `json:"privileges"` + Privileges *string `json:"privileges"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,7 +129,7 @@ func (o *PrivilegeListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"databaseName", "privileges"}) + common.DeleteKeys(additionalProperties, &[]string{ "databaseName", "privileges", }) } else { return err } diff --git a/api/kbcloud/admin/model_provider.go b/api/kbcloud/admin/model_provider.go index 20a7de9b..692d7d90 100644 --- a/api/kbcloud/admin/model_provider.go +++ b/api/kbcloud/admin/model_provider.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Provider The cloud provider that the environment is running on. + + +// Provider The cloud provider that the environment is running on. type Provider struct { // The name of the cloud provider. Name string `json:"name"` @@ -36,10 +40,11 @@ type Provider struct { // The time when the cloud provider was last updated. UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewProvider instantiates a new Provider object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -67,7 +72,6 @@ func NewProviderWithDefaults() *Provider { this := Provider{} return &this } - // GetName returns the Name field value. func (o *Provider) GetName() string { if o == nil { @@ -91,6 +95,7 @@ func (o *Provider) SetName(v string) { o.Name = v } + // GetNameCn returns the NameCn field value. func (o *Provider) GetNameCn() string { if o == nil { @@ -114,6 +119,7 @@ func (o *Provider) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *Provider) GetNameEn() string { if o == nil { @@ -137,6 +143,7 @@ func (o *Provider) SetNameEn(v string) { o.NameEn = v } + // GetLogo returns the Logo field value. func (o *Provider) GetLogo() string { if o == nil { @@ -160,6 +167,7 @@ func (o *Provider) SetLogo(v string) { o.Logo = v } + // GetEnabled returns the Enabled field value. func (o *Provider) GetEnabled() bool { if o == nil { @@ -183,6 +191,7 @@ func (o *Provider) SetEnabled(v bool) { o.Enabled = v } + // GetSupportArn returns the SupportArn field value. func (o *Provider) GetSupportArn() bool { if o == nil { @@ -206,6 +215,7 @@ func (o *Provider) SetSupportArn(v bool) { o.SupportArn = v } + // GetEnvironmentCount returns the EnvironmentCount field value. func (o *Provider) GetEnvironmentCount() int32 { if o == nil { @@ -229,6 +239,7 @@ func (o *Provider) SetEnvironmentCount(v int32) { o.EnvironmentCount = v } + // GetRegionCount returns the RegionCount field value. func (o *Provider) GetRegionCount() int32 { if o == nil { @@ -252,6 +263,7 @@ func (o *Provider) SetRegionCount(v int32) { o.RegionCount = v } + // GetZoneCount returns the ZoneCount field value. func (o *Provider) GetZoneCount() int32 { if o == nil { @@ -275,6 +287,7 @@ func (o *Provider) SetZoneCount(v int32) { o.ZoneCount = v } + // GetCreatedAt returns the CreatedAt field value. func (o *Provider) GetCreatedAt() time.Time { if o == nil { @@ -298,6 +311,7 @@ func (o *Provider) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Provider) GetUpdatedAt() time.Time { if o == nil { @@ -321,6 +335,8 @@ func (o *Provider) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o Provider) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -356,17 +372,17 @@ func (o Provider) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Provider) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Logo *string `json:"logo"` - Enabled *bool `json:"enabled"` - SupportArn *bool `json:"supportARN"` - EnvironmentCount *int32 `json:"environmentCount"` - RegionCount *int32 `json:"regionCount"` - ZoneCount *int32 `json:"zoneCount"` - CreatedAt *time.Time `json:"createdAt"` - UpdatedAt *time.Time `json:"updatedAt"` + Name *string `json:"name"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Logo *string `json:"logo"` + Enabled *bool `json:"enabled"` + SupportArn *bool `json:"supportARN"` + EnvironmentCount *int32 `json:"environmentCount"` + RegionCount *int32 `json:"regionCount"` + ZoneCount *int32 `json:"zoneCount"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -406,7 +422,7 @@ func (o *Provider) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "nameCN", "nameEN", "logo", "enabled", "supportARN", "environmentCount", "regionCount", "zoneCount", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "nameCN", "nameEN", "logo", "enabled", "supportARN", "environmentCount", "regionCount", "zoneCount", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_provider_create.go b/api/kbcloud/admin/model_provider_create.go index 81e91356..c0631162 100644 --- a/api/kbcloud/admin/model_provider_create.go +++ b/api/kbcloud/admin/model_provider_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ProviderCreate The cloud provider that needs to be created. + + +// ProviderCreate The cloud provider that needs to be created. type ProviderCreate struct { // The name of the cloud provider. Name string `json:"name"` @@ -25,10 +30,11 @@ type ProviderCreate struct { // Whether the cloud provider supports ARN. SupportArn bool `json:"supportARN"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewProviderCreate instantiates a new ProviderCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -51,7 +57,6 @@ func NewProviderCreateWithDefaults() *ProviderCreate { this := ProviderCreate{} return &this } - // GetName returns the Name field value. func (o *ProviderCreate) GetName() string { if o == nil { @@ -75,6 +80,7 @@ func (o *ProviderCreate) SetName(v string) { o.Name = v } + // GetLogo returns the Logo field value. func (o *ProviderCreate) GetLogo() string { if o == nil { @@ -98,6 +104,7 @@ func (o *ProviderCreate) SetLogo(v string) { o.Logo = v } + // GetEnabled returns the Enabled field value. func (o *ProviderCreate) GetEnabled() bool { if o == nil { @@ -121,6 +128,7 @@ func (o *ProviderCreate) SetEnabled(v bool) { o.Enabled = v } + // GetNameCn returns the NameCn field value. func (o *ProviderCreate) GetNameCn() string { if o == nil { @@ -144,6 +152,7 @@ func (o *ProviderCreate) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *ProviderCreate) GetNameEn() string { if o == nil { @@ -167,6 +176,7 @@ func (o *ProviderCreate) SetNameEn(v string) { o.NameEn = v } + // GetSupportArn returns the SupportArn field value. func (o *ProviderCreate) GetSupportArn() bool { if o == nil { @@ -190,6 +200,8 @@ func (o *ProviderCreate) SetSupportArn(v bool) { o.SupportArn = v } + + // MarshalJSON serializes the struct using spec logic. func (o ProviderCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -212,12 +224,12 @@ func (o ProviderCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ProviderCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Logo *string `json:"logo"` - Enabled *bool `json:"enabled"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - SupportArn *bool `json:"supportARN"` + Name *string `json:"name"` + Logo *string `json:"logo"` + Enabled *bool `json:"enabled"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + SupportArn *bool `json:"supportARN"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -242,7 +254,7 @@ func (o *ProviderCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "logo", "enabled", "nameCN", "nameEN", "supportARN"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "logo", "enabled", "nameCN", "nameEN", "supportARN", }) } else { return err } diff --git a/api/kbcloud/admin/model_provider_list.go b/api/kbcloud/admin/model_provider_list.go index 0cd1b076..d8da9d10 100644 --- a/api/kbcloud/admin/model_provider_list.go +++ b/api/kbcloud/admin/model_provider_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ProviderList The list of cloud providers. +// ProviderList The list of cloud providers. type ProviderList struct { // The list of cloud providers. Items []Provider `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewProviderList instantiates a new ProviderList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewProviderListWithDefaults() *ProviderList { this := ProviderList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ProviderList) GetItems() []Provider { if o == nil || o.Items == nil { @@ -60,6 +69,8 @@ func (o *ProviderList) SetItems(v []Provider) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ProviderList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *ProviderList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_provider_update.go b/api/kbcloud/admin/model_provider_update.go index 263ad4b0..475d25b2 100644 --- a/api/kbcloud/admin/model_provider_update.go +++ b/api/kbcloud/admin/model_provider_update.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ProviderUpdate The cloud provider that needs to be updated. + + +// ProviderUpdate The cloud provider that needs to be updated. type ProviderUpdate struct { // The logo of the cloud provider. Logo string `json:"logo"` @@ -23,10 +28,11 @@ type ProviderUpdate struct { // Whether the cloud provider supports ARN. SupportArn bool `json:"supportARN"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewProviderUpdate instantiates a new ProviderUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -48,7 +54,6 @@ func NewProviderUpdateWithDefaults() *ProviderUpdate { this := ProviderUpdate{} return &this } - // GetLogo returns the Logo field value. func (o *ProviderUpdate) GetLogo() string { if o == nil { @@ -72,6 +77,7 @@ func (o *ProviderUpdate) SetLogo(v string) { o.Logo = v } + // GetEnabled returns the Enabled field value. func (o *ProviderUpdate) GetEnabled() bool { if o == nil { @@ -95,6 +101,7 @@ func (o *ProviderUpdate) SetEnabled(v bool) { o.Enabled = v } + // GetNameCn returns the NameCn field value. func (o *ProviderUpdate) GetNameCn() string { if o == nil { @@ -118,6 +125,7 @@ func (o *ProviderUpdate) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *ProviderUpdate) GetNameEn() string { if o == nil { @@ -141,6 +149,7 @@ func (o *ProviderUpdate) SetNameEn(v string) { o.NameEn = v } + // GetSupportArn returns the SupportArn field value. func (o *ProviderUpdate) GetSupportArn() bool { if o == nil { @@ -164,6 +173,8 @@ func (o *ProviderUpdate) SetSupportArn(v bool) { o.SupportArn = v } + + // MarshalJSON serializes the struct using spec logic. func (o ProviderUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -185,11 +196,11 @@ func (o ProviderUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ProviderUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Logo *string `json:"logo"` - Enabled *bool `json:"enabled"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - SupportArn *bool `json:"supportARN"` + Logo *string `json:"logo"` + Enabled *bool `json:"enabled"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + SupportArn *bool `json:"supportARN"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -211,7 +222,7 @@ func (o *ProviderUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"logo", "enabled", "nameCN", "nameEN", "supportARN"}) + common.DeleteKeys(additionalProperties, &[]string{ "logo", "enabled", "nameCN", "nameEN", "supportARN", }) } else { return err } diff --git a/api/kbcloud/admin/model_provision_config.go b/api/kbcloud/admin/model_provision_config.go index 7af8bfbf..3333680e 100644 --- a/api/kbcloud/admin/model_provision_config.go +++ b/api/kbcloud/admin/model_provision_config.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ProvisionConfig Configuration to provision infrastructure for this environment + + +// ProvisionConfig Configuration to provision infrastructure for this environment type ProvisionConfig struct { // Register manifest for environment Register Register `json:"register"` @@ -21,10 +26,11 @@ type ProvisionConfig struct { // Storage config for environment Storage StorageConfig `json:"storage"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewProvisionConfig instantiates a new ProvisionConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewProvisionConfigWithDefaults() *ProvisionConfig { this := ProvisionConfig{} return &this } - // GetRegister returns the Register field value. func (o *ProvisionConfig) GetRegister() Register { if o == nil { @@ -68,6 +73,7 @@ func (o *ProvisionConfig) SetRegister(v Register) { o.Register = v } + // GetComponent returns the Component field value. func (o *ProvisionConfig) GetComponent() Component { if o == nil { @@ -91,6 +97,7 @@ func (o *ProvisionConfig) SetComponent(v Component) { o.Component = v } + // GetNodePool returns the NodePool field value if set, zero value otherwise. func (o *ProvisionConfig) GetNodePool() []NodePoolNode { if o == nil || o.NodePool == nil { @@ -119,6 +126,7 @@ func (o *ProvisionConfig) SetNodePool(v []NodePoolNode) { o.NodePool = v } + // GetStorage returns the Storage field value. func (o *ProvisionConfig) GetStorage() StorageConfig { if o == nil { @@ -142,6 +150,8 @@ func (o *ProvisionConfig) SetStorage(v StorageConfig) { o.Storage = v } + + // MarshalJSON serializes the struct using spec logic. func (o ProvisionConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -164,10 +174,10 @@ func (o ProvisionConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ProvisionConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Register *Register `json:"register"` - Component *Component `json:"component"` - NodePool []NodePoolNode `json:"nodePool,omitempty"` - Storage *StorageConfig `json:"storage"` + Register *Register `json:"register"` + Component *Component `json:"component"` + NodePool []NodePoolNode `json:"nodePool,omitempty"` + Storage *StorageConfig `json:"storage"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -183,7 +193,7 @@ func (o *ProvisionConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"register", "component", "nodePool", "storage"}) + common.DeleteKeys(additionalProperties, &[]string{ "register", "component", "nodePool", "storage", }) } else { return err } diff --git a/api/kbcloud/admin/model_query_history.go b/api/kbcloud/admin/model_query_history.go index 9aa6ccce..d097d506 100644 --- a/api/kbcloud/admin/model_query_history.go +++ b/api/kbcloud/admin/model_query_history.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type QueryHistory struct { // executed sql statements Sql *string `json:"sql,omitempty"` @@ -20,10 +25,11 @@ type QueryHistory struct { // sql executed duration Duration *int32 `json:"duration,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewQueryHistory instantiates a new QueryHistory object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewQueryHistoryWithDefaults() *QueryHistory { this := QueryHistory{} return &this } - // GetSql returns the Sql field value if set, zero value otherwise. func (o *QueryHistory) GetSql() string { if o == nil || o.Sql == nil { @@ -69,6 +74,7 @@ func (o *QueryHistory) SetSql(v string) { o.Sql = &v } + // GetErrMassage returns the ErrMassage field value if set, zero value otherwise. func (o *QueryHistory) GetErrMassage() string { if o == nil || o.ErrMassage == nil { @@ -97,6 +103,7 @@ func (o *QueryHistory) SetErrMassage(v string) { o.ErrMassage = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *QueryHistory) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -125,6 +132,7 @@ func (o *QueryHistory) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetDuration returns the Duration field value if set, zero value otherwise. func (o *QueryHistory) GetDuration() int32 { if o == nil || o.Duration == nil { @@ -153,6 +161,8 @@ func (o *QueryHistory) SetDuration(v int32) { o.Duration = &v } + + // MarshalJSON serializes the struct using spec logic. func (o QueryHistory) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -185,17 +195,17 @@ func (o QueryHistory) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *QueryHistory) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Sql *string `json:"sql,omitempty"` - ErrMassage *string `json:"errMassage,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Duration *int32 `json:"duration,omitempty"` + Sql *string `json:"sql,omitempty"` + ErrMassage *string `json:"errMassage,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Duration *int32 `json:"duration,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"sql", "errMassage", "createdAt", "duration"}) + common.DeleteKeys(additionalProperties, &[]string{ "sql", "errMassage", "createdAt", "duration", }) } else { return err } diff --git a/api/kbcloud/admin/model_query_response.go b/api/kbcloud/admin/model_query_response.go index d0496206..4eac65bb 100644 --- a/api/kbcloud/admin/model_query_response.go +++ b/api/kbcloud/admin/model_query_response.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type QueryResponse struct { // result set of query Data []Result `json:"data,omitempty"` // error message set of query ErrMessage common.NullableList[string] `json:"errMessage,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewQueryResponse instantiates a new QueryResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewQueryResponseWithDefaults() *QueryResponse { this := QueryResponse{} return &this } - // GetData returns the Data field value if set, zero value otherwise. func (o *QueryResponse) GetData() []Result { if o == nil || o.Data == nil { @@ -61,6 +70,7 @@ func (o *QueryResponse) SetData(v []Result) { o.Data = v } + // GetErrMessage returns the ErrMessage field value if set, zero value otherwise (both if not set or set to explicit null). func (o *QueryResponse) GetErrMessage() []string { if o == nil || o.ErrMessage.Get() == nil { @@ -74,7 +84,7 @@ func (o *QueryResponse) GetErrMessage() []string { // 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 *QueryResponse) GetErrMessageOk() (*[]string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ErrMessage.Get(), o.ErrMessage.IsSet() @@ -89,7 +99,6 @@ func (o *QueryResponse) HasErrMessage() bool { func (o *QueryResponse) SetErrMessage(v []string) { o.ErrMessage.Set(&v) } - // SetErrMessageNil sets the value for ErrMessage to be an explicit nil. func (o *QueryResponse) SetErrMessageNil() { o.ErrMessage.Set(nil) @@ -100,6 +109,8 @@ func (o *QueryResponse) UnsetErrMessage() { o.ErrMessage.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o QueryResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -122,7 +133,7 @@ func (o QueryResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *QueryResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data []Result `json:"data,omitempty"` + Data []Result `json:"data,omitempty"` ErrMessage common.NullableList[string] `json:"errMessage,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -130,7 +141,7 @@ func (o *QueryResponse) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"data", "errMessage"}) + common.DeleteKeys(additionalProperties, &[]string{ "data", "errMessage", }) } else { return err } diff --git a/api/kbcloud/admin/model_raw_backup_repo.go b/api/kbcloud/admin/model_raw_backup_repo.go deleted file mode 100644 index 0a4e5d8d..00000000 --- a/api/kbcloud/admin/model_raw_backup_repo.go +++ /dev/null @@ -1,135 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package admin - -import "github.com/apecloud/kb-cloud-client-go/api/common" - -// RawBackupRepo backup repo info -type RawBackupRepo struct { - // the backup repo name - Name *string `json:"name,omitempty"` - // default backup repo - Default *bool `json:"default,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewRawBackupRepo instantiates a new RawBackupRepo object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewRawBackupRepo() *RawBackupRepo { - this := RawBackupRepo{} - return &this -} - -// NewRawBackupRepoWithDefaults instantiates a new RawBackupRepo object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewRawBackupRepoWithDefaults() *RawBackupRepo { - this := RawBackupRepo{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *RawBackupRepo) GetName() string { - if o == nil || o.Name == nil { - 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 *RawBackupRepo) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *RawBackupRepo) HasName() bool { - return o != nil && o.Name != nil -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *RawBackupRepo) SetName(v string) { - o.Name = &v -} - -// GetDefault returns the Default field value if set, zero value otherwise. -func (o *RawBackupRepo) GetDefault() bool { - if o == nil || o.Default == nil { - var ret bool - return ret - } - return *o.Default -} - -// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RawBackupRepo) GetDefaultOk() (*bool, bool) { - if o == nil || o.Default == nil { - return nil, false - } - return o.Default, true -} - -// HasDefault returns a boolean if a field has been set. -func (o *RawBackupRepo) HasDefault() bool { - return o != nil && o.Default != nil -} - -// SetDefault gets a reference to the given bool and assigns it to the Default field. -func (o *RawBackupRepo) SetDefault(v bool) { - o.Default = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o RawBackupRepo) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return common.Marshal(o.UnparsedObject) - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Default != nil { - toSerialize["default"] = o.Default - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return common.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *RawBackupRepo) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Name *string `json:"name,omitempty"` - Default *bool `json:"default,omitempty"` - }{} - if err = common.Unmarshal(bytes, &all); err != nil { - return common.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "default"}) - } else { - return err - } - o.Name = all.Name - o.Default = all.Default - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/kbcloud/admin/model_raw_cluster.go b/api/kbcloud/admin/model_raw_cluster.go deleted file mode 100644 index 325c19cc..00000000 --- a/api/kbcloud/admin/model_raw_cluster.go +++ /dev/null @@ -1,275 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package admin - -import "github.com/apecloud/kb-cloud-client-go/api/common" - -// RawCluster cluster info -type RawCluster struct { - // the cluster name in k8s - KubernetesName *string `json:"kubernetesName,omitempty"` - // the namespace of cluster - Namespace *string `json:"namespace,omitempty"` - // the replicas of cluster - Replicas *int32 `json:"replicas,omitempty"` - // Storage size, the unit is Gi - Storage *float64 `json:"storage,omitempty"` - // CPU cores. - Cpu *float64 `json:"cpu,omitempty"` - // Memory, the unit is Gi. - Memory *float64 `json:"memory,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewRawCluster instantiates a new RawCluster object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewRawCluster() *RawCluster { - this := RawCluster{} - return &this -} - -// NewRawClusterWithDefaults instantiates a new RawCluster object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewRawClusterWithDefaults() *RawCluster { - this := RawCluster{} - return &this -} - -// GetKubernetesName returns the KubernetesName field value if set, zero value otherwise. -func (o *RawCluster) GetKubernetesName() string { - if o == nil || o.KubernetesName == nil { - var ret string - return ret - } - return *o.KubernetesName -} - -// GetKubernetesNameOk returns a tuple with the KubernetesName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RawCluster) GetKubernetesNameOk() (*string, bool) { - if o == nil || o.KubernetesName == nil { - return nil, false - } - return o.KubernetesName, true -} - -// HasKubernetesName returns a boolean if a field has been set. -func (o *RawCluster) HasKubernetesName() bool { - return o != nil && o.KubernetesName != nil -} - -// SetKubernetesName gets a reference to the given string and assigns it to the KubernetesName field. -func (o *RawCluster) SetKubernetesName(v string) { - o.KubernetesName = &v -} - -// GetNamespace returns the Namespace field value if set, zero value otherwise. -func (o *RawCluster) GetNamespace() string { - if o == nil || o.Namespace == nil { - var ret string - return ret - } - return *o.Namespace -} - -// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RawCluster) GetNamespaceOk() (*string, bool) { - if o == nil || o.Namespace == nil { - return nil, false - } - return o.Namespace, true -} - -// HasNamespace returns a boolean if a field has been set. -func (o *RawCluster) HasNamespace() bool { - return o != nil && o.Namespace != nil -} - -// SetNamespace gets a reference to the given string and assigns it to the Namespace field. -func (o *RawCluster) SetNamespace(v string) { - o.Namespace = &v -} - -// GetReplicas returns the Replicas field value if set, zero value otherwise. -func (o *RawCluster) GetReplicas() int32 { - if o == nil || o.Replicas == nil { - var ret int32 - return ret - } - return *o.Replicas -} - -// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RawCluster) GetReplicasOk() (*int32, bool) { - if o == nil || o.Replicas == nil { - return nil, false - } - return o.Replicas, true -} - -// HasReplicas returns a boolean if a field has been set. -func (o *RawCluster) HasReplicas() bool { - return o != nil && o.Replicas != nil -} - -// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. -func (o *RawCluster) SetReplicas(v int32) { - o.Replicas = &v -} - -// GetStorage returns the Storage field value if set, zero value otherwise. -func (o *RawCluster) GetStorage() float64 { - if o == nil || o.Storage == nil { - var ret float64 - return ret - } - return *o.Storage -} - -// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RawCluster) GetStorageOk() (*float64, bool) { - if o == nil || o.Storage == nil { - return nil, false - } - return o.Storage, true -} - -// HasStorage returns a boolean if a field has been set. -func (o *RawCluster) HasStorage() bool { - return o != nil && o.Storage != nil -} - -// SetStorage gets a reference to the given float64 and assigns it to the Storage field. -func (o *RawCluster) SetStorage(v float64) { - o.Storage = &v -} - -// GetCpu returns the Cpu field value if set, zero value otherwise. -func (o *RawCluster) GetCpu() float64 { - if o == nil || o.Cpu == nil { - var ret float64 - return ret - } - return *o.Cpu -} - -// GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RawCluster) GetCpuOk() (*float64, bool) { - if o == nil || o.Cpu == nil { - return nil, false - } - return o.Cpu, true -} - -// HasCpu returns a boolean if a field has been set. -func (o *RawCluster) HasCpu() bool { - return o != nil && o.Cpu != nil -} - -// SetCpu gets a reference to the given float64 and assigns it to the Cpu field. -func (o *RawCluster) SetCpu(v float64) { - o.Cpu = &v -} - -// GetMemory returns the Memory field value if set, zero value otherwise. -func (o *RawCluster) GetMemory() float64 { - if o == nil || o.Memory == nil { - var ret float64 - return ret - } - return *o.Memory -} - -// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RawCluster) GetMemoryOk() (*float64, bool) { - if o == nil || o.Memory == nil { - return nil, false - } - return o.Memory, true -} - -// HasMemory returns a boolean if a field has been set. -func (o *RawCluster) HasMemory() bool { - return o != nil && o.Memory != nil -} - -// SetMemory gets a reference to the given float64 and assigns it to the Memory field. -func (o *RawCluster) SetMemory(v float64) { - o.Memory = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o RawCluster) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return common.Marshal(o.UnparsedObject) - } - if o.KubernetesName != nil { - toSerialize["kubernetesName"] = o.KubernetesName - } - if o.Namespace != nil { - toSerialize["namespace"] = o.Namespace - } - if o.Replicas != nil { - toSerialize["replicas"] = o.Replicas - } - if o.Storage != nil { - toSerialize["storage"] = o.Storage - } - if o.Cpu != nil { - toSerialize["cpu"] = o.Cpu - } - if o.Memory != nil { - toSerialize["memory"] = o.Memory - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return common.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *RawCluster) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - KubernetesName *string `json:"kubernetesName,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - Storage *float64 `json:"storage,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - }{} - if err = common.Unmarshal(bytes, &all); err != nil { - return common.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"kubernetesName", "namespace", "replicas", "storage", "cpu", "memory"}) - } else { - return err - } - o.KubernetesName = all.KubernetesName - o.Namespace = all.Namespace - o.Replicas = all.Replicas - o.Storage = all.Storage - o.Cpu = all.Cpu - o.Memory = all.Memory - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/kbcloud/admin/model_reconfigure_create.go b/api/kbcloud/admin/model_reconfigure_create.go index 7ef7c320..b338c74b 100644 --- a/api/kbcloud/admin/model_reconfigure_create.go +++ b/api/kbcloud/admin/model_reconfigure_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ReconfigureCreate ReconfigureCreate is the payload to reconfigure a KubeBlocks cluster + + +// ReconfigureCreate ReconfigureCreate is the payload to reconfigure a KubeBlocks cluster type ReconfigureCreate struct { // component type Component *string `json:"component,omitempty"` @@ -19,10 +24,11 @@ type ReconfigureCreate struct { // Specify parameters list to be updated Parameters map[string]string `json:"parameters"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewReconfigureCreate instantiates a new ReconfigureCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewReconfigureCreateWithDefaults() *ReconfigureCreate { this := ReconfigureCreate{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *ReconfigureCreate) GetComponent() string { if o == nil || o.Component == nil { @@ -69,6 +74,7 @@ func (o *ReconfigureCreate) SetComponent(v string) { o.Component = &v } + // GetConfigFileName returns the ConfigFileName field value if set, zero value otherwise. func (o *ReconfigureCreate) GetConfigFileName() string { if o == nil || o.ConfigFileName == nil { @@ -97,6 +103,7 @@ func (o *ReconfigureCreate) SetConfigFileName(v string) { o.ConfigFileName = &v } + // GetParameters returns the Parameters field value. func (o *ReconfigureCreate) GetParameters() map[string]string { if o == nil { @@ -120,6 +127,8 @@ func (o *ReconfigureCreate) SetParameters(v map[string]string) { o.Parameters = v } + + // MarshalJSON serializes the struct using spec logic. func (o ReconfigureCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,9 +152,9 @@ func (o ReconfigureCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ReconfigureCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - ConfigFileName *string `json:"configFileName,omitempty"` - Parameters *map[string]string `json:"parameters"` + Component *string `json:"component,omitempty"` + ConfigFileName *string `json:"configFileName,omitempty"` + Parameters *map[string]string `json:"parameters"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -155,7 +164,7 @@ func (o *ReconfigureCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "configFileName", "parameters"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "configFileName", "parameters", }) } else { return err } diff --git a/api/kbcloud/admin/model_recycle_bin_cluster.go b/api/kbcloud/admin/model_recycle_bin_cluster.go index 03b0a1f1..fee5d6df 100644 --- a/api/kbcloud/admin/model_recycle_bin_cluster.go +++ b/api/kbcloud/admin/model_recycle_bin_cluster.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RecycleBinCluster KubeBlocks cluster(in recycle bin) information + + +// RecycleBinCluster KubeBlocks cluster(in recycle bin) information type RecycleBinCluster struct { // Cluster Recycle Bin ID Id *string `json:"id,omitempty"` @@ -70,10 +74,11 @@ type RecycleBinCluster struct { // ExpiredAt is a timestamp representing the server time when this object will be expired, and deleted automatically. ExpiredAt *time.Time `json:"expiredAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRecycleBinCluster instantiates a new RecycleBinCluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -101,7 +106,6 @@ func NewRecycleBinClusterWithDefaults() *RecycleBinCluster { this.SingleZone = &singleZone return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *RecycleBinCluster) GetId() string { if o == nil || o.Id == nil { @@ -130,6 +134,7 @@ func (o *RecycleBinCluster) SetId(v string) { o.Id = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *RecycleBinCluster) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -158,6 +163,7 @@ func (o *RecycleBinCluster) SetClusterId(v string) { o.ClusterId = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *RecycleBinCluster) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -186,6 +192,7 @@ func (o *RecycleBinCluster) SetOrgName(v string) { o.OrgName = &v } + // GetCloudProvider returns the CloudProvider field value if set, zero value otherwise. func (o *RecycleBinCluster) GetCloudProvider() string { if o == nil || o.CloudProvider == nil { @@ -214,6 +221,7 @@ func (o *RecycleBinCluster) SetCloudProvider(v string) { o.CloudProvider = &v } + // GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. func (o *RecycleBinCluster) GetEnvironmentId() string { if o == nil || o.EnvironmentId == nil { @@ -242,6 +250,7 @@ func (o *RecycleBinCluster) SetEnvironmentId(v string) { o.EnvironmentId = &v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *RecycleBinCluster) GetEnvironmentName() string { if o == nil { @@ -265,6 +274,7 @@ func (o *RecycleBinCluster) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetEnvironmentType returns the EnvironmentType field value if set, zero value otherwise. func (o *RecycleBinCluster) GetEnvironmentType() string { if o == nil || o.EnvironmentType == nil { @@ -293,6 +303,7 @@ func (o *RecycleBinCluster) SetEnvironmentType(v string) { o.EnvironmentType = &v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *RecycleBinCluster) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -321,6 +332,7 @@ func (o *RecycleBinCluster) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *RecycleBinCluster) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -349,6 +361,7 @@ func (o *RecycleBinCluster) SetNamespace(v string) { o.Namespace = &v } + // GetName returns the Name field value. func (o *RecycleBinCluster) GetName() string { if o == nil { @@ -372,6 +385,7 @@ func (o *RecycleBinCluster) SetName(v string) { o.Name = v } + // GetHash returns the Hash field value if set, zero value otherwise. func (o *RecycleBinCluster) GetHash() string { if o == nil || o.Hash == nil { @@ -400,6 +414,7 @@ func (o *RecycleBinCluster) SetHash(v string) { o.Hash = &v } + // GetEngine returns the Engine field value. func (o *RecycleBinCluster) GetEngine() string { if o == nil { @@ -423,6 +438,7 @@ func (o *RecycleBinCluster) SetEngine(v string) { o.Engine = v } + // GetValues returns the Values field value if set, zero value otherwise. func (o *RecycleBinCluster) GetValues() map[string]interface{} { if o == nil || o.Values == nil { @@ -451,6 +467,7 @@ func (o *RecycleBinCluster) SetValues(v map[string]interface{}) { o.Values = v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *RecycleBinCluster) GetVersion() string { if o == nil || o.Version == nil { @@ -479,6 +496,7 @@ func (o *RecycleBinCluster) SetVersion(v string) { o.Version = &v } + // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *RecycleBinCluster) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -507,6 +525,7 @@ func (o *RecycleBinCluster) SetReplicas(v int32) { o.Replicas = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *RecycleBinCluster) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -535,6 +554,7 @@ func (o *RecycleBinCluster) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *RecycleBinCluster) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -563,6 +583,7 @@ func (o *RecycleBinCluster) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *RecycleBinCluster) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -591,6 +612,7 @@ func (o *RecycleBinCluster) SetStorage(v float64) { o.Storage = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *RecycleBinCluster) GetStatus() string { if o == nil || o.Status == nil { @@ -619,6 +641,7 @@ func (o *RecycleBinCluster) SetStatus(v string) { o.Status = &v } + // GetState returns the State field value if set, zero value otherwise. func (o *RecycleBinCluster) GetState() string { if o == nil || o.State == nil { @@ -647,6 +670,7 @@ func (o *RecycleBinCluster) SetState(v string) { o.State = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *RecycleBinCluster) GetMode() string { if o == nil || o.Mode == nil { @@ -675,6 +699,7 @@ func (o *RecycleBinCluster) SetMode(v string) { o.Mode = &v } + // GetComponents returns the Components field value if set, zero value otherwise. func (o *RecycleBinCluster) GetComponents() []ComponentsItem { if o == nil || o.Components == nil { @@ -703,6 +728,7 @@ func (o *RecycleBinCluster) SetComponents(v []ComponentsItem) { o.Components = v } + // GetSingleZone returns the SingleZone field value if set, zero value otherwise. func (o *RecycleBinCluster) GetSingleZone() bool { if o == nil || o.SingleZone == nil { @@ -731,6 +757,7 @@ func (o *RecycleBinCluster) SetSingleZone(v bool) { o.SingleZone = &v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *RecycleBinCluster) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -759,6 +786,7 @@ func (o *RecycleBinCluster) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetBackup returns the Backup field value if set, zero value otherwise. func (o *RecycleBinCluster) GetBackup() ClusterBackup { if o == nil || o.Backup == nil { @@ -787,6 +815,7 @@ func (o *RecycleBinCluster) SetBackup(v ClusterBackup) { o.Backup = &v } + // GetStoppedAt returns the StoppedAt field value if set, zero value otherwise. func (o *RecycleBinCluster) GetStoppedAt() time.Time { if o == nil || o.StoppedAt == nil { @@ -815,6 +844,7 @@ func (o *RecycleBinCluster) SetStoppedAt(v time.Time) { o.StoppedAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *RecycleBinCluster) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -843,6 +873,7 @@ func (o *RecycleBinCluster) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetExpiredAt returns the ExpiredAt field value if set, zero value otherwise. func (o *RecycleBinCluster) GetExpiredAt() time.Time { if o == nil || o.ExpiredAt == nil { @@ -871,6 +902,8 @@ func (o *RecycleBinCluster) SetExpiredAt(v time.Time) { o.ExpiredAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RecycleBinCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -977,34 +1010,34 @@ func (o RecycleBinCluster) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RecycleBinCluster) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - ClusterId *string `json:"clusterId,omitempty"` - OrgName *string `json:"orgName,omitempty"` - CloudProvider *string `json:"cloudProvider,omitempty"` - EnvironmentId *string `json:"environmentId,omitempty"` - EnvironmentName *string `json:"environmentName"` - EnvironmentType *string `json:"environmentType,omitempty"` - CloudRegion *string `json:"cloudRegion,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Name *string `json:"name"` - Hash *string `json:"hash,omitempty"` - Engine *string `json:"engine"` - Values map[string]interface{} `json:"values,omitempty"` - Version *string `json:"version,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *float64 `json:"storage,omitempty"` - Status *string `json:"status,omitempty"` - State *string `json:"state,omitempty"` - Mode *string `json:"mode,omitempty"` - Components []ComponentsItem `json:"components,omitempty"` - SingleZone *bool `json:"singleZone,omitempty"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - Backup *ClusterBackup `json:"backup,omitempty"` - StoppedAt *time.Time `json:"stoppedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` + Id *string `json:"id,omitempty"` + ClusterId *string `json:"clusterId,omitempty"` + OrgName *string `json:"orgName,omitempty"` + CloudProvider *string `json:"cloudProvider,omitempty"` + EnvironmentId *string `json:"environmentId,omitempty"` + EnvironmentName *string `json:"environmentName"` + EnvironmentType *string `json:"environmentType,omitempty"` + CloudRegion *string `json:"cloudRegion,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name"` + Hash *string `json:"hash,omitempty"` + Engine *string `json:"engine"` + Values map[string]interface{} `json:"values,omitempty"` + Version *string `json:"version,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *float64 `json:"storage,omitempty"` + Status *string `json:"status,omitempty"` + State *string `json:"state,omitempty"` + Mode *string `json:"mode,omitempty"` + Components []ComponentsItem `json:"components,omitempty"` + SingleZone *bool `json:"singleZone,omitempty"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + Backup *ClusterBackup `json:"backup,omitempty"` + StoppedAt *time.Time `json:"stoppedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -1020,7 +1053,7 @@ func (o *RecycleBinCluster) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "clusterId", "orgName", "cloudProvider", "environmentId", "environmentName", "environmentType", "cloudRegion", "namespace", "name", "hash", "engine", "values", "version", "replicas", "cpu", "memory", "storage", "status", "state", "mode", "components", "singleZone", "availabilityZones", "backup", "stoppedAt", "createdAt", "expiredAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "clusterId", "orgName", "cloudProvider", "environmentId", "environmentName", "environmentType", "cloudRegion", "namespace", "name", "hash", "engine", "values", "version", "replicas", "cpu", "memory", "storage", "status", "state", "mode", "components", "singleZone", "availabilityZones", "backup", "stoppedAt", "createdAt", "expiredAt", }) } else { return err } @@ -1050,7 +1083,7 @@ func (o *RecycleBinCluster) UnmarshalJSON(bytes []byte) (err error) { o.Components = all.Components o.SingleZone = all.SingleZone o.AvailabilityZones = all.AvailabilityZones - if all.Backup != nil && all.Backup.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Backup != nil && all.Backup.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Backup = all.Backup diff --git a/api/kbcloud/admin/model_recycle_bin_cluster_list.go b/api/kbcloud/admin/model_recycle_bin_cluster_list.go index 6142eb76..1358b771 100644 --- a/api/kbcloud/admin/model_recycle_bin_cluster_list.go +++ b/api/kbcloud/admin/model_recycle_bin_cluster_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RecycleBinClusterList recycleBinClusterList is a list of KubeBlocks clusters in the recycle bin + + +// RecycleBinClusterList recycleBinClusterList is a list of KubeBlocks clusters in the recycle bin type RecycleBinClusterList struct { // Items is the KubeBlocks cluster objects in the recycleBinClusterList Items []RecycleBinClusterListItem `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRecycleBinClusterList instantiates a new RecycleBinClusterList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewRecycleBinClusterListWithDefaults() *RecycleBinClusterList { this := RecycleBinClusterList{} return &this } - // GetItems returns the Items field value. func (o *RecycleBinClusterList) GetItems() []RecycleBinClusterListItem { if o == nil { @@ -60,6 +65,8 @@ func (o *RecycleBinClusterList) SetItems(v []RecycleBinClusterListItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RecycleBinClusterList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *RecycleBinClusterList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_recycle_bin_cluster_list_item.go b/api/kbcloud/admin/model_recycle_bin_cluster_list_item.go index 01c394bf..c7d5762d 100644 --- a/api/kbcloud/admin/model_recycle_bin_cluster_list_item.go +++ b/api/kbcloud/admin/model_recycle_bin_cluster_list_item.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RecycleBinClusterListItem information of kubeblocks cluster in recycle bin + + +// RecycleBinClusterListItem information of kubeblocks cluster in recycle bin type RecycleBinClusterListItem struct { // Cloud Provider CloudProvider string `json:"cloudProvider"` @@ -50,10 +54,11 @@ type RecycleBinClusterListItem struct { // ExpiredAt is a timestamp representing the server time when this object will be expired, and deleted automatically. ExpiredAt *time.Time `json:"expiredAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRecycleBinClusterListItem instantiates a new RecycleBinClusterListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -78,7 +83,6 @@ func NewRecycleBinClusterListItemWithDefaults() *RecycleBinClusterListItem { this := RecycleBinClusterListItem{} return &this } - // GetCloudProvider returns the CloudProvider field value. func (o *RecycleBinClusterListItem) GetCloudProvider() string { if o == nil { @@ -102,6 +106,7 @@ func (o *RecycleBinClusterListItem) SetCloudProvider(v string) { o.CloudProvider = v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -130,6 +135,7 @@ func (o *RecycleBinClusterListItem) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -158,6 +164,7 @@ func (o *RecycleBinClusterListItem) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -186,6 +193,7 @@ func (o *RecycleBinClusterListItem) SetDisplayName(v string) { o.DisplayName = &v } + // GetEngine returns the Engine field value. func (o *RecycleBinClusterListItem) GetEngine() string { if o == nil { @@ -209,6 +217,7 @@ func (o *RecycleBinClusterListItem) SetEngine(v string) { o.Engine = v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetMode() string { if o == nil || o.Mode == nil { @@ -237,6 +246,7 @@ func (o *RecycleBinClusterListItem) SetMode(v string) { o.Mode = &v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *RecycleBinClusterListItem) GetEnvironmentName() string { if o == nil { @@ -260,6 +270,7 @@ func (o *RecycleBinClusterListItem) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetId returns the Id field value. func (o *RecycleBinClusterListItem) GetId() string { if o == nil { @@ -283,6 +294,7 @@ func (o *RecycleBinClusterListItem) SetId(v string) { o.Id = v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -311,6 +323,7 @@ func (o *RecycleBinClusterListItem) SetClusterId(v string) { o.ClusterId = &v } + // GetName returns the Name field value. func (o *RecycleBinClusterListItem) GetName() string { if o == nil { @@ -334,6 +347,7 @@ func (o *RecycleBinClusterListItem) SetName(v string) { o.Name = v } + // GetVersion returns the Version field value. func (o *RecycleBinClusterListItem) GetVersion() string { if o == nil { @@ -357,6 +371,7 @@ func (o *RecycleBinClusterListItem) SetVersion(v string) { o.Version = v } + // GetClassCode returns the ClassCode field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetClassCode() string { if o == nil || o.ClassCode == nil { @@ -385,6 +400,7 @@ func (o *RecycleBinClusterListItem) SetClassCode(v string) { o.ClassCode = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetStorage() string { if o == nil || o.Storage == nil { @@ -413,6 +429,7 @@ func (o *RecycleBinClusterListItem) SetStorage(v string) { o.Storage = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -441,6 +458,7 @@ func (o *RecycleBinClusterListItem) SetOrgName(v string) { o.OrgName = &v } + // GetState returns the State field value. func (o *RecycleBinClusterListItem) GetState() string { if o == nil { @@ -464,6 +482,7 @@ func (o *RecycleBinClusterListItem) SetState(v string) { o.State = v } + // GetStoppedAt returns the StoppedAt field value. func (o *RecycleBinClusterListItem) GetStoppedAt() time.Time { if o == nil { @@ -487,6 +506,7 @@ func (o *RecycleBinClusterListItem) SetStoppedAt(v time.Time) { o.StoppedAt = v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -515,6 +535,7 @@ func (o *RecycleBinClusterListItem) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetExpiredAt returns the ExpiredAt field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetExpiredAt() time.Time { if o == nil || o.ExpiredAt == nil { @@ -543,6 +564,8 @@ func (o *RecycleBinClusterListItem) SetExpiredAt(v time.Time) { o.ExpiredAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RecycleBinClusterListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -609,24 +632,24 @@ func (o RecycleBinClusterListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RecycleBinClusterListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CloudProvider *string `json:"cloudProvider"` - CloudRegion *string `json:"cloudRegion,omitempty"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Engine *string `json:"engine"` - Mode *string `json:"mode,omitempty"` - EnvironmentName *string `json:"environmentName"` - Id *string `json:"id"` - ClusterId *string `json:"clusterId,omitempty"` - Name *string `json:"name"` - Version *string `json:"version"` - ClassCode *string `json:"classCode,omitempty"` - Storage *string `json:"storage,omitempty"` - OrgName *string `json:"orgName,omitempty"` - State *string `json:"state"` - StoppedAt *time.Time `json:"stoppedAt"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` + CloudProvider *string `json:"cloudProvider"` + CloudRegion *string `json:"cloudRegion,omitempty"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Engine *string `json:"engine"` + Mode *string `json:"mode,omitempty"` + EnvironmentName *string `json:"environmentName"` + Id *string `json:"id"` + ClusterId *string `json:"clusterId,omitempty"` + Name *string `json:"name"` + Version *string `json:"version"` + ClassCode *string `json:"classCode,omitempty"` + Storage *string `json:"storage,omitempty"` + OrgName *string `json:"orgName,omitempty"` + State *string `json:"state"` + StoppedAt *time.Time `json:"stoppedAt"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -657,7 +680,7 @@ func (o *RecycleBinClusterListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cloudProvider", "cloudRegion", "availabilityZones", "displayName", "engine", "mode", "environmentName", "id", "clusterId", "name", "version", "classCode", "storage", "orgName", "state", "stoppedAt", "createdAt", "expiredAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "cloudProvider", "cloudRegion", "availabilityZones", "displayName", "engine", "mode", "environmentName", "id", "clusterId", "name", "version", "classCode", "storage", "orgName", "state", "stoppedAt", "createdAt", "expiredAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_region.go b/api/kbcloud/admin/model_region.go index d0eed32e..601c5edf 100644 --- a/api/kbcloud/admin/model_region.go +++ b/api/kbcloud/admin/model_region.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Region The region that the cloud provider has. + + +// Region The region that the cloud provider has. type Region struct { // The name of the region. Name string `json:"name"` @@ -32,10 +36,11 @@ type Region struct { // The time when the region was last updated. UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegion instantiates a new Region object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -61,7 +66,6 @@ func NewRegionWithDefaults() *Region { this := Region{} return &this } - // GetName returns the Name field value. func (o *Region) GetName() string { if o == nil { @@ -85,6 +89,7 @@ func (o *Region) SetName(v string) { o.Name = v } + // GetNameCn returns the NameCn field value. func (o *Region) GetNameCn() string { if o == nil { @@ -108,6 +113,7 @@ func (o *Region) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *Region) GetNameEn() string { if o == nil { @@ -131,6 +137,7 @@ func (o *Region) SetNameEn(v string) { o.NameEn = v } + // GetProvider returns the Provider field value. func (o *Region) GetProvider() string { if o == nil { @@ -154,6 +161,7 @@ func (o *Region) SetProvider(v string) { o.Provider = v } + // GetGroup returns the Group field value. func (o *Region) GetGroup() string { if o == nil { @@ -177,6 +185,7 @@ func (o *Region) SetGroup(v string) { o.Group = v } + // GetEnabled returns the Enabled field value. func (o *Region) GetEnabled() bool { if o == nil { @@ -200,6 +209,7 @@ func (o *Region) SetEnabled(v bool) { o.Enabled = v } + // GetZoneCount returns the ZoneCount field value. func (o *Region) GetZoneCount() int32 { if o == nil { @@ -223,6 +233,7 @@ func (o *Region) SetZoneCount(v int32) { o.ZoneCount = v } + // GetCreatedAt returns the CreatedAt field value. func (o *Region) GetCreatedAt() time.Time { if o == nil { @@ -246,6 +257,7 @@ func (o *Region) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Region) GetUpdatedAt() time.Time { if o == nil { @@ -269,6 +281,8 @@ func (o *Region) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o Region) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -302,13 +316,13 @@ func (o Region) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Region) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Provider *string `json:"provider"` - Group *string `json:"group"` - Enabled *bool `json:"enabled"` - ZoneCount *int32 `json:"zoneCount"` + Name *string `json:"name"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Provider *string `json:"provider"` + Group *string `json:"group"` + Enabled *bool `json:"enabled"` + ZoneCount *int32 `json:"zoneCount"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` }{} @@ -344,7 +358,7 @@ func (o *Region) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "nameCN", "nameEN", "provider", "group", "enabled", "zoneCount", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "nameCN", "nameEN", "provider", "group", "enabled", "zoneCount", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_region_create.go b/api/kbcloud/admin/model_region_create.go index 59dc8e3b..2e4d375b 100644 --- a/api/kbcloud/admin/model_region_create.go +++ b/api/kbcloud/admin/model_region_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RegionCreate The region that needs to be created. + + +// RegionCreate The region that needs to be created. type RegionCreate struct { // The name of the region. Name string `json:"name"` @@ -23,10 +28,11 @@ type RegionCreate struct { // The group of the region. Group string `json:"group"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegionCreate instantiates a new RegionCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -48,7 +54,6 @@ func NewRegionCreateWithDefaults() *RegionCreate { this := RegionCreate{} return &this } - // GetName returns the Name field value. func (o *RegionCreate) GetName() string { if o == nil { @@ -72,6 +77,7 @@ func (o *RegionCreate) SetName(v string) { o.Name = v } + // GetNameCn returns the NameCn field value. func (o *RegionCreate) GetNameCn() string { if o == nil { @@ -95,6 +101,7 @@ func (o *RegionCreate) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *RegionCreate) GetNameEn() string { if o == nil { @@ -118,6 +125,7 @@ func (o *RegionCreate) SetNameEn(v string) { o.NameEn = v } + // GetEnabled returns the Enabled field value. func (o *RegionCreate) GetEnabled() bool { if o == nil { @@ -141,6 +149,7 @@ func (o *RegionCreate) SetEnabled(v bool) { o.Enabled = v } + // GetGroup returns the Group field value. func (o *RegionCreate) GetGroup() string { if o == nil { @@ -164,6 +173,8 @@ func (o *RegionCreate) SetGroup(v string) { o.Group = v } + + // MarshalJSON serializes the struct using spec logic. func (o RegionCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -185,11 +196,11 @@ func (o RegionCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RegionCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Enabled *bool `json:"enabled"` - Group *string `json:"group"` + Name *string `json:"name"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Enabled *bool `json:"enabled"` + Group *string `json:"group"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -211,7 +222,7 @@ func (o *RegionCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "nameCN", "nameEN", "enabled", "group"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "nameCN", "nameEN", "enabled", "group", }) } else { return err } diff --git a/api/kbcloud/admin/model_region_group.go b/api/kbcloud/admin/model_region_group.go index d7b0ef85..0cb7b9d9 100644 --- a/api/kbcloud/admin/model_region_group.go +++ b/api/kbcloud/admin/model_region_group.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RegionGroup The region group + + +// RegionGroup The region group type RegionGroup struct { // The name of the region group Group string `json:"group"` @@ -21,10 +26,11 @@ type RegionGroup struct { // The name of the provider. Provider string `json:"provider"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegionGroup instantiates a new RegionGroup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewRegionGroupWithDefaults() *RegionGroup { this := RegionGroup{} return &this } - // GetGroup returns the Group field value. func (o *RegionGroup) GetGroup() string { if o == nil { @@ -69,6 +74,7 @@ func (o *RegionGroup) SetGroup(v string) { o.Group = v } + // GetGroupCn returns the GroupCn field value. func (o *RegionGroup) GetGroupCn() string { if o == nil { @@ -92,6 +98,7 @@ func (o *RegionGroup) SetGroupCn(v string) { o.GroupCn = v } + // GetGroupEn returns the GroupEn field value. func (o *RegionGroup) GetGroupEn() string { if o == nil { @@ -115,6 +122,7 @@ func (o *RegionGroup) SetGroupEn(v string) { o.GroupEn = v } + // GetProvider returns the Provider field value. func (o *RegionGroup) GetProvider() string { if o == nil { @@ -138,6 +146,8 @@ func (o *RegionGroup) SetProvider(v string) { o.Provider = v } + + // MarshalJSON serializes the struct using spec logic. func (o RegionGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,9 +168,9 @@ func (o RegionGroup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RegionGroup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Group *string `json:"group"` - GroupCn *string `json:"groupCN"` - GroupEn *string `json:"groupEN"` + Group *string `json:"group"` + GroupCn *string `json:"groupCN"` + GroupEn *string `json:"groupEN"` Provider *string `json:"provider"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -180,7 +190,7 @@ func (o *RegionGroup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"group", "groupCN", "groupEN", "provider"}) + common.DeleteKeys(additionalProperties, &[]string{ "group", "groupCN", "groupEN", "provider", }) } else { return err } diff --git a/api/kbcloud/admin/model_region_group_create.go b/api/kbcloud/admin/model_region_group_create.go index c7c6d6f0..9f0339f2 100644 --- a/api/kbcloud/admin/model_region_group_create.go +++ b/api/kbcloud/admin/model_region_group_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RegionGroupCreate The region group that needs to be created. + + +// RegionGroupCreate The region group that needs to be created. type RegionGroupCreate struct { // The name of the region group. Group string `json:"group"` @@ -19,10 +24,11 @@ type RegionGroupCreate struct { // The English name of the region group. GroupEn string `json:"groupEN"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegionGroupCreate instantiates a new RegionGroupCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewRegionGroupCreateWithDefaults() *RegionGroupCreate { this := RegionGroupCreate{} return &this } - // GetGroup returns the Group field value. func (o *RegionGroupCreate) GetGroup() string { if o == nil { @@ -66,6 +71,7 @@ func (o *RegionGroupCreate) SetGroup(v string) { o.Group = v } + // GetGroupCn returns the GroupCn field value. func (o *RegionGroupCreate) GetGroupCn() string { if o == nil { @@ -89,6 +95,7 @@ func (o *RegionGroupCreate) SetGroupCn(v string) { o.GroupCn = v } + // GetGroupEn returns the GroupEn field value. func (o *RegionGroupCreate) GetGroupEn() string { if o == nil { @@ -112,6 +119,8 @@ func (o *RegionGroupCreate) SetGroupEn(v string) { o.GroupEn = v } + + // MarshalJSON serializes the struct using spec logic. func (o RegionGroupCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -131,7 +140,7 @@ func (o RegionGroupCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RegionGroupCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Group *string `json:"group"` + Group *string `json:"group"` GroupCn *string `json:"groupCN"` GroupEn *string `json:"groupEN"` }{} @@ -149,7 +158,7 @@ func (o *RegionGroupCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"group", "groupCN", "groupEN"}) + common.DeleteKeys(additionalProperties, &[]string{ "group", "groupCN", "groupEN", }) } else { return err } diff --git a/api/kbcloud/admin/model_region_group_list.go b/api/kbcloud/admin/model_region_group_list.go index 95b73a1b..d4e59612 100644 --- a/api/kbcloud/admin/model_region_group_list.go +++ b/api/kbcloud/admin/model_region_group_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RegionGroupList The list of region group. +// RegionGroupList The list of region group. type RegionGroupList struct { // The list of region group. Items []RegionGroup `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegionGroupList instantiates a new RegionGroupList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewRegionGroupListWithDefaults() *RegionGroupList { this := RegionGroupList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *RegionGroupList) GetItems() []RegionGroup { if o == nil || o.Items == nil { @@ -60,6 +69,8 @@ func (o *RegionGroupList) SetItems(v []RegionGroup) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RegionGroupList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *RegionGroupList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_region_group_update.go b/api/kbcloud/admin/model_region_group_update.go index 06603ad6..4fd3d4c6 100644 --- a/api/kbcloud/admin/model_region_group_update.go +++ b/api/kbcloud/admin/model_region_group_update.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RegionGroupUpdate The region group that needs to be updated. +// RegionGroupUpdate The region group that needs to be updated. type RegionGroupUpdate struct { // The Chinese name of the region group. GroupCn *string `json:"groupCN,omitempty"` // The English name of the region group. GroupEn *string `json:"groupEN,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegionGroupUpdate instantiates a new RegionGroupUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewRegionGroupUpdateWithDefaults() *RegionGroupUpdate { this := RegionGroupUpdate{} return &this } - // GetGroupCn returns the GroupCn field value if set, zero value otherwise. func (o *RegionGroupUpdate) GetGroupCn() string { if o == nil || o.GroupCn == nil { @@ -62,6 +71,7 @@ func (o *RegionGroupUpdate) SetGroupCn(v string) { o.GroupCn = &v } + // GetGroupEn returns the GroupEn field value if set, zero value otherwise. func (o *RegionGroupUpdate) GetGroupEn() string { if o == nil || o.GroupEn == nil { @@ -90,6 +100,8 @@ func (o *RegionGroupUpdate) SetGroupEn(v string) { o.GroupEn = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RegionGroupUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -120,7 +132,7 @@ func (o *RegionGroupUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"groupCN", "groupEN"}) + common.DeleteKeys(additionalProperties, &[]string{ "groupCN", "groupEN", }) } else { return err } diff --git a/api/kbcloud/admin/model_region_list.go b/api/kbcloud/admin/model_region_list.go index 83c7c236..46405355 100644 --- a/api/kbcloud/admin/model_region_list.go +++ b/api/kbcloud/admin/model_region_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RegionList The list of regions. +// RegionList The list of regions. type RegionList struct { // The list of regions. Items []Region `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegionList instantiates a new RegionList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewRegionListWithDefaults() *RegionList { this := RegionList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *RegionList) GetItems() []Region { if o == nil || o.Items == nil { @@ -60,6 +69,8 @@ func (o *RegionList) SetItems(v []Region) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RegionList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *RegionList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_region_update.go b/api/kbcloud/admin/model_region_update.go index d1117623..edfe0848 100644 --- a/api/kbcloud/admin/model_region_update.go +++ b/api/kbcloud/admin/model_region_update.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RegionUpdate The region that needs to be updated. + + +// RegionUpdate The region that needs to be updated. type RegionUpdate struct { // The Chinese name of the region. NameCn string `json:"nameCN"` @@ -21,10 +26,11 @@ type RegionUpdate struct { // Whether the region is enabled. Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegionUpdate instantiates a new RegionUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewRegionUpdateWithDefaults() *RegionUpdate { this := RegionUpdate{} return &this } - // GetNameCn returns the NameCn field value. func (o *RegionUpdate) GetNameCn() string { if o == nil { @@ -69,6 +74,7 @@ func (o *RegionUpdate) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *RegionUpdate) GetNameEn() string { if o == nil { @@ -92,6 +98,7 @@ func (o *RegionUpdate) SetNameEn(v string) { o.NameEn = v } + // GetGroup returns the Group field value. func (o *RegionUpdate) GetGroup() string { if o == nil { @@ -115,6 +122,7 @@ func (o *RegionUpdate) SetGroup(v string) { o.Group = v } + // GetEnabled returns the Enabled field value. func (o *RegionUpdate) GetEnabled() bool { if o == nil { @@ -138,6 +146,8 @@ func (o *RegionUpdate) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o RegionUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +168,10 @@ func (o RegionUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RegionUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Group *string `json:"group"` - Enabled *bool `json:"enabled"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Group *string `json:"group"` + Enabled *bool `json:"enabled"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *RegionUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"nameCN", "nameEN", "group", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "nameCN", "nameEN", "group", "enabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_register.go b/api/kbcloud/admin/model_register.go index 2d1d9798..7922b76e 100644 --- a/api/kbcloud/admin/model_register.go +++ b/api/kbcloud/admin/model_register.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Register Register manifest for environment + + +// Register Register manifest for environment type Register struct { // Configuration for privisoining environment resources Type EnvironmentRegisterType `json:"type"` @@ -19,10 +24,11 @@ type Register struct { // The base64 encoded kubeconfig file contents to connect to this environment Kubeconfig *string `json:"kubeconfig,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegister instantiates a new Register object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewRegisterWithDefaults() *Register { this := Register{} return &this } - // GetType returns the Type field value. func (o *Register) GetType() EnvironmentRegisterType { if o == nil { @@ -64,6 +69,7 @@ func (o *Register) SetType(v EnvironmentRegisterType) { o.Type = v } + // GetIac returns the Iac field value if set, zero value otherwise. func (o *Register) GetIac() Iac { if o == nil || o.Iac == nil { @@ -92,6 +98,7 @@ func (o *Register) SetIac(v Iac) { o.Iac = &v } + // GetKubeconfig returns the Kubeconfig field value if set, zero value otherwise. func (o *Register) GetKubeconfig() string { if o == nil || o.Kubeconfig == nil { @@ -120,6 +127,8 @@ func (o *Register) SetKubeconfig(v string) { o.Kubeconfig = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Register) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,9 +152,9 @@ func (o Register) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Register) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Type *EnvironmentRegisterType `json:"type"` - Iac *Iac `json:"iac,omitempty"` - Kubeconfig *string `json:"kubeconfig,omitempty"` + Type *EnvironmentRegisterType `json:"type"` + Iac *Iac `json:"iac,omitempty"` + Kubeconfig *string `json:"kubeconfig,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -155,7 +164,7 @@ func (o *Register) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"type", "iac", "kubeconfig"}) + common.DeleteKeys(additionalProperties, &[]string{ "type", "iac", "kubeconfig", }) } else { return err } @@ -166,7 +175,7 @@ func (o *Register) UnmarshalJSON(bytes []byte) (err error) { } else { o.Type = *all.Type } - if all.Iac != nil && all.Iac.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Iac != nil && all.Iac.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Iac = all.Iac diff --git a/api/kbcloud/admin/model_resource_stats.go b/api/kbcloud/admin/model_resource_stats.go index ef3ac37a..3d7f8e27 100644 --- a/api/kbcloud/admin/model_resource_stats.go +++ b/api/kbcloud/admin/model_resource_stats.go @@ -2,42 +2,43 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ResourceStats ResourceStats holds the requests, limits, and available stats for a resource. + + +// ResourceStats ResourceStats holds the requests, limits, and available stats for a resource. type ResourceStats struct { // The amount of CPU or Memory resources that are available on the node. Unit is GiB for memory and Cores for CPU. - Allocatable float64 `json:"allocatable"` + Allocatable *float64 `json:"allocatable,omitempty"` // The maximum number of CPU or Memory resources pods are allowed to use on the node. Unit is GiB for memory and Cores for CPU - Limits float64 `json:"limits"` + Limits *float64 `json:"limits,omitempty"` // The number of CPU or Memory resources requested by pods running on the node. Unit is GiB for memory and Cores for CPU. - Requests float64 `json:"requests"` + Requests *float64 `json:"requests,omitempty"` // The amount of CPU or Memory resources that are already used on the node. Unit is GiB for memory and Cores for CPU. - Usage float64 `json:"usage"` + Usage *float64 `json:"usage,omitempty"` // The total amount of physical resources available on the node. Unit is GiB for memory and Cores for CPU. - Capacity float64 `json:"capacity"` + Capacity *float64 `json:"capacity,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewResourceStats instantiates a new ResourceStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewResourceStats(allocatable float64, limits float64, requests float64, usage float64, capacity float64) *ResourceStats { +func NewResourceStats() *ResourceStats { this := ResourceStats{} - this.Allocatable = allocatable - this.Limits = limits - this.Requests = requests - this.Usage = usage - this.Capacity = capacity return &this } @@ -48,133 +49,173 @@ func NewResourceStatsWithDefaults() *ResourceStats { this := ResourceStats{} return &this } - -// GetAllocatable returns the Allocatable field value. +// GetAllocatable returns the Allocatable field value if set, zero value otherwise. func (o *ResourceStats) GetAllocatable() float64 { - if o == nil { + if o == nil || o.Allocatable == nil { var ret float64 return ret } - return o.Allocatable + return *o.Allocatable } -// GetAllocatableOk returns a tuple with the Allocatable field value +// GetAllocatableOk returns a tuple with the Allocatable field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ResourceStats) GetAllocatableOk() (*float64, bool) { - if o == nil { + if o == nil || o.Allocatable == nil { return nil, false } - return &o.Allocatable, true + return o.Allocatable, true +} + +// HasAllocatable returns a boolean if a field has been set. +func (o *ResourceStats) HasAllocatable() bool { + return o != nil && o.Allocatable != nil } -// SetAllocatable sets field value. +// SetAllocatable gets a reference to the given float64 and assigns it to the Allocatable field. func (o *ResourceStats) SetAllocatable(v float64) { - o.Allocatable = v + o.Allocatable = &v } -// GetLimits returns the Limits field value. + +// GetLimits returns the Limits field value if set, zero value otherwise. func (o *ResourceStats) GetLimits() float64 { - if o == nil { + if o == nil || o.Limits == nil { var ret float64 return ret } - return o.Limits + return *o.Limits } -// GetLimitsOk returns a tuple with the Limits field value +// GetLimitsOk returns a tuple with the Limits field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ResourceStats) GetLimitsOk() (*float64, bool) { - if o == nil { + if o == nil || o.Limits == nil { return nil, false } - return &o.Limits, true + return o.Limits, true +} + +// HasLimits returns a boolean if a field has been set. +func (o *ResourceStats) HasLimits() bool { + return o != nil && o.Limits != nil } -// SetLimits sets field value. +// SetLimits gets a reference to the given float64 and assigns it to the Limits field. func (o *ResourceStats) SetLimits(v float64) { - o.Limits = v + o.Limits = &v } -// GetRequests returns the Requests field value. + +// GetRequests returns the Requests field value if set, zero value otherwise. func (o *ResourceStats) GetRequests() float64 { - if o == nil { + if o == nil || o.Requests == nil { var ret float64 return ret } - return o.Requests + return *o.Requests } -// GetRequestsOk returns a tuple with the Requests field value +// GetRequestsOk returns a tuple with the Requests field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ResourceStats) GetRequestsOk() (*float64, bool) { - if o == nil { + if o == nil || o.Requests == nil { return nil, false } - return &o.Requests, true + return o.Requests, true } -// SetRequests sets field value. +// HasRequests returns a boolean if a field has been set. +func (o *ResourceStats) HasRequests() bool { + return o != nil && o.Requests != nil +} + +// SetRequests gets a reference to the given float64 and assigns it to the Requests field. func (o *ResourceStats) SetRequests(v float64) { - o.Requests = v + o.Requests = &v } -// GetUsage returns the Usage field value. + +// GetUsage returns the Usage field value if set, zero value otherwise. func (o *ResourceStats) GetUsage() float64 { - if o == nil { + if o == nil || o.Usage == nil { var ret float64 return ret } - return o.Usage + return *o.Usage } -// GetUsageOk returns a tuple with the Usage field value +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ResourceStats) GetUsageOk() (*float64, bool) { - if o == nil { + if o == nil || o.Usage == nil { return nil, false } - return &o.Usage, true + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *ResourceStats) HasUsage() bool { + return o != nil && o.Usage != nil } -// SetUsage sets field value. +// SetUsage gets a reference to the given float64 and assigns it to the Usage field. func (o *ResourceStats) SetUsage(v float64) { - o.Usage = v + o.Usage = &v } -// GetCapacity returns the Capacity field value. + +// GetCapacity returns the Capacity field value if set, zero value otherwise. func (o *ResourceStats) GetCapacity() float64 { - if o == nil { + if o == nil || o.Capacity == nil { var ret float64 return ret } - return o.Capacity + return *o.Capacity } -// GetCapacityOk returns a tuple with the Capacity field value +// GetCapacityOk returns a tuple with the Capacity field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ResourceStats) GetCapacityOk() (*float64, bool) { - if o == nil { + if o == nil || o.Capacity == nil { return nil, false } - return &o.Capacity, true + return o.Capacity, true +} + +// HasCapacity returns a boolean if a field has been set. +func (o *ResourceStats) HasCapacity() bool { + return o != nil && o.Capacity != nil } -// SetCapacity sets field value. +// SetCapacity gets a reference to the given float64 and assigns it to the Capacity field. func (o *ResourceStats) SetCapacity(v float64) { - o.Capacity = v + o.Capacity = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ResourceStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return common.Marshal(o.UnparsedObject) } - toSerialize["allocatable"] = o.Allocatable - toSerialize["limits"] = o.Limits - toSerialize["requests"] = o.Requests - toSerialize["usage"] = o.Usage - toSerialize["capacity"] = o.Capacity + if o.Allocatable != nil { + toSerialize["allocatable"] = o.Allocatable + } + if o.Limits != nil { + toSerialize["limits"] = o.Limits + } + if o.Requests != nil { + toSerialize["requests"] = o.Requests + } + if o.Usage != nil { + toSerialize["usage"] = o.Usage + } + if o.Capacity != nil { + toSerialize["capacity"] = o.Capacity + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -185,41 +226,26 @@ func (o ResourceStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ResourceStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Allocatable *float64 `json:"allocatable"` - Limits *float64 `json:"limits"` - Requests *float64 `json:"requests"` - Usage *float64 `json:"usage"` - Capacity *float64 `json:"capacity"` + Allocatable *float64 `json:"allocatable,omitempty"` + Limits *float64 `json:"limits,omitempty"` + Requests *float64 `json:"requests,omitempty"` + Usage *float64 `json:"usage,omitempty"` + Capacity *float64 `json:"capacity,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } - if all.Allocatable == nil { - return fmt.Errorf("required field allocatable missing") - } - if all.Limits == nil { - return fmt.Errorf("required field limits missing") - } - if all.Requests == nil { - return fmt.Errorf("required field requests missing") - } - if all.Usage == nil { - return fmt.Errorf("required field usage missing") - } - if all.Capacity == nil { - return fmt.Errorf("required field capacity missing") - } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"allocatable", "limits", "requests", "usage", "capacity"}) + common.DeleteKeys(additionalProperties, &[]string{ "allocatable", "limits", "requests", "usage", "capacity", }) } else { return err } - o.Allocatable = *all.Allocatable - o.Limits = *all.Limits - o.Requests = *all.Requests - o.Usage = *all.Usage - o.Capacity = *all.Capacity + o.Allocatable = all.Allocatable + o.Limits = all.Limits + o.Requests = all.Requests + o.Usage = all.Usage + o.Capacity = all.Capacity if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/kbcloud/admin/model_resource_stats_instance_type.go b/api/kbcloud/admin/model_resource_stats_instance_type.go index 6488bbfb..7b5b5adb 100644 --- a/api/kbcloud/admin/model_resource_stats_instance_type.go +++ b/api/kbcloud/admin/model_resource_stats_instance_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // ResourceStatsInstanceType Type of the instance, choose cluster or system type ResourceStatsInstanceType string // List of ResourceStatsInstanceType. const ( ResourceStatsInstanceTypeCluster ResourceStatsInstanceType = "cluster" - ResourceStatsInstanceTypeSystem ResourceStatsInstanceType = "system" + ResourceStatsInstanceTypeSystem ResourceStatsInstanceType = "system" ) var allowedResourceStatsInstanceTypeEnumValues = []ResourceStatsInstanceType{ diff --git a/api/kbcloud/admin/model_restore.go b/api/kbcloud/admin/model_restore.go index 4d2d021f..02ecb981 100644 --- a/api/kbcloud/admin/model_restore.go +++ b/api/kbcloud/admin/model_restore.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Restore create a KubeBlocks restore API + + +// Restore create a KubeBlocks restore API type Restore struct { // organization name OrgName *string `json:"orgName,omitempty"` @@ -22,8 +26,8 @@ type Restore struct { // component name of cluster ComponentName string `json:"componentName"` // target pod name - TargetPodName *string `json:"targetPodName,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` + TargetPodName *string `json:"targetPodName,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` // kubeBlocks restore name Name *string `json:"name,omitempty"` // restore parameters to inject env of the restore CR. @@ -33,10 +37,11 @@ type Restore struct { // restore status Status *RestoreStatus `json:"status,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestore instantiates a new Restore object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +61,6 @@ func NewRestoreWithDefaults() *Restore { this := Restore{} return &this } - // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *Restore) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -85,6 +89,7 @@ func (o *Restore) SetOrgName(v string) { o.OrgName = &v } + // GetBackupName returns the BackupName field value. func (o *Restore) GetBackupName() string { if o == nil { @@ -108,6 +113,7 @@ func (o *Restore) SetBackupName(v string) { o.BackupName = v } + // GetClusterName returns the ClusterName field value. func (o *Restore) GetClusterName() string { if o == nil { @@ -131,6 +137,7 @@ func (o *Restore) SetClusterName(v string) { o.ClusterName = v } + // GetComponentName returns the ComponentName field value. func (o *Restore) GetComponentName() string { if o == nil { @@ -154,6 +161,7 @@ func (o *Restore) SetComponentName(v string) { o.ComponentName = v } + // GetTargetPodName returns the TargetPodName field value if set, zero value otherwise. func (o *Restore) GetTargetPodName() string { if o == nil || o.TargetPodName == nil { @@ -182,6 +190,7 @@ func (o *Restore) SetTargetPodName(v string) { o.TargetPodName = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Restore) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -210,6 +219,7 @@ func (o *Restore) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Restore) GetName() string { if o == nil || o.Name == nil { @@ -238,6 +248,7 @@ func (o *Restore) SetName(v string) { o.Name = &v } + // GetParameters returns the Parameters field value if set, zero value otherwise. func (o *Restore) GetParameters() RestoreParameters { if o == nil || o.Parameters == nil { @@ -266,6 +277,7 @@ func (o *Restore) SetParameters(v RestoreParameters) { o.Parameters = &v } + // GetRestoreTime returns the RestoreTime field value if set, zero value otherwise. func (o *Restore) GetRestoreTime() string { if o == nil || o.RestoreTime == nil { @@ -294,6 +306,7 @@ func (o *Restore) SetRestoreTime(v string) { o.RestoreTime = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Restore) GetStatus() RestoreStatus { if o == nil || o.Status == nil { @@ -322,6 +335,8 @@ func (o *Restore) SetStatus(v RestoreStatus) { o.Status = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Restore) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -366,16 +381,16 @@ func (o Restore) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Restore) UnmarshalJSON(bytes []byte) (err error) { all := struct { - OrgName *string `json:"orgName,omitempty"` - BackupName *string `json:"backupName"` - ClusterName *string `json:"clusterName"` - ComponentName *string `json:"componentName"` - TargetPodName *string `json:"targetPodName,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Name *string `json:"name,omitempty"` - Parameters *RestoreParameters `json:"parameters,omitempty"` - RestoreTime *string `json:"restoreTime,omitempty"` - Status *RestoreStatus `json:"status,omitempty"` + OrgName *string `json:"orgName,omitempty"` + BackupName *string `json:"backupName"` + ClusterName *string `json:"clusterName"` + ComponentName *string `json:"componentName"` + TargetPodName *string `json:"targetPodName,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Name *string `json:"name,omitempty"` + Parameters *RestoreParameters `json:"parameters,omitempty"` + RestoreTime *string `json:"restoreTime,omitempty"` + Status *RestoreStatus `json:"status,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -391,7 +406,7 @@ func (o *Restore) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"orgName", "backupName", "clusterName", "componentName", "targetPodName", "createdAt", "name", "parameters", "restoreTime", "status"}) + common.DeleteKeys(additionalProperties, &[]string{ "orgName", "backupName", "clusterName", "componentName", "targetPodName", "createdAt", "name", "parameters", "restoreTime", "status", }) } else { return err } @@ -404,12 +419,12 @@ func (o *Restore) UnmarshalJSON(bytes []byte) (err error) { o.TargetPodName = all.TargetPodName o.CreatedAt = all.CreatedAt o.Name = all.Name - if all.Parameters != nil && all.Parameters.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Parameters != nil && all.Parameters.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Parameters = all.Parameters o.RestoreTime = all.RestoreTime - if all.Status != nil && all.Status.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Status != nil && all.Status.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Status = all.Status diff --git a/api/kbcloud/admin/model_restore_create.go b/api/kbcloud/admin/model_restore_create.go index 63be1ebb..78e3369e 100644 --- a/api/kbcloud/admin/model_restore_create.go +++ b/api/kbcloud/admin/model_restore_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RestoreCreate RestoreCreate is the payload to restore a KubeBlocks cluster + + +// RestoreCreate RestoreCreate is the payload to restore a KubeBlocks cluster type RestoreCreate struct { // the env name of the target environment to restore EnvironmentName string `json:"environmentName"` @@ -25,10 +30,11 @@ type RestoreCreate struct { // the volume claim restore policy, support values: [Serial, Parallel] VolumeRestorePolicy *VolumeRestorePolicy `json:"volumeRestorePolicy,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreCreate instantiates a new RestoreCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +58,6 @@ func NewRestoreCreateWithDefaults() *RestoreCreate { this.VolumeRestorePolicy = &volumeRestorePolicy return &this } - // GetEnvironmentName returns the EnvironmentName field value. func (o *RestoreCreate) GetEnvironmentName() string { if o == nil { @@ -76,6 +81,7 @@ func (o *RestoreCreate) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetBackupId returns the BackupId field value. func (o *RestoreCreate) GetBackupId() string { if o == nil { @@ -99,6 +105,7 @@ func (o *RestoreCreate) SetBackupId(v string) { o.BackupId = v } + // GetCluster returns the Cluster field value. func (o *RestoreCreate) GetCluster() Cluster { if o == nil { @@ -122,6 +129,7 @@ func (o *RestoreCreate) SetCluster(v Cluster) { o.Cluster = v } + // GetRestoreTimeStr returns the RestoreTimeStr field value if set, zero value otherwise. func (o *RestoreCreate) GetRestoreTimeStr() string { if o == nil || o.RestoreTimeStr == nil { @@ -150,6 +158,7 @@ func (o *RestoreCreate) SetRestoreTimeStr(v string) { o.RestoreTimeStr = &v } + // GetDoReadyRestoreAfterClusterRunning returns the DoReadyRestoreAfterClusterRunning field value if set, zero value otherwise. func (o *RestoreCreate) GetDoReadyRestoreAfterClusterRunning() bool { if o == nil || o.DoReadyRestoreAfterClusterRunning == nil { @@ -178,6 +187,7 @@ func (o *RestoreCreate) SetDoReadyRestoreAfterClusterRunning(v bool) { o.DoReadyRestoreAfterClusterRunning = &v } + // GetVolumeRestorePolicy returns the VolumeRestorePolicy field value if set, zero value otherwise. func (o *RestoreCreate) GetVolumeRestorePolicy() VolumeRestorePolicy { if o == nil || o.VolumeRestorePolicy == nil { @@ -206,6 +216,8 @@ func (o *RestoreCreate) SetVolumeRestorePolicy(v VolumeRestorePolicy) { o.VolumeRestorePolicy = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -234,12 +246,12 @@ func (o RestoreCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RestoreCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EnvironmentName *string `json:"environmentName"` - BackupId *string `json:"backupId"` - Cluster *Cluster `json:"cluster"` - RestoreTimeStr *string `json:"restoreTimeStr,omitempty"` - DoReadyRestoreAfterClusterRunning *bool `json:"doReadyRestoreAfterClusterRunning,omitempty"` - VolumeRestorePolicy *VolumeRestorePolicy `json:"volumeRestorePolicy,omitempty"` + EnvironmentName *string `json:"environmentName"` + BackupId *string `json:"backupId"` + Cluster *Cluster `json:"cluster"` + RestoreTimeStr *string `json:"restoreTimeStr,omitempty"` + DoReadyRestoreAfterClusterRunning *bool `json:"doReadyRestoreAfterClusterRunning,omitempty"` + VolumeRestorePolicy *VolumeRestorePolicy `json:"volumeRestorePolicy,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -255,7 +267,7 @@ func (o *RestoreCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"environmentName", "backupId", "cluster", "restoreTimeStr", "doReadyRestoreAfterClusterRunning", "volumeRestorePolicy"}) + common.DeleteKeys(additionalProperties, &[]string{ "environmentName", "backupId", "cluster", "restoreTimeStr", "doReadyRestoreAfterClusterRunning", "volumeRestorePolicy", }) } else { return err } @@ -269,7 +281,7 @@ func (o *RestoreCreate) UnmarshalJSON(bytes []byte) (err error) { o.Cluster = *all.Cluster o.RestoreTimeStr = all.RestoreTimeStr o.DoReadyRestoreAfterClusterRunning = all.DoReadyRestoreAfterClusterRunning - if all.VolumeRestorePolicy != nil && !all.VolumeRestorePolicy.IsValid() { + if all.VolumeRestorePolicy != nil &&!all.VolumeRestorePolicy.IsValid() { hasInvalidField = true } else { o.VolumeRestorePolicy = all.VolumeRestorePolicy diff --git a/api/kbcloud/admin/model_restore_list.go b/api/kbcloud/admin/model_restore_list.go index 88fae860..4cf8712d 100644 --- a/api/kbcloud/admin/model_restore_list.go +++ b/api/kbcloud/admin/model_restore_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RestoreList restoreList is a list of restore object + + +// RestoreList restoreList is a list of restore object type RestoreList struct { // Items is the list of restore objects in the list Items []Restore `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreList instantiates a new RestoreList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewRestoreListWithDefaults() *RestoreList { this := RestoreList{} return &this } - // GetItems returns the Items field value. func (o *RestoreList) GetItems() []Restore { if o == nil { @@ -60,6 +65,8 @@ func (o *RestoreList) SetItems(v []Restore) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *RestoreList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_restore_log.go b/api/kbcloud/admin/model_restore_log.go index 3ee3adab..a396b605 100644 --- a/api/kbcloud/admin/model_restore_log.go +++ b/api/kbcloud/admin/model_restore_log.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RestoreLog restore workload logs +// RestoreLog restore workload logs type RestoreLog struct { // items is the list of restoreLogByPod objects Items []RestoreLogByPod `json:"items,omitempty"` // restore id RestoreId *string `json:"restoreId,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreLog instantiates a new RestoreLog object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewRestoreLogWithDefaults() *RestoreLog { this := RestoreLog{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *RestoreLog) GetItems() []RestoreLogByPod { if o == nil || o.Items == nil { @@ -62,6 +71,7 @@ func (o *RestoreLog) SetItems(v []RestoreLogByPod) { o.Items = v } + // GetRestoreId returns the RestoreId field value if set, zero value otherwise. func (o *RestoreLog) GetRestoreId() string { if o == nil || o.RestoreId == nil { @@ -90,6 +100,8 @@ func (o *RestoreLog) SetRestoreId(v string) { o.RestoreId = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreLog) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o RestoreLog) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RestoreLog) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items []RestoreLogByPod `json:"items,omitempty"` - RestoreId *string `json:"restoreId,omitempty"` + Items []RestoreLogByPod `json:"items,omitempty"` + RestoreId *string `json:"restoreId,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "restoreId"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "restoreId", }) } else { return err } diff --git a/api/kbcloud/admin/model_restore_log_by_pod.go b/api/kbcloud/admin/model_restore_log_by_pod.go index a4382701..4faa78de 100644 --- a/api/kbcloud/admin/model_restore_log_by_pod.go +++ b/api/kbcloud/admin/model_restore_log_by_pod.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// RestoreLogByPod info of restore workload log + + +// RestoreLogByPod info of restore workload log type RestoreLogByPod struct { // restore pod log Log *string `json:"log,omitempty"` @@ -21,10 +26,11 @@ type RestoreLogByPod struct { // Date/time when the restore pod was created. CreationTimestamp *time.Time `json:"creationTimestamp,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreLogByPod instantiates a new RestoreLogByPod object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewRestoreLogByPodWithDefaults() *RestoreLogByPod { this := RestoreLogByPod{} return &this } - // GetLog returns the Log field value if set, zero value otherwise. func (o *RestoreLogByPod) GetLog() string { if o == nil || o.Log == nil { @@ -70,6 +75,7 @@ func (o *RestoreLogByPod) SetLog(v string) { o.Log = &v } + // GetOwnerObjectKey returns the OwnerObjectKey field value if set, zero value otherwise. func (o *RestoreLogByPod) GetOwnerObjectKey() string { if o == nil || o.OwnerObjectKey == nil { @@ -98,6 +104,7 @@ func (o *RestoreLogByPod) SetOwnerObjectKey(v string) { o.OwnerObjectKey = &v } + // GetPodName returns the PodName field value if set, zero value otherwise. func (o *RestoreLogByPod) GetPodName() string { if o == nil || o.PodName == nil { @@ -126,6 +133,7 @@ func (o *RestoreLogByPod) SetPodName(v string) { o.PodName = &v } + // GetCreationTimestamp returns the CreationTimestamp field value if set, zero value otherwise. func (o *RestoreLogByPod) GetCreationTimestamp() time.Time { if o == nil || o.CreationTimestamp == nil { @@ -154,6 +162,8 @@ func (o *RestoreLogByPod) SetCreationTimestamp(v time.Time) { o.CreationTimestamp = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreLogByPod) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -186,9 +196,9 @@ func (o RestoreLogByPod) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RestoreLogByPod) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Log *string `json:"log,omitempty"` - OwnerObjectKey *string `json:"ownerObjectKey,omitempty"` - PodName *string `json:"podName,omitempty"` + Log *string `json:"log,omitempty"` + OwnerObjectKey *string `json:"ownerObjectKey,omitempty"` + PodName *string `json:"podName,omitempty"` CreationTimestamp *time.Time `json:"creationTimestamp,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -196,7 +206,7 @@ func (o *RestoreLogByPod) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"log", "ownerObjectKey", "podName", "creationTimestamp"}) + common.DeleteKeys(additionalProperties, &[]string{ "log", "ownerObjectKey", "podName", "creationTimestamp", }) } else { return err } diff --git a/api/kbcloud/admin/model_restore_parameters.go b/api/kbcloud/admin/model_restore_parameters.go index f879be79..0384ee80 100644 --- a/api/kbcloud/admin/model_restore_parameters.go +++ b/api/kbcloud/admin/model_restore_parameters.go @@ -2,17 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// RestoreParameters restore parameters to inject env of the restore CR. + + +// RestoreParameters restore parameters to inject env of the restore CR. type RestoreParameters struct { // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreParameters instantiates a new RestoreParameters object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +62,7 @@ func (o *RestoreParameters) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{}) + common.DeleteKeys(additionalProperties, &[]string{ }) } else { return err } diff --git a/api/kbcloud/admin/model_restore_status.go b/api/kbcloud/admin/model_restore_status.go index 791226b9..d8d933aa 100644 --- a/api/kbcloud/admin/model_restore_status.go +++ b/api/kbcloud/admin/model_restore_status.go @@ -2,25 +2,35 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// RestoreStatus restore status + +// RestoreStatus restore status type RestoreStatus struct { Actions []RestoreStatusActionsItem `json:"actions,omitempty"` // completion time - CompletionTimestamp *string `json:"completionTimestamp,omitempty"` - Conditions []RestoreStatusConditionsItem `json:"conditions,omitempty"` + CompletionTimestamp *string `json:"completionTimestamp,omitempty"` + Conditions []RestoreStatusConditionsItem `json:"conditions,omitempty"` // restore phase Phase *string `json:"phase,omitempty"` // start time StartTimestamp *string `json:"startTimestamp,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreStatus instantiates a new RestoreStatus object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewRestoreStatusWithDefaults() *RestoreStatus { this := RestoreStatus{} return &this } - // GetActions returns the Actions field value if set, zero value otherwise. func (o *RestoreStatus) GetActions() []RestoreStatusActionsItem { if o == nil || o.Actions == nil { @@ -66,6 +75,7 @@ func (o *RestoreStatus) SetActions(v []RestoreStatusActionsItem) { o.Actions = v } + // GetCompletionTimestamp returns the CompletionTimestamp field value if set, zero value otherwise. func (o *RestoreStatus) GetCompletionTimestamp() string { if o == nil || o.CompletionTimestamp == nil { @@ -94,6 +104,7 @@ func (o *RestoreStatus) SetCompletionTimestamp(v string) { o.CompletionTimestamp = &v } + // GetConditions returns the Conditions field value if set, zero value otherwise. func (o *RestoreStatus) GetConditions() []RestoreStatusConditionsItem { if o == nil || o.Conditions == nil { @@ -122,6 +133,7 @@ func (o *RestoreStatus) SetConditions(v []RestoreStatusConditionsItem) { o.Conditions = v } + // GetPhase returns the Phase field value if set, zero value otherwise. func (o *RestoreStatus) GetPhase() string { if o == nil || o.Phase == nil { @@ -150,6 +162,7 @@ func (o *RestoreStatus) SetPhase(v string) { o.Phase = &v } + // GetStartTimestamp returns the StartTimestamp field value if set, zero value otherwise. func (o *RestoreStatus) GetStartTimestamp() string { if o == nil || o.StartTimestamp == nil { @@ -178,6 +191,8 @@ func (o *RestoreStatus) SetStartTimestamp(v string) { o.StartTimestamp = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -209,18 +224,18 @@ func (o RestoreStatus) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RestoreStatus) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Actions []RestoreStatusActionsItem `json:"actions,omitempty"` - CompletionTimestamp *string `json:"completionTimestamp,omitempty"` - Conditions []RestoreStatusConditionsItem `json:"conditions,omitempty"` - Phase *string `json:"phase,omitempty"` - StartTimestamp *string `json:"startTimestamp,omitempty"` + Actions []RestoreStatusActionsItem `json:"actions,omitempty"` + CompletionTimestamp *string `json:"completionTimestamp,omitempty"` + Conditions []RestoreStatusConditionsItem `json:"conditions,omitempty"` + Phase *string `json:"phase,omitempty"` + StartTimestamp *string `json:"startTimestamp,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"actions", "completionTimestamp", "conditions", "phase", "startTimestamp"}) + common.DeleteKeys(additionalProperties, &[]string{ "actions", "completionTimestamp", "conditions", "phase", "startTimestamp", }) } else { return err } diff --git a/api/kbcloud/admin/model_restore_status_actions_item.go b/api/kbcloud/admin/model_restore_status_actions_item.go index 15affd37..bd7b9d1f 100644 --- a/api/kbcloud/admin/model_restore_status_actions_item.go +++ b/api/kbcloud/admin/model_restore_status_actions_item.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type RestoreStatusActionsItem struct { Message *string `json:"message,omitempty"` // action name @@ -13,10 +22,11 @@ type RestoreStatusActionsItem struct { // action status, enum values: [Processing, Completed, Failed] Status *string `json:"status,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreStatusActionsItem instantiates a new RestoreStatusActionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewRestoreStatusActionsItemWithDefaults() *RestoreStatusActionsItem { this := RestoreStatusActionsItem{} return &this } - // GetMessage returns the Message field value if set, zero value otherwise. func (o *RestoreStatusActionsItem) GetMessage() string { if o == nil || o.Message == nil { @@ -62,6 +71,7 @@ func (o *RestoreStatusActionsItem) SetMessage(v string) { o.Message = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *RestoreStatusActionsItem) GetName() string { if o == nil || o.Name == nil { @@ -90,6 +100,7 @@ func (o *RestoreStatusActionsItem) SetName(v string) { o.Name = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *RestoreStatusActionsItem) GetStatus() string { if o == nil || o.Status == nil { @@ -118,6 +129,8 @@ func (o *RestoreStatusActionsItem) SetStatus(v string) { o.Status = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreStatusActionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -144,15 +157,15 @@ func (o RestoreStatusActionsItem) MarshalJSON() ([]byte, error) { func (o *RestoreStatusActionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { Message *string `json:"message,omitempty"` - Name *string `json:"name,omitempty"` - Status *string `json:"status,omitempty"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"message", "name", "status"}) + common.DeleteKeys(additionalProperties, &[]string{ "message", "name", "status", }) } else { return err } diff --git a/api/kbcloud/admin/model_restore_status_conditions_item.go b/api/kbcloud/admin/model_restore_status_conditions_item.go index b2fe6adf..f0c94b68 100644 --- a/api/kbcloud/admin/model_restore_status_conditions_item.go +++ b/api/kbcloud/admin/model_restore_status_conditions_item.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type RestoreStatusConditionsItem struct { Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` + Reason *string `json:"reason,omitempty"` // conditionType Type *string `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreStatusConditionsItem instantiates a new RestoreStatusConditionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewRestoreStatusConditionsItemWithDefaults() *RestoreStatusConditionsItem { this := RestoreStatusConditionsItem{} return &this } - // GetMessage returns the Message field value if set, zero value otherwise. func (o *RestoreStatusConditionsItem) GetMessage() string { if o == nil || o.Message == nil { @@ -61,6 +70,7 @@ func (o *RestoreStatusConditionsItem) SetMessage(v string) { o.Message = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *RestoreStatusConditionsItem) GetReason() string { if o == nil || o.Reason == nil { @@ -89,6 +99,7 @@ func (o *RestoreStatusConditionsItem) SetReason(v string) { o.Reason = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *RestoreStatusConditionsItem) GetType() string { if o == nil || o.Type == nil { @@ -117,6 +128,8 @@ func (o *RestoreStatusConditionsItem) SetType(v string) { o.Type = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreStatusConditionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,15 +156,15 @@ func (o RestoreStatusConditionsItem) MarshalJSON() ([]byte, error) { func (o *RestoreStatusConditionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` - Type *string `json:"type,omitempty"` + Reason *string `json:"reason,omitempty"` + Type *string `json:"type,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"message", "reason", "type"}) + common.DeleteKeys(additionalProperties, &[]string{ "message", "reason", "type", }) } else { return err } diff --git a/api/kbcloud/admin/model_result.go b/api/kbcloud/admin/model_result.go index dd7d941e..37ee08d5 100644 --- a/api/kbcloud/admin/model_result.go +++ b/api/kbcloud/admin/model_result.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Result struct { - Pagination *Pagination `json:"pagination,omitempty"` - Columns []string `json:"columns,omitempty"` - Rows [][]interface{} `json:"rows,omitempty"` - Stats *ResultStats `json:"stats,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` + Columns []string `json:"columns,omitempty"` + Rows [][]interface{} `json:"rows,omitempty"` + Stats *ResultStats `json:"stats,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewResult instantiates a new Result object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewResultWithDefaults() *Result { this := Result{} return &this } - // GetPagination returns the Pagination field value if set, zero value otherwise. func (o *Result) GetPagination() Pagination { if o == nil || o.Pagination == nil { @@ -61,6 +70,7 @@ func (o *Result) SetPagination(v Pagination) { o.Pagination = &v } + // GetColumns returns the Columns field value if set, zero value otherwise. func (o *Result) GetColumns() []string { if o == nil || o.Columns == nil { @@ -89,6 +99,7 @@ func (o *Result) SetColumns(v []string) { o.Columns = v } + // GetRows returns the Rows field value if set, zero value otherwise. func (o *Result) GetRows() [][]interface{} { if o == nil || o.Rows == nil { @@ -117,6 +128,7 @@ func (o *Result) SetRows(v [][]interface{}) { o.Rows = v } + // GetStats returns the Stats field value if set, zero value otherwise. func (o *Result) GetStats() ResultStats { if o == nil || o.Stats == nil { @@ -145,6 +157,8 @@ func (o *Result) SetStats(v ResultStats) { o.Stats = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Result) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -173,29 +187,29 @@ func (o Result) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Result) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Pagination *Pagination `json:"pagination,omitempty"` - Columns []string `json:"columns,omitempty"` - Rows [][]interface{} `json:"rows,omitempty"` - Stats *ResultStats `json:"stats,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` + Columns []string `json:"columns,omitempty"` + Rows [][]interface{} `json:"rows,omitempty"` + Stats *ResultStats `json:"stats,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"pagination", "columns", "rows", "stats"}) + common.DeleteKeys(additionalProperties, &[]string{ "pagination", "columns", "rows", "stats", }) } else { return err } hasInvalidField := false - if all.Pagination != nil && all.Pagination.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Pagination != nil && all.Pagination.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Pagination = all.Pagination o.Columns = all.Columns o.Rows = all.Rows - if all.Stats != nil && all.Stats.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Stats != nil && all.Stats.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Stats = all.Stats diff --git a/api/kbcloud/admin/model_result_stats.go b/api/kbcloud/admin/model_result_stats.go index 1ab9b601..54dd95c0 100644 --- a/api/kbcloud/admin/model_result_stats.go +++ b/api/kbcloud/admin/model_result_stats.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type ResultStats struct { - ColumnsCount *int32 `json:"columns_count,omitempty"` - RowsCount *int32 `json:"rows_count,omitempty"` - RowsAffected *int32 `json:"rows_affected,omitempty"` - QueryStartTime *time.Time `json:"query_start_time,omitempty"` + ColumnsCount *int32 `json:"columns_count,omitempty"` + RowsCount *int32 `json:"rows_count,omitempty"` + RowsAffected *int32 `json:"rows_affected,omitempty"` + QueryStartTime *time.Time `json:"query_start_time,omitempty"` QueryFinishTime *time.Time `json:"query_finish_time,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewResultStats instantiates a new ResultStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +43,6 @@ func NewResultStatsWithDefaults() *ResultStats { this := ResultStats{} return &this } - // GetColumnsCount returns the ColumnsCount field value if set, zero value otherwise. func (o *ResultStats) GetColumnsCount() int32 { if o == nil || o.ColumnsCount == nil { @@ -66,6 +71,7 @@ func (o *ResultStats) SetColumnsCount(v int32) { o.ColumnsCount = &v } + // GetRowsCount returns the RowsCount field value if set, zero value otherwise. func (o *ResultStats) GetRowsCount() int32 { if o == nil || o.RowsCount == nil { @@ -94,6 +100,7 @@ func (o *ResultStats) SetRowsCount(v int32) { o.RowsCount = &v } + // GetRowsAffected returns the RowsAffected field value if set, zero value otherwise. func (o *ResultStats) GetRowsAffected() int32 { if o == nil || o.RowsAffected == nil { @@ -122,6 +129,7 @@ func (o *ResultStats) SetRowsAffected(v int32) { o.RowsAffected = &v } + // GetQueryStartTime returns the QueryStartTime field value if set, zero value otherwise. func (o *ResultStats) GetQueryStartTime() time.Time { if o == nil || o.QueryStartTime == nil { @@ -150,6 +158,7 @@ func (o *ResultStats) SetQueryStartTime(v time.Time) { o.QueryStartTime = &v } + // GetQueryFinishTime returns the QueryFinishTime field value if set, zero value otherwise. func (o *ResultStats) GetQueryFinishTime() time.Time { if o == nil || o.QueryFinishTime == nil { @@ -178,6 +187,8 @@ func (o *ResultStats) SetQueryFinishTime(v time.Time) { o.QueryFinishTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ResultStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -217,10 +228,10 @@ func (o ResultStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ResultStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ColumnsCount *int32 `json:"columns_count,omitempty"` - RowsCount *int32 `json:"rows_count,omitempty"` - RowsAffected *int32 `json:"rows_affected,omitempty"` - QueryStartTime *time.Time `json:"query_start_time,omitempty"` + ColumnsCount *int32 `json:"columns_count,omitempty"` + RowsCount *int32 `json:"rows_count,omitempty"` + RowsAffected *int32 `json:"rows_affected,omitempty"` + QueryStartTime *time.Time `json:"query_start_time,omitempty"` QueryFinishTime *time.Time `json:"query_finish_time,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -228,7 +239,7 @@ func (o *ResultStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"columns_count", "rows_count", "rows_affected", "query_start_time", "query_finish_time"}) + common.DeleteKeys(additionalProperties, &[]string{ "columns_count", "rows_count", "rows_affected", "query_start_time", "query_finish_time", }) } else { return err } diff --git a/api/kbcloud/admin/model_role.go b/api/kbcloud/admin/model_role.go index 77ac1f87..1479ac41 100644 --- a/api/kbcloud/admin/model_role.go +++ b/api/kbcloud/admin/model_role.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Role Role information + + +// Role Role information type Role struct { // The name of the role Name *string `json:"name,omitempty"` @@ -23,10 +28,11 @@ type Role struct { // The time when the role was updated. Read-Only UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRole instantiates a new Role object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +49,6 @@ func NewRoleWithDefaults() *Role { this := Role{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *Role) GetName() string { if o == nil || o.Name == nil { @@ -72,6 +77,7 @@ func (o *Role) SetName(v string) { o.Name = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *Role) GetType() string { if o == nil || o.Type == nil { @@ -100,6 +106,7 @@ func (o *Role) SetType(v string) { o.Type = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Role) GetDescription() string { if o == nil || o.Description == nil { @@ -128,6 +135,7 @@ func (o *Role) SetDescription(v string) { o.Description = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Role) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -156,6 +164,7 @@ func (o *Role) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Role) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -184,6 +193,8 @@ func (o *Role) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Role) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -223,18 +234,18 @@ func (o Role) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Role) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Description *string `json:"description,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "type", "description", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "type", "description", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_role_create.go b/api/kbcloud/admin/model_role_create.go index 49c38986..f226bbb3 100644 --- a/api/kbcloud/admin/model_role_create.go +++ b/api/kbcloud/admin/model_role_create.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RoleCreate Role create +// RoleCreate Role create type RoleCreate struct { // The name of the role Name *string `json:"name,omitempty"` // The description of the role Description *string `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRoleCreate instantiates a new RoleCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewRoleCreateWithDefaults() *RoleCreate { this := RoleCreate{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *RoleCreate) GetName() string { if o == nil || o.Name == nil { @@ -62,6 +71,7 @@ func (o *RoleCreate) SetName(v string) { o.Name = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *RoleCreate) GetDescription() string { if o == nil || o.Description == nil { @@ -90,6 +100,8 @@ func (o *RoleCreate) SetDescription(v string) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RoleCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,7 +124,7 @@ func (o RoleCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RoleCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -120,7 +132,7 @@ func (o *RoleCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "description", }) } else { return err } diff --git a/api/kbcloud/admin/model_role_list.go b/api/kbcloud/admin/model_role_list.go index a1e03b85..03d331a6 100644 --- a/api/kbcloud/admin/model_role_list.go +++ b/api/kbcloud/admin/model_role_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RoleList RoleList is a list of Roles + + +// RoleList RoleList is a list of Roles type RoleList struct { // Items is the list of Role objects in the list Items []Role `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRoleList instantiates a new RoleList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewRoleListWithDefaults() *RoleList { this := RoleList{} return &this } - // GetItems returns the Items field value. func (o *RoleList) GetItems() []Role { if o == nil { @@ -60,6 +65,8 @@ func (o *RoleList) SetItems(v []Role) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RoleList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *RoleList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_role_update.go b/api/kbcloud/admin/model_role_update.go index 4de3d3c6..4751775d 100644 --- a/api/kbcloud/admin/model_role_update.go +++ b/api/kbcloud/admin/model_role_update.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RoleUpdate Role update +// RoleUpdate Role update type RoleUpdate struct { // The description of the role Description *string `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRoleUpdate instantiates a new RoleUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewRoleUpdateWithDefaults() *RoleUpdate { this := RoleUpdate{} return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *RoleUpdate) GetDescription() string { if o == nil || o.Description == nil { @@ -60,6 +69,8 @@ func (o *RoleUpdate) SetDescription(v string) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RoleUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *RoleUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", }) } else { return err } diff --git a/api/kbcloud/admin/model_scheduling_config.go b/api/kbcloud/admin/model_scheduling_config.go index 8c234e13..e9a3d901 100644 --- a/api/kbcloud/admin/model_scheduling_config.go +++ b/api/kbcloud/admin/model_scheduling_config.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// SchedulingConfig Configuration of resource scheduling for this environment +// SchedulingConfig Configuration of resource scheduling for this environment type SchedulingConfig struct { // Enable pod antiaffinity for cluster PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` // When creating a cluster, add the default tolerations from the bootstrap node to the pods TolerateDefaultTaints *TolerateDefaultTaints `json:"tolerateDefaultTaints,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewSchedulingConfig instantiates a new SchedulingConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewSchedulingConfigWithDefaults() *SchedulingConfig { this.PodAntiAffinityEnabled = &podAntiAffinityEnabled return &this } - // GetPodAntiAffinityEnabled returns the PodAntiAffinityEnabled field value if set, zero value otherwise. func (o *SchedulingConfig) GetPodAntiAffinityEnabled() bool { if o == nil || o.PodAntiAffinityEnabled == nil { @@ -66,6 +75,7 @@ func (o *SchedulingConfig) SetPodAntiAffinityEnabled(v bool) { o.PodAntiAffinityEnabled = &v } + // GetTolerateDefaultTaints returns the TolerateDefaultTaints field value if set, zero value otherwise. func (o *SchedulingConfig) GetTolerateDefaultTaints() TolerateDefaultTaints { if o == nil || o.TolerateDefaultTaints == nil { @@ -94,6 +104,8 @@ func (o *SchedulingConfig) SetTolerateDefaultTaints(v TolerateDefaultTaints) { o.TolerateDefaultTaints = &v } + + // MarshalJSON serializes the struct using spec logic. func (o SchedulingConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -116,22 +128,22 @@ func (o SchedulingConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *SchedulingConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` - TolerateDefaultTaints *TolerateDefaultTaints `json:"tolerateDefaultTaints,omitempty"` + PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` + TolerateDefaultTaints *TolerateDefaultTaints `json:"tolerateDefaultTaints,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"podAntiAffinityEnabled", "tolerateDefaultTaints"}) + common.DeleteKeys(additionalProperties, &[]string{ "podAntiAffinityEnabled", "tolerateDefaultTaints", }) } else { return err } hasInvalidField := false o.PodAntiAffinityEnabled = all.PodAntiAffinityEnabled - if all.TolerateDefaultTaints != nil && all.TolerateDefaultTaints.UnparsedObject != nil && o.UnparsedObject == nil { + if all.TolerateDefaultTaints != nil && all.TolerateDefaultTaints.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.TolerateDefaultTaints = all.TolerateDefaultTaints diff --git a/api/kbcloud/admin/model_series_item.go b/api/kbcloud/admin/model_series_item.go index 4a1efe6a..2ca061cd 100644 --- a/api/kbcloud/admin/model_series_item.go +++ b/api/kbcloud/admin/model_series_item.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// SeriesItem A data point in a series for meta data, including a count and a timestamp. + + +// SeriesItem A data point in a series for meta data, including a count and a timestamp. type SeriesItem struct { // The value of the series data point. Value float64 `json:"value"` // The timestamp representing the time of the data point, unit is seconds. Timestamp int64 `json:"timestamp"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewSeriesItem instantiates a new SeriesItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewSeriesItemWithDefaults() *SeriesItem { this := SeriesItem{} return &this } - // GetValue returns the Value field value. func (o *SeriesItem) GetValue() float64 { if o == nil { @@ -63,6 +68,7 @@ func (o *SeriesItem) SetValue(v float64) { o.Value = v } + // GetTimestamp returns the Timestamp field value. func (o *SeriesItem) GetTimestamp() int64 { if o == nil { @@ -86,6 +92,8 @@ func (o *SeriesItem) SetTimestamp(v int64) { o.Timestamp = v } + + // MarshalJSON serializes the struct using spec logic. func (o SeriesItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,8 +112,8 @@ func (o SeriesItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *SeriesItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Value *float64 `json:"value"` - Timestamp *int64 `json:"timestamp"` + Value *float64 `json:"value"` + Timestamp *int64 `json:"timestamp"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *SeriesItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"value", "timestamp"}) + common.DeleteKeys(additionalProperties, &[]string{ "value", "timestamp", }) } else { return err } diff --git a/api/kbcloud/admin/model_sort_type.go b/api/kbcloud/admin/model_sort_type.go index 8a5d3f11..72da019d 100644 --- a/api/kbcloud/admin/model_sort_type.go +++ b/api/kbcloud/admin/model_sort_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // SortType Represents the type of sorting. type SortType string // List of SortType. const ( - SortTypeAsc SortType = "asc" + SortTypeAsc SortType = "asc" SortTypeDesc SortType = "desc" ) diff --git a/api/kbcloud/admin/model_storage.go b/api/kbcloud/admin/model_storage.go index 1357dbb1..cd52ded9 100644 --- a/api/kbcloud/admin/model_storage.go +++ b/api/kbcloud/admin/model_storage.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Storage Storage is a specification that provides guidance accessing remote storage. + + +// Storage Storage is a specification that provides guidance accessing remote storage. type Storage struct { // Unique identifier for the storage Id *string `json:"id,omitempty"` @@ -31,10 +36,11 @@ type Storage struct { // the tags for the storage Tags map[string]string `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorage instantiates a new Storage object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -51,7 +57,6 @@ func NewStorageWithDefaults() *Storage { this := Storage{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Storage) GetId() string { if o == nil || o.Id == nil { @@ -80,6 +85,7 @@ func (o *Storage) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Storage) GetName() string { if o == nil || o.Name == nil { @@ -108,6 +114,7 @@ func (o *Storage) SetName(v string) { o.Name = &v } + // GetStorageProvider returns the StorageProvider field value if set, zero value otherwise. func (o *Storage) GetStorageProvider() string { if o == nil || o.StorageProvider == nil { @@ -136,6 +143,7 @@ func (o *Storage) SetStorageProvider(v string) { o.StorageProvider = &v } + // GetParams returns the Params field value if set, zero value otherwise. func (o *Storage) GetParams() map[string]string { if o == nil || o.Params == nil { @@ -164,6 +172,7 @@ func (o *Storage) SetParams(v map[string]string) { o.Params = v } + // GetEnvName returns the EnvName field value if set, zero value otherwise. func (o *Storage) GetEnvName() string { if o == nil || o.EnvName == nil { @@ -192,6 +201,7 @@ func (o *Storage) SetEnvName(v string) { o.EnvName = &v } + // GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. func (o *Storage) GetCreatedBy() time.Time { if o == nil || o.CreatedBy == nil { @@ -220,6 +230,7 @@ func (o *Storage) SetCreatedBy(v time.Time) { o.CreatedBy = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *Storage) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -248,6 +259,7 @@ func (o *Storage) SetClusterId(v string) { o.ClusterId = &v } + // GetUpdatedBy returns the UpdatedBy field value if set, zero value otherwise. func (o *Storage) GetUpdatedBy() time.Time { if o == nil || o.UpdatedBy == nil { @@ -276,6 +288,7 @@ func (o *Storage) SetUpdatedBy(v time.Time) { o.UpdatedBy = &v } + // GetTags returns the Tags field value if set, zero value otherwise. func (o *Storage) GetTags() map[string]string { if o == nil || o.Tags == nil { @@ -304,6 +317,8 @@ func (o *Storage) SetTags(v map[string]string) { o.Tags = v } + + // MarshalJSON serializes the struct using spec logic. func (o Storage) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -355,22 +370,22 @@ func (o Storage) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Storage) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - StorageProvider *string `json:"storageProvider,omitempty"` - Params map[string]string `json:"params,omitempty"` - EnvName *string `json:"envName,omitempty"` - CreatedBy *time.Time `json:"createdBy,omitempty"` - ClusterId *string `json:"clusterID,omitempty"` - UpdatedBy *time.Time `json:"updatedBy,omitempty"` - Tags map[string]string `json:"tags,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + StorageProvider *string `json:"storageProvider,omitempty"` + Params map[string]string `json:"params,omitempty"` + EnvName *string `json:"envName,omitempty"` + CreatedBy *time.Time `json:"createdBy,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + UpdatedBy *time.Time `json:"updatedBy,omitempty"` + Tags map[string]string `json:"tags,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "storageProvider", "params", "envName", "createdBy", "clusterID", "updatedBy", "tags"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "storageProvider", "params", "envName", "createdBy", "clusterID", "updatedBy", "tags", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_check_result.go b/api/kbcloud/admin/model_storage_check_result.go index 11d43435..85baab51 100644 --- a/api/kbcloud/admin/model_storage_check_result.go +++ b/api/kbcloud/admin/model_storage_check_result.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// StorageCheckResult storageCheck is the result when checking storage connectivity +// StorageCheckResult storageCheck is the result when checking storage connectivity type StorageCheckResult struct { // the result that the storage connectivity Connected *bool `json:"connected,omitempty"` // the error msg Error *string `json:"error,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageCheckResult instantiates a new StorageCheckResult object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewStorageCheckResultWithDefaults() *StorageCheckResult { this := StorageCheckResult{} return &this } - // GetConnected returns the Connected field value if set, zero value otherwise. func (o *StorageCheckResult) GetConnected() bool { if o == nil || o.Connected == nil { @@ -62,6 +71,7 @@ func (o *StorageCheckResult) SetConnected(v bool) { o.Connected = &v } + // GetError returns the Error field value if set, zero value otherwise. func (o *StorageCheckResult) GetError() string { if o == nil || o.Error == nil { @@ -90,6 +100,8 @@ func (o *StorageCheckResult) SetError(v string) { o.Error = &v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageCheckResult) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o StorageCheckResult) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageCheckResult) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Connected *bool `json:"connected,omitempty"` - Error *string `json:"error,omitempty"` + Connected *bool `json:"connected,omitempty"` + Error *string `json:"error,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"connected", "error"}) + common.DeleteKeys(additionalProperties, &[]string{ "connected", "error", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_class_create.go b/api/kbcloud/admin/model_storage_class_create.go index 9267486d..04bc5b17 100644 --- a/api/kbcloud/admin/model_storage_class_create.go +++ b/api/kbcloud/admin/model_storage_class_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageClassCreate StorageClassCreate provides detailed creation information about a storage class. + + +// StorageClassCreate StorageClassCreate provides detailed creation information about a storage class. type StorageClassCreate struct { // the name of the storage class Name string `json:"name"` @@ -47,10 +52,11 @@ type StorageClassCreate struct { // whether the storage class is enabled Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageClassCreate instantiates a new StorageClassCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -73,7 +79,6 @@ func NewStorageClassCreateWithDefaults() *StorageClassCreate { this := StorageClassCreate{} return &this } - // GetName returns the Name field value. func (o *StorageClassCreate) GetName() string { if o == nil { @@ -97,6 +102,7 @@ func (o *StorageClassCreate) SetName(v string) { o.Name = v } + // GetProvisioner returns the Provisioner field value if set, zero value otherwise. func (o *StorageClassCreate) GetProvisioner() string { if o == nil || o.Provisioner == nil { @@ -125,6 +131,7 @@ func (o *StorageClassCreate) SetProvisioner(v string) { o.Provisioner = &v } + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *StorageClassCreate) GetLabels() map[string]string { if o == nil || o.Labels == nil { @@ -153,6 +160,7 @@ func (o *StorageClassCreate) SetLabels(v map[string]string) { o.Labels = v } + // GetAnnotations returns the Annotations field value if set, zero value otherwise. func (o *StorageClassCreate) GetAnnotations() map[string]string { if o == nil || o.Annotations == nil { @@ -181,6 +189,7 @@ func (o *StorageClassCreate) SetAnnotations(v map[string]string) { o.Annotations = v } + // GetParameters returns the Parameters field value if set, zero value otherwise. func (o *StorageClassCreate) GetParameters() map[string]string { if o == nil || o.Parameters == nil { @@ -209,6 +218,7 @@ func (o *StorageClassCreate) SetParameters(v map[string]string) { o.Parameters = v } + // GetReclaimPolicy returns the ReclaimPolicy field value. func (o *StorageClassCreate) GetReclaimPolicy() StorageClassReclaimPolicy { if o == nil { @@ -232,6 +242,7 @@ func (o *StorageClassCreate) SetReclaimPolicy(v StorageClassReclaimPolicy) { o.ReclaimPolicy = v } + // GetAllowVolumeExpansion returns the AllowVolumeExpansion field value if set, zero value otherwise. func (o *StorageClassCreate) GetAllowVolumeExpansion() bool { if o == nil || o.AllowVolumeExpansion == nil { @@ -260,6 +271,7 @@ func (o *StorageClassCreate) SetAllowVolumeExpansion(v bool) { o.AllowVolumeExpansion = &v } + // GetVolumeBindingMode returns the VolumeBindingMode field value. func (o *StorageClassCreate) GetVolumeBindingMode() StorageClassVolumeBindingMode { if o == nil { @@ -283,6 +295,7 @@ func (o *StorageClassCreate) SetVolumeBindingMode(v StorageClassVolumeBindingMod o.VolumeBindingMode = v } + // GetAllowClone returns the AllowClone field value if set, zero value otherwise. func (o *StorageClassCreate) GetAllowClone() bool { if o == nil || o.AllowClone == nil { @@ -311,6 +324,7 @@ func (o *StorageClassCreate) SetAllowClone(v bool) { o.AllowClone = &v } + // GetAllowSnapshot returns the AllowSnapshot field value if set, zero value otherwise. func (o *StorageClassCreate) GetAllowSnapshot() bool { if o == nil || o.AllowSnapshot == nil { @@ -339,6 +353,7 @@ func (o *StorageClassCreate) SetAllowSnapshot(v bool) { o.AllowSnapshot = &v } + // GetIsDefaultClass returns the IsDefaultClass field value if set, zero value otherwise. func (o *StorageClassCreate) GetIsDefaultClass() bool { if o == nil || o.IsDefaultClass == nil { @@ -367,6 +382,7 @@ func (o *StorageClassCreate) SetIsDefaultClass(v bool) { o.IsDefaultClass = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *StorageClassCreate) GetType() string { if o == nil || o.Type == nil { @@ -395,6 +411,7 @@ func (o *StorageClassCreate) SetType(v string) { o.Type = &v } + // GetHostPath returns the HostPath field value if set, zero value otherwise. func (o *StorageClassCreate) GetHostPath() string { if o == nil || o.HostPath == nil { @@ -423,6 +440,7 @@ func (o *StorageClassCreate) SetHostPath(v string) { o.HostPath = &v } + // GetMountOptions returns the MountOptions field value if set, zero value otherwise. func (o *StorageClassCreate) GetMountOptions() []string { if o == nil || o.MountOptions == nil { @@ -451,6 +469,7 @@ func (o *StorageClassCreate) SetMountOptions(v []string) { o.MountOptions = v } + // GetDescription returns the Description field value. func (o *StorageClassCreate) GetDescription() string { if o == nil { @@ -474,6 +493,7 @@ func (o *StorageClassCreate) SetDescription(v string) { o.Description = v } + // GetDisplayName returns the DisplayName field value. func (o *StorageClassCreate) GetDisplayName() string { if o == nil { @@ -497,6 +517,7 @@ func (o *StorageClassCreate) SetDisplayName(v string) { o.DisplayName = v } + // GetEnabled returns the Enabled field value. func (o *StorageClassCreate) GetEnabled() bool { if o == nil { @@ -520,6 +541,8 @@ func (o *StorageClassCreate) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageClassCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -575,23 +598,23 @@ func (o StorageClassCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageClassCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Provisioner *string `json:"provisioner,omitempty"` - Labels map[string]string `json:"labels,omitempty"` - Annotations map[string]string `json:"annotations,omitempty"` - Parameters map[string]string `json:"parameters,omitempty"` - ReclaimPolicy *StorageClassReclaimPolicy `json:"reclaimPolicy"` - AllowVolumeExpansion *bool `json:"allowVolumeExpansion,omitempty"` - VolumeBindingMode *StorageClassVolumeBindingMode `json:"volumeBindingMode"` - AllowClone *bool `json:"allowClone,omitempty"` - AllowSnapshot *bool `json:"allowSnapshot,omitempty"` - IsDefaultClass *bool `json:"isDefaultClass,omitempty"` - Type *string `json:"type,omitempty"` - HostPath *string `json:"hostPath,omitempty"` - MountOptions []string `json:"mountOptions,omitempty"` - Description *string `json:"description"` - DisplayName *string `json:"displayName"` - Enabled *bool `json:"enabled"` + Name *string `json:"name"` + Provisioner *string `json:"provisioner,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` + ReclaimPolicy *StorageClassReclaimPolicy `json:"reclaimPolicy"` + AllowVolumeExpansion *bool `json:"allowVolumeExpansion,omitempty"` + VolumeBindingMode *StorageClassVolumeBindingMode `json:"volumeBindingMode"` + AllowClone *bool `json:"allowClone,omitempty"` + AllowSnapshot *bool `json:"allowSnapshot,omitempty"` + IsDefaultClass *bool `json:"isDefaultClass,omitempty"` + Type *string `json:"type,omitempty"` + HostPath *string `json:"hostPath,omitempty"` + MountOptions []string `json:"mountOptions,omitempty"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + Enabled *bool `json:"enabled"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -616,7 +639,7 @@ func (o *StorageClassCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "provisioner", "labels", "annotations", "parameters", "reclaimPolicy", "allowVolumeExpansion", "volumeBindingMode", "allowClone", "allowSnapshot", "isDefaultClass", "type", "hostPath", "mountOptions", "description", "displayName", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "provisioner", "labels", "annotations", "parameters", "reclaimPolicy", "allowVolumeExpansion", "volumeBindingMode", "allowClone", "allowSnapshot", "isDefaultClass", "type", "hostPath", "mountOptions", "description", "displayName", "enabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_class_info.go b/api/kbcloud/admin/model_storage_class_info.go index b7800153..fe6dd201 100644 --- a/api/kbcloud/admin/model_storage_class_info.go +++ b/api/kbcloud/admin/model_storage_class_info.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageClassInfo StorageClassInfo provides detailed information about a specific storage class. + + +// StorageClassInfo StorageClassInfo provides detailed information about a specific storage class. type StorageClassInfo struct { // the name of the storage class Name string `json:"name"` @@ -60,10 +64,11 @@ type StorageClassInfo struct { // the List stands for stats for the storage volumes of nodes. StatsByNodeList StorageClassInfoStatsByNodeList `json:"statsByNodeList"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageClassInfo instantiates a new StorageClassInfo object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -102,7 +107,6 @@ func NewStorageClassInfoWithDefaults() *StorageClassInfo { this := StorageClassInfo{} return &this } - // GetName returns the Name field value. func (o *StorageClassInfo) GetName() string { if o == nil { @@ -126,6 +130,7 @@ func (o *StorageClassInfo) SetName(v string) { o.Name = v } + // GetCreationTimestamp returns the CreationTimestamp field value. func (o *StorageClassInfo) GetCreationTimestamp() string { if o == nil { @@ -149,6 +154,7 @@ func (o *StorageClassInfo) SetCreationTimestamp(v string) { o.CreationTimestamp = v } + // GetProvisioner returns the Provisioner field value. func (o *StorageClassInfo) GetProvisioner() string { if o == nil { @@ -172,6 +178,7 @@ func (o *StorageClassInfo) SetProvisioner(v string) { o.Provisioner = v } + // GetParameters returns the Parameters field value. func (o *StorageClassInfo) GetParameters() map[string]string { if o == nil { @@ -195,6 +202,7 @@ func (o *StorageClassInfo) SetParameters(v map[string]string) { o.Parameters = v } + // GetLabels returns the Labels field value. func (o *StorageClassInfo) GetLabels() map[string]string { if o == nil { @@ -218,6 +226,7 @@ func (o *StorageClassInfo) SetLabels(v map[string]string) { o.Labels = v } + // GetAnnotations returns the Annotations field value. func (o *StorageClassInfo) GetAnnotations() map[string]string { if o == nil { @@ -241,6 +250,7 @@ func (o *StorageClassInfo) SetAnnotations(v map[string]string) { o.Annotations = v } + // GetReclaimPolicy returns the ReclaimPolicy field value. func (o *StorageClassInfo) GetReclaimPolicy() string { if o == nil { @@ -264,6 +274,7 @@ func (o *StorageClassInfo) SetReclaimPolicy(v string) { o.ReclaimPolicy = v } + // GetAllowVolumeExpansion returns the AllowVolumeExpansion field value. func (o *StorageClassInfo) GetAllowVolumeExpansion() bool { if o == nil { @@ -287,6 +298,7 @@ func (o *StorageClassInfo) SetAllowVolumeExpansion(v bool) { o.AllowVolumeExpansion = v } + // GetVolumeBindingMode returns the VolumeBindingMode field value. func (o *StorageClassInfo) GetVolumeBindingMode() string { if o == nil { @@ -310,6 +322,7 @@ func (o *StorageClassInfo) SetVolumeBindingMode(v string) { o.VolumeBindingMode = v } + // GetPvcCount returns the PvcCount field value. func (o *StorageClassInfo) GetPvcCount() string { if o == nil { @@ -333,6 +346,7 @@ func (o *StorageClassInfo) SetPvcCount(v string) { o.PvcCount = v } + // GetAllowClone returns the AllowClone field value. func (o *StorageClassInfo) GetAllowClone() bool { if o == nil { @@ -356,6 +370,7 @@ func (o *StorageClassInfo) SetAllowClone(v bool) { o.AllowClone = v } + // GetAllowSnapshot returns the AllowSnapshot field value. func (o *StorageClassInfo) GetAllowSnapshot() bool { if o == nil { @@ -379,6 +394,7 @@ func (o *StorageClassInfo) SetAllowSnapshot(v bool) { o.AllowSnapshot = v } + // GetIsDefaultClass returns the IsDefaultClass field value. func (o *StorageClassInfo) GetIsDefaultClass() bool { if o == nil { @@ -402,6 +418,7 @@ func (o *StorageClassInfo) SetIsDefaultClass(v bool) { o.IsDefaultClass = v } + // GetType returns the Type field value. func (o *StorageClassInfo) GetType() string { if o == nil { @@ -425,6 +442,7 @@ func (o *StorageClassInfo) SetType(v string) { o.Type = v } + // GetHostPath returns the HostPath field value if set, zero value otherwise. func (o *StorageClassInfo) GetHostPath() string { if o == nil || o.HostPath == nil { @@ -453,6 +471,7 @@ func (o *StorageClassInfo) SetHostPath(v string) { o.HostPath = &v } + // GetMountOptions returns the MountOptions field value. func (o *StorageClassInfo) GetMountOptions() []string { if o == nil { @@ -476,6 +495,7 @@ func (o *StorageClassInfo) SetMountOptions(v []string) { o.MountOptions = v } + // GetCreatedAt returns the CreatedAt field value. func (o *StorageClassInfo) GetCreatedAt() time.Time { if o == nil { @@ -499,6 +519,7 @@ func (o *StorageClassInfo) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDescription returns the Description field value. func (o *StorageClassInfo) GetDescription() string { if o == nil { @@ -522,6 +543,7 @@ func (o *StorageClassInfo) SetDescription(v string) { o.Description = v } + // GetDisplayName returns the DisplayName field value. func (o *StorageClassInfo) GetDisplayName() string { if o == nil { @@ -545,6 +567,7 @@ func (o *StorageClassInfo) SetDisplayName(v string) { o.DisplayName = v } + // GetEnabled returns the Enabled field value. func (o *StorageClassInfo) GetEnabled() bool { if o == nil { @@ -568,6 +591,7 @@ func (o *StorageClassInfo) SetEnabled(v bool) { o.Enabled = v } + // GetId returns the Id field value. func (o *StorageClassInfo) GetId() string { if o == nil { @@ -591,6 +615,7 @@ func (o *StorageClassInfo) SetId(v string) { o.Id = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *StorageClassInfo) GetUpdatedAt() time.Time { if o == nil { @@ -614,6 +639,7 @@ func (o *StorageClassInfo) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetStatsByNodeList returns the StatsByNodeList field value. func (o *StorageClassInfo) GetStatsByNodeList() StorageClassInfoStatsByNodeList { if o == nil { @@ -637,6 +663,8 @@ func (o *StorageClassInfo) SetStatsByNodeList(v StorageClassInfoStatsByNodeList) o.StatsByNodeList = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageClassInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -686,29 +714,29 @@ func (o StorageClassInfo) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageClassInfo) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - CreationTimestamp *string `json:"creationTimestamp"` - Provisioner *string `json:"provisioner"` - Parameters *map[string]string `json:"parameters"` - Labels *map[string]string `json:"labels"` - Annotations *map[string]string `json:"annotations"` - ReclaimPolicy *string `json:"reclaimPolicy"` - AllowVolumeExpansion *bool `json:"allowVolumeExpansion"` - VolumeBindingMode *string `json:"volumeBindingMode"` - PvcCount *string `json:"pvcCount"` - AllowClone *bool `json:"allowClone"` - AllowSnapshot *bool `json:"allowSnapshot"` - IsDefaultClass *bool `json:"isDefaultClass"` - Type *string `json:"type"` - HostPath *string `json:"hostPath,omitempty"` - MountOptions *[]string `json:"mountOptions"` - CreatedAt *time.Time `json:"createdAt"` - Description *string `json:"description"` - DisplayName *string `json:"displayName"` - Enabled *bool `json:"enabled"` - Id *string `json:"id"` - UpdatedAt *time.Time `json:"updatedAt"` - StatsByNodeList *StorageClassInfoStatsByNodeList `json:"statsByNodeList"` + Name *string `json:"name"` + CreationTimestamp *string `json:"creationTimestamp"` + Provisioner *string `json:"provisioner"` + Parameters *map[string]string `json:"parameters"` + Labels *map[string]string `json:"labels"` + Annotations *map[string]string `json:"annotations"` + ReclaimPolicy *string `json:"reclaimPolicy"` + AllowVolumeExpansion *bool `json:"allowVolumeExpansion"` + VolumeBindingMode *string `json:"volumeBindingMode"` + PvcCount *string `json:"pvcCount"` + AllowClone *bool `json:"allowClone"` + AllowSnapshot *bool `json:"allowSnapshot"` + IsDefaultClass *bool `json:"isDefaultClass"` + Type *string `json:"type"` + HostPath *string `json:"hostPath,omitempty"` + MountOptions *[]string `json:"mountOptions"` + CreatedAt *time.Time `json:"createdAt"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + Enabled *bool `json:"enabled"` + Id *string `json:"id"` + UpdatedAt *time.Time `json:"updatedAt"` + StatsByNodeList *StorageClassInfoStatsByNodeList `json:"statsByNodeList"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -781,7 +809,7 @@ func (o *StorageClassInfo) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "creationTimestamp", "provisioner", "parameters", "labels", "annotations", "reclaimPolicy", "allowVolumeExpansion", "volumeBindingMode", "pvcCount", "allowClone", "allowSnapshot", "isDefaultClass", "type", "hostPath", "mountOptions", "createdAt", "description", "displayName", "enabled", "id", "updatedAt", "statsByNodeList"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "creationTimestamp", "provisioner", "parameters", "labels", "annotations", "reclaimPolicy", "allowVolumeExpansion", "volumeBindingMode", "pvcCount", "allowClone", "allowSnapshot", "isDefaultClass", "type", "hostPath", "mountOptions", "createdAt", "description", "displayName", "enabled", "id", "updatedAt", "statsByNodeList", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_class_info_stats_by_node_list.go b/api/kbcloud/admin/model_storage_class_info_stats_by_node_list.go index 00821659..5d6095f9 100644 --- a/api/kbcloud/admin/model_storage_class_info_stats_by_node_list.go +++ b/api/kbcloud/admin/model_storage_class_info_stats_by_node_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageClassInfoStatsByNodeList the List stands for stats for the storage volumes of nodes. + + +// StorageClassInfoStatsByNodeList the List stands for stats for the storage volumes of nodes. type StorageClassInfoStatsByNodeList struct { // the list of storage volumes stats by node Items []StorageVolumeStatsByNode `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageClassInfoStatsByNodeList instantiates a new StorageClassInfoStatsByNodeList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewStorageClassInfoStatsByNodeListWithDefaults() *StorageClassInfoStatsByNo this := StorageClassInfoStatsByNodeList{} return &this } - // GetItems returns the Items field value. func (o *StorageClassInfoStatsByNodeList) GetItems() []StorageVolumeStatsByNode { if o == nil { @@ -60,6 +65,8 @@ func (o *StorageClassInfoStatsByNodeList) SetItems(v []StorageVolumeStatsByNode) o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageClassInfoStatsByNodeList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *StorageClassInfoStatsByNodeList) UnmarshalJSON(bytes []byte) (err error } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_class_list.go b/api/kbcloud/admin/model_storage_class_list.go index cd0c48a8..0d224b8e 100644 --- a/api/kbcloud/admin/model_storage_class_list.go +++ b/api/kbcloud/admin/model_storage_class_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageClassList StorageClassList stands for stats for storage classes. + + +// StorageClassList StorageClassList stands for stats for storage classes. type StorageClassList struct { // the list of storage classes Items []StorageClassInfo `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageClassList instantiates a new StorageClassList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewStorageClassListWithDefaults() *StorageClassList { this := StorageClassList{} return &this } - // GetItems returns the Items field value. func (o *StorageClassList) GetItems() []StorageClassInfo { if o == nil { @@ -60,6 +65,8 @@ func (o *StorageClassList) SetItems(v []StorageClassInfo) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageClassList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *StorageClassList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_class_reclaim_policy.go b/api/kbcloud/admin/model_storage_class_reclaim_policy.go index 15bef41d..f71ac939 100644 --- a/api/kbcloud/admin/model_storage_class_reclaim_policy.go +++ b/api/kbcloud/admin/model_storage_class_reclaim_policy.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // StorageClassReclaimPolicy reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class. Defaults to Delete. type StorageClassReclaimPolicy string // List of StorageClassReclaimPolicy. const ( - StorageClassReclaimPolicyDelete StorageClassReclaimPolicy = "Delete" - StorageClassReclaimPolicyRetain StorageClassReclaimPolicy = "Retain" + StorageClassReclaimPolicyDelete StorageClassReclaimPolicy = "Delete" + StorageClassReclaimPolicyRetain StorageClassReclaimPolicy = "Retain" StorageClassReclaimPolicyRecycle StorageClassReclaimPolicy = "Recycle" ) diff --git a/api/kbcloud/admin/model_storage_class_update.go b/api/kbcloud/admin/model_storage_class_update.go index 73179618..c7a68e96 100644 --- a/api/kbcloud/admin/model_storage_class_update.go +++ b/api/kbcloud/admin/model_storage_class_update.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageClassUpdate StorageClassUpdate provides the fields for updating a specific storage class. + + +// StorageClassUpdate StorageClassUpdate provides the fields for updating a specific storage class. type StorageClassUpdate struct { // Indicates if this is the default storage class. IsDefaultClass bool `json:"isDefaultClass"` @@ -21,10 +26,11 @@ type StorageClassUpdate struct { // Indicates if the storage class is enabled. Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageClassUpdate instantiates a new StorageClassUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewStorageClassUpdateWithDefaults() *StorageClassUpdate { this := StorageClassUpdate{} return &this } - // GetIsDefaultClass returns the IsDefaultClass field value. func (o *StorageClassUpdate) GetIsDefaultClass() bool { if o == nil { @@ -69,6 +74,7 @@ func (o *StorageClassUpdate) SetIsDefaultClass(v bool) { o.IsDefaultClass = v } + // GetDisplayName returns the DisplayName field value. func (o *StorageClassUpdate) GetDisplayName() string { if o == nil { @@ -92,6 +98,7 @@ func (o *StorageClassUpdate) SetDisplayName(v string) { o.DisplayName = v } + // GetDescription returns the Description field value. func (o *StorageClassUpdate) GetDescription() string { if o == nil { @@ -115,6 +122,7 @@ func (o *StorageClassUpdate) SetDescription(v string) { o.Description = v } + // GetEnabled returns the Enabled field value. func (o *StorageClassUpdate) GetEnabled() bool { if o == nil { @@ -138,6 +146,8 @@ func (o *StorageClassUpdate) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageClassUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +168,10 @@ func (o StorageClassUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageClassUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - IsDefaultClass *bool `json:"isDefaultClass"` - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - Enabled *bool `json:"enabled"` + IsDefaultClass *bool `json:"isDefaultClass"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + Enabled *bool `json:"enabled"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *StorageClassUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"isDefaultClass", "displayName", "description", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "isDefaultClass", "displayName", "description", "enabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_class_volume_binding_mode.go b/api/kbcloud/admin/model_storage_class_volume_binding_mode.go index 7e175b1e..c36385f7 100644 --- a/api/kbcloud/admin/model_storage_class_volume_binding_mode.go +++ b/api/kbcloud/admin/model_storage_class_volume_binding_mode.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // StorageClassVolumeBindingMode volumeBindingMode indicates how PersistentVolumeClaims should be provisioned and bound. Defaults to Immediate. type StorageClassVolumeBindingMode string // List of StorageClassVolumeBindingMode. const ( - StorageClassVolumeBindingModeImmediate StorageClassVolumeBindingMode = "Immediate" + StorageClassVolumeBindingModeImmediate StorageClassVolumeBindingMode = "Immediate" StorageClassVolumeBindingModeWaitForFirstConsumer StorageClassVolumeBindingMode = "WaitForFirstConsumer" ) diff --git a/api/kbcloud/admin/model_storage_config.go b/api/kbcloud/admin/model_storage_config.go index a821d690..9f6a023b 100644 --- a/api/kbcloud/admin/model_storage_config.go +++ b/api/kbcloud/admin/model_storage_config.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageConfig Storage config for environment + + +// StorageConfig Storage config for environment type StorageConfig struct { // these storages will be created Storages []EnvironmentStorage `json:"storages"` @@ -19,10 +24,11 @@ type StorageConfig struct { // the storage config for backup Backup StorageConfigBackup `json:"backup"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageConfig instantiates a new StorageConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewStorageConfigWithDefaults() *StorageConfig { this := StorageConfig{} return &this } - // GetStorages returns the Storages field value. func (o *StorageConfig) GetStorages() []EnvironmentStorage { if o == nil { @@ -66,6 +71,7 @@ func (o *StorageConfig) SetStorages(v []EnvironmentStorage) { o.Storages = v } + // GetLog returns the Log field value. func (o *StorageConfig) GetLog() StorageConfigLog { if o == nil { @@ -89,6 +95,7 @@ func (o *StorageConfig) SetLog(v StorageConfigLog) { o.Log = v } + // GetBackup returns the Backup field value. func (o *StorageConfig) GetBackup() StorageConfigBackup { if o == nil { @@ -112,6 +119,8 @@ func (o *StorageConfig) SetBackup(v StorageConfigBackup) { o.Backup = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -132,8 +141,8 @@ func (o StorageConfig) MarshalJSON() ([]byte, error) { func (o *StorageConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { Storages *[]EnvironmentStorage `json:"storages"` - Log *StorageConfigLog `json:"log"` - Backup *StorageConfigBackup `json:"backup"` + Log *StorageConfigLog `json:"log"` + Backup *StorageConfigBackup `json:"backup"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,7 +158,7 @@ func (o *StorageConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"storages", "log", "backup"}) + common.DeleteKeys(additionalProperties, &[]string{ "storages", "log", "backup", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_config_backup.go b/api/kbcloud/admin/model_storage_config_backup.go index 30dd9c72..50a6c767 100644 --- a/api/kbcloud/admin/model_storage_config_backup.go +++ b/api/kbcloud/admin/model_storage_config_backup.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageConfigBackup the storage config for backup + + +// StorageConfigBackup the storage config for backup type StorageConfigBackup struct { // the name of storage StorageName string `json:"storageName"` @@ -19,10 +24,11 @@ type StorageConfigBackup struct { // judge whether to set the backup is default which will be init DefaultBackupRepo bool `json:"defaultBackupRepo"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageConfigBackup instantiates a new StorageConfigBackup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewStorageConfigBackupWithDefaults() *StorageConfigBackup { this := StorageConfigBackup{} return &this } - // GetStorageName returns the StorageName field value. func (o *StorageConfigBackup) GetStorageName() string { if o == nil { @@ -66,6 +71,7 @@ func (o *StorageConfigBackup) SetStorageName(v string) { o.StorageName = v } + // GetBackupRepoName returns the BackupRepoName field value. func (o *StorageConfigBackup) GetBackupRepoName() string { if o == nil { @@ -89,6 +95,7 @@ func (o *StorageConfigBackup) SetBackupRepoName(v string) { o.BackupRepoName = v } + // GetDefaultBackupRepo returns the DefaultBackupRepo field value. func (o *StorageConfigBackup) GetDefaultBackupRepo() bool { if o == nil { @@ -112,6 +119,8 @@ func (o *StorageConfigBackup) SetDefaultBackupRepo(v bool) { o.DefaultBackupRepo = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageConfigBackup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -131,9 +140,9 @@ func (o StorageConfigBackup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageConfigBackup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - StorageName *string `json:"storageName"` - BackupRepoName *string `json:"backupRepoName"` - DefaultBackupRepo *bool `json:"defaultBackupRepo"` + StorageName *string `json:"storageName"` + BackupRepoName *string `json:"backupRepoName"` + DefaultBackupRepo *bool `json:"defaultBackupRepo"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,7 +158,7 @@ func (o *StorageConfigBackup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"storageName", "backupRepoName", "defaultBackupRepo"}) + common.DeleteKeys(additionalProperties, &[]string{ "storageName", "backupRepoName", "defaultBackupRepo", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_config_log.go b/api/kbcloud/admin/model_storage_config_log.go index 444f70e0..3d8522b1 100644 --- a/api/kbcloud/admin/model_storage_config_log.go +++ b/api/kbcloud/admin/model_storage_config_log.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageConfigLog the storage config for log + + +// StorageConfigLog the storage config for log type StorageConfigLog struct { // the name of storage StorageName string `json:"storageName"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageConfigLog instantiates a new StorageConfigLog object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewStorageConfigLogWithDefaults() *StorageConfigLog { this := StorageConfigLog{} return &this } - // GetStorageName returns the StorageName field value. func (o *StorageConfigLog) GetStorageName() string { if o == nil { @@ -60,6 +65,8 @@ func (o *StorageConfigLog) SetStorageName(v string) { o.StorageName = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageConfigLog) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *StorageConfigLog) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"storageName"}) + common.DeleteKeys(additionalProperties, &[]string{ "storageName", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_create.go b/api/kbcloud/admin/model_storage_create.go index 5f25f676..b1d1c479 100644 --- a/api/kbcloud/admin/model_storage_create.go +++ b/api/kbcloud/admin/model_storage_create.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// StorageCreate storageCreate is the schema for the storage create request + +// StorageCreate storageCreate is the schema for the storage create request type StorageCreate struct { // Name of the storage Name *string `json:"name,omitempty"` @@ -19,10 +28,11 @@ type StorageCreate struct { // the tags for the storage Tags map[string]string `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageCreate instantiates a new StorageCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewStorageCreateWithDefaults() *StorageCreate { this := StorageCreate{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *StorageCreate) GetName() string { if o == nil || o.Name == nil { @@ -68,6 +77,7 @@ func (o *StorageCreate) SetName(v string) { o.Name = &v } + // GetStorageProvider returns the StorageProvider field value if set, zero value otherwise. func (o *StorageCreate) GetStorageProvider() string { if o == nil || o.StorageProvider == nil { @@ -96,6 +106,7 @@ func (o *StorageCreate) SetStorageProvider(v string) { o.StorageProvider = &v } + // GetParams returns the Params field value if set, zero value otherwise. func (o *StorageCreate) GetParams() map[string]string { if o == nil || o.Params == nil { @@ -124,6 +135,7 @@ func (o *StorageCreate) SetParams(v map[string]string) { o.Params = v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *StorageCreate) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -152,6 +164,7 @@ func (o *StorageCreate) SetClusterId(v string) { o.ClusterId = &v } + // GetTags returns the Tags field value if set, zero value otherwise. func (o *StorageCreate) GetTags() map[string]string { if o == nil || o.Tags == nil { @@ -180,6 +193,8 @@ func (o *StorageCreate) SetTags(v map[string]string) { o.Tags = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,18 +226,18 @@ func (o StorageCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - StorageProvider *string `json:"storageProvider,omitempty"` - Params map[string]string `json:"params,omitempty"` - ClusterId *string `json:"clusterID,omitempty"` - Tags map[string]string `json:"tags,omitempty"` + Name *string `json:"name,omitempty"` + StorageProvider *string `json:"storageProvider,omitempty"` + Params map[string]string `json:"params,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + Tags map[string]string `json:"tags,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "storageProvider", "params", "clusterID", "tags"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "storageProvider", "params", "clusterID", "tags", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_option.go b/api/kbcloud/admin/model_storage_option.go index db719379..15cae6da 100644 --- a/api/kbcloud/admin/model_storage_option.go +++ b/api/kbcloud/admin/model_storage_option.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type StorageOption struct { - Title LocalizedDescription `json:"title"` - Name string `json:"name"` - Min int32 `json:"min"` - Max int32 `json:"max"` - Default int32 `json:"default"` - Step int32 `json:"step"` + Title LocalizedDescription `json:"title"` + Name string `json:"name"` + Min int32 `json:"min"` + Max int32 `json:"max"` + Default int32 `json:"default"` + Step int32 `json:"step"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageOption instantiates a new StorageOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewStorageOptionWithDefaults() *StorageOption { this := StorageOption{} return &this } - // GetTitle returns the Title field value. func (o *StorageOption) GetTitle() LocalizedDescription { if o == nil { @@ -68,6 +73,7 @@ func (o *StorageOption) SetTitle(v LocalizedDescription) { o.Title = v } + // GetName returns the Name field value. func (o *StorageOption) GetName() string { if o == nil { @@ -91,6 +97,7 @@ func (o *StorageOption) SetName(v string) { o.Name = v } + // GetMin returns the Min field value. func (o *StorageOption) GetMin() int32 { if o == nil { @@ -114,6 +121,7 @@ func (o *StorageOption) SetMin(v int32) { o.Min = v } + // GetMax returns the Max field value. func (o *StorageOption) GetMax() int32 { if o == nil { @@ -137,6 +145,7 @@ func (o *StorageOption) SetMax(v int32) { o.Max = v } + // GetDefault returns the Default field value. func (o *StorageOption) GetDefault() int32 { if o == nil { @@ -160,6 +169,7 @@ func (o *StorageOption) SetDefault(v int32) { o.Default = v } + // GetStep returns the Step field value. func (o *StorageOption) GetStep() int32 { if o == nil { @@ -183,6 +193,8 @@ func (o *StorageOption) SetStep(v int32) { o.Step = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -205,12 +217,12 @@ func (o StorageOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Title *LocalizedDescription `json:"title"` - Name *string `json:"name"` - Min *int32 `json:"min"` - Max *int32 `json:"max"` - Default *int32 `json:"default"` - Step *int32 `json:"step"` + Title *LocalizedDescription `json:"title"` + Name *string `json:"name"` + Min *int32 `json:"min"` + Max *int32 `json:"max"` + Default *int32 `json:"default"` + Step *int32 `json:"step"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -235,7 +247,7 @@ func (o *StorageOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"title", "name", "min", "max", "default", "step"}) + common.DeleteKeys(additionalProperties, &[]string{ "title", "name", "min", "max", "default", "step", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_provider.go b/api/kbcloud/admin/model_storage_provider.go index efb81278..c0c3be4c 100644 --- a/api/kbcloud/admin/model_storage_provider.go +++ b/api/kbcloud/admin/model_storage_provider.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// StorageProvider Storage Provider comprises specifications that provide guidance accessing remote storage. + +// StorageProvider Storage Provider comprises specifications that provide guidance accessing remote storage. type StorageProvider struct { // Unique identifier for the storage provider Id *string `json:"id,omitempty"` @@ -19,10 +28,11 @@ type StorageProvider struct { // defines which parameters are required Required []string `json:"required,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageProvider instantiates a new StorageProvider object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewStorageProviderWithDefaults() *StorageProvider { this := StorageProvider{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *StorageProvider) GetId() string { if o == nil || o.Id == nil { @@ -68,6 +77,7 @@ func (o *StorageProvider) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *StorageProvider) GetName() string { if o == nil || o.Name == nil { @@ -96,6 +106,7 @@ func (o *StorageProvider) SetName(v string) { o.Name = &v } + // GetCredential returns the Credential field value if set, zero value otherwise. func (o *StorageProvider) GetCredential() []string { if o == nil || o.Credential == nil { @@ -124,6 +135,7 @@ func (o *StorageProvider) SetCredential(v []string) { o.Credential = v } + // GetSchema returns the Schema field value if set, zero value otherwise. func (o *StorageProvider) GetSchema() map[string]StorageProviderSchemaProps { if o == nil || o.Schema == nil { @@ -152,6 +164,7 @@ func (o *StorageProvider) SetSchema(v map[string]StorageProviderSchemaProps) { o.Schema = v } + // GetRequired returns the Required field value if set, zero value otherwise. func (o *StorageProvider) GetRequired() []string { if o == nil || o.Required == nil { @@ -180,6 +193,8 @@ func (o *StorageProvider) SetRequired(v []string) { o.Required = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageProvider) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,18 +226,18 @@ func (o StorageProvider) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageProvider) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Credential []string `json:"credential,omitempty"` - Schema map[string]StorageProviderSchemaProps `json:"schema,omitempty"` - Required []string `json:"required,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Credential []string `json:"credential,omitempty"` + Schema map[string]StorageProviderSchemaProps `json:"schema,omitempty"` + Required []string `json:"required,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "credential", "schema", "required"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "credential", "schema", "required", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_provider_schema_props.go b/api/kbcloud/admin/model_storage_provider_schema_props.go index b0229043..d595cf66 100644 --- a/api/kbcloud/admin/model_storage_provider_schema_props.go +++ b/api/kbcloud/admin/model_storage_provider_schema_props.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// StorageProviderSchemaProps the schema properties for storage provider parameters + + +// StorageProviderSchemaProps the schema properties for storage provider parameters type StorageProviderSchemaProps struct { // default value for the parameter Default interface{} `json:"default,omitempty"` @@ -15,10 +24,11 @@ type StorageProviderSchemaProps struct { // type of the parameter Type *string `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageProviderSchemaProps instantiates a new StorageProviderSchemaProps object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewStorageProviderSchemaPropsWithDefaults() *StorageProviderSchemaProps { this := StorageProviderSchemaProps{} return &this } - // GetDefault returns the Default field value if set, zero value otherwise. func (o *StorageProviderSchemaProps) GetDefault() interface{} { if o == nil || o.Default == nil { @@ -64,6 +73,7 @@ func (o *StorageProviderSchemaProps) SetDefault(v interface{}) { o.Default = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *StorageProviderSchemaProps) GetDescription() string { if o == nil || o.Description == nil { @@ -92,6 +102,7 @@ func (o *StorageProviderSchemaProps) SetDescription(v string) { o.Description = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *StorageProviderSchemaProps) GetType() string { if o == nil || o.Type == nil { @@ -120,6 +131,8 @@ func (o *StorageProviderSchemaProps) SetType(v string) { o.Type = &v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageProviderSchemaProps) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -145,16 +158,16 @@ func (o StorageProviderSchemaProps) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageProviderSchemaProps) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Default interface{} `json:"default,omitempty"` - Description *string `json:"description,omitempty"` - Type *string `json:"type,omitempty"` + Default interface{} `json:"default,omitempty"` + Description *string `json:"description,omitempty"` + Type *string `json:"type,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"default", "description", "type"}) + common.DeleteKeys(additionalProperties, &[]string{ "default", "description", "type", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_provisioner.go b/api/kbcloud/admin/model_storage_provisioner.go index 7ce20646..7a23e25c 100644 --- a/api/kbcloud/admin/model_storage_provisioner.go +++ b/api/kbcloud/admin/model_storage_provisioner.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageProvisioner StorageProvisioner provides detailed information about the provisioner used by storage classes. + + +// StorageProvisioner StorageProvisioner provides detailed information about the provisioner used by storage classes. type StorageProvisioner struct { - Provisioner string `json:"provisioner"` - Type string `json:"type"` + Provisioner string `json:"provisioner"` + Type string `json:"type"` CloudProvider string `json:"cloudProvider"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageProvisioner instantiates a new StorageProvisioner object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewStorageProvisionerWithDefaults() *StorageProvisioner { this := StorageProvisioner{} return &this } - // GetProvisioner returns the Provisioner field value. func (o *StorageProvisioner) GetProvisioner() string { if o == nil { @@ -63,6 +68,7 @@ func (o *StorageProvisioner) SetProvisioner(v string) { o.Provisioner = v } + // GetType returns the Type field value. func (o *StorageProvisioner) GetType() string { if o == nil { @@ -86,6 +92,7 @@ func (o *StorageProvisioner) SetType(v string) { o.Type = v } + // GetCloudProvider returns the CloudProvider field value. func (o *StorageProvisioner) GetCloudProvider() string { if o == nil { @@ -109,6 +116,8 @@ func (o *StorageProvisioner) SetCloudProvider(v string) { o.CloudProvider = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageProvisioner) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -128,8 +137,8 @@ func (o StorageProvisioner) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageProvisioner) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Provisioner *string `json:"provisioner"` - Type *string `json:"type"` + Provisioner *string `json:"provisioner"` + Type *string `json:"type"` CloudProvider *string `json:"cloudProvider"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -146,7 +155,7 @@ func (o *StorageProvisioner) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"provisioner", "type", "cloudProvider"}) + common.DeleteKeys(additionalProperties, &[]string{ "provisioner", "type", "cloudProvider", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_provisioner_list.go b/api/kbcloud/admin/model_storage_provisioner_list.go index fcb46f6a..079c56e6 100644 --- a/api/kbcloud/admin/model_storage_provisioner_list.go +++ b/api/kbcloud/admin/model_storage_provisioner_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageProvisionerList StorageProvisionerList stands for stats for provisioners can be used by storage classes. + + +// StorageProvisionerList StorageProvisionerList stands for stats for provisioners can be used by storage classes. type StorageProvisionerList struct { Items []StorageProvisioner `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageProvisionerList instantiates a new StorageProvisionerList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewStorageProvisionerListWithDefaults() *StorageProvisionerList { this := StorageProvisionerList{} return &this } - // GetItems returns the Items field value. func (o *StorageProvisionerList) GetItems() []StorageProvisioner { if o == nil { @@ -59,6 +64,8 @@ func (o *StorageProvisionerList) SetItems(v []StorageProvisioner) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageProvisionerList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *StorageProvisionerList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_stats.go b/api/kbcloud/admin/model_storage_stats.go index 213aa5e6..07b69768 100644 --- a/api/kbcloud/admin/model_storage_stats.go +++ b/api/kbcloud/admin/model_storage_stats.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageStats StorageStats holds the resource stats of the volume, such as provisioned capacity, etc. + + +// StorageStats StorageStats holds the resource stats of the volume, such as provisioned capacity, etc. type StorageStats struct { // ProvisionedCapacity is the actual size of the volumes that is bound to the PVC, unit is GiB ProvisionedCapacity float64 `json:"provisionedCapacity"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageStats instantiates a new StorageStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewStorageStatsWithDefaults() *StorageStats { this := StorageStats{} return &this } - // GetProvisionedCapacity returns the ProvisionedCapacity field value. func (o *StorageStats) GetProvisionedCapacity() float64 { if o == nil { @@ -60,6 +65,8 @@ func (o *StorageStats) SetProvisionedCapacity(v float64) { o.ProvisionedCapacity = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *StorageStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"provisionedCapacity"}) + common.DeleteKeys(additionalProperties, &[]string{ "provisionedCapacity", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_update.go b/api/kbcloud/admin/model_storage_update.go index 905df974..12d5c96f 100644 --- a/api/kbcloud/admin/model_storage_update.go +++ b/api/kbcloud/admin/model_storage_update.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// StorageUpdate storageUpdate is the schema for storage update request + + +// StorageUpdate storageUpdate is the schema for storage update request type StorageUpdate struct { // the name of storage StorageId *string `json:"storageID,omitempty"` @@ -15,10 +24,11 @@ type StorageUpdate struct { // the tags for the storage Tags map[string]string `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageUpdate instantiates a new StorageUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewStorageUpdateWithDefaults() *StorageUpdate { this := StorageUpdate{} return &this } - // GetStorageId returns the StorageId field value if set, zero value otherwise. func (o *StorageUpdate) GetStorageId() string { if o == nil || o.StorageId == nil { @@ -64,6 +73,7 @@ func (o *StorageUpdate) SetStorageId(v string) { o.StorageId = &v } + // GetParams returns the Params field value if set, zero value otherwise. func (o *StorageUpdate) GetParams() map[string]string { if o == nil || o.Params == nil { @@ -92,6 +102,7 @@ func (o *StorageUpdate) SetParams(v map[string]string) { o.Params = v } + // GetTags returns the Tags field value if set, zero value otherwise. func (o *StorageUpdate) GetTags() map[string]string { if o == nil || o.Tags == nil { @@ -120,6 +131,8 @@ func (o *StorageUpdate) SetTags(v map[string]string) { o.Tags = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -145,16 +158,16 @@ func (o StorageUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - StorageId *string `json:"storageID,omitempty"` - Params map[string]string `json:"params,omitempty"` - Tags map[string]string `json:"tags,omitempty"` + StorageId *string `json:"storageID,omitempty"` + Params map[string]string `json:"params,omitempty"` + Tags map[string]string `json:"tags,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"storageID", "params", "tags"}) + common.DeleteKeys(additionalProperties, &[]string{ "storageID", "params", "tags", }) } else { return err } diff --git a/api/kbcloud/admin/model_storage_volume_stats_by_node.go b/api/kbcloud/admin/model_storage_volume_stats_by_node.go index 908b78f3..0ea81313 100644 --- a/api/kbcloud/admin/model_storage_volume_stats_by_node.go +++ b/api/kbcloud/admin/model_storage_volume_stats_by_node.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// StorageVolumeStatsByNode storageVolumeStatsByNode provides detailed information about storage volumes of nodes. + + +// StorageVolumeStatsByNode storageVolumeStatsByNode provides detailed information about storage volumes of nodes. type StorageVolumeStatsByNode struct { // the name of the node NodeName *string `json:"nodeName,omitempty"` @@ -17,10 +26,11 @@ type StorageVolumeStatsByNode struct { // the sum of capacity of PVC on the node Capacity *string `json:"capacity,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageVolumeStatsByNode instantiates a new StorageVolumeStatsByNode object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewStorageVolumeStatsByNodeWithDefaults() *StorageVolumeStatsByNode { this := StorageVolumeStatsByNode{} return &this } - // GetNodeName returns the NodeName field value if set, zero value otherwise. func (o *StorageVolumeStatsByNode) GetNodeName() string { if o == nil || o.NodeName == nil { @@ -66,6 +75,7 @@ func (o *StorageVolumeStatsByNode) SetNodeName(v string) { o.NodeName = &v } + // GetNodeStatus returns the NodeStatus field value if set, zero value otherwise. func (o *StorageVolumeStatsByNode) GetNodeStatus() string { if o == nil || o.NodeStatus == nil { @@ -94,6 +104,7 @@ func (o *StorageVolumeStatsByNode) SetNodeStatus(v string) { o.NodeStatus = &v } + // GetVolumeNum returns the VolumeNum field value if set, zero value otherwise. func (o *StorageVolumeStatsByNode) GetVolumeNum() string { if o == nil || o.VolumeNum == nil { @@ -122,6 +133,7 @@ func (o *StorageVolumeStatsByNode) SetVolumeNum(v string) { o.VolumeNum = &v } + // GetCapacity returns the Capacity field value if set, zero value otherwise. func (o *StorageVolumeStatsByNode) GetCapacity() string { if o == nil || o.Capacity == nil { @@ -150,6 +162,8 @@ func (o *StorageVolumeStatsByNode) SetCapacity(v string) { o.Capacity = &v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageVolumeStatsByNode) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -178,17 +192,17 @@ func (o StorageVolumeStatsByNode) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageVolumeStatsByNode) UnmarshalJSON(bytes []byte) (err error) { all := struct { - NodeName *string `json:"nodeName,omitempty"` + NodeName *string `json:"nodeName,omitempty"` NodeStatus *string `json:"nodeStatus,omitempty"` - VolumeNum *string `json:"VolumeNum,omitempty"` - Capacity *string `json:"capacity,omitempty"` + VolumeNum *string `json:"VolumeNum,omitempty"` + Capacity *string `json:"capacity,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"nodeName", "nodeStatus", "VolumeNum", "capacity"}) + common.DeleteKeys(additionalProperties, &[]string{ "nodeName", "nodeStatus", "VolumeNum", "capacity", }) } else { return err } diff --git a/api/kbcloud/admin/model_summary.go b/api/kbcloud/admin/model_summary.go index f84c87a0..243b3b8c 100644 --- a/api/kbcloud/admin/model_summary.go +++ b/api/kbcloud/admin/model_summary.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Summary struct { // The namespace of cluster Namespace *string `json:"namespace,omitempty"` @@ -34,10 +43,11 @@ type Summary struct { // The creation time of cluster CreationTime *string `json:"creationTime,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewSummary instantiates a new Summary object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -54,7 +64,6 @@ func NewSummaryWithDefaults() *Summary { this := Summary{} return &this } - // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *Summary) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -83,6 +92,7 @@ func (o *Summary) SetNamespace(v string) { o.Namespace = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Summary) GetName() string { if o == nil || o.Name == nil { @@ -111,6 +121,7 @@ func (o *Summary) SetName(v string) { o.Name = &v } + // GetCpuRequests returns the CpuRequests field value if set, zero value otherwise. func (o *Summary) GetCpuRequests() string { if o == nil || o.CpuRequests == nil { @@ -139,6 +150,7 @@ func (o *Summary) SetCpuRequests(v string) { o.CpuRequests = &v } + // GetCpuLimits returns the CpuLimits field value if set, zero value otherwise. func (o *Summary) GetCpuLimits() string { if o == nil || o.CpuLimits == nil { @@ -167,6 +179,7 @@ func (o *Summary) SetCpuLimits(v string) { o.CpuLimits = &v } + // GetMemoryRequests returns the MemoryRequests field value if set, zero value otherwise. func (o *Summary) GetMemoryRequests() string { if o == nil || o.MemoryRequests == nil { @@ -195,6 +208,7 @@ func (o *Summary) SetMemoryRequests(v string) { o.MemoryRequests = &v } + // GetMemoryLimits returns the MemoryLimits field value if set, zero value otherwise. func (o *Summary) GetMemoryLimits() string { if o == nil || o.MemoryLimits == nil { @@ -223,6 +237,7 @@ func (o *Summary) SetMemoryLimits(v string) { o.MemoryLimits = &v } + // GetStorageSize returns the StorageSize field value if set, zero value otherwise. func (o *Summary) GetStorageSize() string { if o == nil || o.StorageSize == nil { @@ -251,6 +266,7 @@ func (o *Summary) SetStorageSize(v string) { o.StorageSize = &v } + // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *Summary) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -279,6 +295,7 @@ func (o *Summary) SetReplicas(v int32) { o.Replicas = &v } + // GetBackupEndpoint returns the BackupEndpoint field value if set, zero value otherwise. func (o *Summary) GetBackupEndpoint() string { if o == nil || o.BackupEndpoint == nil { @@ -307,6 +324,7 @@ func (o *Summary) SetBackupEndpoint(v string) { o.BackupEndpoint = &v } + // GetBackupPath returns the BackupPath field value if set, zero value otherwise. func (o *Summary) GetBackupPath() string { if o == nil || o.BackupPath == nil { @@ -335,6 +353,7 @@ func (o *Summary) SetBackupPath(v string) { o.BackupPath = &v } + // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. func (o *Summary) GetBackupSchedule() string { if o == nil || o.BackupSchedule == nil { @@ -363,6 +382,7 @@ func (o *Summary) SetBackupSchedule(v string) { o.BackupSchedule = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Summary) GetStatus() string { if o == nil || o.Status == nil { @@ -391,6 +411,7 @@ func (o *Summary) SetStatus(v string) { o.Status = &v } + // GetCreationTime returns the CreationTime field value if set, zero value otherwise. func (o *Summary) GetCreationTime() string { if o == nil || o.CreationTime == nil { @@ -419,6 +440,8 @@ func (o *Summary) SetCreationTime(v string) { o.CreationTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Summary) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -474,26 +497,26 @@ func (o Summary) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Summary) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Namespace *string `json:"namespace,omitempty"` - Name *string `json:"name,omitempty"` - CpuRequests *string `json:"cpuRequests,omitempty"` - CpuLimits *string `json:"cpuLimits,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` + CpuRequests *string `json:"cpuRequests,omitempty"` + CpuLimits *string `json:"cpuLimits,omitempty"` MemoryRequests *string `json:"memoryRequests,omitempty"` - MemoryLimits *string `json:"memoryLimits,omitempty"` - StorageSize *string `json:"storageSize,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` + MemoryLimits *string `json:"memoryLimits,omitempty"` + StorageSize *string `json:"storageSize,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` BackupEndpoint *string `json:"backupEndpoint,omitempty"` - BackupPath *string `json:"backupPath,omitempty"` + BackupPath *string `json:"backupPath,omitempty"` BackupSchedule *string `json:"backupSchedule,omitempty"` - Status *string `json:"status,omitempty"` - CreationTime *string `json:"creationTime,omitempty"` + Status *string `json:"status,omitempty"` + CreationTime *string `json:"creationTime,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"namespace", "name", "cpuRequests", "cpuLimits", "memoryRequests", "memoryLimits", "storageSize", "replicas", "backupEndpoint", "backupPath", "backupSchedule", "status", "creationTime"}) + common.DeleteKeys(additionalProperties, &[]string{ "namespace", "name", "cpuRequests", "cpuLimits", "memoryRequests", "memoryLimits", "storageSize", "replicas", "backupEndpoint", "backupPath", "backupSchedule", "status", "creationTime", }) } else { return err } diff --git a/api/kbcloud/admin/model_tag.go b/api/kbcloud/admin/model_tag.go index 3c694db1..557e7a2d 100644 --- a/api/kbcloud/admin/model_tag.go +++ b/api/kbcloud/admin/model_tag.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Tag tag info + + +// Tag tag info type Tag struct { // The id of the tag Id string `json:"id"` @@ -19,10 +24,11 @@ type Tag struct { // The value corresponding to the key Value *string `json:"value,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTag instantiates a new Tag object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewTagWithDefaults() *Tag { this := Tag{} return &this } - // GetId returns the Id field value. func (o *Tag) GetId() string { if o == nil { @@ -64,6 +69,7 @@ func (o *Tag) SetId(v string) { o.Id = v } + // GetKey returns the Key field value if set, zero value otherwise. func (o *Tag) GetKey() string { if o == nil || o.Key == nil { @@ -92,6 +98,7 @@ func (o *Tag) SetKey(v string) { o.Key = &v } + // GetValue returns the Value field value if set, zero value otherwise. func (o *Tag) GetValue() string { if o == nil || o.Value == nil { @@ -120,6 +127,8 @@ func (o *Tag) SetValue(v string) { o.Value = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Tag) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o Tag) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Tag) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Key *string `json:"key,omitempty"` + Id *string `json:"id"` + Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *Tag) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "key", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "key", "value", }) } else { return err } diff --git a/api/kbcloud/admin/model_tag_cluster.go b/api/kbcloud/admin/model_tag_cluster.go index de53fe2c..59a692d6 100644 --- a/api/kbcloud/admin/model_tag_cluster.go +++ b/api/kbcloud/admin/model_tag_cluster.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type TagCluster struct { // The cluster id corresponding to the tag ClusterId *string `json:"clusterId,omitempty"` - Tags []Tag `json:"tags,omitempty"` + Tags []Tag `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTagCluster instantiates a new TagCluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewTagClusterWithDefaults() *TagCluster { this := TagCluster{} return &this } - // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *TagCluster) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -60,6 +69,7 @@ func (o *TagCluster) SetClusterId(v string) { o.ClusterId = &v } + // GetTags returns the Tags field value if set, zero value otherwise. func (o *TagCluster) GetTags() []Tag { if o == nil || o.Tags == nil { @@ -88,6 +98,8 @@ func (o *TagCluster) SetTags(v []Tag) { o.Tags = v } + + // MarshalJSON serializes the struct using spec logic. func (o TagCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,14 +123,14 @@ func (o TagCluster) MarshalJSON() ([]byte, error) { func (o *TagCluster) UnmarshalJSON(bytes []byte) (err error) { all := struct { ClusterId *string `json:"clusterId,omitempty"` - Tags []Tag `json:"tags,omitempty"` + Tags []Tag `json:"tags,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"clusterId", "tags"}) + common.DeleteKeys(additionalProperties, &[]string{ "clusterId", "tags", }) } else { return err } diff --git a/api/kbcloud/admin/model_tag_create.go b/api/kbcloud/admin/model_tag_create.go index df73bac9..a16f4f7b 100644 --- a/api/kbcloud/admin/model_tag_create.go +++ b/api/kbcloud/admin/model_tag_create.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// TagCreate Tag create + + +// TagCreate Tag create type TagCreate struct { // The cluster id corresponding to the tag ClusterId string `json:"clusterId"` // The key value pair of the tag needed to create Items []TagCreateItemsItem `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTagCreate instantiates a new TagCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewTagCreateWithDefaults() *TagCreate { this := TagCreate{} return &this } - // GetClusterId returns the ClusterId field value. func (o *TagCreate) GetClusterId() string { if o == nil { @@ -63,6 +68,7 @@ func (o *TagCreate) SetClusterId(v string) { o.ClusterId = v } + // GetItems returns the Items field value. func (o *TagCreate) GetItems() []TagCreateItemsItem { if o == nil { @@ -86,6 +92,8 @@ func (o *TagCreate) SetItems(v []TagCreateItemsItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o TagCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,8 +112,8 @@ func (o TagCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TagCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ClusterId *string `json:"clusterId"` - Items *[]TagCreateItemsItem `json:"items"` + ClusterId *string `json:"clusterId"` + Items *[]TagCreateItemsItem `json:"items"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *TagCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"clusterId", "items"}) + common.DeleteKeys(additionalProperties, &[]string{ "clusterId", "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_tag_create_items_item.go b/api/kbcloud/admin/model_tag_create_items_item.go index 5cd0ea9d..4e54c1af 100644 --- a/api/kbcloud/admin/model_tag_create_items_item.go +++ b/api/kbcloud/admin/model_tag_create_items_item.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type TagCreateItemsItem struct { - Id *string `json:"id,omitempty"` - Key string `json:"key"` - Value string `json:"value"` + Id *string `json:"id,omitempty"` + Key string `json:"key"` + Value string `json:"value"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTagCreateItemsItem instantiates a new TagCreateItemsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +43,6 @@ func NewTagCreateItemsItemWithDefaults() *TagCreateItemsItem { this := TagCreateItemsItem{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *TagCreateItemsItem) GetId() string { if o == nil || o.Id == nil { @@ -66,6 +71,7 @@ func (o *TagCreateItemsItem) SetId(v string) { o.Id = &v } + // GetKey returns the Key field value. func (o *TagCreateItemsItem) GetKey() string { if o == nil { @@ -89,6 +95,7 @@ func (o *TagCreateItemsItem) SetKey(v string) { o.Key = v } + // GetValue returns the Value field value. func (o *TagCreateItemsItem) GetValue() string { if o == nil { @@ -112,6 +119,8 @@ func (o *TagCreateItemsItem) SetValue(v string) { o.Value = v } + + // MarshalJSON serializes the struct using spec logic. func (o TagCreateItemsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -133,8 +142,8 @@ func (o TagCreateItemsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TagCreateItemsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Key *string `json:"key"` + Id *string `json:"id,omitempty"` + Key *string `json:"key"` Value *string `json:"value"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -148,7 +157,7 @@ func (o *TagCreateItemsItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "key", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "key", "value", }) } else { return err } diff --git a/api/kbcloud/admin/model_tag_update.go b/api/kbcloud/admin/model_tag_update.go index 59c1d444..22fadcff 100644 --- a/api/kbcloud/admin/model_tag_update.go +++ b/api/kbcloud/admin/model_tag_update.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// TagUpdate Tag update + + +// TagUpdate Tag update type TagUpdate struct { // The key of the tag Key string `json:"key"` // the value corresponding th the key Value string `json:"value"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTagUpdate instantiates a new TagUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewTagUpdateWithDefaults() *TagUpdate { this := TagUpdate{} return &this } - // GetKey returns the Key field value. func (o *TagUpdate) GetKey() string { if o == nil { @@ -63,6 +68,7 @@ func (o *TagUpdate) SetKey(v string) { o.Key = v } + // GetValue returns the Value field value. func (o *TagUpdate) GetValue() string { if o == nil { @@ -86,6 +92,8 @@ func (o *TagUpdate) SetValue(v string) { o.Value = v } + + // MarshalJSON serializes the struct using spec logic. func (o TagUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,7 +112,7 @@ func (o TagUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TagUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Key *string `json:"key"` + Key *string `json:"key"` Value *string `json:"value"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,7 +126,7 @@ func (o *TagUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"key", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "key", "value", }) } else { return err } diff --git a/api/kbcloud/admin/model_tenant.go b/api/kbcloud/admin/model_tenant.go index d0c3bae3..706c7f19 100644 --- a/api/kbcloud/admin/model_tenant.go +++ b/api/kbcloud/admin/model_tenant.go @@ -2,30 +2,40 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Tenant struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Mode *string `json:"mode,omitempty"` - CreateAt *string `json:"create_at,omitempty"` - Role *string `json:"role,omitempty"` - PrimaryZone *string `json:"primary_zone,omitempty"` - Status *string `json:"status,omitempty"` - PrimaryZoneProxy *string `json:"primary_zone_proxy,omitempty"` - ChartSet *string `json:"chart_set,omitempty"` - Resource *string `json:"resource,omitempty"` - Cpu *CPU `json:"cpu,omitempty"` - Memory *Memory `json:"memory,omitempty"` - LogDisk *LogDisk `json:"log_disk,omitempty"` - DataDisk *DataDisk `json:"data_disk,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Mode *string `json:"mode,omitempty"` + CreateAt *string `json:"create_at,omitempty"` + Role *string `json:"role,omitempty"` + PrimaryZone *string `json:"primary_zone,omitempty"` + Status *string `json:"status,omitempty"` + PrimaryZoneProxy *string `json:"primary_zone_proxy,omitempty"` + ChartSet *string `json:"chart_set,omitempty"` + Resource *string `json:"resource,omitempty"` + Cpu *CPU `json:"cpu,omitempty"` + Memory *Memory `json:"memory,omitempty"` + LogDisk *LogDisk `json:"log_disk,omitempty"` + DataDisk *DataDisk `json:"data_disk,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTenant instantiates a new Tenant object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +52,6 @@ func NewTenantWithDefaults() *Tenant { this := Tenant{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Tenant) GetId() string { if o == nil || o.Id == nil { @@ -71,6 +80,7 @@ func (o *Tenant) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Tenant) GetName() string { if o == nil || o.Name == nil { @@ -99,6 +109,7 @@ func (o *Tenant) SetName(v string) { o.Name = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *Tenant) GetMode() string { if o == nil || o.Mode == nil { @@ -127,6 +138,7 @@ func (o *Tenant) SetMode(v string) { o.Mode = &v } + // GetCreateAt returns the CreateAt field value if set, zero value otherwise. func (o *Tenant) GetCreateAt() string { if o == nil || o.CreateAt == nil { @@ -155,6 +167,7 @@ func (o *Tenant) SetCreateAt(v string) { o.CreateAt = &v } + // GetRole returns the Role field value if set, zero value otherwise. func (o *Tenant) GetRole() string { if o == nil || o.Role == nil { @@ -183,6 +196,7 @@ func (o *Tenant) SetRole(v string) { o.Role = &v } + // GetPrimaryZone returns the PrimaryZone field value if set, zero value otherwise. func (o *Tenant) GetPrimaryZone() string { if o == nil || o.PrimaryZone == nil { @@ -211,6 +225,7 @@ func (o *Tenant) SetPrimaryZone(v string) { o.PrimaryZone = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Tenant) GetStatus() string { if o == nil || o.Status == nil { @@ -239,6 +254,7 @@ func (o *Tenant) SetStatus(v string) { o.Status = &v } + // GetPrimaryZoneProxy returns the PrimaryZoneProxy field value if set, zero value otherwise. func (o *Tenant) GetPrimaryZoneProxy() string { if o == nil || o.PrimaryZoneProxy == nil { @@ -267,6 +283,7 @@ func (o *Tenant) SetPrimaryZoneProxy(v string) { o.PrimaryZoneProxy = &v } + // GetChartSet returns the ChartSet field value if set, zero value otherwise. func (o *Tenant) GetChartSet() string { if o == nil || o.ChartSet == nil { @@ -295,6 +312,7 @@ func (o *Tenant) SetChartSet(v string) { o.ChartSet = &v } + // GetResource returns the Resource field value if set, zero value otherwise. func (o *Tenant) GetResource() string { if o == nil || o.Resource == nil { @@ -323,6 +341,7 @@ func (o *Tenant) SetResource(v string) { o.Resource = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *Tenant) GetCpu() CPU { if o == nil || o.Cpu == nil { @@ -351,6 +370,7 @@ func (o *Tenant) SetCpu(v CPU) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *Tenant) GetMemory() Memory { if o == nil || o.Memory == nil { @@ -379,6 +399,7 @@ func (o *Tenant) SetMemory(v Memory) { o.Memory = &v } + // GetLogDisk returns the LogDisk field value if set, zero value otherwise. func (o *Tenant) GetLogDisk() LogDisk { if o == nil || o.LogDisk == nil { @@ -407,6 +428,7 @@ func (o *Tenant) SetLogDisk(v LogDisk) { o.LogDisk = &v } + // GetDataDisk returns the DataDisk field value if set, zero value otherwise. func (o *Tenant) GetDataDisk() DataDisk { if o == nil || o.DataDisk == nil { @@ -435,6 +457,8 @@ func (o *Tenant) SetDataDisk(v DataDisk) { o.DataDisk = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Tenant) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -493,27 +517,27 @@ func (o Tenant) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Tenant) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Mode *string `json:"mode,omitempty"` - CreateAt *string `json:"create_at,omitempty"` - Role *string `json:"role,omitempty"` - PrimaryZone *string `json:"primary_zone,omitempty"` - Status *string `json:"status,omitempty"` - PrimaryZoneProxy *string `json:"primary_zone_proxy,omitempty"` - ChartSet *string `json:"chart_set,omitempty"` - Resource *string `json:"resource,omitempty"` - Cpu *CPU `json:"cpu,omitempty"` - Memory *Memory `json:"memory,omitempty"` - LogDisk *LogDisk `json:"log_disk,omitempty"` - DataDisk *DataDisk `json:"data_disk,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Mode *string `json:"mode,omitempty"` + CreateAt *string `json:"create_at,omitempty"` + Role *string `json:"role,omitempty"` + PrimaryZone *string `json:"primary_zone,omitempty"` + Status *string `json:"status,omitempty"` + PrimaryZoneProxy *string `json:"primary_zone_proxy,omitempty"` + ChartSet *string `json:"chart_set,omitempty"` + Resource *string `json:"resource,omitempty"` + Cpu *CPU `json:"cpu,omitempty"` + Memory *Memory `json:"memory,omitempty"` + LogDisk *LogDisk `json:"log_disk,omitempty"` + DataDisk *DataDisk `json:"data_disk,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "mode", "create_at", "role", "primary_zone", "status", "primary_zone_proxy", "chart_set", "resource", "cpu", "memory", "log_disk", "data_disk"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "mode", "create_at", "role", "primary_zone", "status", "primary_zone_proxy", "chart_set", "resource", "cpu", "memory", "log_disk", "data_disk", }) } else { return err } @@ -529,19 +553,19 @@ func (o *Tenant) UnmarshalJSON(bytes []byte) (err error) { o.PrimaryZoneProxy = all.PrimaryZoneProxy o.ChartSet = all.ChartSet o.Resource = all.Resource - if all.Cpu != nil && all.Cpu.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Cpu != nil && all.Cpu.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Cpu = all.Cpu - if all.Memory != nil && all.Memory.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Memory != nil && all.Memory.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Memory = all.Memory - if all.LogDisk != nil && all.LogDisk.UnparsedObject != nil && o.UnparsedObject == nil { + if all.LogDisk != nil && all.LogDisk.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.LogDisk = all.LogDisk - if all.DataDisk != nil && all.DataDisk.UnparsedObject != nil && o.UnparsedObject == nil { + if all.DataDisk != nil && all.DataDisk.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.DataDisk = all.DataDisk diff --git a/api/kbcloud/admin/model_tls_cert.go b/api/kbcloud/admin/model_tls_cert.go index 82ee5a9b..8f2587b2 100644 --- a/api/kbcloud/admin/model_tls_cert.go +++ b/api/kbcloud/admin/model_tls_cert.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type TlsCert struct { // Configuration for TLS including all certificates and keys TlsConfig *TlsConfig `json:"tlsConfig,omitempty"` @@ -20,10 +29,11 @@ type TlsCert struct { // Expiration days of Truststore certificate ExpirationDaysTruststore *int32 `json:"expirationDaysTruststore,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTlsCert instantiates a new TlsCert object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +50,6 @@ func NewTlsCertWithDefaults() *TlsCert { this := TlsCert{} return &this } - // GetTlsConfig returns the TlsConfig field value if set, zero value otherwise. func (o *TlsCert) GetTlsConfig() TlsConfig { if o == nil || o.TlsConfig == nil { @@ -69,6 +78,7 @@ func (o *TlsCert) SetTlsConfig(v TlsConfig) { o.TlsConfig = &v } + // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *TlsCert) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -97,6 +107,7 @@ func (o *TlsCert) SetComponentName(v string) { o.ComponentName = &v } + // GetExpirationDaysCa returns the ExpirationDaysCa field value if set, zero value otherwise. func (o *TlsCert) GetExpirationDaysCa() int32 { if o == nil || o.ExpirationDaysCa == nil { @@ -125,6 +136,7 @@ func (o *TlsCert) SetExpirationDaysCa(v int32) { o.ExpirationDaysCa = &v } + // GetExpirationDaysClient returns the ExpirationDaysClient field value if set, zero value otherwise. func (o *TlsCert) GetExpirationDaysClient() int32 { if o == nil || o.ExpirationDaysClient == nil { @@ -153,6 +165,7 @@ func (o *TlsCert) SetExpirationDaysClient(v int32) { o.ExpirationDaysClient = &v } + // GetExpirationDaysKeystore returns the ExpirationDaysKeystore field value if set, zero value otherwise. func (o *TlsCert) GetExpirationDaysKeystore() int32 { if o == nil || o.ExpirationDaysKeystore == nil { @@ -181,6 +194,7 @@ func (o *TlsCert) SetExpirationDaysKeystore(v int32) { o.ExpirationDaysKeystore = &v } + // GetExpirationDaysTruststore returns the ExpirationDaysTruststore field value if set, zero value otherwise. func (o *TlsCert) GetExpirationDaysTruststore() int32 { if o == nil || o.ExpirationDaysTruststore == nil { @@ -209,6 +223,8 @@ func (o *TlsCert) SetExpirationDaysTruststore(v int32) { o.ExpirationDaysTruststore = &v } + + // MarshalJSON serializes the struct using spec logic. func (o TlsCert) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -243,25 +259,25 @@ func (o TlsCert) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TlsCert) UnmarshalJSON(bytes []byte) (err error) { all := struct { - TlsConfig *TlsConfig `json:"tlsConfig,omitempty"` - ComponentName *string `json:"componentName,omitempty"` - ExpirationDaysCa *int32 `json:"expirationDaysCA,omitempty"` - ExpirationDaysClient *int32 `json:"expirationDaysClient,omitempty"` - ExpirationDaysKeystore *int32 `json:"expirationDaysKeystore,omitempty"` - ExpirationDaysTruststore *int32 `json:"expirationDaysTruststore,omitempty"` + TlsConfig *TlsConfig `json:"tlsConfig,omitempty"` + ComponentName *string `json:"componentName,omitempty"` + ExpirationDaysCa *int32 `json:"expirationDaysCA,omitempty"` + ExpirationDaysClient *int32 `json:"expirationDaysClient,omitempty"` + ExpirationDaysKeystore *int32 `json:"expirationDaysKeystore,omitempty"` + ExpirationDaysTruststore *int32 `json:"expirationDaysTruststore,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"tlsConfig", "componentName", "expirationDaysCA", "expirationDaysClient", "expirationDaysKeystore", "expirationDaysTruststore"}) + common.DeleteKeys(additionalProperties, &[]string{ "tlsConfig", "componentName", "expirationDaysCA", "expirationDaysClient", "expirationDaysKeystore", "expirationDaysTruststore", }) } else { return err } hasInvalidField := false - if all.TlsConfig != nil && all.TlsConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.TlsConfig != nil && all.TlsConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.TlsConfig = all.TlsConfig diff --git a/api/kbcloud/admin/model_tls_config.go b/api/kbcloud/admin/model_tls_config.go index 77396aa9..33f72af9 100644 --- a/api/kbcloud/admin/model_tls_config.go +++ b/api/kbcloud/admin/model_tls_config.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// TlsConfig Configuration for TLS including all certificates and keys + +// TlsConfig Configuration for TLS including all certificates and keys type TlsConfig struct { // CA Certificate CaCert *string `json:"caCert,omitempty"` @@ -19,10 +28,11 @@ type TlsConfig struct { // Truststore in PEM format Truststore *string `json:"truststore,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTlsConfig instantiates a new TlsConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewTlsConfigWithDefaults() *TlsConfig { this := TlsConfig{} return &this } - // GetCaCert returns the CaCert field value if set, zero value otherwise. func (o *TlsConfig) GetCaCert() string { if o == nil || o.CaCert == nil { @@ -68,6 +77,7 @@ func (o *TlsConfig) SetCaCert(v string) { o.CaCert = &v } + // GetClientCert returns the ClientCert field value if set, zero value otherwise. func (o *TlsConfig) GetClientCert() string { if o == nil || o.ClientCert == nil { @@ -96,6 +106,7 @@ func (o *TlsConfig) SetClientCert(v string) { o.ClientCert = &v } + // GetClientKey returns the ClientKey field value if set, zero value otherwise. func (o *TlsConfig) GetClientKey() string { if o == nil || o.ClientKey == nil { @@ -124,6 +135,7 @@ func (o *TlsConfig) SetClientKey(v string) { o.ClientKey = &v } + // GetKeystore returns the Keystore field value if set, zero value otherwise. func (o *TlsConfig) GetKeystore() string { if o == nil || o.Keystore == nil { @@ -152,6 +164,7 @@ func (o *TlsConfig) SetKeystore(v string) { o.Keystore = &v } + // GetTruststore returns the Truststore field value if set, zero value otherwise. func (o *TlsConfig) GetTruststore() string { if o == nil || o.Truststore == nil { @@ -180,6 +193,8 @@ func (o *TlsConfig) SetTruststore(v string) { o.Truststore = &v } + + // MarshalJSON serializes the struct using spec logic. func (o TlsConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,10 +226,10 @@ func (o TlsConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TlsConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CaCert *string `json:"caCert,omitempty"` + CaCert *string `json:"caCert,omitempty"` ClientCert *string `json:"clientCert,omitempty"` - ClientKey *string `json:"clientKey,omitempty"` - Keystore *string `json:"keystore,omitempty"` + ClientKey *string `json:"clientKey,omitempty"` + Keystore *string `json:"keystore,omitempty"` Truststore *string `json:"truststore,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -222,7 +237,7 @@ func (o *TlsConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"caCert", "clientCert", "clientKey", "keystore", "truststore"}) + common.DeleteKeys(additionalProperties, &[]string{ "caCert", "clientCert", "clientKey", "keystore", "truststore", }) } else { return err } diff --git a/api/kbcloud/admin/model_tls_request.go b/api/kbcloud/admin/model_tls_request.go index 05e05992..c06929e2 100644 --- a/api/kbcloud/admin/model_tls_request.go +++ b/api/kbcloud/admin/model_tls_request.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type TlsRequest struct { // Enable TLS or not Enable *bool `json:"enable,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTlsRequest instantiates a new TlsRequest object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewTlsRequestWithDefaults() *TlsRequest { this := TlsRequest{} return &this } - // GetEnable returns the Enable field value if set, zero value otherwise. func (o *TlsRequest) GetEnable() bool { if o == nil || o.Enable == nil { @@ -59,6 +68,8 @@ func (o *TlsRequest) SetEnable(v bool) { o.Enable = &v } + + // MarshalJSON serializes the struct using spec logic. func (o TlsRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *TlsRequest) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enable"}) + common.DeleteKeys(additionalProperties, &[]string{ "enable", }) } else { return err } diff --git a/api/kbcloud/admin/model_tolerate_default_taints.go b/api/kbcloud/admin/model_tolerate_default_taints.go index a98c1b99..a79f528e 100644 --- a/api/kbcloud/admin/model_tolerate_default_taints.go +++ b/api/kbcloud/admin/model_tolerate_default_taints.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// TolerateDefaultTaints When creating a cluster, add the default tolerations from the bootstrap node to the pods +// TolerateDefaultTaints When creating a cluster, add the default tolerations from the bootstrap node to the pods type TolerateDefaultTaints struct { - Enabled *bool `json:"enabled,omitempty"` - Taints []string `json:"taints,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Taints []string `json:"taints,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTolerateDefaultTaints instantiates a new TolerateDefaultTaints object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewTolerateDefaultTaintsWithDefaults() *TolerateDefaultTaints { this := TolerateDefaultTaints{} return &this } - // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *TolerateDefaultTaints) GetEnabled() bool { if o == nil || o.Enabled == nil { @@ -60,6 +69,7 @@ func (o *TolerateDefaultTaints) SetEnabled(v bool) { o.Enabled = &v } + // GetTaints returns the Taints field value if set, zero value otherwise. func (o *TolerateDefaultTaints) GetTaints() []string { if o == nil || o.Taints == nil { @@ -88,6 +98,8 @@ func (o *TolerateDefaultTaints) SetTaints(v []string) { o.Taints = v } + + // MarshalJSON serializes the struct using spec logic. func (o TolerateDefaultTaints) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,15 +122,15 @@ func (o TolerateDefaultTaints) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TolerateDefaultTaints) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Enabled *bool `json:"enabled,omitempty"` - Taints []string `json:"taints,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Taints []string `json:"taints,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled", "taints"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", "taints", }) } else { return err } diff --git a/api/kbcloud/admin/model_tree_node.go b/api/kbcloud/admin/model_tree_node.go index 60e6fb17..2248e645 100644 --- a/api/kbcloud/admin/model_tree_node.go +++ b/api/kbcloud/admin/model_tree_node.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type TreeNode struct { // A string representing the level of the node. Level *string `json:"level,omitempty"` @@ -18,10 +27,11 @@ type TreeNode struct { // An array of child nodes. Children []TreeNode `json:"children,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTreeNode instantiates a new TreeNode object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +48,6 @@ func NewTreeNodeWithDefaults() *TreeNode { this := TreeNode{} return &this } - // GetLevel returns the Level field value if set, zero value otherwise. func (o *TreeNode) GetLevel() string { if o == nil || o.Level == nil { @@ -67,6 +76,7 @@ func (o *TreeNode) SetLevel(v string) { o.Level = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *TreeNode) GetName() string { if o == nil || o.Name == nil { @@ -95,6 +105,7 @@ func (o *TreeNode) SetName(v string) { o.Name = &v } + // GetUid returns the Uid field value if set, zero value otherwise. func (o *TreeNode) GetUid() string { if o == nil || o.Uid == nil { @@ -123,6 +134,7 @@ func (o *TreeNode) SetUid(v string) { o.Uid = &v } + // GetEvents returns the Events field value if set, zero value otherwise. func (o *TreeNode) GetEvents() []Event { if o == nil || o.Events == nil { @@ -151,6 +163,7 @@ func (o *TreeNode) SetEvents(v []Event) { o.Events = v } + // GetChildren returns the Children field value if set, zero value otherwise. func (o *TreeNode) GetChildren() []TreeNode { if o == nil || o.Children == nil { @@ -179,6 +192,8 @@ func (o *TreeNode) SetChildren(v []TreeNode) { o.Children = v } + + // MarshalJSON serializes the struct using spec logic. func (o TreeNode) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -210,10 +225,10 @@ func (o TreeNode) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TreeNode) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Level *string `json:"level,omitempty"` - Name *string `json:"name,omitempty"` - Uid *string `json:"uid,omitempty"` - Events []Event `json:"events,omitempty"` + Level *string `json:"level,omitempty"` + Name *string `json:"name,omitempty"` + Uid *string `json:"uid,omitempty"` + Events []Event `json:"events,omitempty"` Children []TreeNode `json:"children,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -221,7 +236,7 @@ func (o *TreeNode) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"level", "name", "uid", "events", "children"}) + common.DeleteKeys(additionalProperties, &[]string{ "level", "name", "uid", "events", "children", }) } else { return err } diff --git a/api/kbcloud/admin/model_view.go b/api/kbcloud/admin/model_view.go index 70673327..00257e26 100644 --- a/api/kbcloud/admin/model_view.go +++ b/api/kbcloud/admin/model_view.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// View View is the schema for the views API + +// View View is the schema for the views API type View struct { // A label selector is a label query over a set of resources. InvolvedObjectsSelector *ViewInvolvedObjectsSelector `json:"involvedObjectsSelector,omitempty"` @@ -19,10 +28,11 @@ type View struct { // Progress describes the overall progress of the view. Progress *string `json:"progress,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewView instantiates a new View object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewViewWithDefaults() *View { this := View{} return &this } - // GetInvolvedObjectsSelector returns the InvolvedObjectsSelector field value if set, zero value otherwise. func (o *View) GetInvolvedObjectsSelector() ViewInvolvedObjectsSelector { if o == nil || o.InvolvedObjectsSelector == nil { @@ -68,6 +77,7 @@ func (o *View) SetInvolvedObjectsSelector(v ViewInvolvedObjectsSelector) { o.InvolvedObjectsSelector = &v } + // GetTargetResource returns the TargetResource field value if set, zero value otherwise. func (o *View) GetTargetResource() string { if o == nil || o.TargetResource == nil { @@ -96,6 +106,7 @@ func (o *View) SetTargetResource(v string) { o.TargetResource = &v } + // GetViewDefRef returns the ViewDefRef field value if set, zero value otherwise. func (o *View) GetViewDefRef() string { if o == nil || o.ViewDefRef == nil { @@ -124,6 +135,7 @@ func (o *View) SetViewDefRef(v string) { o.ViewDefRef = &v } + // GetEvents returns the Events field value if set, zero value otherwise. func (o *View) GetEvents() []Event { if o == nil || o.Events == nil { @@ -152,6 +164,7 @@ func (o *View) SetEvents(v []Event) { o.Events = v } + // GetProgress returns the Progress field value if set, zero value otherwise. func (o *View) GetProgress() string { if o == nil || o.Progress == nil { @@ -180,6 +193,8 @@ func (o *View) SetProgress(v string) { o.Progress = &v } + + // MarshalJSON serializes the struct using spec logic. func (o View) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -212,23 +227,23 @@ func (o View) MarshalJSON() ([]byte, error) { func (o *View) UnmarshalJSON(bytes []byte) (err error) { all := struct { InvolvedObjectsSelector *ViewInvolvedObjectsSelector `json:"involvedObjectsSelector,omitempty"` - TargetResource *string `json:"targetResource,omitempty"` - ViewDefRef *string `json:"viewDefRef,omitempty"` - Events []Event `json:"events,omitempty"` - Progress *string `json:"progress,omitempty"` + TargetResource *string `json:"targetResource,omitempty"` + ViewDefRef *string `json:"viewDefRef,omitempty"` + Events []Event `json:"events,omitempty"` + Progress *string `json:"progress,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"involvedObjectsSelector", "targetResource", "viewDefRef", "events", "progress"}) + common.DeleteKeys(additionalProperties, &[]string{ "involvedObjectsSelector", "targetResource", "viewDefRef", "events", "progress", }) } else { return err } hasInvalidField := false - if all.InvolvedObjectsSelector != nil && all.InvolvedObjectsSelector.UnparsedObject != nil && o.UnparsedObject == nil { + if all.InvolvedObjectsSelector != nil && all.InvolvedObjectsSelector.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.InvolvedObjectsSelector = all.InvolvedObjectsSelector diff --git a/api/kbcloud/admin/model_view_involved_objects_selector.go b/api/kbcloud/admin/model_view_involved_objects_selector.go index 6dfd702b..6dcc121f 100644 --- a/api/kbcloud/admin/model_view_involved_objects_selector.go +++ b/api/kbcloud/admin/model_view_involved_objects_selector.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ViewInvolvedObjectsSelector A label selector is a label query over a set of resources. +// ViewInvolvedObjectsSelector A label selector is a label query over a set of resources. type ViewInvolvedObjectsSelector struct { // matchExpressions is a list of label selector requirements. The requirements are ANDed. MatchExpressions []ViewInvolvedObjectsSelectorMatchExpressionsItem `json:"matchExpressions,omitempty"` // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. MatchLabels map[string]string `json:"matchLabels,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewViewInvolvedObjectsSelector instantiates a new ViewInvolvedObjectsSelector object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewViewInvolvedObjectsSelectorWithDefaults() *ViewInvolvedObjectsSelector { this := ViewInvolvedObjectsSelector{} return &this } - // GetMatchExpressions returns the MatchExpressions field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelector) GetMatchExpressions() []ViewInvolvedObjectsSelectorMatchExpressionsItem { if o == nil || o.MatchExpressions == nil { @@ -62,6 +71,7 @@ func (o *ViewInvolvedObjectsSelector) SetMatchExpressions(v []ViewInvolvedObject o.MatchExpressions = v } + // GetMatchLabels returns the MatchLabels field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelector) GetMatchLabels() map[string]string { if o == nil || o.MatchLabels == nil { @@ -90,6 +100,8 @@ func (o *ViewInvolvedObjectsSelector) SetMatchLabels(v map[string]string) { o.MatchLabels = v } + + // MarshalJSON serializes the struct using spec logic. func (o ViewInvolvedObjectsSelector) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -113,14 +125,14 @@ func (o ViewInvolvedObjectsSelector) MarshalJSON() ([]byte, error) { func (o *ViewInvolvedObjectsSelector) UnmarshalJSON(bytes []byte) (err error) { all := struct { MatchExpressions []ViewInvolvedObjectsSelectorMatchExpressionsItem `json:"matchExpressions,omitempty"` - MatchLabels map[string]string `json:"matchLabels,omitempty"` + MatchLabels map[string]string `json:"matchLabels,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"matchExpressions", "matchLabels"}) + common.DeleteKeys(additionalProperties, &[]string{ "matchExpressions", "matchLabels", }) } else { return err } diff --git a/api/kbcloud/admin/model_view_involved_objects_selector_match_expressions_item.go b/api/kbcloud/admin/model_view_involved_objects_selector_match_expressions_item.go index 0c6edae0..1f218745 100644 --- a/api/kbcloud/admin/model_view_involved_objects_selector_match_expressions_item.go +++ b/api/kbcloud/admin/model_view_involved_objects_selector_match_expressions_item.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ViewInvolvedObjectsSelectorMatchExpressionsItem struct { // key is the label key that the selector applies to. Key *string `json:"key,omitempty"` @@ -14,10 +23,11 @@ type ViewInvolvedObjectsSelectorMatchExpressionsItem struct { // values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. Values []string `json:"values,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewViewInvolvedObjectsSelectorMatchExpressionsItem instantiates a new ViewInvolvedObjectsSelectorMatchExpressionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +44,6 @@ func NewViewInvolvedObjectsSelectorMatchExpressionsItemWithDefaults() *ViewInvol this := ViewInvolvedObjectsSelectorMatchExpressionsItem{} return &this } - // GetKey returns the Key field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) GetKey() string { if o == nil || o.Key == nil { @@ -63,6 +72,7 @@ func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) SetKey(v string) { o.Key = &v } + // GetOperator returns the Operator field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) GetOperator() string { if o == nil || o.Operator == nil { @@ -91,6 +101,7 @@ func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) SetOperator(v string) o.Operator = &v } + // GetValues returns the Values field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) GetValues() []string { if o == nil || o.Values == nil { @@ -119,6 +130,8 @@ func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) SetValues(v []string) o.Values = v } + + // MarshalJSON serializes the struct using spec logic. func (o ViewInvolvedObjectsSelectorMatchExpressionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -144,16 +157,16 @@ func (o ViewInvolvedObjectsSelectorMatchExpressionsItem) MarshalJSON() ([]byte, // UnmarshalJSON deserializes the given payload. func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Key *string `json:"key,omitempty"` - Operator *string `json:"operator,omitempty"` - Values []string `json:"values,omitempty"` + Key *string `json:"key,omitempty"` + Operator *string `json:"operator,omitempty"` + Values []string `json:"values,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"key", "operator", "values"}) + common.DeleteKeys(additionalProperties, &[]string{ "key", "operator", "values", }) } else { return err } diff --git a/api/kbcloud/admin/model_vip_pool.go b/api/kbcloud/admin/model_vip_pool.go index c37f3f03..4187d663 100644 --- a/api/kbcloud/admin/model_vip_pool.go +++ b/api/kbcloud/admin/model_vip_pool.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// VipPool VIP Pool + + +// VipPool VIP Pool type VipPool struct { // IP Addresses Addresses string `json:"addresses"` @@ -21,10 +26,11 @@ type VipPool struct { // Used number of IP addresses Used int64 `json:"used"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewVipPool instantiates a new VipPool object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewVipPoolWithDefaults() *VipPool { this := VipPool{} return &this } - // GetAddresses returns the Addresses field value. func (o *VipPool) GetAddresses() string { if o == nil { @@ -68,6 +73,7 @@ func (o *VipPool) SetAddresses(v string) { o.Addresses = v } + // GetId returns the Id field value if set, zero value otherwise. func (o *VipPool) GetId() interface{} { if o == nil || o.Id == nil { @@ -96,6 +102,7 @@ func (o *VipPool) SetId(v interface{}) { o.Id = v } + // GetTotal returns the Total field value. func (o *VipPool) GetTotal() int64 { if o == nil { @@ -119,6 +126,7 @@ func (o *VipPool) SetTotal(v int64) { o.Total = v } + // GetUsed returns the Used field value. func (o *VipPool) GetUsed() int64 { if o == nil { @@ -142,6 +150,8 @@ func (o *VipPool) SetUsed(v int64) { o.Used = v } + + // MarshalJSON serializes the struct using spec logic. func (o VipPool) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -164,10 +174,10 @@ func (o VipPool) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *VipPool) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Addresses *string `json:"addresses"` - Id interface{} `json:"id,omitempty"` - Total *int64 `json:"total"` - Used *int64 `json:"used"` + Addresses *string `json:"addresses"` + Id interface{} `json:"id,omitempty"` + Total *int64 `json:"total"` + Used *int64 `json:"used"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -183,7 +193,7 @@ func (o *VipPool) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"addresses", "id", "total", "used"}) + common.DeleteKeys(additionalProperties, &[]string{ "addresses", "id", "total", "used", }) } else { return err } diff --git a/api/kbcloud/admin/model_vip_pool_create.go b/api/kbcloud/admin/model_vip_pool_create.go index 0095d7fa..08cd74d7 100644 --- a/api/kbcloud/admin/model_vip_pool_create.go +++ b/api/kbcloud/admin/model_vip_pool_create.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// VipPoolCreate VIP Pool create + + +// VipPoolCreate VIP Pool create type VipPoolCreate struct { // IP Addresses Addresses string `json:"addresses"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewVipPoolCreate instantiates a new VipPoolCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewVipPoolCreateWithDefaults() *VipPoolCreate { this := VipPoolCreate{} return &this } - // GetAddresses returns the Addresses field value. func (o *VipPoolCreate) GetAddresses() string { if o == nil { @@ -60,6 +65,8 @@ func (o *VipPoolCreate) SetAddresses(v string) { o.Addresses = v } + + // MarshalJSON serializes the struct using spec logic. func (o VipPoolCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *VipPoolCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"addresses"}) + common.DeleteKeys(additionalProperties, &[]string{ "addresses", }) } else { return err } diff --git a/api/kbcloud/admin/model_vip_pool_list.go b/api/kbcloud/admin/model_vip_pool_list.go index f471d11a..af7e89bc 100644 --- a/api/kbcloud/admin/model_vip_pool_list.go +++ b/api/kbcloud/admin/model_vip_pool_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// VipPoolList vipPoolList is a list of vip pools + + +// VipPoolList vipPoolList is a list of vip pools type VipPoolList struct { // Items is the list of vip pool objects in the list Items []VipPool `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewVipPoolList instantiates a new VipPoolList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewVipPoolListWithDefaults() *VipPoolList { this := VipPoolList{} return &this } - // GetItems returns the Items field value. func (o *VipPoolList) GetItems() []VipPool { if o == nil { @@ -60,6 +65,8 @@ func (o *VipPoolList) SetItems(v []VipPool) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o VipPoolList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *VipPoolList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_volume_expand.go b/api/kbcloud/admin/model_volume_expand.go index 609a2165..d8b15faf 100644 --- a/api/kbcloud/admin/model_volume_expand.go +++ b/api/kbcloud/admin/model_volume_expand.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type VolumeExpand struct { // the new volume size of cluster Size *string `json:"size,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewVolumeExpand instantiates a new VolumeExpand object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewVolumeExpandWithDefaults() *VolumeExpand { this := VolumeExpand{} return &this } - // GetSize returns the Size field value if set, zero value otherwise. func (o *VolumeExpand) GetSize() string { if o == nil || o.Size == nil { @@ -59,6 +68,8 @@ func (o *VolumeExpand) SetSize(v string) { o.Size = &v } + + // MarshalJSON serializes the struct using spec logic. func (o VolumeExpand) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *VolumeExpand) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"size"}) + common.DeleteKeys(additionalProperties, &[]string{ "size", }) } else { return err } diff --git a/api/kbcloud/admin/model_volume_restore_policy.go b/api/kbcloud/admin/model_volume_restore_policy.go index 4a87666c..bc791324 100644 --- a/api/kbcloud/admin/model_volume_restore_policy.go +++ b/api/kbcloud/admin/model_volume_restore_policy.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // VolumeRestorePolicy the volume claim restore policy, support values: [Serial, Parallel] type VolumeRestorePolicy string // List of VolumeRestorePolicy. const ( - VolumeRestorePolicySerial VolumeRestorePolicy = "Serial" + VolumeRestorePolicySerial VolumeRestorePolicy = "Serial" VolumeRestorePolicyParallel VolumeRestorePolicy = "Parallel" ) diff --git a/api/kbcloud/admin/model_vscale.go b/api/kbcloud/admin/model_vscale.go index db4c2bb8..7893bdd5 100644 --- a/api/kbcloud/admin/model_vscale.go +++ b/api/kbcloud/admin/model_vscale.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type Vscale struct { // the cpu resource of vertical scale Cpu string `json:"cpu"` // the memory resource of vertical scale Memory string `json:"memory"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewVscale instantiates a new Vscale object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewVscaleWithDefaults() *Vscale { this := Vscale{} return &this } - // GetCpu returns the Cpu field value. func (o *Vscale) GetCpu() string { if o == nil { @@ -62,6 +67,7 @@ func (o *Vscale) SetCpu(v string) { o.Cpu = v } + // GetMemory returns the Memory field value. func (o *Vscale) GetMemory() string { if o == nil { @@ -85,6 +91,8 @@ func (o *Vscale) SetMemory(v string) { o.Memory = v } + + // MarshalJSON serializes the struct using spec logic. func (o Vscale) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -103,7 +111,7 @@ func (o Vscale) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Vscale) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Cpu *string `json:"cpu"` + Cpu *string `json:"cpu"` Memory *string `json:"memory"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +125,7 @@ func (o *Vscale) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cpu", "memory"}) + common.DeleteKeys(additionalProperties, &[]string{ "cpu", "memory", }) } else { return err } diff --git a/api/kbcloud/admin/model_webhook_config.go b/api/kbcloud/admin/model_webhook_config.go index 89b2833d..c64b884b 100644 --- a/api/kbcloud/admin/model_webhook_config.go +++ b/api/kbcloud/admin/model_webhook_config.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// WebhookConfig Webhook config of alert receiver + + +// WebhookConfig Webhook config of alert receiver type WebhookConfig struct { Url string `json:"url"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewWebhookConfig instantiates a new WebhookConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewWebhookConfigWithDefaults() *WebhookConfig { this := WebhookConfig{} return &this } - // GetUrl returns the Url field value. func (o *WebhookConfig) GetUrl() string { if o == nil { @@ -59,6 +64,8 @@ func (o *WebhookConfig) SetUrl(v string) { o.Url = v } + + // MarshalJSON serializes the struct using spec logic. func (o WebhookConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *WebhookConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"url"}) + common.DeleteKeys(additionalProperties, &[]string{ "url", }) } else { return err } diff --git a/api/kbcloud/admin/model_workflow.go b/api/kbcloud/admin/model_workflow.go index d763ab74..d2237689 100644 --- a/api/kbcloud/admin/model_workflow.go +++ b/api/kbcloud/admin/model_workflow.go @@ -2,28 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Workflow component management workflow + + +// Workflow component management workflow type Workflow struct { - Name *string `json:"name,omitempty"` - Phase *string `json:"phase,omitempty"` - Message *string `json:"message,omitempty"` - StartedAt common.NullableTime `json:"startedAt,omitempty"` + Name *string `json:"name,omitempty"` + Phase *string `json:"phase,omitempty"` + Message *string `json:"message,omitempty"` + StartedAt common.NullableTime `json:"startedAt,omitempty"` FinishedAt common.NullableTime `json:"finishedAt,omitempty"` // ordered by time asc Steps []WorkflowStep `json:"steps,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewWorkflow instantiates a new Workflow object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewWorkflowWithDefaults() *Workflow { this := Workflow{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *Workflow) GetName() string { if o == nil || o.Name == nil { @@ -69,6 +74,7 @@ func (o *Workflow) SetName(v string) { o.Name = &v } + // GetPhase returns the Phase field value if set, zero value otherwise. func (o *Workflow) GetPhase() string { if o == nil || o.Phase == nil { @@ -97,6 +103,7 @@ func (o *Workflow) SetPhase(v string) { o.Phase = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *Workflow) GetMessage() string { if o == nil || o.Message == nil { @@ -125,6 +132,7 @@ func (o *Workflow) SetMessage(v string) { o.Message = &v } + // GetStartedAt returns the StartedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Workflow) GetStartedAt() time.Time { if o == nil || o.StartedAt.Get() == nil { @@ -138,7 +146,7 @@ func (o *Workflow) GetStartedAt() time.Time { // 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 *Workflow) GetStartedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.StartedAt.Get(), o.StartedAt.IsSet() @@ -153,7 +161,6 @@ func (o *Workflow) HasStartedAt() bool { func (o *Workflow) SetStartedAt(v time.Time) { o.StartedAt.Set(&v) } - // SetStartedAtNil sets the value for StartedAt to be an explicit nil. func (o *Workflow) SetStartedAtNil() { o.StartedAt.Set(nil) @@ -164,6 +171,7 @@ func (o *Workflow) UnsetStartedAt() { o.StartedAt.Unset() } + // GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Workflow) GetFinishedAt() time.Time { if o == nil || o.FinishedAt.Get() == nil { @@ -177,7 +185,7 @@ func (o *Workflow) GetFinishedAt() time.Time { // 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 *Workflow) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.FinishedAt.Get(), o.FinishedAt.IsSet() @@ -192,7 +200,6 @@ func (o *Workflow) HasFinishedAt() bool { func (o *Workflow) SetFinishedAt(v time.Time) { o.FinishedAt.Set(&v) } - // SetFinishedAtNil sets the value for FinishedAt to be an explicit nil. func (o *Workflow) SetFinishedAtNil() { o.FinishedAt.Set(nil) @@ -203,6 +210,7 @@ func (o *Workflow) UnsetFinishedAt() { o.FinishedAt.Unset() } + // GetSteps returns the Steps field value if set, zero value otherwise. func (o *Workflow) GetSteps() []WorkflowStep { if o == nil || o.Steps == nil { @@ -231,6 +239,8 @@ func (o *Workflow) SetSteps(v []WorkflowStep) { o.Steps = v } + + // MarshalJSON serializes the struct using spec logic. func (o Workflow) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -265,19 +275,19 @@ func (o Workflow) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Workflow) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Phase *string `json:"phase,omitempty"` - Message *string `json:"message,omitempty"` - StartedAt common.NullableTime `json:"startedAt,omitempty"` + Name *string `json:"name,omitempty"` + Phase *string `json:"phase,omitempty"` + Message *string `json:"message,omitempty"` + StartedAt common.NullableTime `json:"startedAt,omitempty"` FinishedAt common.NullableTime `json:"finishedAt,omitempty"` - Steps []WorkflowStep `json:"steps,omitempty"` + Steps []WorkflowStep `json:"steps,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "phase", "message", "startedAt", "finishedAt", "steps"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "phase", "message", "startedAt", "finishedAt", "steps", }) } else { return err } diff --git a/api/kbcloud/admin/model_workflow_create.go b/api/kbcloud/admin/model_workflow_create.go index 789cea2e..a5c627c0 100644 --- a/api/kbcloud/admin/model_workflow_create.go +++ b/api/kbcloud/admin/model_workflow_create.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type WorkflowCreate struct { // workflow type - Type *WorkflowType `json:"type,omitempty"` - Version *string `json:"version,omitempty"` - OteldVersion *string `json:"oteldVersion,omitempty"` + Type *WorkflowType `json:"type,omitempty"` + Version *string `json:"version,omitempty"` + OteldVersion *string `json:"oteldVersion,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewWorkflowCreate instantiates a new WorkflowCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewWorkflowCreateWithDefaults() *WorkflowCreate { this := WorkflowCreate{} return &this } - // GetType returns the Type field value if set, zero value otherwise. func (o *WorkflowCreate) GetType() WorkflowType { if o == nil || o.Type == nil { @@ -61,6 +70,7 @@ func (o *WorkflowCreate) SetType(v WorkflowType) { o.Type = &v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *WorkflowCreate) GetVersion() string { if o == nil || o.Version == nil { @@ -89,6 +99,7 @@ func (o *WorkflowCreate) SetVersion(v string) { o.Version = &v } + // GetOteldVersion returns the OteldVersion field value if set, zero value otherwise. func (o *WorkflowCreate) GetOteldVersion() string { if o == nil || o.OteldVersion == nil { @@ -117,6 +128,8 @@ func (o *WorkflowCreate) SetOteldVersion(v string) { o.OteldVersion = &v } + + // MarshalJSON serializes the struct using spec logic. func (o WorkflowCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -142,22 +155,22 @@ func (o WorkflowCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *WorkflowCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Type *WorkflowType `json:"type,omitempty"` - Version *string `json:"version,omitempty"` - OteldVersion *string `json:"oteldVersion,omitempty"` + Type *WorkflowType `json:"type,omitempty"` + Version *string `json:"version,omitempty"` + OteldVersion *string `json:"oteldVersion,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"type", "version", "oteldVersion"}) + common.DeleteKeys(additionalProperties, &[]string{ "type", "version", "oteldVersion", }) } else { return err } hasInvalidField := false - if all.Type != nil && !all.Type.IsValid() { + if all.Type != nil &&!all.Type.IsValid() { hasInvalidField = true } else { o.Type = all.Type diff --git a/api/kbcloud/admin/model_workflow_list.go b/api/kbcloud/admin/model_workflow_list.go index b32bfa71..e2517e13 100644 --- a/api/kbcloud/admin/model_workflow_list.go +++ b/api/kbcloud/admin/model_workflow_list.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// WorkflowList component management workflow list + +// WorkflowList component management workflow list type WorkflowList struct { // component management workflow Install *Workflow `json:"install,omitempty"` @@ -19,10 +28,11 @@ type WorkflowList struct { // component management workflow UpgradeVictoriaMetrics *Workflow `json:"upgradeVictoriaMetrics,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewWorkflowList instantiates a new WorkflowList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewWorkflowListWithDefaults() *WorkflowList { this := WorkflowList{} return &this } - // GetInstall returns the Install field value if set, zero value otherwise. func (o *WorkflowList) GetInstall() Workflow { if o == nil || o.Install == nil { @@ -68,6 +77,7 @@ func (o *WorkflowList) SetInstall(v Workflow) { o.Install = &v } + // GetUninstall returns the Uninstall field value if set, zero value otherwise. func (o *WorkflowList) GetUninstall() Workflow { if o == nil || o.Uninstall == nil { @@ -96,6 +106,7 @@ func (o *WorkflowList) SetUninstall(v Workflow) { o.Uninstall = &v } + // GetUpgradeKubeblocks returns the UpgradeKubeblocks field value if set, zero value otherwise. func (o *WorkflowList) GetUpgradeKubeblocks() Workflow { if o == nil || o.UpgradeKubeblocks == nil { @@ -124,6 +135,7 @@ func (o *WorkflowList) SetUpgradeKubeblocks(v Workflow) { o.UpgradeKubeblocks = &v } + // GetUpgradeGemini returns the UpgradeGemini field value if set, zero value otherwise. func (o *WorkflowList) GetUpgradeGemini() Workflow { if o == nil || o.UpgradeGemini == nil { @@ -152,6 +164,7 @@ func (o *WorkflowList) SetUpgradeGemini(v Workflow) { o.UpgradeGemini = &v } + // GetUpgradeVictoriaMetrics returns the UpgradeVictoriaMetrics field value if set, zero value otherwise. func (o *WorkflowList) GetUpgradeVictoriaMetrics() Workflow { if o == nil || o.UpgradeVictoriaMetrics == nil { @@ -180,6 +193,8 @@ func (o *WorkflowList) SetUpgradeVictoriaMetrics(v Workflow) { o.UpgradeVictoriaMetrics = &v } + + // MarshalJSON serializes the struct using spec logic. func (o WorkflowList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,10 +226,10 @@ func (o WorkflowList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *WorkflowList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Install *Workflow `json:"install,omitempty"` - Uninstall *Workflow `json:"uninstall,omitempty"` - UpgradeKubeblocks *Workflow `json:"upgradeKubeblocks,omitempty"` - UpgradeGemini *Workflow `json:"upgradeGemini,omitempty"` + Install *Workflow `json:"install,omitempty"` + Uninstall *Workflow `json:"uninstall,omitempty"` + UpgradeKubeblocks *Workflow `json:"upgradeKubeblocks,omitempty"` + UpgradeGemini *Workflow `json:"upgradeGemini,omitempty"` UpgradeVictoriaMetrics *Workflow `json:"upgradeVictoriaMetrics,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -222,29 +237,29 @@ func (o *WorkflowList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"install", "uninstall", "upgradeKubeblocks", "upgradeGemini", "upgradeVictoriaMetrics"}) + common.DeleteKeys(additionalProperties, &[]string{ "install", "uninstall", "upgradeKubeblocks", "upgradeGemini", "upgradeVictoriaMetrics", }) } else { return err } hasInvalidField := false - if all.Install != nil && all.Install.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Install != nil && all.Install.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Install = all.Install - if all.Uninstall != nil && all.Uninstall.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Uninstall != nil && all.Uninstall.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Uninstall = all.Uninstall - if all.UpgradeKubeblocks != nil && all.UpgradeKubeblocks.UnparsedObject != nil && o.UnparsedObject == nil { + if all.UpgradeKubeblocks != nil && all.UpgradeKubeblocks.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.UpgradeKubeblocks = all.UpgradeKubeblocks - if all.UpgradeGemini != nil && all.UpgradeGemini.UnparsedObject != nil && o.UnparsedObject == nil { + if all.UpgradeGemini != nil && all.UpgradeGemini.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.UpgradeGemini = all.UpgradeGemini - if all.UpgradeVictoriaMetrics != nil && all.UpgradeVictoriaMetrics.UnparsedObject != nil && o.UnparsedObject == nil { + if all.UpgradeVictoriaMetrics != nil && all.UpgradeVictoriaMetrics.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.UpgradeVictoriaMetrics = all.UpgradeVictoriaMetrics diff --git a/api/kbcloud/admin/model_workflow_step.go b/api/kbcloud/admin/model_workflow_step.go index 619fd1f3..66b4274d 100644 --- a/api/kbcloud/admin/model_workflow_step.go +++ b/api/kbcloud/admin/model_workflow_step.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// WorkflowStep workflow step + + +// WorkflowStep workflow step type WorkflowStep struct { - Name *string `json:"name,omitempty"` - Phase *string `json:"phase,omitempty"` - Message *string `json:"message,omitempty"` - StartedAt common.NullableTime `json:"startedAt,omitempty"` + Name *string `json:"name,omitempty"` + Phase *string `json:"phase,omitempty"` + Message *string `json:"message,omitempty"` + StartedAt common.NullableTime `json:"startedAt,omitempty"` FinishedAt common.NullableTime `json:"finishedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewWorkflowStep instantiates a new WorkflowStep object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewWorkflowStepWithDefaults() *WorkflowStep { this := WorkflowStep{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *WorkflowStep) GetName() string { if o == nil || o.Name == nil { @@ -67,6 +72,7 @@ func (o *WorkflowStep) SetName(v string) { o.Name = &v } + // GetPhase returns the Phase field value if set, zero value otherwise. func (o *WorkflowStep) GetPhase() string { if o == nil || o.Phase == nil { @@ -95,6 +101,7 @@ func (o *WorkflowStep) SetPhase(v string) { o.Phase = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *WorkflowStep) GetMessage() string { if o == nil || o.Message == nil { @@ -123,6 +130,7 @@ func (o *WorkflowStep) SetMessage(v string) { o.Message = &v } + // GetStartedAt returns the StartedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WorkflowStep) GetStartedAt() time.Time { if o == nil || o.StartedAt.Get() == nil { @@ -136,7 +144,7 @@ func (o *WorkflowStep) GetStartedAt() time.Time { // 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 *WorkflowStep) GetStartedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.StartedAt.Get(), o.StartedAt.IsSet() @@ -151,7 +159,6 @@ func (o *WorkflowStep) HasStartedAt() bool { func (o *WorkflowStep) SetStartedAt(v time.Time) { o.StartedAt.Set(&v) } - // SetStartedAtNil sets the value for StartedAt to be an explicit nil. func (o *WorkflowStep) SetStartedAtNil() { o.StartedAt.Set(nil) @@ -162,6 +169,7 @@ func (o *WorkflowStep) UnsetStartedAt() { o.StartedAt.Unset() } + // GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WorkflowStep) GetFinishedAt() time.Time { if o == nil || o.FinishedAt.Get() == nil { @@ -175,7 +183,7 @@ func (o *WorkflowStep) GetFinishedAt() time.Time { // 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 *WorkflowStep) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.FinishedAt.Get(), o.FinishedAt.IsSet() @@ -190,7 +198,6 @@ func (o *WorkflowStep) HasFinishedAt() bool { func (o *WorkflowStep) SetFinishedAt(v time.Time) { o.FinishedAt.Set(&v) } - // SetFinishedAtNil sets the value for FinishedAt to be an explicit nil. func (o *WorkflowStep) SetFinishedAtNil() { o.FinishedAt.Set(nil) @@ -201,6 +208,8 @@ func (o *WorkflowStep) UnsetFinishedAt() { o.FinishedAt.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o WorkflowStep) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -232,10 +241,10 @@ func (o WorkflowStep) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *WorkflowStep) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Phase *string `json:"phase,omitempty"` - Message *string `json:"message,omitempty"` - StartedAt common.NullableTime `json:"startedAt,omitempty"` + Name *string `json:"name,omitempty"` + Phase *string `json:"phase,omitempty"` + Message *string `json:"message,omitempty"` + StartedAt common.NullableTime `json:"startedAt,omitempty"` FinishedAt common.NullableTime `json:"finishedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -243,7 +252,7 @@ func (o *WorkflowStep) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "phase", "message", "startedAt", "finishedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "phase", "message", "startedAt", "finishedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_workflow_type.go b/api/kbcloud/admin/model_workflow_type.go index 5e18431e..ff410c82 100644 --- a/api/kbcloud/admin/model_workflow_type.go +++ b/api/kbcloud/admin/model_workflow_type.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // WorkflowType workflow type type WorkflowType string // List of WorkflowType. const ( - WorkflowTypeInstall WorkflowType = "install" - WorkflowTypeUpgradeKubeblocks WorkflowType = "upgradeKubeblocks" - WorkflowTypeUpgradeGemini WorkflowType = "upgradeGemini" - WorkflowTypeUninstall WorkflowType = "uninstall" + WorkflowTypeInstall WorkflowType = "install" + WorkflowTypeUpgradeKubeblocks WorkflowType = "upgradeKubeblocks" + WorkflowTypeUpgradeGemini WorkflowType = "upgradeGemini" + WorkflowTypeUninstall WorkflowType = "uninstall" WorkflowTypeUpgradeVictoriaMetrics WorkflowType = "upgradeVictoriaMetrics" ) diff --git a/api/kbcloud/admin/model_zone.go b/api/kbcloud/admin/model_zone.go index eb6ba774..5d21b8c7 100644 --- a/api/kbcloud/admin/model_zone.go +++ b/api/kbcloud/admin/model_zone.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Zone The zone that the region has. + + +// Zone The zone that the region has. type Zone struct { // The name of the zone. Name string `json:"name"` @@ -28,10 +32,11 @@ type Zone struct { // The time when the zone was last updated. UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewZone instantiates a new Zone object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +60,6 @@ func NewZoneWithDefaults() *Zone { this := Zone{} return &this } - // GetName returns the Name field value. func (o *Zone) GetName() string { if o == nil { @@ -79,6 +83,7 @@ func (o *Zone) SetName(v string) { o.Name = v } + // GetNameCn returns the NameCn field value. func (o *Zone) GetNameCn() string { if o == nil { @@ -102,6 +107,7 @@ func (o *Zone) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *Zone) GetNameEn() string { if o == nil { @@ -125,6 +131,7 @@ func (o *Zone) SetNameEn(v string) { o.NameEn = v } + // GetEnabled returns the Enabled field value. func (o *Zone) GetEnabled() bool { if o == nil { @@ -148,6 +155,7 @@ func (o *Zone) SetEnabled(v bool) { o.Enabled = v } + // GetRegion returns the Region field value. func (o *Zone) GetRegion() string { if o == nil { @@ -171,6 +179,7 @@ func (o *Zone) SetRegion(v string) { o.Region = v } + // GetCreatedAt returns the CreatedAt field value. func (o *Zone) GetCreatedAt() time.Time { if o == nil { @@ -194,6 +203,7 @@ func (o *Zone) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Zone) GetUpdatedAt() time.Time { if o == nil { @@ -217,6 +227,8 @@ func (o *Zone) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o Zone) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -248,11 +260,11 @@ func (o Zone) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Zone) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Enabled *bool `json:"enabled"` - Region *string `json:"region"` + Name *string `json:"name"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Enabled *bool `json:"enabled"` + Region *string `json:"region"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` }{} @@ -282,7 +294,7 @@ func (o *Zone) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "nameCN", "nameEN", "enabled", "region", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "nameCN", "nameEN", "enabled", "region", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/admin/model_zone_create.go b/api/kbcloud/admin/model_zone_create.go index d803a243..3297c337 100644 --- a/api/kbcloud/admin/model_zone_create.go +++ b/api/kbcloud/admin/model_zone_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ZoneCreate The zone that needs to be created. + + +// ZoneCreate The zone that needs to be created. type ZoneCreate struct { // The name of the zone. Name string `json:"name"` @@ -21,10 +26,11 @@ type ZoneCreate struct { // Whether the zone is enabled. Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewZoneCreate instantiates a new ZoneCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewZoneCreateWithDefaults() *ZoneCreate { this := ZoneCreate{} return &this } - // GetName returns the Name field value. func (o *ZoneCreate) GetName() string { if o == nil { @@ -69,6 +74,7 @@ func (o *ZoneCreate) SetName(v string) { o.Name = v } + // GetNameCn returns the NameCn field value. func (o *ZoneCreate) GetNameCn() string { if o == nil { @@ -92,6 +98,7 @@ func (o *ZoneCreate) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *ZoneCreate) GetNameEn() string { if o == nil { @@ -115,6 +122,7 @@ func (o *ZoneCreate) SetNameEn(v string) { o.NameEn = v } + // GetEnabled returns the Enabled field value. func (o *ZoneCreate) GetEnabled() bool { if o == nil { @@ -138,6 +146,8 @@ func (o *ZoneCreate) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o ZoneCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +168,10 @@ func (o ZoneCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ZoneCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Enabled *bool `json:"enabled"` + Name *string `json:"name"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Enabled *bool `json:"enabled"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *ZoneCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "nameCN", "nameEN", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "nameCN", "nameEN", "enabled", }) } else { return err } diff --git a/api/kbcloud/admin/model_zone_list.go b/api/kbcloud/admin/model_zone_list.go index 83e93ccd..ee53d975 100644 --- a/api/kbcloud/admin/model_zone_list.go +++ b/api/kbcloud/admin/model_zone_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ZoneList The list of zones. +// ZoneList The list of zones. type ZoneList struct { // The list of zones. Items []Zone `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewZoneList instantiates a new ZoneList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewZoneListWithDefaults() *ZoneList { this := ZoneList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ZoneList) GetItems() []Zone { if o == nil || o.Items == nil { @@ -60,6 +69,8 @@ func (o *ZoneList) SetItems(v []Zone) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ZoneList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *ZoneList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/admin/model_zone_update.go b/api/kbcloud/admin/model_zone_update.go index 5aa1c3c3..31a1ef3c 100644 --- a/api/kbcloud/admin/model_zone_update.go +++ b/api/kbcloud/admin/model_zone_update.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package admin import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ZoneUpdate The zone that needs to be updated. + + +// ZoneUpdate The zone that needs to be updated. type ZoneUpdate struct { // The Chinese name of the zone. NameCn string `json:"nameCN"` @@ -19,10 +24,11 @@ type ZoneUpdate struct { // Whether the zone is enabled. Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewZoneUpdate instantiates a new ZoneUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewZoneUpdateWithDefaults() *ZoneUpdate { this := ZoneUpdate{} return &this } - // GetNameCn returns the NameCn field value. func (o *ZoneUpdate) GetNameCn() string { if o == nil { @@ -66,6 +71,7 @@ func (o *ZoneUpdate) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *ZoneUpdate) GetNameEn() string { if o == nil { @@ -89,6 +95,7 @@ func (o *ZoneUpdate) SetNameEn(v string) { o.NameEn = v } + // GetEnabled returns the Enabled field value. func (o *ZoneUpdate) GetEnabled() bool { if o == nil { @@ -112,6 +119,8 @@ func (o *ZoneUpdate) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o ZoneUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -131,9 +140,9 @@ func (o ZoneUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ZoneUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Enabled *bool `json:"enabled"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Enabled *bool `json:"enabled"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,7 +158,7 @@ func (o *ZoneUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"nameCN", "nameEN", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "nameCN", "nameEN", "enabled", }) } else { return err } diff --git a/api/kbcloud/api_account.go b/api/kbcloud/api_account.go index f9f586c6..4c60a7fe 100644 --- a/api/kbcloud/api_account.go +++ b/api/kbcloud/api_account.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type AccountApi common.Service // create an account in cluster func (a *AccountApi) CreateAccount(ctx _context.Context, orgName string, clusterName string, body Account) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.CreateAccount") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *AccountApi) CreateAccount(ctx _context.Context, orgName string, cluster localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *AccountApi) CreateAccount(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -84,10 +93,12 @@ func (a *AccountApi) CreateAccount(ctx _context.Context, orgName string, cluster // delete an account in cluster func (a *AccountApi) DeleteAccount(ctx _context.Context, orgName string, clusterName string, accountName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.DeleteAccount") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -103,7 +114,8 @@ func (a *AccountApi) DeleteAccount(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -125,10 +137,11 @@ func (a *AccountApi) DeleteAccount(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -146,11 +159,13 @@ func (a *AccountApi) DeleteAccount(ctx _context.Context, orgName string, cluster // get dsn by username func (a *AccountApi) GetDSN(ctx _context.Context, orgName string, clusterName string, accountName string) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue string + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.GetDSN") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -166,7 +181,8 @@ func (a *AccountApi) GetDSN(ctx _context.Context, orgName string, clusterName st localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -188,10 +204,11 @@ func (a *AccountApi) GetDSN(ctx _context.Context, orgName string, clusterName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -205,7 +222,7 @@ func (a *AccountApi) GetDSN(ctx _context.Context, orgName string, clusterName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -224,7 +241,6 @@ func NewListAccountsOptionalParameters() *ListAccountsOptionalParameters { this := ListAccountsOptionalParameters{} return &this } - // WithIncludeRoot sets the corresponding parameter name and returns the struct. func (r *ListAccountsOptionalParameters) WithIncludeRoot(includeRoot bool) *ListAccountsOptionalParameters { r.IncludeRoot = &includeRoot @@ -235,18 +251,20 @@ func (r *ListAccountsOptionalParameters) WithIncludeRoot(includeRoot bool) *List // list accounts in cluster func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterName string, o ...ListAccountsOptionalParameters) ([]AccountListItem, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []AccountListItem - optionalParams ListAccountsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []AccountListItem + optionalParams ListAccountsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAccountsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAccountsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.ListAccounts") if err != nil { @@ -265,7 +283,8 @@ func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterN } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -287,10 +306,11 @@ func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -304,7 +324,7 @@ func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -317,10 +337,12 @@ func (a *AccountApi) ListAccounts(ctx _context.Context, orgName string, clusterN // update an account in cluster func (a *AccountApi) UpdateAccount(ctx _context.Context, orgName string, clusterName string, accountName string, body Account) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.UpdateAccount") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -337,9 +359,11 @@ func (a *AccountApi) UpdateAccount(ctx _context.Context, orgName string, cluster localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -361,10 +385,11 @@ func (a *AccountApi) UpdateAccount(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -382,10 +407,12 @@ func (a *AccountApi) UpdateAccount(ctx _context.Context, orgName string, cluster // update privileges of account func (a *AccountApi) UpdateAccountPrivileges(ctx _context.Context, orgName string, clusterName string, accountName string, body []PrivilegeListItem) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AccountApi.UpdateAccountPrivileges") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -402,9 +429,11 @@ func (a *AccountApi) UpdateAccountPrivileges(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -426,10 +455,11 @@ func (a *AccountApi) UpdateAccountPrivileges(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/api_alert_config.go b/api/kbcloud/api_alert_config.go index 335a941e..c6402ee0 100644 --- a/api/kbcloud/api_alert_config.go +++ b/api/kbcloud/api_alert_config.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertConfigApi common.Service // GetAlertConfig Get alert config. func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (AlertConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertConfig + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertConfig ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertConfigApi.GetAlertConfig") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (A localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (A if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -76,7 +84,7 @@ func (a *AlertConfigApi) GetAlertConfig(ctx _context.Context, orgName string) (A err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -95,7 +103,6 @@ func NewSetAlertConfigOptionalParameters() *SetAlertConfigOptionalParameters { this := SetAlertConfigOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *SetAlertConfigOptionalParameters) WithBody(body AlertConfig) *SetAlertConfigOptionalParameters { r.Body = &body @@ -105,18 +112,20 @@ func (r *SetAlertConfigOptionalParameters) WithBody(body AlertConfig) *SetAlertC // SetAlertConfig Set alert config. func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o ...SetAlertConfigOptionalParameters) (AlertConfig, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertConfig - optionalParams SetAlertConfigOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertConfig + optionalParams SetAlertConfigOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type SetAlertConfigOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type SetAlertConfigOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertConfigApi.SetAlertConfig") if err != nil { @@ -132,11 +141,13 @@ func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -158,10 +169,11 @@ func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -175,7 +187,7 @@ func (a *AlertConfigApi) SetAlertConfig(ctx _context.Context, orgName string, o err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_alert_inhibit.go b/api/kbcloud/api_alert_inhibit.go index 4d2db98f..ce6a29d3 100644 --- a/api/kbcloud/api_alert_inhibit.go +++ b/api/kbcloud/api_alert_inhibit.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewCreateAlertInhibitOptionalParameters() *CreateAlertInhibitOptionalParame this := CreateAlertInhibitOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *CreateAlertInhibitOptionalParameters) WithBody(body AlertInhibit) *CreateAlertInhibitOptionalParameters { r.Body = &body @@ -36,18 +39,20 @@ func (r *CreateAlertInhibitOptionalParameters) WithBody(body AlertInhibit) *Crea // CreateAlertInhibit Create alert inhibit. func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName string, o ...CreateAlertInhibitOptionalParameters) (AlertInhibit, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertInhibit - optionalParams CreateAlertInhibitOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertInhibit + optionalParams CreateAlertInhibitOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CreateAlertInhibitOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CreateAlertInhibitOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.CreateAlertInhibit") if err != nil { @@ -63,11 +68,13 @@ func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -89,10 +96,11 @@ func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -106,7 +114,7 @@ func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -118,11 +126,13 @@ func (a *AlertInhibitApi) CreateAlertInhibit(ctx _context.Context, orgName strin // DeleteAlertInhibit Delete alert inhibit. func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName string, inhibitId string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.DeleteAlertInhibit") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -137,7 +147,8 @@ func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName strin localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -159,10 +170,11 @@ func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -176,7 +188,7 @@ func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -188,11 +200,13 @@ func (a *AlertInhibitApi) DeleteAlertInhibit(ctx _context.Context, orgName strin // GetAlertInhibit Get alert inhibit. func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, inhibitId string) (AlertInhibit, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertInhibit + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertInhibit ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.GetAlertInhibit") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -207,7 +221,8 @@ func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -229,10 +244,11 @@ func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -246,7 +262,7 @@ func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -258,11 +274,13 @@ func (a *AlertInhibitApi) GetAlertInhibit(ctx _context.Context, orgName string, // ListAlertInhibits List alert inhibits. func (a *AlertInhibitApi) ListAlertInhibits(ctx _context.Context, orgName string) (AlertInhibitList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertInhibitList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertInhibitList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.ListAlertInhibits") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -276,7 +294,8 @@ func (a *AlertInhibitApi) ListAlertInhibits(ctx _context.Context, orgName string localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -298,10 +317,11 @@ func (a *AlertInhibitApi) ListAlertInhibits(ctx _context.Context, orgName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -315,7 +335,7 @@ func (a *AlertInhibitApi) ListAlertInhibits(ctx _context.Context, orgName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -334,7 +354,6 @@ func NewPatchAlertInhibitOptionalParameters() *PatchAlertInhibitOptionalParamete this := PatchAlertInhibitOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *PatchAlertInhibitOptionalParameters) WithBody(body AlertInhibit) *PatchAlertInhibitOptionalParameters { r.Body = &body @@ -344,18 +363,20 @@ func (r *PatchAlertInhibitOptionalParameters) WithBody(body AlertInhibit) *Patch // PatchAlertInhibit Patch alert inhibit. func (a *AlertInhibitApi) PatchAlertInhibit(ctx _context.Context, orgName string, o ...PatchAlertInhibitOptionalParameters) (AlertInhibit, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertInhibit - optionalParams PatchAlertInhibitOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertInhibit + optionalParams PatchAlertInhibitOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type PatchAlertInhibitOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type PatchAlertInhibitOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertInhibitApi.PatchAlertInhibit") if err != nil { @@ -371,11 +392,13 @@ func (a *AlertInhibitApi) PatchAlertInhibit(ctx _context.Context, orgName string localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -397,10 +420,11 @@ func (a *AlertInhibitApi) PatchAlertInhibit(ctx _context.Context, orgName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -414,7 +438,7 @@ func (a *AlertInhibitApi) PatchAlertInhibit(ctx _context.Context, orgName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_alert_metrics.go b/api/kbcloud/api_alert_metrics.go index 686eb123..610d29c1 100644 --- a/api/kbcloud/api_alert_metrics.go +++ b/api/kbcloud/api_alert_metrics.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListAlertMetricsOptionalParameters() *ListAlertMetricsOptionalParameters this := ListAlertMetricsOptionalParameters{} return &this } - // WithCategory sets the corresponding parameter name and returns the struct. func (r *ListAlertMetricsOptionalParameters) WithCategory(category string) *ListAlertMetricsOptionalParameters { r.Category = &category @@ -36,18 +39,20 @@ func (r *ListAlertMetricsOptionalParameters) WithCategory(category string) *List // ListAlertMetrics List alert metric types. func (a *AlertMetricsApi) ListAlertMetrics(ctx _context.Context, orgName string, o ...ListAlertMetricsOptionalParameters) (AlertMetricList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertMetricList - optionalParams ListAlertMetricsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertMetricList + optionalParams ListAlertMetricsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertMetricsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertMetricsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertMetricsApi.ListAlertMetrics") if err != nil { @@ -65,7 +70,8 @@ func (a *AlertMetricsApi) ListAlertMetrics(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -87,10 +93,11 @@ func (a *AlertMetricsApi) ListAlertMetrics(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -104,7 +111,7 @@ func (a *AlertMetricsApi) ListAlertMetrics(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_alert_object.go b/api/kbcloud/api_alert_object.go index 687ee7cb..ec7753c0 100644 --- a/api/kbcloud/api_alert_object.go +++ b/api/kbcloud/api_alert_object.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertObjectApi common.Service // ListAlertObjects List alert objects. func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, orgName string) (AlertObjectList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertObjectList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertObjectList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertObjectApi.ListAlertObjects") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, orgName string) localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, orgName string) if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -76,7 +84,7 @@ func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, orgName string) err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -88,11 +96,13 @@ func (a *AlertObjectApi) ListAlertObjects(ctx _context.Context, orgName string) // SetAlertObjectStatus Set alert object status. func (a *AlertObjectApi) SetAlertObjectStatus(ctx _context.Context, orgName string, alertId string, status string) (AlertObject, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertObject + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertObject ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertObjectApi.SetAlertObjectStatus") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -108,7 +118,8 @@ func (a *AlertObjectApi) SetAlertObjectStatus(ctx _context.Context, orgName stri localVarQueryParams.Add("status", common.ParameterToString(status, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -130,10 +141,11 @@ func (a *AlertObjectApi) SetAlertObjectStatus(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -147,7 +159,7 @@ func (a *AlertObjectApi) SetAlertObjectStatus(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -166,7 +178,6 @@ func NewSetAlertObjectsStatusOptionalParameters() *SetAlertObjectsStatusOptional this := SetAlertObjectsStatusOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *SetAlertObjectsStatusOptionalParameters) WithBody(body []AlertObject) *SetAlertObjectsStatusOptionalParameters { r.Body = &body @@ -176,18 +187,20 @@ func (r *SetAlertObjectsStatusOptionalParameters) WithBody(body []AlertObject) * // SetAlertObjectsStatus Set alert objects status. func (a *AlertObjectApi) SetAlertObjectsStatus(ctx _context.Context, orgName string, status string, o ...SetAlertObjectsStatusOptionalParameters) (AlertObjectList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertObjectList - optionalParams SetAlertObjectsStatusOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertObjectList + optionalParams SetAlertObjectsStatusOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type SetAlertObjectsStatusOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type SetAlertObjectsStatusOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertObjectApi.SetAlertObjectsStatus") if err != nil { @@ -204,11 +217,13 @@ func (a *AlertObjectApi) SetAlertObjectsStatus(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -230,10 +245,11 @@ func (a *AlertObjectApi) SetAlertObjectsStatus(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -247,7 +263,7 @@ func (a *AlertObjectApi) SetAlertObjectsStatus(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_alert_receiver.go b/api/kbcloud/api_alert_receiver.go index a7ba1618..49b218ba 100644 --- a/api/kbcloud/api_alert_receiver.go +++ b/api/kbcloud/api_alert_receiver.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertReceiverApi common.Service // CreateAlertReceiver Create alert receiver. func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName string, category AlertReceiverCategory, body AlertReceiver) (AlertReceiver, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertReceiver + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertReceiver ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.CreateAlertReceiver") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,10 +101,12 @@ func (a *AlertReceiverApi) CreateAlertReceiver(ctx _context.Context, orgName str // DeleteAlertReceiver Delete alert receiver. func (a *AlertReceiverApi) DeleteAlertReceiver(ctx _context.Context, orgName string, receiverId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.DeleteAlertReceiver") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,7 +121,8 @@ func (a *AlertReceiverApi) DeleteAlertReceiver(ctx _context.Context, orgName str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *AlertReceiverApi) DeleteAlertReceiver(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,11 +165,13 @@ func (a *AlertReceiverApi) DeleteAlertReceiver(ctx _context.Context, orgName str // GetAlertReceiver Get alert receiver. func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string, receiverId string) (AlertReceiver, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertReceiver + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertReceiver ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.GetAlertReceiver") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -171,7 +186,8 @@ func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -193,10 +209,11 @@ func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -210,7 +227,7 @@ func (a *AlertReceiverApi) GetAlertReceiver(ctx _context.Context, orgName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -229,7 +246,6 @@ func NewListAlertReceiversOptionalParameters() *ListAlertReceiversOptionalParame this := ListAlertReceiversOptionalParameters{} return &this } - // WithCategory sets the corresponding parameter name and returns the struct. func (r *ListAlertReceiversOptionalParameters) WithCategory(category AlertReceiverCategory) *ListAlertReceiversOptionalParameters { r.Category = &category @@ -239,18 +255,20 @@ func (r *ListAlertReceiversOptionalParameters) WithCategory(category AlertReceiv // ListAlertReceivers List alert receivers. func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, orgName string, o ...ListAlertReceiversOptionalParameters) (AlertReceiverList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertReceiverList - optionalParams ListAlertReceiversOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertReceiverList + optionalParams ListAlertReceiversOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertReceiversOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListAlertReceiversOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.ListAlertReceivers") if err != nil { @@ -268,7 +286,8 @@ func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, orgName stri } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -290,10 +309,11 @@ func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -307,7 +327,7 @@ func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -320,11 +340,13 @@ func (a *AlertReceiverApi) ListAlertReceivers(ctx _context.Context, orgName stri // partially update the alert receiver func (a *AlertReceiverApi) PatchAlertReceiver(ctx _context.Context, orgName string, receiverId string, body AlertReceiver) (AlertReceiver, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertReceiver + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertReceiver ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertReceiverApi.PatchAlertReceiver") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -337,12 +359,14 @@ func (a *AlertReceiverApi) PatchAlertReceiver(ctx _context.Context, orgName stri localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -364,10 +388,11 @@ func (a *AlertReceiverApi) PatchAlertReceiver(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -381,7 +406,7 @@ func (a *AlertReceiverApi) PatchAlertReceiver(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_alert_rule.go b/api/kbcloud/api_alert_rule.go index b775db4d..9ff13dd5 100644 --- a/api/kbcloud/api_alert_rule.go +++ b/api/kbcloud/api_alert_rule.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertRuleApi common.Service // CreateAlertRule Create alert rule. func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, body AlertRule) (AlertRule, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertRule + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertRule ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.CreateAlertRule") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, bod localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, bod if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, bod err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,11 +100,13 @@ func (a *AlertRuleApi) CreateAlertRule(ctx _context.Context, orgName string, bod // DeleteAlertRule Delete alert rule. func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, alertName string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.DeleteAlertRule") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,7 +121,8 @@ func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, ale localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, ale if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -149,7 +162,7 @@ func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, ale err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -161,11 +174,13 @@ func (a *AlertRuleApi) DeleteAlertRule(ctx _context.Context, orgName string, ale // GetAlertRule . func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertName string) (AlertRule, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertRule + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertRule ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.GetAlertRule") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -180,7 +195,8 @@ func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -202,10 +218,11 @@ func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -219,7 +236,7 @@ func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -231,11 +248,13 @@ func (a *AlertRuleApi) GetAlertRule(ctx _context.Context, orgName string, alertN // ListAlertRules List alert rules. func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (AlertRuleList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertRuleList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertRuleList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.ListAlertRules") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -249,7 +268,8 @@ func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (Ale localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -271,10 +291,11 @@ func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (Ale if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -288,7 +309,7 @@ func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (Ale err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -300,11 +321,13 @@ func (a *AlertRuleApi) ListAlertRules(ctx _context.Context, orgName string) (Ale // UpdateAlertRule Update alert rule. func (a *AlertRuleApi) UpdateAlertRule(ctx _context.Context, orgName string, alertName string, body AlertRule) (AlertRule, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertRule + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertRule ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertRuleApi.UpdateAlertRule") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -320,9 +343,11 @@ func (a *AlertRuleApi) UpdateAlertRule(ctx _context.Context, orgName string, ale localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -344,10 +369,11 @@ func (a *AlertRuleApi) UpdateAlertRule(ctx _context.Context, orgName string, ale if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -361,7 +387,7 @@ func (a *AlertRuleApi) UpdateAlertRule(ctx _context.Context, orgName string, ale err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_alert_strategy.go b/api/kbcloud/api_alert_strategy.go index 8880672d..3846e110 100644 --- a/api/kbcloud/api_alert_strategy.go +++ b/api/kbcloud/api_alert_strategy.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AlertStrategyApi common.Service // CreateAlertStrategy Create alert strategy. func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName string, body AlertStrategy) (AlertStrategy, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AlertStrategy + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AlertStrategy ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.CreateAlertStrategy") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,11 +100,13 @@ func (a *AlertStrategyApi) CreateAlertStrategy(ctx _context.Context, orgName str // DeleteAlertStrategy Delete alert strategy. func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName string, strategyId string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.DeleteAlertStrategy") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,7 +121,8 @@ func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -149,7 +162,7 @@ func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -161,11 +174,13 @@ func (a *AlertStrategyApi) DeleteAlertStrategy(ctx _context.Context, orgName str // ListAlertStrategies List alert strategies. func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, orgName string) (AlertStrategyList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertStrategyList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertStrategyList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.ListAlertStrategies") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -179,7 +194,8 @@ func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, orgName str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -201,10 +217,11 @@ func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -218,7 +235,7 @@ func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -230,11 +247,13 @@ func (a *AlertStrategyApi) ListAlertStrategies(ctx _context.Context, orgName str // PatchAlertStrategy Update alert strategy. func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName string, body AlertStrategy) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.PatchAlertStrategy") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -249,9 +268,11 @@ func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName stri localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -273,10 +294,11 @@ func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -290,7 +312,7 @@ func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -302,11 +324,13 @@ func (a *AlertStrategyApi) PatchAlertStrategy(ctx _context.Context, orgName stri // UpdateAlertStrategy Update alert strategy. func (a *AlertStrategyApi) UpdateAlertStrategy(ctx _context.Context, orgName string, strategyId string, body AlertStrategy) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AlertStrategyApi.UpdateAlertStrategy") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -322,9 +346,11 @@ func (a *AlertStrategyApi) UpdateAlertStrategy(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -346,10 +372,11 @@ func (a *AlertStrategyApi) UpdateAlertStrategy(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -363,7 +390,7 @@ func (a *AlertStrategyApi) UpdateAlertStrategy(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_analyze.go b/api/kbcloud/api_analyze.go index 19ba270f..5f0f7344 100644 --- a/api/kbcloud/api_analyze.go +++ b/api/kbcloud/api_analyze.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AnalyzeApi common.Service // AnalyzeBackup Analyze backup. func (a *AnalyzeApi) AnalyzeBackup(ctx _context.Context, orgName string, backupId string) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *AnalyzeApi) AnalyzeBackup(ctx _context.Context, orgName string, backupI localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *AnalyzeApi) AnalyzeBackup(ctx _context.Context, orgName string, backupI if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *AnalyzeApi) AnalyzeBackup(ctx _context.Context, orgName string, backupI err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -96,7 +104,6 @@ func NewAnalyzeClusterParamOptionalParameters() *AnalyzeClusterParamOptionalPara this := AnalyzeClusterParamOptionalParameters{} return &this } - // WithParameterValue sets the corresponding parameter name and returns the struct. func (r *AnalyzeClusterParamOptionalParameters) WithParameterValue(parameterValue string) *AnalyzeClusterParamOptionalParameters { r.ParameterValue = ¶meterValue @@ -106,18 +113,20 @@ func (r *AnalyzeClusterParamOptionalParameters) WithParameterValue(parameterValu // AnalyzeClusterParam Analyze cluster parameter. func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, clusterName string, parameterName string, o ...AnalyzeClusterParamOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeClusterParamOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeClusterParamOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeClusterParamOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeClusterParamOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeClusterParam") if err != nil { @@ -137,7 +146,8 @@ func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, c } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -159,10 +169,11 @@ func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -176,7 +187,7 @@ func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -188,11 +199,13 @@ func (a *AnalyzeApi) AnalyzeClusterParam(ctx _context.Context, orgName string, c // AnalyzeClusterRestore Analyze cluster restore tasks. func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, clusterName string) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeClusterRestore") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -207,7 +220,8 @@ func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -229,10 +243,11 @@ func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -246,7 +261,7 @@ func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -258,9 +273,9 @@ func (a *AnalyzeApi) AnalyzeClusterRestore(ctx _context.Context, orgName string, // AnalyzeLogsOptionalParameters holds optional parameters for AnalyzeLogs. type AnalyzeLogsOptionalParameters struct { ComponentName *string - InstanceName *string - Limit *string - SortType *SortType + InstanceName *string + Limit *string + SortType *SortType } // NewAnalyzeLogsOptionalParameters creates an empty struct for parameters. @@ -268,25 +283,21 @@ func NewAnalyzeLogsOptionalParameters() *AnalyzeLogsOptionalParameters { this := AnalyzeLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *AnalyzeLogsOptionalParameters) WithComponentName(componentName string) *AnalyzeLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithInstanceName sets the corresponding parameter name and returns the struct. func (r *AnalyzeLogsOptionalParameters) WithInstanceName(instanceName string) *AnalyzeLogsOptionalParameters { r.InstanceName = &instanceName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *AnalyzeLogsOptionalParameters) WithLimit(limit string) *AnalyzeLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *AnalyzeLogsOptionalParameters) WithSortType(sortType SortType) *AnalyzeLogsOptionalParameters { r.SortType = &sortType @@ -297,18 +308,20 @@ func (r *AnalyzeLogsOptionalParameters) WithSortType(sortType SortType) *Analyze // Analyze error logs of a cluster func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...AnalyzeLogsOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeLogs") if err != nil { @@ -338,7 +351,8 @@ func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterNa } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -360,10 +374,11 @@ func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -377,7 +392,7 @@ func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -390,11 +405,13 @@ func (a *AnalyzeApi) AnalyzeLogs(ctx _context.Context, orgName string, clusterNa // analyze a OpsRequest func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName string, clusterName string, opsType string) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeOps") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -411,7 +428,8 @@ func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName st localVarQueryParams.Add("opsType", common.ParameterToString(opsType, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -433,10 +451,11 @@ func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -450,7 +469,7 @@ func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -461,7 +480,7 @@ func (a *AnalyzeApi) AnalyzeOps(ctx _context.Context, orgName string, opsName st // AnalyzeParamOptionalParameters holds optional parameters for AnalyzeParam. type AnalyzeParamOptionalParameters struct { - OrgName *string + OrgName *string Partition *ParamTplPartition } @@ -470,13 +489,11 @@ func NewAnalyzeParamOptionalParameters() *AnalyzeParamOptionalParameters { this := AnalyzeParamOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *AnalyzeParamOptionalParameters) WithOrgName(orgName string) *AnalyzeParamOptionalParameters { r.OrgName = &orgName return r } - // WithPartition sets the corresponding parameter name and returns the struct. func (r *AnalyzeParamOptionalParameters) WithPartition(partition ParamTplPartition) *AnalyzeParamOptionalParameters { r.Partition = &partition @@ -486,18 +503,20 @@ func (r *AnalyzeParamOptionalParameters) WithPartition(partition ParamTplPartiti // AnalyzeParam Analyze parameter. func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, parameterName string, o ...AnalyzeParamOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeParamOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeParamOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeParamOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeParamOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeParam") if err != nil { @@ -519,7 +538,8 @@ func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, par } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -541,10 +561,11 @@ func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, par if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -558,7 +579,7 @@ func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, par err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -569,7 +590,7 @@ func (a *AnalyzeApi) AnalyzeParam(ctx _context.Context, paramTplName string, par // AnalyzeServiceOptionalParameters holds optional parameters for AnalyzeService. type AnalyzeServiceOptionalParameters struct { - PortName *string + PortName *string Endpoints *string } @@ -578,13 +599,11 @@ func NewAnalyzeServiceOptionalParameters() *AnalyzeServiceOptionalParameters { this := AnalyzeServiceOptionalParameters{} return &this } - // WithPortName sets the corresponding parameter name and returns the struct. func (r *AnalyzeServiceOptionalParameters) WithPortName(portName string) *AnalyzeServiceOptionalParameters { r.PortName = &portName return r } - // WithEndpoints sets the corresponding parameter name and returns the struct. func (r *AnalyzeServiceOptionalParameters) WithEndpoints(endpoints string) *AnalyzeServiceOptionalParameters { r.Endpoints = &endpoints @@ -594,18 +613,20 @@ func (r *AnalyzeServiceOptionalParameters) WithEndpoints(endpoints string) *Anal // AnalyzeService Analyze service. func (a *AnalyzeApi) AnalyzeService(ctx _context.Context, orgName string, clusterName string, serviceName string, o ...AnalyzeServiceOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeServiceOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeServiceOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeServiceOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeServiceOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeService") if err != nil { @@ -628,7 +649,8 @@ func (a *AnalyzeApi) AnalyzeService(ctx _context.Context, orgName string, cluste } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -650,10 +672,11 @@ func (a *AnalyzeApi) AnalyzeService(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -667,7 +690,7 @@ func (a *AnalyzeApi) AnalyzeService(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -686,7 +709,6 @@ func NewAnalyzeSlowLogsOptionalParameters() *AnalyzeSlowLogsOptionalParameters { this := AnalyzeSlowLogsOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *AnalyzeSlowLogsOptionalParameters) WithBody(body ClusterExecutionLog) *AnalyzeSlowLogsOptionalParameters { r.Body = &body @@ -697,18 +719,20 @@ func (r *AnalyzeSlowLogsOptionalParameters) WithBody(body ClusterExecutionLog) * // Analyze slow logs of a cluster func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clusterName string, o ...AnalyzeSlowLogsOptionalParameters) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AnalysisResult - optionalParams AnalyzeSlowLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AnalysisResult + optionalParams AnalyzeSlowLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeSlowLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type AnalyzeSlowLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeSlowLogs") if err != nil { @@ -725,11 +749,13 @@ func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clust localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -751,10 +777,11 @@ func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -768,7 +795,7 @@ func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clust err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -780,11 +807,13 @@ func (a *AnalyzeApi) AnalyzeSlowLogs(ctx _context.Context, orgName string, clust // AnalyzeView Analyze cluster view. func (a *AnalyzeApi) AnalyzeView(ctx _context.Context, orgName string, clusterName string) (AnalysisResult, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AnalysisResult + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AnalysisResult ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AnalyzeApi.AnalyzeView") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -799,7 +828,8 @@ func (a *AnalyzeApi) AnalyzeView(ctx _context.Context, orgName string, clusterNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -821,10 +851,11 @@ func (a *AnalyzeApi) AnalyzeView(ctx _context.Context, orgName string, clusterNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -838,7 +869,7 @@ func (a *AnalyzeApi) AnalyzeView(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_autohealing.go b/api/kbcloud/api_autohealing.go index f387acdb..8cbf1b8a 100644 --- a/api/kbcloud/api_autohealing.go +++ b/api/kbcloud/api_autohealing.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type AutohealingApi common.Service // GetAutohealing list autohealing job. func (a *AutohealingApi) GetAutohealing(ctx _context.Context, orgName string, clusterName string) ([]AutohealingListItem, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []AutohealingListItem + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []AutohealingListItem ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".AutohealingApi.GetAutohealing") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *AutohealingApi) GetAutohealing(ctx _context.Context, orgName string, cl localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,7 +68,7 @@ func (a *AutohealingApi) GetAutohealing(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_backup.go b/api/kbcloud/api_backup.go index 5c069a44..6b9b39d6 100644 --- a/api/kbcloud/api_backup.go +++ b/api/kbcloud/api_backup.go @@ -2,14 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +23,13 @@ type BackupApi common.Service // CreateClusterBackup Create backup. func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, clusterName string, body BackupCreate) (Backup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Backup + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Backup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.CreateClusterBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,9 +45,11 @@ func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, cl localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -64,10 +71,11 @@ func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -81,7 +89,7 @@ func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +101,12 @@ func (a *BackupApi) CreateClusterBackup(ctx _context.Context, orgName string, cl // DeleteBackup Delete backup. func (a *BackupApi) DeleteBackup(ctx _context.Context, orgName string, backupId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.DeleteBackup") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +121,8 @@ func (a *BackupApi) DeleteBackup(ctx _context.Context, orgName string, backupId localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +144,11 @@ func (a *BackupApi) DeleteBackup(ctx _context.Context, orgName string, backupId if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -153,11 +165,13 @@ func (a *BackupApi) DeleteBackup(ctx _context.Context, orgName string, backupId // DownloadBackup Download full backup. func (a *BackupApi) DownloadBackup(ctx _context.Context, orgName string, backupId string) (_io.Reader, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue _io.Reader + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue _io.Reader ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.DownloadBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -170,9 +184,10 @@ func (a *BackupApi) DownloadBackup(ctx _context.Context, orgName string, backupI localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "application/octet-stream" + localVarHeaderParams["Accept"] = "application/octet-stream" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -194,11 +209,13 @@ func (a *BackupApi) DownloadBackup(ctx _context.Context, orgName string, backupI // DownloadMutipleBackups Download mutiple backup files. func (a *BackupApi) DownloadMutipleBackups(ctx _context.Context, orgName string, backupId string, body BackupDownload) (_io.Reader, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue _io.Reader + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue _io.Reader ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.DownloadMutipleBackups") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -212,11 +229,13 @@ func (a *BackupApi) DownloadMutipleBackups(ctx _context.Context, orgName string, localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/octet-stream" + localVarHeaderParams["Accept"] = "application/octet-stream" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -238,11 +257,13 @@ func (a *BackupApi) DownloadMutipleBackups(ctx _context.Context, orgName string, // GetBackup Get backup. func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId string) (Backup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Backup + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Backup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.GetBackup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -257,7 +278,8 @@ func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -279,10 +301,11 @@ func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -296,7 +319,7 @@ func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -308,11 +331,13 @@ func (a *BackupApi) GetBackup(ctx _context.Context, orgName string, backupId str // GetBackupLog Get backup log. func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId string) (BackupLog, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupLog + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupLog ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.GetBackupLog") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -327,7 +352,8 @@ func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -349,10 +375,11 @@ func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -366,7 +393,7 @@ func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -378,11 +405,13 @@ func (a *BackupApi) GetBackupLog(ctx _context.Context, orgName string, backupId // GetBackupStats Get backup statistics. func (a *BackupApi) GetBackupStats(ctx _context.Context, orgName string) (BackupStats, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupStats + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupStats ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.GetBackupStats") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -396,7 +425,8 @@ func (a *BackupApi) GetBackupStats(ctx _context.Context, orgName string) (Backup localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -418,10 +448,11 @@ func (a *BackupApi) GetBackupStats(ctx _context.Context, orgName string) (Backup if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -435,7 +466,7 @@ func (a *BackupApi) GetBackupStats(ctx _context.Context, orgName string) (Backup err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -454,7 +485,6 @@ func NewGetClusterBackupPolicyOptionalParameters() *GetClusterBackupPolicyOption this := GetClusterBackupPolicyOptionalParameters{} return &this } - // WithUseVolumeSnapshot sets the corresponding parameter name and returns the struct. func (r *GetClusterBackupPolicyOptionalParameters) WithUseVolumeSnapshot(useVolumeSnapshot bool) *GetClusterBackupPolicyOptionalParameters { r.UseVolumeSnapshot = &useVolumeSnapshot @@ -464,18 +494,20 @@ func (r *GetClusterBackupPolicyOptionalParameters) WithUseVolumeSnapshot(useVolu // GetClusterBackupPolicy Get backup policy. func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, clusterName string, o ...GetClusterBackupPolicyOptionalParameters) (BackupPolicy, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupPolicy - optionalParams GetClusterBackupPolicyOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupPolicy + optionalParams GetClusterBackupPolicyOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterBackupPolicyOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterBackupPolicyOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.GetClusterBackupPolicy") if err != nil { @@ -494,7 +526,8 @@ func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -516,10 +549,11 @@ func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -533,7 +567,7 @@ func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -544,13 +578,13 @@ func (a *BackupApi) GetClusterBackupPolicy(ctx _context.Context, orgName string, // ListBackupsOptionalParameters holds optional parameters for ListBackups. type ListBackupsOptionalParameters struct { - ClusterName *string - ClusterId *string - BackupRepo *string + ClusterName *string + ClusterId *string + BackupRepo *string FetchWithDeletedCluster *bool - WithDeletedBackups *bool - BackupType *string - ComponentName *string + WithDeletedBackups *bool + BackupType *string + ComponentName *string } // NewListBackupsOptionalParameters creates an empty struct for parameters. @@ -558,43 +592,36 @@ func NewListBackupsOptionalParameters() *ListBackupsOptionalParameters { this := ListBackupsOptionalParameters{} return &this } - // WithClusterName sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithClusterName(clusterName string) *ListBackupsOptionalParameters { r.ClusterName = &clusterName return r } - // WithClusterId sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithClusterId(clusterId string) *ListBackupsOptionalParameters { r.ClusterId = &clusterId return r } - // WithBackupRepo sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithBackupRepo(backupRepo string) *ListBackupsOptionalParameters { r.BackupRepo = &backupRepo return r } - // WithFetchWithDeletedCluster sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithFetchWithDeletedCluster(fetchWithDeletedCluster bool) *ListBackupsOptionalParameters { r.FetchWithDeletedCluster = &fetchWithDeletedCluster return r } - // WithWithDeletedBackups sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithWithDeletedBackups(withDeletedBackups bool) *ListBackupsOptionalParameters { r.WithDeletedBackups = &withDeletedBackups return r } - // WithBackupType sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithBackupType(backupType string) *ListBackupsOptionalParameters { r.BackupType = &backupType return r } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *ListBackupsOptionalParameters) WithComponentName(componentName string) *ListBackupsOptionalParameters { r.ComponentName = &componentName @@ -604,18 +631,20 @@ func (r *ListBackupsOptionalParameters) WithComponentName(componentName string) // ListBackups List backups. func (a *BackupApi) ListBackups(ctx _context.Context, orgName string, o ...ListBackupsOptionalParameters) (BackupList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupList - optionalParams ListBackupsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupList + optionalParams ListBackupsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListBackupsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListBackupsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.ListBackups") if err != nil { @@ -651,7 +680,8 @@ func (a *BackupApi) ListBackups(ctx _context.Context, orgName string, o ...ListB } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -673,10 +703,11 @@ func (a *BackupApi) ListBackups(ctx _context.Context, orgName string, o ...ListB if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -690,7 +721,7 @@ func (a *BackupApi) ListBackups(ctx _context.Context, orgName string, o ...ListB err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -709,7 +740,6 @@ func NewPatchBackupPolicyOptionalParameters() *PatchBackupPolicyOptionalParamete this := PatchBackupPolicyOptionalParameters{} return &this } - // WithUseVolumeSnapshot sets the corresponding parameter name and returns the struct. func (r *PatchBackupPolicyOptionalParameters) WithUseVolumeSnapshot(useVolumeSnapshot bool) *PatchBackupPolicyOptionalParameters { r.UseVolumeSnapshot = &useVolumeSnapshot @@ -720,18 +750,20 @@ func (r *PatchBackupPolicyOptionalParameters) WithUseVolumeSnapshot(useVolumeSna // partially update the specified Backup Policy func (a *BackupApi) PatchBackupPolicy(ctx _context.Context, orgName string, clusterName string, body BackupPolicy, o ...PatchBackupPolicyOptionalParameters) (BackupPolicy, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue BackupPolicy - optionalParams PatchBackupPolicyOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue BackupPolicy + optionalParams PatchBackupPolicyOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type PatchBackupPolicyOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type PatchBackupPolicyOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.PatchBackupPolicy") if err != nil { @@ -751,9 +783,11 @@ func (a *BackupApi) PatchBackupPolicy(ctx _context.Context, orgName string, clus localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -775,10 +809,11 @@ func (a *BackupApi) PatchBackupPolicy(ctx _context.Context, orgName string, clus if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -792,7 +827,7 @@ func (a *BackupApi) PatchBackupPolicy(ctx _context.Context, orgName string, clus err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -811,7 +846,6 @@ func NewViewBackupOptionalParameters() *ViewBackupOptionalParameters { this := ViewBackupOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *ViewBackupOptionalParameters) WithBody(body BackupView) *ViewBackupOptionalParameters { r.Body = &body @@ -821,18 +855,20 @@ func (r *ViewBackupOptionalParameters) WithBody(body BackupView) *ViewBackupOpti // ViewBackup view backup info. func (a *BackupApi) ViewBackup(ctx _context.Context, orgName string, backupId string, o ...ViewBackupOptionalParameters) (FileEntryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue FileEntryList - optionalParams ViewBackupOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue FileEntryList + optionalParams ViewBackupOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ViewBackupOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ViewBackupOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupApi.ViewBackup") if err != nil { @@ -849,11 +885,13 @@ func (a *BackupApi) ViewBackup(ctx _context.Context, orgName string, backupId st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -875,10 +913,11 @@ func (a *BackupApi) ViewBackup(ctx _context.Context, orgName string, backupId st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -892,7 +931,7 @@ func (a *BackupApi) ViewBackup(ctx _context.Context, orgName string, backupId st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_backup_repo.go b/api/kbcloud/api_backup_repo.go index 1779842d..84d93634 100644 --- a/api/kbcloud/api_backup_repo.go +++ b/api/kbcloud/api_backup_repo.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,10 +23,12 @@ type BackupRepoApi common.Service // DeleteBackupRepo Delete backup repo. func (a *BackupRepoApi) DeleteBackupRepo(ctx _context.Context, environmentName string, backupRepoName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.DeleteBackupRepo") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *BackupRepoApi) DeleteBackupRepo(ctx _context.Context, environmentName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *BackupRepoApi) DeleteBackupRepo(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -86,7 +94,6 @@ func NewGetBackupRepoOptionalParameters() *GetBackupRepoOptionalParameters { this := GetBackupRepoOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *GetBackupRepoOptionalParameters) WithOrgName(orgName string) *GetBackupRepoOptionalParameters { r.OrgName = &orgName @@ -96,18 +103,20 @@ func (r *GetBackupRepoOptionalParameters) WithOrgName(orgName string) *GetBackup // GetBackupRepo Get backup repo. func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName string, backupRepoName string, o ...GetBackupRepoOptionalParameters) (BackupRepo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupRepo - optionalParams GetBackupRepoOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupRepo + optionalParams GetBackupRepoOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetBackupRepoOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetBackupRepoOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.GetBackupRepo") if err != nil { @@ -126,7 +135,8 @@ func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName stri } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -148,10 +158,11 @@ func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -165,7 +176,7 @@ func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -177,11 +188,13 @@ func (a *BackupRepoApi) GetBackupRepo(ctx _context.Context, environmentName stri // ListBackupRepos List backup repos. func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, orgName string) (BackupRepoList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BackupRepoList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BackupRepoList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.ListBackupRepos") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -195,7 +208,8 @@ func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, orgName string) (B localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -217,10 +231,11 @@ func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, orgName string) (B if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -234,7 +249,7 @@ func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, orgName string) (B err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -246,11 +261,13 @@ func (a *BackupRepoApi) ListBackupRepos(ctx _context.Context, orgName string) (B // UpdateBackupRepo Update backup repo. func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName string, backupRepoName string, body BackupRepoUpdate) (BackupRepo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue BackupRepo + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue BackupRepo ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BackupRepoApi.UpdateBackupRepo") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -266,9 +283,11 @@ func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName s localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -290,10 +309,11 @@ func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -307,7 +327,7 @@ func (a *BackupRepoApi) UpdateBackupRepo(ctx _context.Context, environmentName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_benchmark.go b/api/kbcloud/api_benchmark.go index c572d571..d9c939a5 100644 --- a/api/kbcloud/api_benchmark.go +++ b/api/kbcloud/api_benchmark.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type BenchmarkApi common.Service // CreatePgbench Create a pgbench benchmark task. func (a *BenchmarkApi) CreatePgbench(ctx _context.Context, orgName string, body Pgbench) (Benchmark, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Benchmark + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Benchmark ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BenchmarkApi.CreatePgbench") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *BenchmarkApi) CreatePgbench(ctx _context.Context, orgName string, body localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,7 +71,7 @@ func (a *BenchmarkApi) CreatePgbench(ctx _context.Context, orgName string, body err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -75,11 +83,13 @@ func (a *BenchmarkApi) CreatePgbench(ctx _context.Context, orgName string, body // CreateSysbench Create a sysbench benchmark task. func (a *BenchmarkApi) CreateSysbench(ctx _context.Context, orgName string, body Sysbench) (Benchmark, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Benchmark + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Benchmark ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BenchmarkApi.CreateSysbench") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -94,9 +104,11 @@ func (a *BenchmarkApi) CreateSysbench(ctx _context.Context, orgName string, body localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -119,7 +131,7 @@ func (a *BenchmarkApi) CreateSysbench(ctx _context.Context, orgName string, body err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -131,11 +143,13 @@ func (a *BenchmarkApi) CreateSysbench(ctx _context.Context, orgName string, body // CreateTpcc Create a tpcc benchmark task. func (a *BenchmarkApi) CreateTpcc(ctx _context.Context, orgName string, body Tpcc) (Benchmark, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Benchmark + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Benchmark ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BenchmarkApi.CreateTpcc") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -150,9 +164,11 @@ func (a *BenchmarkApi) CreateTpcc(ctx _context.Context, orgName string, body Tpc localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -175,7 +191,7 @@ func (a *BenchmarkApi) CreateTpcc(ctx _context.Context, orgName string, body Tpc err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -187,11 +203,13 @@ func (a *BenchmarkApi) CreateTpcc(ctx _context.Context, orgName string, body Tpc // CreateYcsb Create a ycsb benchmark task. func (a *BenchmarkApi) CreateYcsb(ctx _context.Context, orgName string, body Ycsb) (Benchmark, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Benchmark + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Benchmark ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BenchmarkApi.CreateYcsb") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -206,9 +224,11 @@ func (a *BenchmarkApi) CreateYcsb(ctx _context.Context, orgName string, body Ycs localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -231,7 +251,7 @@ func (a *BenchmarkApi) CreateYcsb(ctx _context.Context, orgName string, body Ycs err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -243,11 +263,13 @@ func (a *BenchmarkApi) CreateYcsb(ctx _context.Context, orgName string, body Ycs // DeleteBenchmark Delete benchmark tasks. func (a *BenchmarkApi) DeleteBenchmark(ctx _context.Context, orgName string, body []string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BenchmarkApi.DeleteBenchmark") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -262,9 +284,11 @@ func (a *BenchmarkApi) DeleteBenchmark(ctx _context.Context, orgName string, bod localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -286,10 +310,11 @@ func (a *BenchmarkApi) DeleteBenchmark(ctx _context.Context, orgName string, bod if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -303,7 +328,7 @@ func (a *BenchmarkApi) DeleteBenchmark(ctx _context.Context, orgName string, bod err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -315,11 +340,13 @@ func (a *BenchmarkApi) DeleteBenchmark(ctx _context.Context, orgName string, bod // GetBenchmark Get benchmark task info. func (a *BenchmarkApi) GetBenchmark(ctx _context.Context, orgName string, benchmarkId string) (Benchmark, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Benchmark + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Benchmark ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BenchmarkApi.GetBenchmark") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -334,7 +361,8 @@ func (a *BenchmarkApi) GetBenchmark(ctx _context.Context, orgName string, benchm localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -357,7 +385,7 @@ func (a *BenchmarkApi) GetBenchmark(ctx _context.Context, orgName string, benchm err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -368,7 +396,7 @@ func (a *BenchmarkApi) GetBenchmark(ctx _context.Context, orgName string, benchm // ListBenchmarkOptionalParameters holds optional parameters for ListBenchmark. type ListBenchmarkOptionalParameters struct { - Cluster *string + Cluster *string BenchType *string ClusterId *string } @@ -378,19 +406,16 @@ func NewListBenchmarkOptionalParameters() *ListBenchmarkOptionalParameters { this := ListBenchmarkOptionalParameters{} return &this } - // WithCluster sets the corresponding parameter name and returns the struct. func (r *ListBenchmarkOptionalParameters) WithCluster(cluster string) *ListBenchmarkOptionalParameters { r.Cluster = &cluster return r } - // WithBenchType sets the corresponding parameter name and returns the struct. func (r *ListBenchmarkOptionalParameters) WithBenchType(benchType string) *ListBenchmarkOptionalParameters { r.BenchType = &benchType return r } - // WithClusterId sets the corresponding parameter name and returns the struct. func (r *ListBenchmarkOptionalParameters) WithClusterId(clusterId string) *ListBenchmarkOptionalParameters { r.ClusterId = &clusterId @@ -400,18 +425,20 @@ func (r *ListBenchmarkOptionalParameters) WithClusterId(clusterId string) *ListB // ListBenchmark List benchmark tasks. func (a *BenchmarkApi) ListBenchmark(ctx _context.Context, orgName string, o ...ListBenchmarkOptionalParameters) (BenchmarkList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue BenchmarkList - optionalParams ListBenchmarkOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BenchmarkList + optionalParams ListBenchmarkOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListBenchmarkOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListBenchmarkOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".BenchmarkApi.ListBenchmark") if err != nil { @@ -435,7 +462,8 @@ func (a *BenchmarkApi) ListBenchmark(ctx _context.Context, orgName string, o ... } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -458,7 +486,7 @@ func (a *BenchmarkApi) ListBenchmark(ctx _context.Context, orgName string, o ... err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_class.go b/api/kbcloud/api_class.go index e9352a8a..7b5d5016 100644 --- a/api/kbcloud/api_class.go +++ b/api/kbcloud/api_class.go @@ -2,10 +2,15 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -25,7 +30,6 @@ func NewCreateClassOptionalParameters() *CreateClassOptionalParameters { this := CreateClassOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *CreateClassOptionalParameters) WithBody(body Class) *CreateClassOptionalParameters { r.Body = &body @@ -35,18 +39,20 @@ func (r *CreateClassOptionalParameters) WithBody(body Class) *CreateClassOptiona // CreateClass Create class. func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalParameters) (Class, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Class - optionalParams CreateClassOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Class + optionalParams CreateClassOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CreateClassOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CreateClassOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.CreateClass") if err != nil { @@ -61,11 +67,13 @@ func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalPar localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -87,10 +95,11 @@ func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalPar if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -104,7 +113,7 @@ func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalPar err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -116,11 +125,13 @@ func (a *ClassApi) CreateClass(ctx _context.Context, o ...CreateClassOptionalPar // DeleteClass Delete class. func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.DeleteClass") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -134,7 +145,8 @@ func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, localVarQueryParams.Add("code", common.ParameterToString(code, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -156,10 +168,11 @@ func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -173,7 +186,7 @@ func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -185,11 +198,13 @@ func (a *ClassApi) DeleteClass(ctx _context.Context, code string) (interface{}, // ListClasses List classes. func (a *ClassApi) ListClasses(ctx _context.Context) ([]Class, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Class + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Class ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.ListClasses") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -202,7 +217,8 @@ func (a *ClassApi) ListClasses(ctx _context.Context) ([]Class, *_nethttp.Respons localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -224,10 +240,11 @@ func (a *ClassApi) ListClasses(ctx _context.Context) ([]Class, *_nethttp.Respons if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -241,7 +258,7 @@ func (a *ClassApi) ListClasses(ctx _context.Context) ([]Class, *_nethttp.Respons err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -260,7 +277,6 @@ func NewPatchClassOptionalParameters() *PatchClassOptionalParameters { this := PatchClassOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *PatchClassOptionalParameters) WithBody(body Class) *PatchClassOptionalParameters { r.Body = &body @@ -270,18 +286,20 @@ func (r *PatchClassOptionalParameters) WithBody(body Class) *PatchClassOptionalP // PatchClass Patch class. func (a *ClassApi) PatchClass(ctx _context.Context, o ...PatchClassOptionalParameters) (Class, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Class - optionalParams PatchClassOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Class + optionalParams PatchClassOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type PatchClassOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type PatchClassOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClassApi.PatchClass") if err != nil { @@ -296,11 +314,13 @@ func (a *ClassApi) PatchClass(ctx _context.Context, o ...PatchClassOptionalParam localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -322,10 +342,11 @@ func (a *ClassApi) PatchClass(ctx _context.Context, o ...PatchClassOptionalParam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -339,7 +360,7 @@ func (a *ClassApi) PatchClass(ctx _context.Context, o ...PatchClassOptionalParam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_cluster.go b/api/kbcloud/api_cluster.go index b2648b9e..c91cccba 100644 --- a/api/kbcloud/api_cluster.go +++ b/api/kbcloud/api_cluster.go @@ -2,14 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "reflect" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +23,13 @@ type ClusterApi common.Service // CreateCluster Create new cluster. func (a *ClusterApi) CreateCluster(ctx _context.Context, orgName string, body Cluster) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.CreateCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +44,11 @@ func (a *ClusterApi) CreateCluster(ctx _context.Context, orgName string, body Cl localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +70,11 @@ func (a *ClusterApi) CreateCluster(ctx _context.Context, orgName string, body Cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +88,7 @@ func (a *ClusterApi) CreateCluster(ctx _context.Context, orgName string, body Cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -99,7 +107,6 @@ func NewDeleteClusterOptionalParameters() *DeleteClusterOptionalParameters { this := DeleteClusterOptionalParameters{} return &this } - // WithForce sets the corresponding parameter name and returns the struct. func (r *DeleteClusterOptionalParameters) WithForce(force bool) *DeleteClusterOptionalParameters { r.Force = &force @@ -109,18 +116,20 @@ func (r *DeleteClusterOptionalParameters) WithForce(force bool) *DeleteClusterOp // DeleteCluster Delete cluster. func (a *ClusterApi) DeleteCluster(ctx _context.Context, orgName string, clusterName string, o ...DeleteClusterOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams DeleteClusterOptionalParameters + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams DeleteClusterOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type DeleteClusterOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type DeleteClusterOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.DeleteCluster") if err != nil { @@ -139,7 +148,8 @@ func (a *ClusterApi) DeleteCluster(ctx _context.Context, orgName string, cluster } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -161,10 +171,11 @@ func (a *ClusterApi) DeleteCluster(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -178,7 +189,7 @@ func (a *ClusterApi) DeleteCluster(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -197,7 +208,6 @@ func NewDescribeClusterHaHistoryOptionalParameters() *DescribeClusterHaHistoryOp this := DescribeClusterHaHistoryOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *DescribeClusterHaHistoryOptionalParameters) WithComponentName(componentName string) *DescribeClusterHaHistoryOptionalParameters { r.ComponentName = &componentName @@ -207,18 +217,20 @@ func (r *DescribeClusterHaHistoryOptionalParameters) WithComponentName(component // DescribeClusterHaHistory describe cluster HA history. func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName string, clusterName string, o ...DescribeClusterHaHistoryOptionalParameters) (HaHistoryResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue HaHistoryResponse - optionalParams DescribeClusterHaHistoryOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue HaHistoryResponse + optionalParams DescribeClusterHaHistoryOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type DescribeClusterHaHistoryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type DescribeClusterHaHistoryOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.DescribeClusterHaHistory") if err != nil { @@ -237,7 +249,8 @@ func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName stri } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -259,10 +272,11 @@ func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -276,7 +290,7 @@ func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -288,11 +302,13 @@ func (a *ClusterApi) DescribeClusterHaHistory(ctx _context.Context, orgName stri // GetCluster Get cluster details. func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterName string) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -307,7 +323,8 @@ func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -329,10 +346,11 @@ func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -346,7 +364,7 @@ func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -358,11 +376,13 @@ func (a *ClusterApi) GetCluster(ctx _context.Context, orgName string, clusterNam // GetClusterByID Get cluster details by ID. func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, clusterId int32) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetClusterByID") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -377,7 +397,8 @@ func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, cluste localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -399,10 +420,11 @@ func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -416,7 +438,7 @@ func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -428,9 +450,9 @@ func (a *ClusterApi) GetClusterByID(ctx _context.Context, orgName string, cluste // GetClusterInstanceLogOptionalParameters holds optional parameters for GetClusterInstanceLog. type GetClusterInstanceLogOptionalParameters struct { WorkloadType *string - Previous *bool + Previous *bool SinceSeconds *int32 - TailLines *int32 + TailLines *int32 } // NewGetClusterInstanceLogOptionalParameters creates an empty struct for parameters. @@ -438,25 +460,21 @@ func NewGetClusterInstanceLogOptionalParameters() *GetClusterInstanceLogOptional this := GetClusterInstanceLogOptionalParameters{} return &this } - // WithWorkloadType sets the corresponding parameter name and returns the struct. func (r *GetClusterInstanceLogOptionalParameters) WithWorkloadType(workloadType string) *GetClusterInstanceLogOptionalParameters { r.WorkloadType = &workloadType return r } - // WithPrevious sets the corresponding parameter name and returns the struct. func (r *GetClusterInstanceLogOptionalParameters) WithPrevious(previous bool) *GetClusterInstanceLogOptionalParameters { r.Previous = &previous return r } - // WithSinceSeconds sets the corresponding parameter name and returns the struct. func (r *GetClusterInstanceLogOptionalParameters) WithSinceSeconds(sinceSeconds int32) *GetClusterInstanceLogOptionalParameters { r.SinceSeconds = &sinceSeconds return r } - // WithTailLines sets the corresponding parameter name and returns the struct. func (r *GetClusterInstanceLogOptionalParameters) WithTailLines(tailLines int32) *GetClusterInstanceLogOptionalParameters { r.TailLines = &tailLines @@ -467,18 +485,20 @@ func (r *GetClusterInstanceLogOptionalParameters) WithTailLines(tailLines int32) // read log of the specified cluster instance func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, clusterName string, workloadName string, o ...GetClusterInstanceLogOptionalParameters) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue string - optionalParams GetClusterInstanceLogOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue string + optionalParams GetClusterInstanceLogOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterInstanceLogOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterInstanceLogOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetClusterInstanceLog") if err != nil { @@ -507,7 +527,8 @@ func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -529,10 +550,11 @@ func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -546,7 +568,7 @@ func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -557,7 +579,7 @@ func (a *ClusterApi) GetClusterInstanceLog(ctx _context.Context, orgName string, // GetClusterManifestOptionalParameters holds optional parameters for GetClusterManifest. type GetClusterManifestOptionalParameters struct { - OpsType *OpsType + OpsType *OpsType Component *string } @@ -566,13 +588,11 @@ func NewGetClusterManifestOptionalParameters() *GetClusterManifestOptionalParame this := GetClusterManifestOptionalParameters{} return &this } - // WithOpsType sets the corresponding parameter name and returns the struct. func (r *GetClusterManifestOptionalParameters) WithOpsType(opsType OpsType) *GetClusterManifestOptionalParameters { r.OpsType = &opsType return r } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *GetClusterManifestOptionalParameters) WithComponent(component string) *GetClusterManifestOptionalParameters { r.Component = &component @@ -582,18 +602,20 @@ func (r *GetClusterManifestOptionalParameters) WithComponent(component string) * // GetClusterManifest Get cluster manifests of kubernetes. func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, clusterName string, manifestType ManifestType, o ...GetClusterManifestOptionalParameters) (KubernetesManifestList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue KubernetesManifestList - optionalParams GetClusterManifestOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue KubernetesManifestList + optionalParams GetClusterManifestOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterManifestOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterManifestOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetClusterManifest") if err != nil { @@ -616,7 +638,8 @@ func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, cl } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -638,10 +661,11 @@ func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -655,7 +679,7 @@ func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -667,11 +691,13 @@ func (a *ClusterApi) GetClusterManifest(ctx _context.Context, orgName string, cl // GetInstacesMetrics Get instaces metrics in cluster. func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, clusterName string) (InstanceMetricsList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue InstanceMetricsList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue InstanceMetricsList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.GetInstacesMetrics") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -686,7 +712,8 @@ func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, cl localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -708,10 +735,11 @@ func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -725,7 +753,7 @@ func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -737,13 +765,13 @@ func (a *ClusterApi) GetInstacesMetrics(ctx _context.Context, orgName string, cl // ListClusterOptionalParameters holds optional parameters for ListCluster. type ListClusterOptionalParameters struct { ClusterDefinition *string - EnvironmentName *string - EnvironmentType *EnvironmentType - TagKey *string - TagValue *string - TagKeys *[]string - TagValues *[]string - LicenseId *int32 + EnvironmentName *string + EnvironmentType *EnvironmentType + TagKey *string + TagValue *string + TagKeys *[]string + TagValues *[]string + LicenseId *int32 } // NewListClusterOptionalParameters creates an empty struct for parameters. @@ -751,49 +779,41 @@ func NewListClusterOptionalParameters() *ListClusterOptionalParameters { this := ListClusterOptionalParameters{} return &this } - // WithClusterDefinition sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithClusterDefinition(clusterDefinition string) *ListClusterOptionalParameters { r.ClusterDefinition = &clusterDefinition return r } - // WithEnvironmentName sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithEnvironmentName(environmentName string) *ListClusterOptionalParameters { r.EnvironmentName = &environmentName return r } - // WithEnvironmentType sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithEnvironmentType(environmentType EnvironmentType) *ListClusterOptionalParameters { r.EnvironmentType = &environmentType return r } - // WithTagKey sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithTagKey(tagKey string) *ListClusterOptionalParameters { r.TagKey = &tagKey return r } - // WithTagValue sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithTagValue(tagValue string) *ListClusterOptionalParameters { r.TagValue = &tagValue return r } - // WithTagKeys sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithTagKeys(tagKeys []string) *ListClusterOptionalParameters { r.TagKeys = &tagKeys return r } - // WithTagValues sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithTagValues(tagValues []string) *ListClusterOptionalParameters { r.TagValues = &tagValues return r } - // WithLicenseId sets the corresponding parameter name and returns the struct. func (r *ListClusterOptionalParameters) WithLicenseId(licenseId int32) *ListClusterOptionalParameters { r.LicenseId = &licenseId @@ -803,18 +823,20 @@ func (r *ListClusterOptionalParameters) WithLicenseId(licenseId int32) *ListClus // ListCluster List clusters in the Org. func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...ListClusterOptionalParameters) (ClusterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ClusterList - optionalParams ListClusterOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ClusterList + optionalParams ListClusterOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListClusterOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListClusterOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.ListCluster") if err != nil { @@ -869,7 +891,8 @@ func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...List } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -891,10 +914,11 @@ func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...List if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -908,7 +932,7 @@ func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...List err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -920,7 +944,7 @@ func (a *ClusterApi) ListCluster(ctx _context.Context, orgName string, o ...List // ListEndpointsOptionalParameters holds optional parameters for ListEndpoints. type ListEndpointsOptionalParameters struct { NodePortHostCount *int32 - IncludeClusterIp *bool + IncludeClusterIp *bool } // NewListEndpointsOptionalParameters creates an empty struct for parameters. @@ -928,13 +952,11 @@ func NewListEndpointsOptionalParameters() *ListEndpointsOptionalParameters { this := ListEndpointsOptionalParameters{} return &this } - // WithNodePortHostCount sets the corresponding parameter name and returns the struct. func (r *ListEndpointsOptionalParameters) WithNodePortHostCount(nodePortHostCount int32) *ListEndpointsOptionalParameters { r.NodePortHostCount = &nodePortHostCount return r } - // WithIncludeClusterIp sets the corresponding parameter name and returns the struct. func (r *ListEndpointsOptionalParameters) WithIncludeClusterIp(includeClusterIp bool) *ListEndpointsOptionalParameters { r.IncludeClusterIp = &includeClusterIp @@ -944,18 +966,20 @@ func (r *ListEndpointsOptionalParameters) WithIncludeClusterIp(includeClusterIp // ListEndpoints List cluster endpoints. func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, clusterName string, o ...ListEndpointsOptionalParameters) (EndpointList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EndpointList - optionalParams ListEndpointsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EndpointList + optionalParams ListEndpointsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEndpointsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEndpointsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.ListEndpoints") if err != nil { @@ -977,7 +1001,8 @@ func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, cluster } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -999,10 +1024,11 @@ func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1016,7 +1042,7 @@ func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1028,11 +1054,13 @@ func (a *ClusterApi) ListEndpoints(ctx _context.Context, orgName string, cluster // ListInstance List cluster instances. func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterName string) (InstanceList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue InstanceList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue InstanceList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.ListInstance") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1047,7 +1075,8 @@ func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1069,10 +1098,11 @@ func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1086,7 +1116,7 @@ func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1099,11 +1129,13 @@ func (a *ClusterApi) ListInstance(ctx _context.Context, orgName string, clusterN // Update the specified Cluster func (a *ClusterApi) PatchCluster(ctx _context.Context, orgName string, clusterName string, body ClusterUpdate) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterApi.PatchCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1116,12 +1148,14 @@ func (a *ClusterApi) PatchCluster(ctx _context.Context, orgName string, clusterN localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1143,10 +1177,11 @@ func (a *ClusterApi) PatchCluster(ctx _context.Context, orgName string, clusterN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1160,7 +1195,7 @@ func (a *ClusterApi) PatchCluster(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_cluster_alert_switch.go b/api/kbcloud/api_cluster_alert_switch.go index c95cc10b..8e30bb56 100644 --- a/api/kbcloud/api_cluster_alert_switch.go +++ b/api/kbcloud/api_cluster_alert_switch.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type ClusterAlertSwitchApi common.Service // GetClusterAlertDisabled Check if cluster alert is disabled. func (a *ClusterAlertSwitchApi) GetClusterAlertDisabled(ctx _context.Context, orgName string, clusterName string) (AlertCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AlertCluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AlertCluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterAlertSwitchApi.GetClusterAlertDisabled") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *ClusterAlertSwitchApi) GetClusterAlertDisabled(ctx _context.Context, or localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *ClusterAlertSwitchApi) GetClusterAlertDisabled(ctx _context.Context, or if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *ClusterAlertSwitchApi) GetClusterAlertDisabled(ctx _context.Context, or err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -96,7 +104,6 @@ func NewSetClusterAlertDisabledOptionalParameters() *SetClusterAlertDisabledOpti this := SetClusterAlertDisabledOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *SetClusterAlertDisabledOptionalParameters) WithBody(body AlertCluster) *SetClusterAlertDisabledOptionalParameters { r.Body = &body @@ -106,18 +113,20 @@ func (r *SetClusterAlertDisabledOptionalParameters) WithBody(body AlertCluster) // SetClusterAlertDisabled Set cluster alert disabled or enabled. func (a *ClusterAlertSwitchApi) SetClusterAlertDisabled(ctx _context.Context, orgName string, clusterName string, o ...SetClusterAlertDisabledOptionalParameters) (AlertCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AlertCluster - optionalParams SetClusterAlertDisabledOptionalParameters + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AlertCluster + optionalParams SetClusterAlertDisabledOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type SetClusterAlertDisabledOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type SetClusterAlertDisabledOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterAlertSwitchApi.SetClusterAlertDisabled") if err != nil { @@ -134,11 +143,13 @@ func (a *ClusterAlertSwitchApi) SetClusterAlertDisabled(ctx _context.Context, or localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -160,10 +171,11 @@ func (a *ClusterAlertSwitchApi) SetClusterAlertDisabled(ctx _context.Context, or if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -177,7 +189,7 @@ func (a *ClusterAlertSwitchApi) SetClusterAlertDisabled(ctx _context.Context, or err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_cluster_log.go b/api/kbcloud/api_cluster_log.go index e353cc84..e681aaf3 100644 --- a/api/kbcloud/api_cluster_log.go +++ b/api/kbcloud/api_cluster_log.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -18,9 +22,9 @@ type ClusterLogApi common.Service // QueryAuditLogsOptionalParameters holds optional parameters for QueryAuditLogs. type QueryAuditLogsOptionalParameters struct { - Limit *string + Limit *string ComponentName *string - SortType *SortType + SortType *SortType } // NewQueryAuditLogsOptionalParameters creates an empty struct for parameters. @@ -28,19 +32,16 @@ func NewQueryAuditLogsOptionalParameters() *QueryAuditLogsOptionalParameters { this := QueryAuditLogsOptionalParameters{} return &this } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QueryAuditLogsOptionalParameters) WithLimit(limit string) *QueryAuditLogsOptionalParameters { r.Limit = &limit return r } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QueryAuditLogsOptionalParameters) WithComponentName(componentName string) *QueryAuditLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QueryAuditLogsOptionalParameters) WithSortType(sortType SortType) *QueryAuditLogsOptionalParameters { r.SortType = &sortType @@ -51,18 +52,20 @@ func (r *QueryAuditLogsOptionalParameters) WithSortType(sortType SortType) *Quer // Query audit logs of a cluster func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QueryAuditLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QueryAuditLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QueryAuditLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryAuditLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryAuditLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QueryAuditLogs") if err != nil { @@ -89,7 +92,8 @@ func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clu } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -111,10 +115,11 @@ func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -128,7 +133,7 @@ func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -140,9 +145,9 @@ func (a *ClusterLogApi) QueryAuditLogs(ctx _context.Context, orgName string, clu // QueryErrorLogsOptionalParameters holds optional parameters for QueryErrorLogs. type QueryErrorLogsOptionalParameters struct { ComponentName *string - InstanceName *string - Limit *string - SortType *SortType + InstanceName *string + Limit *string + SortType *SortType } // NewQueryErrorLogsOptionalParameters creates an empty struct for parameters. @@ -150,25 +155,21 @@ func NewQueryErrorLogsOptionalParameters() *QueryErrorLogsOptionalParameters { this := QueryErrorLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QueryErrorLogsOptionalParameters) WithComponentName(componentName string) *QueryErrorLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithInstanceName sets the corresponding parameter name and returns the struct. func (r *QueryErrorLogsOptionalParameters) WithInstanceName(instanceName string) *QueryErrorLogsOptionalParameters { r.InstanceName = &instanceName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QueryErrorLogsOptionalParameters) WithLimit(limit string) *QueryErrorLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QueryErrorLogsOptionalParameters) WithSortType(sortType SortType) *QueryErrorLogsOptionalParameters { r.SortType = &sortType @@ -179,18 +180,20 @@ func (r *QueryErrorLogsOptionalParameters) WithSortType(sortType SortType) *Quer // Query error logs of a cluster func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QueryErrorLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QueryErrorLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QueryErrorLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryErrorLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryErrorLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QueryErrorLogs") if err != nil { @@ -220,7 +223,8 @@ func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clu } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -242,10 +246,11 @@ func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -259,7 +264,7 @@ func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -271,9 +276,9 @@ func (a *ClusterLogApi) QueryErrorLogs(ctx _context.Context, orgName string, clu // QueryPodLogsOptionalParameters holds optional parameters for QueryPodLogs. type QueryPodLogsOptionalParameters struct { ComponentName *string - InstanceName *string - Limit *string - SortType *SortType + InstanceName *string + Limit *string + SortType *SortType } // NewQueryPodLogsOptionalParameters creates an empty struct for parameters. @@ -281,25 +286,21 @@ func NewQueryPodLogsOptionalParameters() *QueryPodLogsOptionalParameters { this := QueryPodLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QueryPodLogsOptionalParameters) WithComponentName(componentName string) *QueryPodLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithInstanceName sets the corresponding parameter name and returns the struct. func (r *QueryPodLogsOptionalParameters) WithInstanceName(instanceName string) *QueryPodLogsOptionalParameters { r.InstanceName = &instanceName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QueryPodLogsOptionalParameters) WithLimit(limit string) *QueryPodLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QueryPodLogsOptionalParameters) WithSortType(sortType SortType) *QueryPodLogsOptionalParameters { r.SortType = &sortType @@ -310,18 +311,20 @@ func (r *QueryPodLogsOptionalParameters) WithSortType(sortType SortType) *QueryP // Query pod logs of a cluster func (a *ClusterLogApi) QueryPodLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QueryPodLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QueryPodLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QueryPodLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryPodLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryPodLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QueryPodLogs") if err != nil { @@ -351,7 +354,8 @@ func (a *ClusterLogApi) QueryPodLogs(ctx _context.Context, orgName string, clust } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -373,10 +377,11 @@ func (a *ClusterLogApi) QueryPodLogs(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -390,7 +395,7 @@ func (a *ClusterLogApi) QueryPodLogs(ctx _context.Context, orgName string, clust err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -402,9 +407,9 @@ func (a *ClusterLogApi) QueryPodLogs(ctx _context.Context, orgName string, clust // QueryRunningLogsOptionalParameters holds optional parameters for QueryRunningLogs. type QueryRunningLogsOptionalParameters struct { ComponentName *string - InstanceName *string - Limit *string - SortType *SortType + InstanceName *string + Limit *string + SortType *SortType } // NewQueryRunningLogsOptionalParameters creates an empty struct for parameters. @@ -412,25 +417,21 @@ func NewQueryRunningLogsOptionalParameters() *QueryRunningLogsOptionalParameters this := QueryRunningLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QueryRunningLogsOptionalParameters) WithComponentName(componentName string) *QueryRunningLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithInstanceName sets the corresponding parameter name and returns the struct. func (r *QueryRunningLogsOptionalParameters) WithInstanceName(instanceName string) *QueryRunningLogsOptionalParameters { r.InstanceName = &instanceName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QueryRunningLogsOptionalParameters) WithLimit(limit string) *QueryRunningLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QueryRunningLogsOptionalParameters) WithSortType(sortType SortType) *QueryRunningLogsOptionalParameters { r.SortType = &sortType @@ -441,18 +442,20 @@ func (r *QueryRunningLogsOptionalParameters) WithSortType(sortType SortType) *Qu // Query running logs of a cluster func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QueryRunningLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QueryRunningLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QueryRunningLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryRunningLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryRunningLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QueryRunningLogs") if err != nil { @@ -482,7 +485,8 @@ func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, c } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -504,10 +508,11 @@ func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -521,7 +526,7 @@ func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -533,8 +538,8 @@ func (a *ClusterLogApi) QueryRunningLogs(ctx _context.Context, orgName string, c // QuerySlowLogsOptionalParameters holds optional parameters for QuerySlowLogs. type QuerySlowLogsOptionalParameters struct { ComponentName *string - Limit *string - SortType *SortType + Limit *string + SortType *SortType } // NewQuerySlowLogsOptionalParameters creates an empty struct for parameters. @@ -542,19 +547,16 @@ func NewQuerySlowLogsOptionalParameters() *QuerySlowLogsOptionalParameters { this := QuerySlowLogsOptionalParameters{} return &this } - // WithComponentName sets the corresponding parameter name and returns the struct. func (r *QuerySlowLogsOptionalParameters) WithComponentName(componentName string) *QuerySlowLogsOptionalParameters { r.ComponentName = &componentName return r } - // WithLimit sets the corresponding parameter name and returns the struct. func (r *QuerySlowLogsOptionalParameters) WithLimit(limit string) *QuerySlowLogsOptionalParameters { r.Limit = &limit return r } - // WithSortType sets the corresponding parameter name and returns the struct. func (r *QuerySlowLogsOptionalParameters) WithSortType(sortType SortType) *QuerySlowLogsOptionalParameters { r.SortType = &sortType @@ -565,18 +567,20 @@ func (r *QuerySlowLogsOptionalParameters) WithSortType(sortType SortType) *Query // Query slow logs of a cluster func (a *ClusterLogApi) QuerySlowLogs(ctx _context.Context, orgName string, clusterName string, startTime string, endTime string, o ...QuerySlowLogsOptionalParameters) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue interface{} - optionalParams QuerySlowLogsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue interface{} + optionalParams QuerySlowLogsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QuerySlowLogsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QuerySlowLogsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ClusterLogApi.QuerySlowLogs") if err != nil { @@ -603,7 +607,8 @@ func (a *ClusterLogApi) QuerySlowLogs(ctx _context.Context, orgName string, clus } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -625,10 +630,11 @@ func (a *ClusterLogApi) QuerySlowLogs(ctx _context.Context, orgName string, clus if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -642,7 +648,7 @@ func (a *ClusterLogApi) QuerySlowLogs(ctx _context.Context, orgName string, clus err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_database.go b/api/kbcloud/api_database.go index 8e81f231..692d432c 100644 --- a/api/kbcloud/api_database.go +++ b/api/kbcloud/api_database.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type DatabaseApi common.Service // create a database in cluster func (a *DatabaseApi) CreateDatabase(ctx _context.Context, orgName string, clusterName string, body Database) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DatabaseApi.CreateDatabase") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *DatabaseApi) CreateDatabase(ctx _context.Context, orgName string, clust localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *DatabaseApi) CreateDatabase(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -84,10 +93,12 @@ func (a *DatabaseApi) CreateDatabase(ctx _context.Context, orgName string, clust // delete a database in cluster func (a *DatabaseApi) DeleteDatabase(ctx _context.Context, orgName string, clusterName string, databaseName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DatabaseApi.DeleteDatabase") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -103,7 +114,8 @@ func (a *DatabaseApi) DeleteDatabase(ctx _context.Context, orgName string, clust localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -125,10 +137,11 @@ func (a *DatabaseApi) DeleteDatabase(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -146,11 +159,13 @@ func (a *DatabaseApi) DeleteDatabase(ctx _context.Context, orgName string, clust // list databases in cluster func (a *DatabaseApi) ListDatabases(ctx _context.Context, orgName string, clusterName string) (DatabaseList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue DatabaseList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue DatabaseList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DatabaseApi.ListDatabases") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -165,7 +180,8 @@ func (a *DatabaseApi) ListDatabases(ctx _context.Context, orgName string, cluste localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -187,10 +203,11 @@ func (a *DatabaseApi) ListDatabases(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -204,7 +221,7 @@ func (a *DatabaseApi) ListDatabases(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_dms.go b/api/kbcloud/api_dms.go index 1ece8bc2..5325c50d 100644 --- a/api/kbcloud/api_dms.go +++ b/api/kbcloud/api_dms.go @@ -2,14 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +23,13 @@ type DmsApi common.Service // AlterVolumes Alter the Storage Volume. func (a *DmsApi) AlterVolumes(ctx _context.Context, orgName string, clusterName string, volumeName string, body interface{}) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue string + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.AlterVolumes") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -41,9 +46,11 @@ func (a *DmsApi) AlterVolumes(ctx _context.Context, orgName string, clusterName localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -65,10 +72,11 @@ func (a *DmsApi) AlterVolumes(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -82,7 +90,7 @@ func (a *DmsApi) AlterVolumes(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -94,11 +102,13 @@ func (a *DmsApi) AlterVolumes(ctx _context.Context, orgName string, clusterName // CreateVolumes Create the Storage Volume. func (a *DmsApi) CreateVolumes(ctx _context.Context, orgName string, clusterName string, body interface{}) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue string + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.CreateVolumes") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -114,9 +124,11 @@ func (a *DmsApi) CreateVolumes(ctx _context.Context, orgName string, clusterName localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -138,10 +150,11 @@ func (a *DmsApi) CreateVolumes(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -155,7 +168,7 @@ func (a *DmsApi) CreateVolumes(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -174,7 +187,6 @@ func NewDataExportOptionalParameters() *DataExportOptionalParameters { this := DataExportOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *DataExportOptionalParameters) WithBody(body interface{}) *DataExportOptionalParameters { r.Body = &body @@ -184,17 +196,19 @@ func (r *DataExportOptionalParameters) WithBody(body interface{}) *DataExportOpt // DataExport Data Export. func (a *DmsApi) DataExport(ctx _context.Context, orgName string, clusterName string, id string, o ...DataExportOptionalParameters) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - optionalParams DataExportOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + optionalParams DataExportOptionalParameters ) - if len(o) > 1 { - return nil, common.ReportError("only one argument of type DataExportOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return nil, common.ReportError("only one argument of type DataExportOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.DataExport") if err != nil { @@ -210,13 +224,15 @@ func (a *DmsApi) DataExport(ctx _context.Context, orgName string, clusterName st localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -238,10 +254,11 @@ func (a *DmsApi) DataExport(ctx _context.Context, orgName string, clusterName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -258,11 +275,13 @@ func (a *DmsApi) DataExport(ctx _context.Context, orgName string, clusterName st // DataImport Data Import. func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName string, id string, file _io.Reader) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.DataImport") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -279,14 +298,15 @@ func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" - formFile := common.FormFile{} + + formFile := common.FormFile{} formFile.FormFileName = "file" localVarFile := file if localVarFile != nil { fbs, _ := _io.ReadAll(localVarFile) formFile.FileBytes = fbs } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -308,10 +328,11 @@ func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -325,7 +346,7 @@ func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -337,11 +358,13 @@ func (a *DmsApi) DataImport(ctx _context.Context, orgName string, clusterName st // DropVolumes Drop the Storage Volume. func (a *DmsApi) DropVolumes(ctx _context.Context, orgName string, clusterName string, volumeName string) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue string + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.DropVolumes") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -357,7 +380,8 @@ func (a *DmsApi) DropVolumes(ctx _context.Context, orgName string, clusterName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -379,10 +403,11 @@ func (a *DmsApi) DropVolumes(ctx _context.Context, orgName string, clusterName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -396,7 +421,7 @@ func (a *DmsApi) DropVolumes(ctx _context.Context, orgName string, clusterName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -408,11 +433,13 @@ func (a *DmsApi) DropVolumes(ctx _context.Context, orgName string, clusterName s // GetObjectInfo get the detail object info. func (a *DmsApi) GetObjectInfo(ctx _context.Context, orgName string, clusterName string, id string, schema string, typeVar string, objectName string) (ObjectResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ObjectResponse + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ObjectResponse ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetObjectInfo") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -431,7 +458,8 @@ func (a *DmsApi) GetObjectInfo(ctx _context.Context, orgName string, clusterName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -454,7 +482,7 @@ func (a *DmsApi) GetObjectInfo(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -466,11 +494,13 @@ func (a *DmsApi) GetObjectInfo(ctx _context.Context, orgName string, clusterName // GetTaskList Get the task list. func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName string, id string) (DmsTaskList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue DmsTaskList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue DmsTaskList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetTaskList") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -486,7 +516,8 @@ func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -508,10 +539,11 @@ func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -525,7 +557,7 @@ func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -537,11 +569,13 @@ func (a *DmsApi) GetTaskList(ctx _context.Context, orgName string, clusterName s // GetTaskProgress Get the task progress. func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterName string, id string, taskId string) (DmsTaskInfo, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue DmsTaskInfo + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue DmsTaskInfo ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetTaskProgress") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -558,7 +592,8 @@ func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterNa localVarQueryParams.Add("taskId", common.ParameterToString(taskId, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -580,10 +615,11 @@ func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -597,7 +633,7 @@ func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -609,11 +645,13 @@ func (a *DmsApi) GetTaskProgress(ctx _context.Context, orgName string, clusterNa // ListObjectNamesByType list the all name for the specified object type. func (a *DmsApi) ListObjectNamesByType(ctx _context.Context, orgName string, clusterName string, id string, schema string, typeVar string) ([]string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []string + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListObjectNamesByType") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -631,7 +669,8 @@ func (a *DmsApi) ListObjectNamesByType(ctx _context.Context, orgName string, clu localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -654,7 +693,7 @@ func (a *DmsApi) ListObjectNamesByType(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -666,11 +705,13 @@ func (a *DmsApi) ListObjectNamesByType(ctx _context.Context, orgName string, clu // ListObjectTypesInSchema list the type and number of database objects in the specified database or schema. func (a *DmsApi) ListObjectTypesInSchema(ctx _context.Context, orgName string, clusterName string, id string, schema string) ([]Object, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Object + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Object ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListObjectTypesInSchema") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -687,7 +728,8 @@ func (a *DmsApi) ListObjectTypesInSchema(ctx _context.Context, orgName string, c localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -710,7 +752,7 @@ func (a *DmsApi) ListObjectTypesInSchema(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -722,11 +764,13 @@ func (a *DmsApi) ListObjectTypesInSchema(ctx _context.Context, orgName string, c // ListVolumes List all Storage Volumes. func (a *DmsApi) ListVolumes(ctx _context.Context, orgName string, clusterName string) ([]Volume, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Volume + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Volume ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListVolumes") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -741,7 +785,8 @@ func (a *DmsApi) ListVolumes(ctx _context.Context, orgName string, clusterName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -763,10 +808,11 @@ func (a *DmsApi) ListVolumes(ctx _context.Context, orgName string, clusterName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -780,7 +826,7 @@ func (a *DmsApi) ListVolumes(ctx _context.Context, orgName string, clusterName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -792,11 +838,13 @@ func (a *DmsApi) ListVolumes(ctx _context.Context, orgName string, clusterName s // SetDefaultVolumes Set the Default Storage Volume. func (a *DmsApi) SetDefaultVolumes(ctx _context.Context, orgName string, clusterName string, volumeName string) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue string + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.SetDefaultVolumes") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -812,7 +860,8 @@ func (a *DmsApi) SetDefaultVolumes(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -834,10 +883,11 @@ func (a *DmsApi) SetDefaultVolumes(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -851,7 +901,7 @@ func (a *DmsApi) SetDefaultVolumes(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -863,11 +913,13 @@ func (a *DmsApi) SetDefaultVolumes(ctx _context.Context, orgName string, cluster // AlterParameter alter cluster parameter. func (a *DmsApi) AlterParameter(ctx _context.Context, orgName string, clusterName string, tenantId string, body interface{}) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue string + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.AlterParameter") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -884,9 +936,11 @@ func (a *DmsApi) AlterParameter(ctx _context.Context, orgName string, clusterNam localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -908,10 +962,11 @@ func (a *DmsApi) AlterParameter(ctx _context.Context, orgName string, clusterNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -925,7 +980,7 @@ func (a *DmsApi) AlterParameter(ctx _context.Context, orgName string, clusterNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -944,7 +999,6 @@ func NewCloseSessionsOptionalParameters() *CloseSessionsOptionalParameters { this := CloseSessionsOptionalParameters{} return &this } - // WithKeep sets the corresponding parameter name and returns the struct. func (r *CloseSessionsOptionalParameters) WithKeep(keep string) *CloseSessionsOptionalParameters { r.Keep = &keep @@ -954,18 +1008,20 @@ func (r *CloseSessionsOptionalParameters) WithKeep(keep string) *CloseSessionsOp // CloseSessions close the session for the cluster. func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName string, session string, o ...CloseSessionsOptionalParameters) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue string - optionalParams CloseSessionsOptionalParameters + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue string + optionalParams CloseSessionsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CloseSessionsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CloseSessionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.CloseSessions") if err != nil { @@ -985,7 +1041,8 @@ func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1007,10 +1064,11 @@ func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1024,7 +1082,7 @@ func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1036,11 +1094,13 @@ func (a *DmsApi) CloseSessions(ctx _context.Context, orgName string, clusterName // CreateDataSourceV2 create the datasource. func (a *DmsApi) CreateDataSourceV2(ctx _context.Context, orgName string, clusterName string, body Datasource) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.CreateDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1056,9 +1116,11 @@ func (a *DmsApi) CreateDataSourceV2(ctx _context.Context, orgName string, cluste localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1081,7 +1143,7 @@ func (a *DmsApi) CreateDataSourceV2(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1093,10 +1155,12 @@ func (a *DmsApi) CreateDataSourceV2(ctx _context.Context, orgName string, cluste // DeleteDataSourceV2 delete the datasource. func (a *DmsApi) DeleteDataSourceV2(ctx _context.Context, orgName string, clusterName string, id string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.DeleteDataSourceV2") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1112,7 +1176,8 @@ func (a *DmsApi) DeleteDataSourceV2(ctx _context.Context, orgName string, cluste localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1134,10 +1199,11 @@ func (a *DmsApi) DeleteDataSourceV2(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1161,7 +1227,6 @@ func NewGenerateDDLOptionalParameters() *GenerateDDLOptionalParameters { this := GenerateDDLOptionalParameters{} return &this } - // WithBody sets the corresponding parameter name and returns the struct. func (r *GenerateDDLOptionalParameters) WithBody(body interface{}) *GenerateDDLOptionalParameters { r.Body = &body @@ -1171,18 +1236,20 @@ func (r *GenerateDDLOptionalParameters) WithBody(body interface{}) *GenerateDDLO // GenerateDDL support ddl and dml operations. func (a *DmsApi) GenerateDDL(ctx _context.Context, orgName string, clusterName string, id string, o ...GenerateDDLOptionalParameters) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue string - optionalParams GenerateDDLOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue string + optionalParams GenerateDDLOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GenerateDDLOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GenerateDDLOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GenerateDDL") if err != nil { @@ -1200,11 +1267,13 @@ func (a *DmsApi) GenerateDDL(ctx _context.Context, orgName string, clusterName s localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params if optionalParams.Body != nil { localVarPostBody = &optionalParams.Body } - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1227,7 +1296,7 @@ func (a *DmsApi) GenerateDDL(ctx _context.Context, orgName string, clusterName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1239,11 +1308,13 @@ func (a *DmsApi) GenerateDDL(ctx _context.Context, orgName string, clusterName s // GetDataSourceV2 get the datasource. func (a *DmsApi) GetDataSourceV2(ctx _context.Context, orgName string, clusterName string, id string) (Datasource, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Datasource + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Datasource ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1259,7 +1330,8 @@ func (a *DmsApi) GetDataSourceV2(ctx _context.Context, orgName string, clusterNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1282,7 +1354,7 @@ func (a *DmsApi) GetDataSourceV2(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1294,11 +1366,13 @@ func (a *DmsApi) GetDataSourceV2(ctx _context.Context, orgName string, clusterNa // GetSchemaList list all databases or schema of the cluster. func (a *DmsApi) GetSchemaList(ctx _context.Context, orgName string, clusterName string, id string) ([]string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []string + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []string ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.GetSchemaList") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1314,7 +1388,8 @@ func (a *DmsApi) GetSchemaList(ctx _context.Context, orgName string, clusterName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1337,7 +1412,7 @@ func (a *DmsApi) GetSchemaList(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1349,11 +1424,13 @@ func (a *DmsApi) GetSchemaList(ctx _context.Context, orgName string, clusterName // ListDataSourceV2 list the datasource of a cluster. func (a *DmsApi) ListDataSourceV2(ctx _context.Context, orgName string, clusterName string) ([]Datasource, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Datasource + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Datasource ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1368,7 +1445,8 @@ func (a *DmsApi) ListDataSourceV2(ctx _context.Context, orgName string, clusterN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1391,7 +1469,7 @@ func (a *DmsApi) ListDataSourceV2(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1403,11 +1481,13 @@ func (a *DmsApi) ListDataSourceV2(ctx _context.Context, orgName string, clusterN // ListParameters list cluster parameters. func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterName string, tenantId string, mode string) ([]ObParameter, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []ObParameter + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []ObParameter ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListParameters") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1424,7 +1504,8 @@ func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterNam localVarQueryParams.Add("mode", common.ParameterToString(mode, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1446,10 +1527,11 @@ func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1463,7 +1545,7 @@ func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1475,11 +1557,13 @@ func (a *DmsApi) ListParameters(ctx _context.Context, orgName string, clusterNam // ListQueryHistory list the query History. func (a *DmsApi) ListQueryHistory(ctx _context.Context, orgName string, clusterName string, id string) (QueryHistory, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue QueryHistory + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue QueryHistory ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListQueryHistory") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1495,7 +1579,8 @@ func (a *DmsApi) ListQueryHistory(ctx _context.Context, orgName string, clusterN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1518,7 +1603,7 @@ func (a *DmsApi) ListQueryHistory(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1537,7 +1622,6 @@ func NewListSessionsOptionalParameters() *ListSessionsOptionalParameters { this := ListSessionsOptionalParameters{} return &this } - // WithAll sets the corresponding parameter name and returns the struct. func (r *ListSessionsOptionalParameters) WithAll(all string) *ListSessionsOptionalParameters { r.All = &all @@ -1547,18 +1631,20 @@ func (r *ListSessionsOptionalParameters) WithAll(all string) *ListSessionsOption // ListSessions list all session for the cluster. func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName string, o ...ListSessionsOptionalParameters) ([]ObSession, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []ObSession - optionalParams ListSessionsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []ObSession + optionalParams ListSessionsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListSessionsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListSessionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ListSessions") if err != nil { @@ -1577,7 +1663,8 @@ func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1599,10 +1686,11 @@ func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1616,7 +1704,7 @@ func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1628,11 +1716,13 @@ func (a *DmsApi) ListSessions(ctx _context.Context, orgName string, clusterName // Query create a SQL query. func (a *DmsApi) Query(ctx _context.Context, orgName string, clusterName string, id string, body interface{}) (QueryResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue QueryResponse + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue QueryResponse ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.Query") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1649,9 +1739,11 @@ func (a *DmsApi) Query(ctx _context.Context, orgName string, clusterName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1674,7 +1766,7 @@ func (a *DmsApi) Query(ctx _context.Context, orgName string, clusterName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1686,11 +1778,13 @@ func (a *DmsApi) Query(ctx _context.Context, orgName string, clusterName string, // ShowData read data of table or view. func (a *DmsApi) ShowData(ctx _context.Context, orgName string, clusterName string, id string, body interface{}) (Result, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Result + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Result ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.ShowData") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1707,9 +1801,11 @@ func (a *DmsApi) ShowData(ctx _context.Context, orgName string, clusterName stri localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1732,7 +1828,7 @@ func (a *DmsApi) ShowData(ctx _context.Context, orgName string, clusterName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1744,11 +1840,13 @@ func (a *DmsApi) ShowData(ctx _context.Context, orgName string, clusterName stri // SqlExplain explain a SQL. func (a *DmsApi) SqlExplain(ctx _context.Context, orgName string, clusterName string, id string, body interface{}) (QueryResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue QueryResponse + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue QueryResponse ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.SqlExplain") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1765,9 +1863,11 @@ func (a *DmsApi) SqlExplain(ctx _context.Context, orgName string, clusterName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1790,7 +1890,7 @@ func (a *DmsApi) SqlExplain(ctx _context.Context, orgName string, clusterName st err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1809,7 +1909,6 @@ func NewTenantParameterHistoryOptionalParameters() *TenantParameterHistoryOption this := TenantParameterHistoryOptionalParameters{} return &this } - // WithParameterName sets the corresponding parameter name and returns the struct. func (r *TenantParameterHistoryOptionalParameters) WithParameterName(parameterName string) *TenantParameterHistoryOptionalParameters { r.ParameterName = ¶meterName @@ -1819,18 +1918,20 @@ func (r *TenantParameterHistoryOptionalParameters) WithParameterName(parameterNa // TenantParameterHistory List parameters history of the Oceanbase tenant. func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, clusterName string, tenantId string, o ...TenantParameterHistoryOptionalParameters) (ParameterHistoryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParameterHistoryList - optionalParams TenantParameterHistoryOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParameterHistoryList + optionalParams TenantParameterHistoryOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type TenantParameterHistoryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type TenantParameterHistoryOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.TenantParameterHistory") if err != nil { @@ -1850,7 +1951,8 @@ func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, cl } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1872,10 +1974,11 @@ func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1889,7 +1992,7 @@ func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1901,11 +2004,13 @@ func (a *DmsApi) TenantParameterHistory(ctx _context.Context, orgName string, cl // TestDataSourceV2 test the datasource. func (a *DmsApi) TestDataSourceV2(ctx _context.Context, orgName string, clusterName string, body Datasource) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.TestDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1921,9 +2026,11 @@ func (a *DmsApi) TestDataSourceV2(ctx _context.Context, orgName string, clusterN localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -1946,7 +2053,7 @@ func (a *DmsApi) TestDataSourceV2(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -1958,11 +2065,13 @@ func (a *DmsApi) TestDataSourceV2(ctx _context.Context, orgName string, clusterN // UpdateDataSourceV2 update the datasource. func (a *DmsApi) UpdateDataSourceV2(ctx _context.Context, orgName string, clusterName string, body Datasource) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".DmsApi.UpdateDataSourceV2") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1978,9 +2087,11 @@ func (a *DmsApi) UpdateDataSourceV2(ctx _context.Context, orgName string, cluste localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -2003,7 +2114,7 @@ func (a *DmsApi) UpdateDataSourceV2(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_engine.go b/api/kbcloud/api_engine.go index 292160ae..c940af8b 100644 --- a/api/kbcloud/api_engine.go +++ b/api/kbcloud/api_engine.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type EngineApi common.Service // EngineActionInOrg Manage engine in organization. func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, actionInfo interface{}) (bool, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue bool + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue bool ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineApi.EngineActionInOrg") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, acti localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &actionInfo - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, acti if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, acti err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +99,11 @@ func (a *EngineApi) EngineActionInOrg(ctx _context.Context, orgName string, acti // ListEnginesInEnvOptionalParameters holds optional parameters for ListEnginesInEnv. type ListEnginesInEnvOptionalParameters struct { - Name *string - Type *EngineType - Version *string + Name *string + Type *EngineType + Version *string Provider *string - All *bool + All *bool } // NewListEnginesInEnvOptionalParameters creates an empty struct for parameters. @@ -102,31 +111,26 @@ func NewListEnginesInEnvOptionalParameters() *ListEnginesInEnvOptionalParameters this := ListEnginesInEnvOptionalParameters{} return &this } - // WithName sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithName(name string) *ListEnginesInEnvOptionalParameters { r.Name = &name return r } - // WithType sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithType(typeVar EngineType) *ListEnginesInEnvOptionalParameters { r.Type = &typeVar return r } - // WithVersion sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithVersion(version string) *ListEnginesInEnvOptionalParameters { r.Version = &version return r } - // WithProvider sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithProvider(provider string) *ListEnginesInEnvOptionalParameters { r.Provider = &provider return r } - // WithAll sets the corresponding parameter name and returns the struct. func (r *ListEnginesInEnvOptionalParameters) WithAll(all bool) *ListEnginesInEnvOptionalParameters { r.All = &all @@ -136,18 +140,20 @@ func (r *ListEnginesInEnvOptionalParameters) WithAll(all bool) *ListEnginesInEnv // ListEnginesInEnv List engines in environment. func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName string, o ...ListEnginesInEnvOptionalParameters) ([]Engine, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Engine - optionalParams ListEnginesInEnvOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Engine + optionalParams ListEnginesInEnvOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnginesInEnvOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnginesInEnvOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineApi.ListEnginesInEnv") if err != nil { @@ -177,7 +183,8 @@ func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName strin } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -199,10 +206,11 @@ func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -216,7 +224,7 @@ func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -228,10 +236,10 @@ func (a *EngineApi) ListEnginesInEnv(ctx _context.Context, environmentName strin // ListEnginesInOrgOptionalParameters holds optional parameters for ListEnginesInOrg. type ListEnginesInOrgOptionalParameters struct { EnvironmentName *string - Name *string - Type *EngineType - Version *string - Provider *string + Name *string + Type *EngineType + Version *string + Provider *string } // NewListEnginesInOrgOptionalParameters creates an empty struct for parameters. @@ -239,31 +247,26 @@ func NewListEnginesInOrgOptionalParameters() *ListEnginesInOrgOptionalParameters this := ListEnginesInOrgOptionalParameters{} return &this } - // WithEnvironmentName sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithEnvironmentName(environmentName string) *ListEnginesInOrgOptionalParameters { r.EnvironmentName = &environmentName return r } - // WithName sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithName(name string) *ListEnginesInOrgOptionalParameters { r.Name = &name return r } - // WithType sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithType(typeVar EngineType) *ListEnginesInOrgOptionalParameters { r.Type = &typeVar return r } - // WithVersion sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithVersion(version string) *ListEnginesInOrgOptionalParameters { r.Version = &version return r } - // WithProvider sets the corresponding parameter name and returns the struct. func (r *ListEnginesInOrgOptionalParameters) WithProvider(provider string) *ListEnginesInOrgOptionalParameters { r.Provider = &provider @@ -273,18 +276,20 @@ func (r *ListEnginesInOrgOptionalParameters) WithProvider(provider string) *List // ListEnginesInOrg List engines in organization. func (a *EngineApi) ListEnginesInOrg(ctx _context.Context, orgName string, o ...ListEnginesInOrgOptionalParameters) ([]Engine, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Engine - optionalParams ListEnginesInOrgOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Engine + optionalParams ListEnginesInOrgOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnginesInOrgOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnginesInOrgOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineApi.ListEnginesInOrg") if err != nil { @@ -314,7 +319,8 @@ func (a *EngineApi) ListEnginesInOrg(ctx _context.Context, orgName string, o ... } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -336,10 +342,11 @@ func (a *EngineApi) ListEnginesInOrg(ctx _context.Context, orgName string, o ... if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -353,7 +360,7 @@ func (a *EngineApi) ListEnginesInOrg(ctx _context.Context, orgName string, o ... err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_engine_license.go b/api/kbcloud/api_engine_license.go index baa5a69e..b022c554 100644 --- a/api/kbcloud/api_engine_license.go +++ b/api/kbcloud/api_engine_license.go @@ -2,10 +2,15 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -25,7 +30,6 @@ func NewListEngineLicensesOptionalParameters() *ListEngineLicensesOptionalParame this := ListEngineLicensesOptionalParameters{} return &this } - // WithEngineName sets the corresponding parameter name and returns the struct. func (r *ListEngineLicensesOptionalParameters) WithEngineName(engineName string) *ListEngineLicensesOptionalParameters { r.EngineName = &engineName @@ -36,18 +40,20 @@ func (r *ListEngineLicensesOptionalParameters) WithEngineName(engineName string) // list all engineLicenses func (a *EngineLicenseApi) ListEngineLicenses(ctx _context.Context, o ...ListEngineLicensesOptionalParameters) (EngineLicenseList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineLicenseList - optionalParams ListEngineLicensesOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineLicenseList + optionalParams ListEngineLicensesOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEngineLicensesOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListEngineLicensesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineLicenseApi.ListEngineLicenses") if err != nil { @@ -64,7 +70,8 @@ func (a *EngineLicenseApi) ListEngineLicenses(ctx _context.Context, o ...ListEng } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -86,10 +93,11 @@ func (a *EngineLicenseApi) ListEngineLicenses(ctx _context.Context, o ...ListEng if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -103,7 +111,7 @@ func (a *EngineLicenseApi) ListEngineLicenses(ctx _context.Context, o ...ListEng err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_engine_option.go b/api/kbcloud/api_engine_option.go index 48942963..c2607a4d 100644 --- a/api/kbcloud/api_engine_option.go +++ b/api/kbcloud/api_engine_option.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type EngineOptionApi common.Service // list upgraded service version of the component func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, clusterName string, orgName string, component string) (EngineServiceVersions, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineServiceVersions + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineServiceVersions ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.ListUpgradeableServiceVersion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,7 +46,8 @@ func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, cl localVarQueryParams.Add("component", common.ParameterToString(component, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +69,11 @@ func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +87,7 @@ func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,11 +100,13 @@ func (a *EngineOptionApi) ListUpgradeableServiceVersion(ctx _context.Context, cl // Get a engineOption detail func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName string) (EngineOption, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineOption + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineOption ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.GetEngineOption") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,7 +120,8 @@ func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName strin localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +143,11 @@ func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -149,7 +161,7 @@ func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -162,11 +174,13 @@ func (a *EngineOptionApi) GetEngineOption(ctx _context.Context, engineName strin // list all engineOptions func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context) (EngineOptionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineOptionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineOptionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EngineOptionApi.ListEngineOptions") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -179,7 +193,8 @@ func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context) (EngineOptionL localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -201,10 +216,11 @@ func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context) (EngineOptionL if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -218,7 +234,7 @@ func (a *EngineOptionApi) ListEngineOptions(ctx _context.Context) (EngineOptionL err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_environment.go b/api/kbcloud/api_environment.go index 32eb1683..b4829cfc 100644 --- a/api/kbcloud/api_environment.go +++ b/api/kbcloud/api_environment.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -16,14 +20,92 @@ import ( // EnvironmentApi service type type EnvironmentApi common.Service +// FilterEnvironment List environments. +// List environments +func (a *EnvironmentApi) FilterEnvironment(ctx _context.Context, orgName string, engineName string, version string) (EnvironmentList, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EnvironmentList + ) + + + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.FilterEnvironment") + if err != nil { + return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/organizations/{orgName}/engine/{engineName}/version/{version}/environments" + localVarPath = strings.Replace(localVarPath, "{"+"orgName"+"}", _neturl.PathEscape(common.ParameterToString(orgName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"engineName"+"}", _neturl.PathEscape(common.ParameterToString(engineName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"version"+"}", _neturl.PathEscape(common.ParameterToString(version, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + + common.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"BearerToken", "authorization"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := common.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := common.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ + var v None + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := common.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // GetEnvironment Get environment. func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, orgName string, environmentName string) (Environment, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Environment + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Environment ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.GetEnvironment") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +120,8 @@ func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, orgName string, en localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +143,11 @@ func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, orgName string, en if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +161,7 @@ func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, orgName string, en err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +174,13 @@ func (a *EnvironmentApi) GetEnvironment(ctx _context.Context, orgName string, en // List available zones of an environment func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, orgName string, environmentName string) (ZoneList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ZoneList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ZoneList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListEnvNodeZone") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +195,8 @@ func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, orgName string, e localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +218,11 @@ func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, orgName string, e if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -148,7 +236,7 @@ func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, orgName string, e err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -157,46 +245,16 @@ func (a *EnvironmentApi) ListEnvNodeZone(ctx _context.Context, orgName string, e return localVarReturnValue, localVarHTTPResponse, nil } -// ListEnvironmentOptionalParameters holds optional parameters for ListEnvironment. -type ListEnvironmentOptionalParameters struct { - Engine *string - Version *string -} - -// NewListEnvironmentOptionalParameters creates an empty struct for parameters. -func NewListEnvironmentOptionalParameters() *ListEnvironmentOptionalParameters { - this := ListEnvironmentOptionalParameters{} - return &this -} - -// WithEngine sets the corresponding parameter name and returns the struct. -func (r *ListEnvironmentOptionalParameters) WithEngine(engine string) *ListEnvironmentOptionalParameters { - r.Engine = &engine - return r -} - -// WithVersion sets the corresponding parameter name and returns the struct. -func (r *ListEnvironmentOptionalParameters) WithVersion(version string) *ListEnvironmentOptionalParameters { - r.Version = &version - return r -} - // ListEnvironment List environments. // List environments -func (a *EnvironmentApi) ListEnvironment(ctx _context.Context, orgName string, o ...ListEnvironmentOptionalParameters) (EnvironmentList, *_nethttp.Response, error) { +func (a *EnvironmentApi) ListEnvironment(ctx _context.Context, orgName string) (EnvironmentList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EnvironmentList - optionalParams ListEnvironmentOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EnvironmentList ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListEnvironmentOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListEnvironment") if err != nil { @@ -209,15 +267,10 @@ func (a *EnvironmentApi) ListEnvironment(ctx _context.Context, orgName string, o localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.Engine != nil { - localVarQueryParams.Add("engine", common.ParameterToString(*optionalParams.Engine, "")) - } - if optionalParams.Version != nil { - localVarQueryParams.Add("version", common.ParameterToString(*optionalParams.Version, "")) - } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -239,10 +292,11 @@ func (a *EnvironmentApi) ListEnvironment(ctx _context.Context, orgName string, o if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -256,7 +310,7 @@ func (a *EnvironmentApi) ListEnvironment(ctx _context.Context, orgName string, o err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -268,11 +322,13 @@ func (a *EnvironmentApi) ListEnvironment(ctx _context.Context, orgName string, o // ListNodeGroup List environment node group. func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName string) (NodeGroup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue NodeGroup + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue NodeGroup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EnvironmentApi.ListNodeGroup") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -286,7 +342,8 @@ func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName str localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -308,10 +365,11 @@ func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -325,7 +383,7 @@ func (a *EnvironmentApi) ListNodeGroup(ctx _context.Context, environmentName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_event.go b/api/kbcloud/api_event.go index d39d01f2..a9702ae2 100644 --- a/api/kbcloud/api_event.go +++ b/api/kbcloud/api_event.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -18,12 +22,12 @@ type EventApi common.Service // QueryClusterEventsOptionalParameters holds optional parameters for QueryClusterEvents. type QueryClusterEventsOptionalParameters struct { - ResourceId *int32 + ResourceId *int32 ResourceType *string - EventName *string - OperatorId *int32 - Start *int64 - End *int64 + EventName *string + OperatorId *int32 + Start *int64 + End *int64 } // NewQueryClusterEventsOptionalParameters creates an empty struct for parameters. @@ -31,37 +35,31 @@ func NewQueryClusterEventsOptionalParameters() *QueryClusterEventsOptionalParame this := QueryClusterEventsOptionalParameters{} return &this } - // WithResourceId sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithResourceId(resourceId int32) *QueryClusterEventsOptionalParameters { r.ResourceId = &resourceId return r } - // WithResourceType sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithResourceType(resourceType string) *QueryClusterEventsOptionalParameters { r.ResourceType = &resourceType return r } - // WithEventName sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithEventName(eventName string) *QueryClusterEventsOptionalParameters { r.EventName = &eventName return r } - // WithOperatorId sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithOperatorId(operatorId int32) *QueryClusterEventsOptionalParameters { r.OperatorId = &operatorId return r } - // WithStart sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithStart(start int64) *QueryClusterEventsOptionalParameters { r.Start = &start return r } - // WithEnd sets the corresponding parameter name and returns the struct. func (r *QueryClusterEventsOptionalParameters) WithEnd(end int64) *QueryClusterEventsOptionalParameters { r.End = &end @@ -72,18 +70,20 @@ func (r *QueryClusterEventsOptionalParameters) WithEnd(end int64) *QueryClusterE // Query events of clusters func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, o ...QueryClusterEventsOptionalParameters) (EventList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EventList - optionalParams QueryClusterEventsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EventList + optionalParams QueryClusterEventsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryClusterEventsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryClusterEventsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EventApi.QueryClusterEvents") if err != nil { @@ -116,7 +116,8 @@ func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, o .. } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -138,10 +139,11 @@ func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, o .. if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -155,7 +157,7 @@ func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, o .. err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_feature.go b/api/kbcloud/api_feature.go index 978d3cb2..e3e89163 100644 --- a/api/kbcloud/api_feature.go +++ b/api/kbcloud/api_feature.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListFeatureOptionalParameters() *ListFeatureOptionalParameters { this := ListFeatureOptionalParameters{} return &this } - // WithGroup sets the corresponding parameter name and returns the struct. func (r *ListFeatureOptionalParameters) WithGroup(group string) *ListFeatureOptionalParameters { r.Group = &group @@ -37,18 +40,20 @@ func (r *ListFeatureOptionalParameters) WithGroup(group string) *ListFeatureOpti // Get feature list func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalParameters) (FeatureList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue FeatureList - optionalParams ListFeatureOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue FeatureList + optionalParams ListFeatureOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListFeatureOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListFeatureOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FeatureApi.ListFeature") if err != nil { @@ -65,7 +70,8 @@ func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalP } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -87,10 +93,11 @@ func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalP if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -104,7 +111,7 @@ func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalP err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -117,11 +124,13 @@ func (a *FeatureApi) ListFeature(ctx _context.Context, o ...ListFeatureOptionalP // Get feature func (a *FeatureApi) ReadFeature(ctx _context.Context, featureName string) (Feature, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Feature + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Feature ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".FeatureApi.ReadFeature") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -135,7 +144,8 @@ func (a *FeatureApi) ReadFeature(ctx _context.Context, featureName string) (Feat localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -157,10 +167,11 @@ func (a *FeatureApi) ReadFeature(ctx _context.Context, featureName string) (Feat if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -174,7 +185,7 @@ func (a *FeatureApi) ReadFeature(ctx _context.Context, featureName string) (Feat err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_inspection.go b/api/kbcloud/api_inspection.go index 3e790d51..907685fd 100644 --- a/api/kbcloud/api_inspection.go +++ b/api/kbcloud/api_inspection.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type InspectionApi common.Service // CreateAutoInspection Create auto inspection. func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName string, body AutoInspection) (AutoInspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue AutoInspection + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AutoInspection ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.CreateAutoInspection") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,11 +100,13 @@ func (a *InspectionApi) CreateAutoInspection(ctx _context.Context, orgName strin // CreateInspectionScript Create inspection script. func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName string, body InspectionScript) (InspectionScript, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue InspectionScript + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue InspectionScript ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.CreateInspectionScript") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,9 +121,11 @@ func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -134,10 +147,11 @@ func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -151,7 +165,7 @@ func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -163,11 +177,13 @@ func (a *InspectionApi) CreateInspectionScript(ctx _context.Context, orgName str // DeleteInspectionScript Delete inspection script. func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName string, body InspectionScript) (InspectionScript, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue InspectionScript + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue InspectionScript ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.DeleteInspectionScript") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -182,9 +198,11 @@ func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -206,10 +224,11 @@ func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -223,7 +242,7 @@ func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -235,11 +254,13 @@ func (a *InspectionApi) DeleteInspectionScript(ctx _context.Context, orgName str // ListAutoInspection list auto inspection. func (a *InspectionApi) ListAutoInspection(ctx _context.Context, orgName string) (AutoInspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AutoInspection + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AutoInspection ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.ListAutoInspection") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -253,7 +274,8 @@ func (a *InspectionApi) ListAutoInspection(ctx _context.Context, orgName string) localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -275,10 +297,11 @@ func (a *InspectionApi) ListAutoInspection(ctx _context.Context, orgName string) if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -292,7 +315,7 @@ func (a *InspectionApi) ListAutoInspection(ctx _context.Context, orgName string) err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -311,7 +334,6 @@ func NewListInspectionScriptsOptionalParameters() *ListInspectionScriptsOptional this := ListInspectionScriptsOptionalParameters{} return &this } - // WithEngine sets the corresponding parameter name and returns the struct. func (r *ListInspectionScriptsOptionalParameters) WithEngine(engine string) *ListInspectionScriptsOptionalParameters { r.Engine = &engine @@ -321,18 +343,20 @@ func (r *ListInspectionScriptsOptionalParameters) WithEngine(engine string) *Lis // ListInspectionScripts list inspection scripts. func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName string, o ...ListInspectionScriptsOptionalParameters) ([]InspectionScript, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []InspectionScript - optionalParams ListInspectionScriptsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []InspectionScript + optionalParams ListInspectionScriptsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListInspectionScriptsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListInspectionScriptsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.ListInspectionScripts") if err != nil { @@ -350,7 +374,8 @@ func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName stri } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -372,10 +397,11 @@ func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -389,7 +415,7 @@ func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName stri err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -401,7 +427,7 @@ func (a *InspectionApi) ListInspectionScripts(ctx _context.Context, orgName stri // ListInspectionsOptionalParameters holds optional parameters for ListInspections. type ListInspectionsOptionalParameters struct { ClusterId *string - TaskId *string + TaskId *string } // NewListInspectionsOptionalParameters creates an empty struct for parameters. @@ -409,13 +435,11 @@ func NewListInspectionsOptionalParameters() *ListInspectionsOptionalParameters { this := ListInspectionsOptionalParameters{} return &this } - // WithClusterId sets the corresponding parameter name and returns the struct. func (r *ListInspectionsOptionalParameters) WithClusterId(clusterId string) *ListInspectionsOptionalParameters { r.ClusterId = &clusterId return r } - // WithTaskId sets the corresponding parameter name and returns the struct. func (r *ListInspectionsOptionalParameters) WithTaskId(taskId string) *ListInspectionsOptionalParameters { r.TaskId = &taskId @@ -425,18 +449,20 @@ func (r *ListInspectionsOptionalParameters) WithTaskId(taskId string) *ListInspe // ListInspections list inspections. func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o ...ListInspectionsOptionalParameters) ([]Inspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Inspection - optionalParams ListInspectionsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Inspection + optionalParams ListInspectionsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListInspectionsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListInspectionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.ListInspections") if err != nil { @@ -457,7 +483,8 @@ func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -479,10 +506,11 @@ func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -496,7 +524,7 @@ func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -508,11 +536,13 @@ func (a *InspectionApi) ListInspections(ctx _context.Context, orgName string, o // UpdateAutoInspection Update auto inspection. func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName string, body AutoInspection) (AutoInspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue AutoInspection + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue AutoInspection ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.UpdateAutoInspection") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -527,9 +557,11 @@ func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -551,10 +583,11 @@ func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -568,7 +601,7 @@ func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -580,11 +613,13 @@ func (a *InspectionApi) UpdateAutoInspection(ctx _context.Context, orgName strin // UpdateInspection Update inspection. func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, body Inspection) (Inspection, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Inspection + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Inspection ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.UpdateInspection") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -599,9 +634,11 @@ func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, b localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -623,10 +660,11 @@ func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, b if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -640,7 +678,7 @@ func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, b err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -652,11 +690,13 @@ func (a *InspectionApi) UpdateInspection(ctx _context.Context, orgName string, b // UpdateInspectionScript Update inspection script. func (a *InspectionApi) UpdateInspectionScript(ctx _context.Context, orgName string, body InspectionScript) (InspectionScript, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue InspectionScript + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue InspectionScript ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InspectionApi.UpdateInspectionScript") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -671,9 +711,11 @@ func (a *InspectionApi) UpdateInspectionScript(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -695,10 +737,11 @@ func (a *InspectionApi) UpdateInspectionScript(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -712,7 +755,7 @@ func (a *InspectionApi) UpdateInspectionScript(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_invitation.go b/api/kbcloud/api_invitation.go index e4aa6865..da2899c5 100644 --- a/api/kbcloud/api_invitation.go +++ b/api/kbcloud/api_invitation.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type InvitationApi common.Service // partially update the specified Invitation func (a *InvitationApi) AcceptInvitation(ctx _context.Context, invitationId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InvitationApi.AcceptInvitation") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *InvitationApi) AcceptInvitation(ctx _context.Context, invitationId stri localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *InvitationApi) AcceptInvitation(ctx _context.Context, invitationId stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +87,7 @@ func (a *InvitationApi) AcceptInvitation(ctx _context.Context, invitationId stri // CreateInvitationOptionalParameters holds optional parameters for CreateInvitation. type CreateInvitationOptionalParameters struct { OrgName *string - UserId *string + UserId *string } // NewCreateInvitationOptionalParameters creates an empty struct for parameters. @@ -87,13 +95,11 @@ func NewCreateInvitationOptionalParameters() *CreateInvitationOptionalParameters this := CreateInvitationOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *CreateInvitationOptionalParameters) WithOrgName(orgName string) *CreateInvitationOptionalParameters { r.OrgName = &orgName return r } - // WithUserId sets the corresponding parameter name and returns the struct. func (r *CreateInvitationOptionalParameters) WithUserId(userId string) *CreateInvitationOptionalParameters { r.UserId = &userId @@ -104,18 +110,20 @@ func (r *CreateInvitationOptionalParameters) WithUserId(userId string) *CreateIn // create a Invitation func (a *InvitationApi) CreateInvitation(ctx _context.Context, body InvitationCreate, o ...CreateInvitationOptionalParameters) (Invitation, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Invitation - optionalParams CreateInvitationOptionalParameters + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Invitation + optionalParams CreateInvitationOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type CreateInvitationOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type CreateInvitationOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InvitationApi.CreateInvitation") if err != nil { @@ -136,9 +144,11 @@ func (a *InvitationApi) CreateInvitation(ctx _context.Context, body InvitationCr localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -160,10 +170,11 @@ func (a *InvitationApi) CreateInvitation(ctx _context.Context, body InvitationCr if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -177,7 +188,7 @@ func (a *InvitationApi) CreateInvitation(ctx _context.Context, body InvitationCr err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -190,10 +201,12 @@ func (a *InvitationApi) CreateInvitation(ctx _context.Context, body InvitationCr // delete the specified Invitation for organization admin func (a *InvitationApi) DeleteInvitation(ctx _context.Context, invitationId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InvitationApi.DeleteInvitation") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -207,7 +220,8 @@ func (a *InvitationApi) DeleteInvitation(ctx _context.Context, invitationId stri localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -229,10 +243,11 @@ func (a *InvitationApi) DeleteInvitation(ctx _context.Context, invitationId stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -248,10 +263,10 @@ func (a *InvitationApi) DeleteInvitation(ctx _context.Context, invitationId stri // ListInvitationOptionalParameters holds optional parameters for ListInvitation. type ListInvitationOptionalParameters struct { - OrgName *string - UserId *string + OrgName *string + UserId *string PageToken *string - PageSize *string + PageSize *string } // NewListInvitationOptionalParameters creates an empty struct for parameters. @@ -259,25 +274,21 @@ func NewListInvitationOptionalParameters() *ListInvitationOptionalParameters { this := ListInvitationOptionalParameters{} return &this } - // WithOrgName sets the corresponding parameter name and returns the struct. func (r *ListInvitationOptionalParameters) WithOrgName(orgName string) *ListInvitationOptionalParameters { r.OrgName = &orgName return r } - // WithUserId sets the corresponding parameter name and returns the struct. func (r *ListInvitationOptionalParameters) WithUserId(userId string) *ListInvitationOptionalParameters { r.UserId = &userId return r } - // WithPageToken sets the corresponding parameter name and returns the struct. func (r *ListInvitationOptionalParameters) WithPageToken(pageToken string) *ListInvitationOptionalParameters { r.PageToken = &pageToken return r } - // WithPageSize sets the corresponding parameter name and returns the struct. func (r *ListInvitationOptionalParameters) WithPageSize(pageSize string) *ListInvitationOptionalParameters { r.PageSize = &pageSize @@ -288,18 +299,20 @@ func (r *ListInvitationOptionalParameters) WithPageSize(pageSize string) *ListIn // list the Invitation of specified Org or User func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitationOptionalParameters) (InvitationList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue InvitationList - optionalParams ListInvitationOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue InvitationList + optionalParams ListInvitationOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListInvitationOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListInvitationOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InvitationApi.ListInvitation") if err != nil { @@ -325,7 +338,8 @@ func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitation } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -347,10 +361,11 @@ func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitation if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -364,7 +379,7 @@ func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitation err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -377,11 +392,13 @@ func (a *InvitationApi) ListInvitation(ctx _context.Context, o ...ListInvitation // read the specified Invitation for organization admin or invitee func (a *InvitationApi) ReadInvitation(ctx _context.Context, invitationId string) (Invitation, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Invitation + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Invitation ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InvitationApi.ReadInvitation") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -395,7 +412,8 @@ func (a *InvitationApi) ReadInvitation(ctx _context.Context, invitationId string localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -417,10 +435,11 @@ func (a *InvitationApi) ReadInvitation(ctx _context.Context, invitationId string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -434,7 +453,7 @@ func (a *InvitationApi) ReadInvitation(ctx _context.Context, invitationId string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -447,10 +466,12 @@ func (a *InvitationApi) ReadInvitation(ctx _context.Context, invitationId string // partially update the specified Invitation func (a *InvitationApi) RejectInvitation(ctx _context.Context, invitationId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InvitationApi.RejectInvitation") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -464,7 +485,8 @@ func (a *InvitationApi) RejectInvitation(ctx _context.Context, invitationId stri localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -486,10 +508,11 @@ func (a *InvitationApi) RejectInvitation(ctx _context.Context, invitationId stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -507,10 +530,12 @@ func (a *InvitationApi) RejectInvitation(ctx _context.Context, invitationId stri // partially update the specified Invitation func (a *InvitationApi) ResendInvitation(ctx _context.Context, invitationId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".InvitationApi.ResendInvitation") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -524,7 +549,8 @@ func (a *InvitationApi) ResendInvitation(ctx _context.Context, invitationId stri localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -546,10 +572,11 @@ func (a *InvitationApi) ResendInvitation(ctx _context.Context, invitationId stri if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/api_ip_whitelist.go b/api/kbcloud/api_ip_whitelist.go index 04cb0833..ca8f5514 100644 --- a/api/kbcloud/api_ip_whitelist.go +++ b/api/kbcloud/api_ip_whitelist.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type IpWhitelistApi common.Service // CreateIPWhitelist Create IP whitelist. func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, clusterName string, body interface{}) (IpWhitelist, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue IpWhitelist + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue IpWhitelist ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".IpWhitelistApi.CreateIPWhitelist") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,11 +101,13 @@ func (a *IpWhitelistApi) CreateIPWhitelist(ctx _context.Context, orgName string, // ListIPWhitelist List IP whitelists. func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, clusterName string) (IpWhitelistList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue IpWhitelistList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue IpWhitelistList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".IpWhitelistApi.ListIPWhitelist") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +122,8 @@ func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, c localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -150,7 +163,7 @@ func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -162,11 +175,13 @@ func (a *IpWhitelistApi) ListIPWhitelist(ctx _context.Context, orgName string, c // UpdateIPWhitelist Update IP whitelist. func (a *IpWhitelistApi) UpdateIPWhitelist(ctx _context.Context, orgName string, clusterName string, ipWhitelistId string, body interface{}) (IpWhitelist, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue IpWhitelist + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue IpWhitelist ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".IpWhitelistApi.UpdateIPWhitelist") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -183,9 +198,11 @@ func (a *IpWhitelistApi) UpdateIPWhitelist(ctx _context.Context, orgName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -207,10 +224,11 @@ func (a *IpWhitelistApi) UpdateIPWhitelist(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -224,7 +242,7 @@ func (a *IpWhitelistApi) UpdateIPWhitelist(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_load_balancer.go b/api/kbcloud/api_load_balancer.go index bd715200..3cfd1376 100644 --- a/api/kbcloud/api_load_balancer.go +++ b/api/kbcloud/api_load_balancer.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type LoadBalancerApi common.Service // GetLoadBalancer Get the load balancer info in the environment. func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, orgName string, environmentName string) (LoadBalancer, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue LoadBalancer + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue LoadBalancer ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".LoadBalancerApi.GetLoadBalancer") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, orgName string, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *LoadBalancerApi) GetLoadBalancer(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_mark_cluster.go b/api/kbcloud/api_mark_cluster.go index 6fd4c600..3c4dc309 100644 --- a/api/kbcloud/api_mark_cluster.go +++ b/api/kbcloud/api_mark_cluster.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,10 +23,12 @@ type MarkClusterApi common.Service // MarkClusterRestoreCompleted mark cluster to restore completed, usually used when manually repairing or recovering issues. func (a *MarkClusterApi) MarkClusterRestoreCompleted(ctx _context.Context, orgName string, clusterName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MarkClusterApi.MarkClusterRestoreCompleted") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,7 +43,8 @@ func (a *MarkClusterApi) MarkClusterRestoreCompleted(ctx _context.Context, orgNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -59,10 +66,11 @@ func (a *MarkClusterApi) MarkClusterRestoreCompleted(ctx _context.Context, orgNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/api_member.go b/api/kbcloud/api_member.go index 15423b88..7a5acdbc 100644 --- a/api/kbcloud/api_member.go +++ b/api/kbcloud/api_member.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type MemberApi common.Service // Add organization with specific role func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgMemberAdd) (OrgMember, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OrgMember + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OrgMember ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.AddOrgMember") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgM localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgM if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgM err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +102,12 @@ func (a *MemberApi) AddOrgMember(ctx _context.Context, orgName string, body OrgM // delete a Org Member func (a *MemberApi) DeleteOrgMember(ctx _context.Context, orgName string, memberId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.DeleteOrgMember") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +122,8 @@ func (a *MemberApi) DeleteOrgMember(ctx _context.Context, orgName string, member localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *MemberApi) DeleteOrgMember(ctx _context.Context, orgName string, member if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -153,7 +166,7 @@ func (a *MemberApi) DeleteOrgMember(ctx _context.Context, orgName string, member // ListOrgMemberOptionalParameters holds optional parameters for ListOrgMember. type ListOrgMemberOptionalParameters struct { PageToken *string - PageSize *string + PageSize *string } // NewListOrgMemberOptionalParameters creates an empty struct for parameters. @@ -161,13 +174,11 @@ func NewListOrgMemberOptionalParameters() *ListOrgMemberOptionalParameters { this := ListOrgMemberOptionalParameters{} return &this } - // WithPageToken sets the corresponding parameter name and returns the struct. func (r *ListOrgMemberOptionalParameters) WithPageToken(pageToken string) *ListOrgMemberOptionalParameters { r.PageToken = &pageToken return r } - // WithPageSize sets the corresponding parameter name and returns the struct. func (r *ListOrgMemberOptionalParameters) WithPageSize(pageSize string) *ListOrgMemberOptionalParameters { r.PageSize = &pageSize @@ -178,18 +189,20 @@ func (r *ListOrgMemberOptionalParameters) WithPageSize(pageSize string) *ListOrg // list members of the specified Org func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...ListOrgMemberOptionalParameters) (OrgMemberList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue OrgMemberList - optionalParams ListOrgMemberOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgMemberList + optionalParams ListOrgMemberOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListOrgMemberOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListOrgMemberOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.ListOrgMember") if err != nil { @@ -210,7 +223,8 @@ func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...Lis } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -232,10 +246,11 @@ func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...Lis if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -249,7 +264,7 @@ func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...Lis err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -261,11 +276,13 @@ func (a *MemberApi) ListOrgMember(ctx _context.Context, orgName string, o ...Lis // ListOrgMemberPermission List permissions of a member. func (a *MemberApi) ListOrgMemberPermission(ctx _context.Context, orgName string) (PermissionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue PermissionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue PermissionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.ListOrgMemberPermission") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -279,7 +296,8 @@ func (a *MemberApi) ListOrgMemberPermission(ctx _context.Context, orgName string localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -301,10 +319,11 @@ func (a *MemberApi) ListOrgMemberPermission(ctx _context.Context, orgName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -318,7 +337,7 @@ func (a *MemberApi) ListOrgMemberPermission(ctx _context.Context, orgName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -331,11 +350,13 @@ func (a *MemberApi) ListOrgMemberPermission(ctx _context.Context, orgName string // Only authenticated organization admins can update the member's role func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberId string, body OrgMemberUpdate) (OrgMember, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue OrgMember + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue OrgMember ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.PatchOrgMember") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -348,12 +369,14 @@ func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberI localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -375,10 +398,11 @@ func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberI if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -392,7 +416,7 @@ func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberI err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -405,11 +429,13 @@ func (a *MemberApi) PatchOrgMember(ctx _context.Context, orgName string, memberI // read the specified OrgMember func (a *MemberApi) ReadOrgMember(ctx _context.Context, orgName string, memberId string) (OrgMember, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue OrgMember + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgMember ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MemberApi.ReadOrgMember") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -424,7 +450,8 @@ func (a *MemberApi) ReadOrgMember(ctx _context.Context, orgName string, memberId localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -446,10 +473,11 @@ func (a *MemberApi) ReadOrgMember(ctx _context.Context, orgName string, memberId if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -463,7 +491,7 @@ func (a *MemberApi) ReadOrgMember(ctx _context.Context, orgName string, memberId err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_metrics.go b/api/kbcloud/api_metrics.go index eedd3d63..1b830094 100644 --- a/api/kbcloud/api_metrics.go +++ b/api/kbcloud/api_metrics.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,7 +23,7 @@ type MetricsApi common.Service // QueryClusterMetricsOptionalParameters holds optional parameters for QueryClusterMetrics. type QueryClusterMetricsOptionalParameters struct { Start *int64 - End *int64 + End *int64 } // NewQueryClusterMetricsOptionalParameters creates an empty struct for parameters. @@ -27,13 +31,11 @@ func NewQueryClusterMetricsOptionalParameters() *QueryClusterMetricsOptionalPara this := QueryClusterMetricsOptionalParameters{} return &this } - // WithStart sets the corresponding parameter name and returns the struct. func (r *QueryClusterMetricsOptionalParameters) WithStart(start int64) *QueryClusterMetricsOptionalParameters { r.Start = &start return r } - // WithEnd sets the corresponding parameter name and returns the struct. func (r *QueryClusterMetricsOptionalParameters) WithEnd(end int64) *QueryClusterMetricsOptionalParameters { r.End = &end @@ -44,18 +46,20 @@ func (r *QueryClusterMetricsOptionalParameters) WithEnd(end int64) *QueryCluster // Query cluster metrics by specified metric name and instance name, support instant and range query func (a *MetricsApi) QueryClusterMetrics(ctx _context.Context, orgName string, clusterName string, query string, queryType MetricsQueryType, o ...QueryClusterMetricsOptionalParameters) (ClusterMetrics, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ClusterMetrics - optionalParams QueryClusterMetricsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ClusterMetrics + optionalParams QueryClusterMetricsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type QueryClusterMetricsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type QueryClusterMetricsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".MetricsApi.QueryClusterMetrics") if err != nil { @@ -79,7 +83,8 @@ func (a *MetricsApi) QueryClusterMetrics(ctx _context.Context, orgName string, c } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -101,10 +106,11 @@ func (a *MetricsApi) QueryClusterMetrics(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -118,7 +124,7 @@ func (a *MetricsApi) QueryClusterMetrics(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_oceanbase.go b/api/kbcloud/api_oceanbase.go index 28713a3c..fde38c99 100644 --- a/api/kbcloud/api_oceanbase.go +++ b/api/kbcloud/api_oceanbase.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type OceanbaseApi common.Service // GetTenant get tenants detail information of the oceanbase cluster. func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterName string, tenantId string) (Tenant, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Tenant + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Tenant ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OceanbaseApi.GetTenant") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,7 +45,8 @@ func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +68,11 @@ func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +86,7 @@ func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +98,13 @@ func (a *OceanbaseApi) GetTenant(ctx _context.Context, orgName string, clusterNa // ListTenants list all tenants for the oceanbase cluster. func (a *OceanbaseApi) ListTenants(ctx _context.Context, orgName string, clusterName string) ([]Tenant, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []Tenant + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []Tenant ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OceanbaseApi.ListTenants") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +119,8 @@ func (a *OceanbaseApi) ListTenants(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +142,11 @@ func (a *OceanbaseApi) ListTenants(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -148,7 +160,7 @@ func (a *OceanbaseApi) ListTenants(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_opsrequest.go b/api/kbcloud/api_opsrequest.go index 9bac4e5d..77286c75 100644 --- a/api/kbcloud/api_opsrequest.go +++ b/api/kbcloud/api_opsrequest.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type OpsrequestApi common.Service // cancel a OpsRequest func (a *OpsrequestApi) CancelOps(ctx _context.Context, orgName string, opsName string, clusterName string, opsType string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.CancelOps") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,7 +46,8 @@ func (a *OpsrequestApi) CancelOps(ctx _context.Context, orgName string, opsName localVarQueryParams.Add("opsType", common.ParameterToString(opsType, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +69,11 @@ func (a *OpsrequestApi) CancelOps(ctx _context.Context, orgName string, opsName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -82,11 +90,13 @@ func (a *OpsrequestApi) CancelOps(ctx _context.Context, orgName string, opsName // ClusterVolumeExpand Expand cluster volume size. func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string, clusterName string, body OpsVolumeExpand) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.ClusterVolumeExpand") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -102,9 +112,11 @@ func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -126,10 +138,11 @@ func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -143,7 +156,7 @@ func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -155,11 +168,13 @@ func (a *OpsrequestApi) ClusterVolumeExpand(ctx _context.Context, orgName string // CustomOps Create custom OpsRequest. func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterName string, body interface{}) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.CustomOps") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -175,9 +190,11 @@ func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterN localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -199,10 +216,11 @@ func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -216,7 +234,7 @@ func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -228,11 +246,13 @@ func (a *OpsrequestApi) CustomOps(ctx _context.Context, orgName string, clusterN // ExposeCluster Expose cluster loadbalancer endpoint. func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clusterName string, body OpsExpose) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.ExposeCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -248,9 +268,11 @@ func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clus localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -272,10 +294,11 @@ func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clus if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -289,7 +312,7 @@ func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clus err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -301,11 +324,13 @@ func (a *OpsrequestApi) ExposeCluster(ctx _context.Context, orgName string, clus // HorizontalScaleCluster Horizontal scale cluster. func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName string, clusterName string, body OpsHScale) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.HorizontalScaleCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -321,9 +346,11 @@ func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName str localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -345,10 +372,11 @@ func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -362,7 +390,7 @@ func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -374,11 +402,13 @@ func (a *OpsrequestApi) HorizontalScaleCluster(ctx _context.Context, orgName str // PromoteCluster Promote cluster intance to primary. func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clusterName string, body OpsPromote) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.PromoteCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -394,9 +424,11 @@ func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clu localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -418,10 +450,11 @@ func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -435,7 +468,7 @@ func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -447,11 +480,13 @@ func (a *OpsrequestApi) PromoteCluster(ctx _context.Context, orgName string, clu // RebuildInstance rebuild the instance. func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, clusterName string, body OpsRebuildInstance) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.RebuildInstance") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -467,9 +502,11 @@ func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, cl localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -491,10 +528,11 @@ func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -508,7 +546,7 @@ func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -520,11 +558,13 @@ func (a *OpsrequestApi) RebuildInstance(ctx _context.Context, orgName string, cl // ReconfigureCluster Update cluster configuration. func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, clusterName string, body ReconfigureCreate) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.ReconfigureCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -540,9 +580,11 @@ func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -564,10 +606,11 @@ func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -581,7 +624,7 @@ func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -593,11 +636,13 @@ func (a *OpsrequestApi) ReconfigureCluster(ctx _context.Context, orgName string, // RestartCluster Restart cluster. func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clusterName string, body OpsRestart) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.RestartCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -613,9 +658,11 @@ func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clu localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -637,10 +684,11 @@ func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -654,7 +702,7 @@ func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -666,11 +714,13 @@ func (a *OpsrequestApi) RestartCluster(ctx _context.Context, orgName string, clu // StartCluster Start cluster. func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clusterName string) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.StartCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -685,7 +735,8 @@ func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clust localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -707,10 +758,11 @@ func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clust if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -724,7 +776,7 @@ func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clust err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -736,11 +788,13 @@ func (a *OpsrequestApi) StartCluster(ctx _context.Context, orgName string, clust // StopCluster Stop cluster. func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, clusterName string) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.StopCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -755,7 +809,8 @@ func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, cluste localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -777,10 +832,11 @@ func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, cluste if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -794,7 +850,7 @@ func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, cluste err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -806,11 +862,13 @@ func (a *OpsrequestApi) StopCluster(ctx _context.Context, orgName string, cluste // UpdateClusterLicense Update the cluster license. func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName string, clusterName string, body OpsLicense) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.UpdateClusterLicense") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -826,9 +884,11 @@ func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -850,10 +910,11 @@ func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -867,7 +928,7 @@ func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -879,11 +940,13 @@ func (a *OpsrequestApi) UpdateClusterLicense(ctx _context.Context, orgName strin // UpgradeCluster Upgrade cluster version. func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clusterName string, body OpsUpgrade) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.UpgradeCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -899,9 +962,11 @@ func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clu localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -923,10 +988,11 @@ func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -940,7 +1006,7 @@ func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -952,11 +1018,13 @@ func (a *OpsrequestApi) UpgradeCluster(ctx _context.Context, orgName string, clu // VerticalScaleCluster Vertical scale cluster. func (a *OpsrequestApi) VerticalScaleCluster(ctx _context.Context, orgName string, clusterName string, body OpsVScale) (OpsRequestName, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue OpsRequestName + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue OpsRequestName ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OpsrequestApi.VerticalScaleCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -972,9 +1040,11 @@ func (a *OpsrequestApi) VerticalScaleCluster(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -996,10 +1066,11 @@ func (a *OpsrequestApi) VerticalScaleCluster(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1013,7 +1084,7 @@ func (a *OpsrequestApi) VerticalScaleCluster(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_organization.go b/api/kbcloud/api_organization.go index e2293a38..e7cdc888 100644 --- a/api/kbcloud/api_organization.go +++ b/api/kbcloud/api_organization.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type OrganizationApi common.Service // Create a new organization func (a *OrganizationApi) CreateOrg(ctx _context.Context, body OrgCreate) (Org, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Org + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Org ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.CreateOrg") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *OrganizationApi) CreateOrg(ctx _context.Context, body OrgCreate) (Org, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *OrganizationApi) CreateOrg(ctx _context.Context, body OrgCreate) (Org, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *OrganizationApi) CreateOrg(ctx _context.Context, body OrgCreate) (Org, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,10 +101,12 @@ func (a *OrganizationApi) CreateOrg(ctx _context.Context, body OrgCreate) (Org, // freeze the member in org func (a *OrganizationApi) FreezeMember(ctx _context.Context, orgName string, memberId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.FreezeMember") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,7 +121,8 @@ func (a *OrganizationApi) FreezeMember(ctx _context.Context, orgName string, mem localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *OrganizationApi) FreezeMember(ctx _context.Context, orgName string, mem if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,7 +165,7 @@ func (a *OrganizationApi) FreezeMember(ctx _context.Context, orgName string, mem // ListOrgOptionalParameters holds optional parameters for ListOrg. type ListOrgOptionalParameters struct { PageToken *string - PageSize *string + PageSize *string } // NewListOrgOptionalParameters creates an empty struct for parameters. @@ -160,13 +173,11 @@ func NewListOrgOptionalParameters() *ListOrgOptionalParameters { this := ListOrgOptionalParameters{} return &this } - // WithPageToken sets the corresponding parameter name and returns the struct. func (r *ListOrgOptionalParameters) WithPageToken(pageToken string) *ListOrgOptionalParameters { r.PageToken = &pageToken return r } - // WithPageSize sets the corresponding parameter name and returns the struct. func (r *ListOrgOptionalParameters) WithPageSize(pageSize string) *ListOrgOptionalParameters { r.PageSize = &pageSize @@ -177,18 +188,20 @@ func (r *ListOrgOptionalParameters) WithPageSize(pageSize string) *ListOrgOption // List organizations of current user func (a *OrganizationApi) ListOrg(ctx _context.Context, o ...ListOrgOptionalParameters) (OrgList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue OrgList - optionalParams ListOrgOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgList + optionalParams ListOrgOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListOrgOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListOrgOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.ListOrg") if err != nil { @@ -208,7 +221,8 @@ func (a *OrganizationApi) ListOrg(ctx _context.Context, o ...ListOrgOptionalPara } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -230,10 +244,11 @@ func (a *OrganizationApi) ListOrg(ctx _context.Context, o ...ListOrgOptionalPara if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -247,7 +262,7 @@ func (a *OrganizationApi) ListOrg(ctx _context.Context, o ...ListOrgOptionalPara err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -260,11 +275,13 @@ func (a *OrganizationApi) ListOrg(ctx _context.Context, o ...ListOrgOptionalPara // partially update the specified Org func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body OrgUpdate) (Org, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Org + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Org ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.PatchOrg") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -276,12 +293,14 @@ func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body Or localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -303,10 +322,11 @@ func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body Or if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -320,7 +340,7 @@ func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body Or err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -333,11 +353,13 @@ func (a *OrganizationApi) PatchOrg(ctx _context.Context, orgName string, body Or // read the specified Org func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Org + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Org ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.ReadOrg") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -351,7 +373,8 @@ func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_ localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -373,10 +396,11 @@ func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_ if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -390,7 +414,7 @@ func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_ err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -403,10 +427,12 @@ func (a *OrganizationApi) ReadOrg(ctx _context.Context, orgName string) (Org, *_ // unfreeze the member in org func (a *OrganizationApi) UnfreezeMember(ctx _context.Context, orgName string, memberId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".OrganizationApi.UnfreezeMember") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -421,7 +447,8 @@ func (a *OrganizationApi) UnfreezeMember(ctx _context.Context, orgName string, m localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -443,10 +470,11 @@ func (a *OrganizationApi) UnfreezeMember(ctx _context.Context, orgName string, m if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/api_param_tpl.go b/api/kbcloud/api_param_tpl.go index b9730435..01be5646 100644 --- a/api/kbcloud/api_param_tpl.go +++ b/api/kbcloud/api_param_tpl.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type ParamTplApi common.Service // CreateParamTpl Create configuration template. func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body ParamTplCreate) (ParamTplListItem, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue ParamTplListItem + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue ParamTplListItem ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.CreateParamTpl") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,10 +100,12 @@ func (a *ParamTplApi) CreateParamTpl(ctx _context.Context, orgName string, body // CreateParamTplFromCluster Export configuration template from cluster. func (a *ParamTplApi) CreateParamTplFromCluster(ctx _context.Context, orgName string, clusterName string, body ParamTplCreateFromCluster) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.CreateParamTplFromCluster") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -110,9 +121,11 @@ func (a *ParamTplApi) CreateParamTplFromCluster(ctx _context.Context, orgName st localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -134,10 +147,11 @@ func (a *ParamTplApi) CreateParamTplFromCluster(ctx _context.Context, orgName st if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -154,10 +168,12 @@ func (a *ParamTplApi) CreateParamTplFromCluster(ctx _context.Context, orgName st // DeleteParamTpl Delete configuration template. func (a *ParamTplApi) DeleteParamTpl(ctx _context.Context, orgName string, paramTplName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.DeleteParamTpl") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -172,7 +188,8 @@ func (a *ParamTplApi) DeleteParamTpl(ctx _context.Context, orgName string, param localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -194,10 +211,11 @@ func (a *ParamTplApi) DeleteParamTpl(ctx _context.Context, orgName string, param if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -213,7 +231,7 @@ func (a *ParamTplApi) DeleteParamTpl(ctx _context.Context, orgName string, param // GetClusterParamTplsOptionalParameters holds optional parameters for GetClusterParamTpls. type GetClusterParamTplsOptionalParameters struct { - Component *string + Component *string EngineName *string } @@ -222,13 +240,11 @@ func NewGetClusterParamTplsOptionalParameters() *GetClusterParamTplsOptionalPara this := GetClusterParamTplsOptionalParameters{} return &this } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *GetClusterParamTplsOptionalParameters) WithComponent(component string) *GetClusterParamTplsOptionalParameters { r.Component = &component return r } - // WithEngineName sets the corresponding parameter name and returns the struct. func (r *GetClusterParamTplsOptionalParameters) WithEngineName(engineName string) *GetClusterParamTplsOptionalParameters { r.EngineName = &engineName @@ -238,18 +254,20 @@ func (r *GetClusterParamTplsOptionalParameters) WithEngineName(engineName string // GetClusterParamTpls Get cluster configuration templates. func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, clusterName string, o ...GetClusterParamTplsOptionalParameters) (ParamTplApplToClusterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParamTplApplToClusterList - optionalParams GetClusterParamTplsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParamTplApplToClusterList + optionalParams GetClusterParamTplsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterParamTplsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type GetClusterParamTplsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.GetClusterParamTpls") if err != nil { @@ -271,7 +289,8 @@ func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -293,10 +312,11 @@ func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -310,7 +330,7 @@ func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -322,7 +342,7 @@ func (a *ParamTplApi) GetClusterParamTpls(ctx _context.Context, orgName string, // ListParamTplOptionalParameters holds optional parameters for ListParamTpl. type ListParamTplOptionalParameters struct { Partition *ParamTplPartition - Version *string + Version *string Component *string } @@ -331,19 +351,16 @@ func NewListParamTplOptionalParameters() *ListParamTplOptionalParameters { this := ListParamTplOptionalParameters{} return &this } - // WithPartition sets the corresponding parameter name and returns the struct. func (r *ListParamTplOptionalParameters) WithPartition(partition ParamTplPartition) *ListParamTplOptionalParameters { r.Partition = &partition return r } - // WithVersion sets the corresponding parameter name and returns the struct. func (r *ListParamTplOptionalParameters) WithVersion(version string) *ListParamTplOptionalParameters { r.Version = &version return r } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *ListParamTplOptionalParameters) WithComponent(component string) *ListParamTplOptionalParameters { r.Component = &component @@ -353,18 +370,20 @@ func (r *ListParamTplOptionalParameters) WithComponent(component string) *ListPa // ListParamTpl List configuration templates in an Org. func (a *ParamTplApi) ListParamTpl(ctx _context.Context, orgName string, o ...ListParamTplOptionalParameters) (ParamTplList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParamTplList - optionalParams ListParamTplOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParamTplList + optionalParams ListParamTplOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListParamTplOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListParamTplOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.ListParamTpl") if err != nil { @@ -388,7 +407,8 @@ func (a *ParamTplApi) ListParamTpl(ctx _context.Context, orgName string, o ...Li } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -410,10 +430,11 @@ func (a *ParamTplApi) ListParamTpl(ctx _context.Context, orgName string, o ...Li if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -427,7 +448,7 @@ func (a *ParamTplApi) ListParamTpl(ctx _context.Context, orgName string, o ...Li err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -440,11 +461,13 @@ func (a *ParamTplApi) ListParamTpl(ctx _context.Context, orgName string, o ...Li // partially update the parameter template func (a *ParamTplApi) PatchParamTpl(ctx _context.Context, orgName string, paramTplName string, body ParamTplUpdate) (ParamTplListItem, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue ParamTplListItem + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue ParamTplListItem ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.PatchParamTpl") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -457,12 +480,14 @@ func (a *ParamTplApi) PatchParamTpl(ctx _context.Context, orgName string, paramT localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" + localVarHeaderParams["Content-Type"] = "application/apply-patch+yaml" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -484,10 +509,11 @@ func (a *ParamTplApi) PatchParamTpl(ctx _context.Context, orgName string, paramT if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -501,7 +527,7 @@ func (a *ParamTplApi) PatchParamTpl(ctx _context.Context, orgName string, paramT err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -520,7 +546,6 @@ func NewReadParamTplOptionalParameters() *ReadParamTplOptionalParameters { this := ReadParamTplOptionalParameters{} return &this } - // WithPartition sets the corresponding parameter name and returns the struct. func (r *ReadParamTplOptionalParameters) WithPartition(partition ParamTplPartition) *ReadParamTplOptionalParameters { r.Partition = &partition @@ -530,18 +555,20 @@ func (r *ReadParamTplOptionalParameters) WithPartition(partition ParamTplPartiti // ReadParamTpl Get configuration template details. func (a *ParamTplApi) ReadParamTpl(ctx _context.Context, orgName string, paramTplName string, o ...ReadParamTplOptionalParameters) (ParamTplGet, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParamTplGet - optionalParams ReadParamTplOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParamTplGet + optionalParams ReadParamTplOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ReadParamTplOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ReadParamTplOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParamTplApi.ReadParamTpl") if err != nil { @@ -560,7 +587,8 @@ func (a *ParamTplApi) ReadParamTpl(ctx _context.Context, orgName string, paramTp } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -582,10 +610,11 @@ func (a *ParamTplApi) ReadParamTpl(ctx _context.Context, orgName string, paramTp if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -599,7 +628,7 @@ func (a *ParamTplApi) ReadParamTpl(ctx _context.Context, orgName string, paramTp err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_parameter.go b/api/kbcloud/api_parameter.go index faa8205a..81549d81 100644 --- a/api/kbcloud/api_parameter.go +++ b/api/kbcloud/api_parameter.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListConfigurationsOptionalParameters() *ListConfigurationsOptionalParame this := ListConfigurationsOptionalParameters{} return &this } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *ListConfigurationsOptionalParameters) WithComponent(component string) *ListConfigurationsOptionalParameters { r.Component = &component @@ -36,18 +39,20 @@ func (r *ListConfigurationsOptionalParameters) WithComponent(component string) * // ListConfigurations List configurations of the cluster. func (a *ParameterApi) ListConfigurations(ctx _context.Context, orgName string, clusterName string, o ...ListConfigurationsOptionalParameters) (ConfigurationList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ConfigurationList - optionalParams ListConfigurationsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ConfigurationList + optionalParams ListConfigurationsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListConfigurationsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListConfigurationsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParameterApi.ListConfigurations") if err != nil { @@ -66,7 +71,8 @@ func (a *ParameterApi) ListConfigurations(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -88,10 +94,11 @@ func (a *ParameterApi) ListConfigurations(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -105,7 +112,7 @@ func (a *ParameterApi) ListConfigurations(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -124,7 +131,6 @@ func NewListParameterSpecsOptionalParameters() *ListParameterSpecsOptionalParame this := ListParameterSpecsOptionalParameters{} return &this } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *ListParameterSpecsOptionalParameters) WithComponent(component string) *ListParameterSpecsOptionalParameters { r.Component = &component @@ -134,18 +140,20 @@ func (r *ListParameterSpecsOptionalParameters) WithComponent(component string) * // ListParameterSpecs List parameter specs of the cluster. func (a *ParameterApi) ListParameterSpecs(ctx _context.Context, orgName string, clusterName string, o ...ListParameterSpecsOptionalParameters) (ParameterSpecList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParameterSpecList - optionalParams ListParameterSpecsOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParameterSpecList + optionalParams ListParameterSpecsOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListParameterSpecsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListParameterSpecsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParameterApi.ListParameterSpecs") if err != nil { @@ -164,7 +172,8 @@ func (a *ParameterApi) ListParameterSpecs(ctx _context.Context, orgName string, } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -186,10 +195,11 @@ func (a *ParameterApi) ListParameterSpecs(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -203,7 +213,7 @@ func (a *ParameterApi) ListParameterSpecs(ctx _context.Context, orgName string, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -222,7 +232,6 @@ func NewListParametersHistoryOptionalParameters() *ListParametersHistoryOptional this := ListParametersHistoryOptionalParameters{} return &this } - // WithParameterName sets the corresponding parameter name and returns the struct. func (r *ListParametersHistoryOptionalParameters) WithParameterName(parameterName string) *ListParametersHistoryOptionalParameters { r.ParameterName = ¶meterName @@ -232,18 +241,20 @@ func (r *ListParametersHistoryOptionalParameters) WithParameterName(parameterNam // ListParametersHistory List parameters history of the cluster. func (a *ParameterApi) ListParametersHistory(ctx _context.Context, orgName string, clusterName string, o ...ListParametersHistoryOptionalParameters) (ParameterHistoryList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ParameterHistoryList - optionalParams ListParametersHistoryOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ParameterHistoryList + optionalParams ListParametersHistoryOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListParametersHistoryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListParametersHistoryOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ParameterApi.ListParametersHistory") if err != nil { @@ -262,7 +273,8 @@ func (a *ParameterApi) ListParametersHistory(ctx _context.Context, orgName strin } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -284,10 +296,11 @@ func (a *ParameterApi) ListParametersHistory(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -301,7 +314,7 @@ func (a *ParameterApi) ListParametersHistory(ctx _context.Context, orgName strin err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_provider.go b/api/kbcloud/api_provider.go index a8791078..292aab6f 100644 --- a/api/kbcloud/api_provider.go +++ b/api/kbcloud/api_provider.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type ProviderApi common.Service // Get cloud provider func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string) (Provider, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Provider + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Provider ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ProviderApi.GetCloudProvider") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,11 +98,13 @@ func (a *ProviderApi) GetCloudProvider(ctx _context.Context, providerName string // Get cloud provider list func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ProviderList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ProviderList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ProviderApi.ListCloudProviders") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -107,7 +117,8 @@ func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_ localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -129,10 +140,11 @@ func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_ if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -146,7 +158,7 @@ func (a *ProviderApi) ListCloudProviders(ctx _context.Context) (ProviderList, *_ err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_recycle_bin_cluster.go b/api/kbcloud/api_recycle_bin_cluster.go index 5bb9b8c7..49b5f0ee 100644 --- a/api/kbcloud/api_recycle_bin_cluster.go +++ b/api/kbcloud/api_recycle_bin_cluster.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,10 +23,12 @@ type RecycleBinClusterApi common.Service // DeleteRecycleBinCluster Delete cluster from the Recycle Bin of the Org. func (a *RecycleBinClusterApi) DeleteRecycleBinCluster(ctx _context.Context, orgName string, clusterName string, isDeleteBackup bool) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.DeleteRecycleBinCluster") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *RecycleBinClusterApi) DeleteRecycleBinCluster(ctx _context.Context, org localVarQueryParams.Add("isDeleteBackup", common.ParameterToString(isDeleteBackup, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *RecycleBinClusterApi) DeleteRecycleBinCluster(ctx _context.Context, org if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,11 +88,13 @@ func (a *RecycleBinClusterApi) DeleteRecycleBinCluster(ctx _context.Context, org // GetRecycleBinCluster Get cluster in the Recycle Bin of the Org. func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgName string, clusterName string) (RecycleBinCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RecycleBinCluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RecycleBinCluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.GetRecycleBinCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -99,7 +109,8 @@ func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -121,10 +132,11 @@ func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -138,7 +150,7 @@ func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -150,11 +162,13 @@ func (a *RecycleBinClusterApi) GetRecycleBinCluster(ctx _context.Context, orgNam // ListRecycleBinCluster List clusters in the Recycle Bin of the Org. func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgName string) (RecycleBinClusterList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RecycleBinClusterList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RecycleBinClusterList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.ListRecycleBinCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -168,7 +182,8 @@ func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgNa localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -190,10 +205,11 @@ func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgNa if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -207,7 +223,7 @@ func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgNa err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -219,11 +235,13 @@ func (a *RecycleBinClusterApi) ListRecycleBinCluster(ctx _context.Context, orgNa // RestoreRecycleBinCluster Restore cluster from the Recycle Bin of the Org. func (a *RecycleBinClusterApi) RestoreRecycleBinCluster(ctx _context.Context, orgName string, clusterName string) (RecycleBinCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue RecycleBinCluster + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue RecycleBinCluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RecycleBinClusterApi.RestoreRecycleBinCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -238,7 +256,8 @@ func (a *RecycleBinClusterApi) RestoreRecycleBinCluster(ctx _context.Context, or localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -260,10 +279,11 @@ func (a *RecycleBinClusterApi) RestoreRecycleBinCluster(ctx _context.Context, or if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -277,7 +297,7 @@ func (a *RecycleBinClusterApi) RestoreRecycleBinCluster(ctx _context.Context, or err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_region.go b/api/kbcloud/api_region.go index 4644e895..bffda9ef 100644 --- a/api/kbcloud/api_region.go +++ b/api/kbcloud/api_region.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type RegionApi common.Service // Get region func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionName string) (Region, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Region + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Region ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionApi.GetRegion") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,7 +45,8 @@ func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionN localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +68,11 @@ func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionN if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +86,7 @@ func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionN err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -91,11 +99,13 @@ func (a *RegionApi) GetRegion(ctx _context.Context, providerName string, regionN // Get region list func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (RegionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RegionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RegionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RegionApi.ListRegions") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +119,8 @@ func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (Regi localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +142,11 @@ func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (Regi if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -148,7 +160,7 @@ func (a *RegionApi) ListRegions(ctx _context.Context, providerName string) (Regi err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_restore.go b/api/kbcloud/api_restore.go index 4f102b9f..bf529d31 100644 --- a/api/kbcloud/api_restore.go +++ b/api/kbcloud/api_restore.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type RestoreApi common.Service // GetRestoreLog get restore workload logs of the cluster. func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, clusterName string, restoreId string) (RestoreLog, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RestoreLog + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RestoreLog ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.GetRestoreLog") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,7 +45,8 @@ func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +68,11 @@ func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -78,7 +86,7 @@ func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -90,10 +98,12 @@ func (a *RestoreApi) GetRestoreLog(ctx _context.Context, orgName string, cluster // DeleteRestoreObject Delete restore task. func (a *RestoreApi) DeleteRestoreObject(ctx _context.Context, orgName string, clusterName string, restoreName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.DeleteRestoreObject") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +119,8 @@ func (a *RestoreApi) DeleteRestoreObject(ctx _context.Context, orgName string, c localVarQueryParams.Add("restoreName", common.ParameterToString(restoreName, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +142,11 @@ func (a *RestoreApi) DeleteRestoreObject(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -151,11 +163,13 @@ func (a *RestoreApi) DeleteRestoreObject(ctx _context.Context, orgName string, c // DoRestore Restore current cluster or instance. func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName string, body Restore) (Restore, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Restore + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Restore ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.DoRestore") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -171,9 +185,11 @@ func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -195,10 +211,11 @@ func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -212,7 +229,7 @@ func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -224,11 +241,13 @@ func (a *RestoreApi) DoRestore(ctx _context.Context, orgName string, clusterName // GetRestoreTimeRange Get cluster restore time ragne. func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, clusterId string) (Backup, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Backup + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Backup ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.GetRestoreTimeRange") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -243,7 +262,8 @@ func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, c localVarQueryParams.Add("clusterID", common.ParameterToString(clusterId, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -265,10 +285,11 @@ func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -282,7 +303,7 @@ func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, c err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -294,11 +315,13 @@ func (a *RestoreApi) GetRestoreTimeRange(ctx _context.Context, orgName string, c // ListClusterRestore List restore tasks. func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, clusterName string) (RestoreList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RestoreList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RestoreList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.ListClusterRestore") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -313,7 +336,8 @@ func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, cl localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -335,10 +359,11 @@ func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, cl if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -352,7 +377,7 @@ func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, cl err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -364,11 +389,13 @@ func (a *RestoreApi) ListClusterRestore(ctx _context.Context, orgName string, cl // ListRestores List restore tasks. func (a *RestoreApi) ListRestores(ctx _context.Context, orgName string) (RestoreList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RestoreList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RestoreList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.ListRestores") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -382,7 +409,8 @@ func (a *RestoreApi) ListRestores(ctx _context.Context, orgName string) (Restore localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -404,10 +432,11 @@ func (a *RestoreApi) ListRestores(ctx _context.Context, orgName string) (Restore if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -421,7 +450,7 @@ func (a *RestoreApi) ListRestores(ctx _context.Context, orgName string) (Restore err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -433,11 +462,13 @@ func (a *RestoreApi) ListRestores(ctx _context.Context, orgName string) (Restore // RestoreCluster Restore new cluster. func (a *RestoreApi) RestoreCluster(ctx _context.Context, orgName string, body RestoreCreate) (Cluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Cluster + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Cluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RestoreApi.RestoreCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -452,9 +483,11 @@ func (a *RestoreApi) RestoreCluster(ctx _context.Context, orgName string, body R localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -476,10 +509,11 @@ func (a *RestoreApi) RestoreCluster(ctx _context.Context, orgName string, body R if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -493,7 +527,7 @@ func (a *RestoreApi) RestoreCluster(ctx _context.Context, orgName string, body R err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_role.go b/api/kbcloud/api_role.go index 0e46ab6a..fb9aa78d 100644 --- a/api/kbcloud/api_role.go +++ b/api/kbcloud/api_role.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,10 +24,12 @@ type RoleApi common.Service // Batch add permissions to a role func (a *RoleApi) BatchAddRolePermissions(ctx _context.Context, orgName string, roleName string, body []string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.BatchAddRolePermissions") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *RoleApi) BatchAddRolePermissions(ctx _context.Context, orgName string, localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *RoleApi) BatchAddRolePermissions(ctx _context.Context, orgName string, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -84,10 +93,12 @@ func (a *RoleApi) BatchAddRolePermissions(ctx _context.Context, orgName string, // Batch remove permissions from a role func (a *RoleApi) BatchRemoveRolePermissions(ctx _context.Context, orgName string, roleName string, body []string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.BatchRemoveRolePermissions") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -103,9 +114,11 @@ func (a *RoleApi) BatchRemoveRolePermissions(ctx _context.Context, orgName strin localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -127,10 +140,11 @@ func (a *RoleApi) BatchRemoveRolePermissions(ctx _context.Context, orgName strin if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -148,11 +162,13 @@ func (a *RoleApi) BatchRemoveRolePermissions(ctx _context.Context, orgName strin // Create role func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCreate) (Role, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue Role + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue Role ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.CreateRole") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -167,9 +183,11 @@ func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCrea localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -191,10 +209,11 @@ func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCrea if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -208,7 +227,7 @@ func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCrea err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -221,10 +240,12 @@ func (a *RoleApi) CreateRole(ctx _context.Context, orgName string, body RoleCrea // Delete role by name func (a *RoleApi) DeleteRoleByName(ctx _context.Context, orgName string, roleName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.DeleteRoleByName") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -239,7 +260,8 @@ func (a *RoleApi) DeleteRoleByName(ctx _context.Context, orgName string, roleNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -261,10 +283,11 @@ func (a *RoleApi) DeleteRoleByName(ctx _context.Context, orgName string, roleNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -282,11 +305,13 @@ func (a *RoleApi) DeleteRoleByName(ctx _context.Context, orgName string, roleNam // Get role by name func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName string) (Role, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Role + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Role ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.GetRoleByName") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -301,7 +326,8 @@ func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName s localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -323,10 +349,11 @@ func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -340,7 +367,7 @@ func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName s err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -353,11 +380,13 @@ func (a *RoleApi) GetRoleByName(ctx _context.Context, orgName string, roleName s // List all permissions func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue PermissionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue PermissionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.ListPermissions") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -370,7 +399,8 @@ func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_netht localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -392,10 +422,11 @@ func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_netht if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -409,7 +440,7 @@ func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_netht err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -422,11 +453,13 @@ func (a *RoleApi) ListPermissions(ctx _context.Context) (PermissionList, *_netht // List permissions of a role func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, roleName string) (PermissionList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue PermissionList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue PermissionList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.ListRolePermissions") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -441,7 +474,8 @@ func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, role localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -463,10 +497,11 @@ func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, role if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -480,7 +515,7 @@ func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, role err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -493,11 +528,13 @@ func (a *RoleApi) ListRolePermissions(ctx _context.Context, orgName string, role // List roles of a organization func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue RoleList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RoleList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.ListRoles") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -511,7 +548,8 @@ func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_n localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -533,10 +571,11 @@ func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_n if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -550,7 +589,7 @@ func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_n err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -563,11 +602,13 @@ func (a *RoleApi) ListRoles(ctx _context.Context, orgName string) (RoleList, *_n // Update role by name func (a *RoleApi) UpdateRoleByName(ctx _context.Context, orgName string, roleName string, body RoleUpdate) (Role, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Role + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Role ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".RoleApi.UpdateRoleByName") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -583,9 +624,11 @@ func (a *RoleApi) UpdateRoleByName(ctx _context.Context, orgName string, roleNam localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -607,10 +650,11 @@ func (a *RoleApi) UpdateRoleByName(ctx _context.Context, orgName string, roleNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -624,7 +668,7 @@ func (a *RoleApi) UpdateRoleByName(ctx _context.Context, orgName string, roleNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_service_version.go b/api/kbcloud/api_service_version.go index 2577e01f..3e41b3ed 100644 --- a/api/kbcloud/api_service_version.go +++ b/api/kbcloud/api_service_version.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -26,7 +30,6 @@ func NewListServiceVersionOptionalParameters() *ListServiceVersionOptionalParame this := ListServiceVersionOptionalParameters{} return &this } - // WithComponent sets the corresponding parameter name and returns the struct. func (r *ListServiceVersionOptionalParameters) WithComponent(component string) *ListServiceVersionOptionalParameters { r.Component = &component @@ -37,18 +40,20 @@ func (r *ListServiceVersionOptionalParameters) WithComponent(component string) * // list the service version of the engine func (a *ServiceVersionApi) ListServiceVersion(ctx _context.Context, environmentName string, engineName string, engineMode string, o ...ListServiceVersionOptionalParameters) (EngineServiceVersions, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue EngineServiceVersions - optionalParams ListServiceVersionOptionalParameters + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue EngineServiceVersions + optionalParams ListServiceVersionOptionalParameters ) - if len(o) > 1 { - return localVarReturnValue, nil, common.ReportError("only one argument of type ListServiceVersionOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } + + if len(o) > 1 { + return localVarReturnValue, nil, common.ReportError("only one argument of type ListServiceVersionOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ServiceVersionApi.ListServiceVersion") if err != nil { @@ -68,7 +73,8 @@ func (a *ServiceVersionApi) ListServiceVersion(ctx _context.Context, environment } localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -90,10 +96,11 @@ func (a *ServiceVersionApi) ListServiceVersion(ctx _context.Context, environment if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -107,7 +114,7 @@ func (a *ServiceVersionApi) ListServiceVersion(ctx _context.Context, environment err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_sql_editor.go b/api/kbcloud/api_sql_editor.go index 0ec36ad3..3409b028 100644 --- a/api/kbcloud/api_sql_editor.go +++ b/api/kbcloud/api_sql_editor.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type SqlEditorApi common.Service // RunSQLOnCluster Connect and run command on cluster. func (a *SqlEditorApi) RunSQLOnCluster(ctx _context.Context, orgName string, clusterName string, body SqlReqRes) (SqlReqRes, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue SqlReqRes + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue SqlReqRes ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".SqlEditorApi.RunSQLOnCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *SqlEditorApi) RunSQLOnCluster(ctx _context.Context, orgName string, clu localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *SqlEditorApi) RunSQLOnCluster(ctx _context.Context, orgName string, clu if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *SqlEditorApi) RunSQLOnCluster(ctx _context.Context, orgName string, clu err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_storage_class.go b/api/kbcloud/api_storage_class.go index b61d390a..27fedaf0 100644 --- a/api/kbcloud/api_storage_class.go +++ b/api/kbcloud/api_storage_class.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type StorageClassApi common.Service // Provides a summary of storage class statistics, aggregated and organized by namespace. func (a *StorageClassApi) GetStorageClassStats(ctx _context.Context, orgName string, environmentName string) (StorageClassList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue StorageClassList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue StorageClassList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".StorageClassApi.GetStorageClassStats") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -37,9 +43,10 @@ func (a *StorageClassApi) GetStorageClassStats(ctx _context.Context, orgName str localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "*/*" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -61,10 +68,11 @@ func (a *StorageClassApi) GetStorageClassStats(ctx _context.Context, orgName str if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 403{ var v interface{} err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -73,7 +81,8 @@ func (a *StorageClassApi) GetStorageClassStats(ctx _context.Context, orgName str newErr.ErrorModel = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 404{ var v string err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -87,7 +96,7 @@ func (a *StorageClassApi) GetStorageClassStats(ctx _context.Context, orgName str err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_tag.go b/api/kbcloud/api_tag.go index 6c20f9f2..df929023 100644 --- a/api/kbcloud/api_tag.go +++ b/api/kbcloud/api_tag.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type TagApi common.Service // create tag func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{}) (TagCreate, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue TagCreate + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue TagCreate ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.CreateTag") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -39,9 +45,11 @@ func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{ localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -63,10 +71,11 @@ func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{ if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -80,7 +89,7 @@ func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{ err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -93,10 +102,12 @@ func (a *TagApi) CreateTag(ctx _context.Context, orgName string, body interface{ // delete tag func (a *TagApi) DeleteTags(ctx _context.Context, orgName string, tagId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.DeleteTags") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +122,8 @@ func (a *TagApi) DeleteTags(ctx _context.Context, orgName string, tagId string) localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +145,11 @@ func (a *TagApi) DeleteTags(ctx _context.Context, orgName string, tagId string) if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -153,11 +166,13 @@ func (a *TagApi) DeleteTags(ctx _context.Context, orgName string, tagId string) // GetTags Get cluster tags. func (a *TagApi) GetTags(ctx _context.Context, orgName string, clusterIds string) ([]TagCluster, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []TagCluster + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []TagCluster ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.GetTags") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -172,7 +187,8 @@ func (a *TagApi) GetTags(ctx _context.Context, orgName string, clusterIds string localVarQueryParams.Add("clusterIds", common.ParameterToString(clusterIds, "")) localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -195,7 +211,7 @@ func (a *TagApi) GetTags(ctx _context.Context, orgName string, clusterIds string err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -208,11 +224,13 @@ func (a *TagApi) GetTags(ctx _context.Context, orgName string, clusterIds string // List tags by organization name. func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue OrgTagsList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgTagsList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.ListOrgTags") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -226,7 +244,8 @@ func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -248,10 +267,11 @@ func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -265,7 +285,7 @@ func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -278,11 +298,13 @@ func (a *TagApi) ListOrgTags(ctx _context.Context, orgName string) (OrgTagsList, // Update tags func (a *TagApi) UpdateTag(ctx _context.Context, orgName string, tagId string, tagUpdate TagUpdate) (Tag, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Tag + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Tag ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TagApi.UpdateTag") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -298,9 +320,11 @@ func (a *TagApi) UpdateTag(ctx _context.Context, orgName string, tagId string, t localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &tagUpdate - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -322,10 +346,11 @@ func (a *TagApi) UpdateTag(ctx _context.Context, orgName string, tagId string, t if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -339,7 +364,7 @@ func (a *TagApi) UpdateTag(ctx _context.Context, orgName string, tagId string, t err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_tls.go b/api/kbcloud/api_tls.go index 43fc1f16..69d9e5f3 100644 --- a/api/kbcloud/api_tls.go +++ b/api/kbcloud/api_tls.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type TlsApi common.Service // GetTLSCertificate Get cluster TLS certificate. func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, clusterName string) ([]TlsCert, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue []TlsCert + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []TlsCert ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TlsApi.GetTLSCertificate") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -89,10 +97,12 @@ func (a *TlsApi) GetTLSCertificate(ctx _context.Context, orgName string, cluster // TlsSwitcher Enable or disable cluster TLS. func (a *TlsApi) TlsSwitcher(ctx _context.Context, orgName string, clusterName string, body TlsRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".TlsApi.TlsSwitcher") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -108,9 +118,11 @@ func (a *TlsApi) TlsSwitcher(ctx _context.Context, orgName string, clusterName s localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -132,10 +144,11 @@ func (a *TlsApi) TlsSwitcher(ctx _context.Context, orgName string, clusterName s if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/api_user.go b/api/kbcloud/api_user.go index 79f65443..8c30ceda 100644 --- a/api/kbcloud/api_user.go +++ b/api/kbcloud/api_user.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type UserApi common.Service // Create apikey of the authenticated user func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (ApikeyWithSK, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue ApikeyWithSK + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue ApikeyWithSK ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.CreateUserApikey") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,9 +44,11 @@ func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (Api localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +70,11 @@ func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (Api if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +88,7 @@ func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (Api err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,10 +101,12 @@ func (a *UserApi) CreateUserApikey(ctx _context.Context, body ApikeyCreate) (Api // delete apikey func (a *UserApi) DeleteApikey(ctx _context.Context, keyName string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.DeleteApikey") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -109,7 +120,8 @@ func (a *UserApi) DeleteApikey(ctx _context.Context, keyName string) (*_nethttp. localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -131,10 +143,11 @@ func (a *UserApi) DeleteApikey(ctx _context.Context, keyName string) (*_nethttp. if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -152,11 +165,13 @@ func (a *UserApi) DeleteApikey(ctx _context.Context, keyName string) (*_nethttp. // partially update the specified apikey func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyCreate) (Apikey, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue Apikey + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue Apikey ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.PatchAPIkey") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -168,12 +183,14 @@ func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyC localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json-patch+json" + localVarHeaderParams["Content-Type"] = "application/json-patch+json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -195,10 +212,11 @@ func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyC if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -212,7 +230,7 @@ func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyC err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -225,10 +243,12 @@ func (a *UserApi) PatchAPIkey(ctx _context.Context, keyName string, body ApikeyC // partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first. func (a *UserApi) PatchUser(ctx _context.Context, body UserUpdate) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.PatchUser") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -242,9 +262,11 @@ func (a *UserApi) PatchUser(ctx _context.Context, body UserUpdate) (*_nethttp.Re localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -266,10 +288,11 @@ func (a *UserApi) PatchUser(ctx _context.Context, body UserUpdate) (*_nethttp.Re if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -287,10 +310,12 @@ func (a *UserApi) PatchUser(ctx _context.Context, body UserUpdate) (*_nethttp.Re // to update user phone number, send verification code first func (a *UserApi) PhoneVerification(ctx _context.Context, body interface{}) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.PhoneVerification") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -304,9 +329,11 @@ func (a *UserApi) PhoneVerification(ctx _context.Context, body interface{}) (*_n localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -328,10 +355,11 @@ func (a *UserApi) PhoneVerification(ctx _context.Context, body interface{}) (*_n if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -349,11 +377,13 @@ func (a *UserApi) PhoneVerification(ctx _context.Context, body interface{}) (*_n // Get authenticated login user info func (a *UserApi) ReadUser(ctx _context.Context) (User, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue User + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue User ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.ReadUser") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -366,7 +396,8 @@ func (a *UserApi) ReadUser(ctx _context.Context) (User, *_nethttp.Response, erro localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -388,10 +419,11 @@ func (a *UserApi) ReadUser(ctx _context.Context) (User, *_nethttp.Response, erro if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -405,7 +437,7 @@ func (a *UserApi) ReadUser(ctx _context.Context) (User, *_nethttp.Response, erro err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -418,11 +450,13 @@ func (a *UserApi) ReadUser(ctx _context.Context) (User, *_nethttp.Response, erro // Get apikeys of the authenticated user func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ApikeyList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ApikeyList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.ReadUserApikeys") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -435,7 +469,8 @@ func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.R localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -457,10 +492,11 @@ func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.R if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if + localVarHTTPResponse.StatusCode == 401{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -474,7 +510,7 @@ func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.R err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -487,10 +523,12 @@ func (a *UserApi) ReadUserApikeys(ctx _context.Context) (ApikeyList, *_nethttp.R // To send verification email checking user's email address func (a *UserApi) SendVerificationEmail(ctx _context.Context) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.SendVerificationEmail") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -503,7 +541,8 @@ func (a *UserApi) SendVerificationEmail(ctx _context.Context) (*_nethttp.Respons localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -525,10 +564,11 @@ func (a *UserApi) SendVerificationEmail(ctx _context.Context) (*_nethttp.Respons if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -546,10 +586,12 @@ func (a *UserApi) SendVerificationEmail(ctx _context.Context) (*_nethttp.Respons // Update user password. func (a *UserApi) UpdateUserPassword(ctx _context.Context, body interface{}) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".UserApi.UpdateUserPassword") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -563,9 +605,11 @@ func (a *UserApi) UpdateUserPassword(ctx _context.Context, body interface{}) (*_ localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + + // body params localVarPostBody = &body - common.SetAuthKeys( + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -587,10 +631,11 @@ func (a *UserApi) UpdateUserPassword(ctx _context.Context, body interface{}) (*_ if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + if + localVarHTTPResponse.StatusCode == 400||localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 500{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/api_view.go b/api/kbcloud/api_view.go index be2f1686..56529ea5 100644 --- a/api/kbcloud/api_view.go +++ b/api/kbcloud/api_view.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,11 +23,13 @@ type ViewApi common.Service // GetTreeView Get tree view by cluster. func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName string) (TreeNode, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue TreeNode + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue TreeNode ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ViewApi.GetTreeView") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -77,7 +85,7 @@ func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -89,11 +97,13 @@ func (a *ViewApi) GetTreeView(ctx _context.Context, orgName string, clusterName // GetViewByCluster Get view details by cluster. func (a *ViewApi) GetViewByCluster(ctx _context.Context, orgName string, clusterName string) (View, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue View + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue View ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ViewApi.GetViewByCluster") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -108,7 +118,8 @@ func (a *ViewApi) GetViewByCluster(ctx _context.Context, orgName string, cluster localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -130,10 +141,11 @@ func (a *ViewApi) GetViewByCluster(ctx _context.Context, orgName string, cluster if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404||localVarHTTPResponse.StatusCode == 409{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -147,7 +159,7 @@ func (a *ViewApi) GetViewByCluster(ctx _context.Context, orgName string, cluster err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/api_whitelist.go b/api/kbcloud/api_whitelist.go index 0baff20c..9ffca51f 100644 --- a/api/kbcloud/api_whitelist.go +++ b/api/kbcloud/api_whitelist.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -19,10 +23,12 @@ type WhitelistApi common.Service // DeleteIPWhiteList Delete IP whitelist. func (a *WhitelistApi) DeleteIPWhiteList(ctx _context.Context, orgName string, clusterName string, ipWhitelistId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".WhitelistApi.DeleteIPWhiteList") if err != nil { return nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -38,7 +44,8 @@ func (a *WhitelistApi) DeleteIPWhiteList(ctx _context.Context, orgName string, c localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -60,10 +67,11 @@ func (a *WhitelistApi) DeleteIPWhiteList(ctx _context.Context, orgName string, c if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/kbcloud/api_zone.go b/api/kbcloud/api_zone.go index 0a25a474..4f69076a 100644 --- a/api/kbcloud/api_zone.go +++ b/api/kbcloud/api_zone.go @@ -2,13 +2,17 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "bytes" _context "context" + _fmt "fmt" + _io "io" + _log "log" _nethttp "net/http" _neturl "net/url" - "strings" "github.com/apecloud/kb-cloud-client-go/api/common" ) @@ -20,11 +24,13 @@ type ZoneApi common.Service // Get zone func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName string, zoneName string) (Zone, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue Zone + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue Zone ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ZoneApi.GetZones") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -40,7 +46,8 @@ func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -62,10 +69,11 @@ func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -79,7 +87,7 @@ func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr @@ -92,11 +100,13 @@ func (a *ZoneApi) GetZones(ctx _context.Context, providerName string, regionName // Get zone list func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionName string) (ZoneList, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ZoneList + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ZoneList ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".ZoneApi.ListZones") if err != nil { return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -111,7 +121,8 @@ func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionNam localVarFormParams := _neturl.Values{} localVarHeaderParams["Accept"] = "application/json" - common.SetAuthKeys( + + common.SetAuthKeys( ctx, &localVarHeaderParams, [2]string{"BearerToken", "authorization"}, @@ -133,10 +144,11 @@ func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionNam if localVarHTTPResponse.StatusCode >= 300 { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if + localVarHTTPResponse.StatusCode == 401||localVarHTTPResponse.StatusCode == 403||localVarHTTPResponse.StatusCode == 404{ var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -150,7 +162,7 @@ func (a *ZoneApi) ListZones(ctx _context.Context, providerName string, regionNam err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := common.GenericOpenAPIError{ - ErrorBody: localVarBody, + ErrorBody: localVarBody, ErrorMessage: err.Error(), } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/kbcloud/doc.go b/api/kbcloud/doc.go index 92af0b1a..bebe7f97 100644 --- a/api/kbcloud/doc.go +++ b/api/kbcloud/doc.go @@ -2,246 +2,249 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + + // List of APIs: -// - [accountApi.createAccount] -// - [accountApi.deleteAccount] -// - [accountApi.getDSN] -// - [accountApi.listAccounts] -// - [accountApi.updateAccount] -// - [accountApi.updateAccountPrivileges] -// - [alertConfigApi.getAlertConfig] -// - [alertConfigApi.setAlertConfig] -// - [alertInhibitApi.createAlertInhibit] -// - [alertInhibitApi.deleteAlertInhibit] -// - [alertInhibitApi.getAlertInhibit] -// - [alertInhibitApi.listAlertInhibits] -// - [alertInhibitApi.patchAlertInhibit] -// - [alertMetricsApi.listAlertMetrics] -// - [alertObjectApi.listAlertObjects] -// - [alertObjectApi.setAlertObjectStatus] -// - [alertObjectApi.setAlertObjectsStatus] -// - [alertReceiverApi.createAlertReceiver] -// - [alertReceiverApi.deleteAlertReceiver] -// - [alertReceiverApi.getAlertReceiver] -// - [alertReceiverApi.listAlertReceivers] -// - [alertReceiverApi.patchAlertReceiver] -// - [alertRuleApi.createAlertRule] -// - [alertRuleApi.deleteAlertRule] -// - [alertRuleApi.getAlertRule] -// - [alertRuleApi.listAlertRules] -// - [alertRuleApi.updateAlertRule] -// - [alertStrategyApi.createAlertStrategy] -// - [alertStrategyApi.deleteAlertStrategy] -// - [alertStrategyApi.listAlertStrategies] -// - [alertStrategyApi.patchAlertStrategy] -// - [alertStrategyApi.updateAlertStrategy] -// - [analyzeApi.analyzeBackup] -// - [analyzeApi.analyzeClusterParam] -// - [analyzeApi.analyzeClusterRestore] -// - [analyzeApi.analyzeLogs] -// - [analyzeApi.analyzeOps] -// - [analyzeApi.analyzeParam] -// - [analyzeApi.analyzeService] -// - [analyzeApi.analyzeSlowLogs] -// - [analyzeApi.analyzeView] -// - [autohealingApi.getAutohealing] -// - [backupApi.createClusterBackup] -// - [backupApi.deleteBackup] -// - [backupApi.downloadBackup] -// - [backupApi.downloadMutipleBackups] -// - [backupApi.getBackup] -// - [backupApi.getBackupLog] -// - [backupApi.getBackupStats] -// - [backupApi.getClusterBackupPolicy] -// - [backupApi.listBackups] -// - [backupApi.patchBackupPolicy] -// - [backupApi.viewBackup] -// - [backupRepoApi.deleteBackupRepo] -// - [backupRepoApi.getBackupRepo] -// - [backupRepoApi.listBackupRepos] -// - [backupRepoApi.updateBackupRepo] -// - [benchmarkApi.createPgbench] -// - [benchmarkApi.createSysbench] -// - [benchmarkApi.createTpcc] -// - [benchmarkApi.createYcsb] -// - [benchmarkApi.deleteBenchmark] -// - [benchmarkApi.getBenchmark] -// - [benchmarkApi.listBenchmark] -// - [classApi.createClass] -// - [classApi.deleteClass] -// - [classApi.listClasses] -// - [classApi.patchClass] -// - [clusterApi.createCluster] -// - [clusterApi.deleteCluster] -// - [clusterApi.describeClusterHaHistory] -// - [clusterApi.getCluster] -// - [clusterApi.getClusterByID] -// - [clusterApi.getClusterInstanceLog] -// - [clusterApi.getClusterManifest] -// - [clusterApi.getInstacesMetrics] -// - [clusterApi.listCluster] -// - [clusterApi.listEndpoints] -// - [clusterApi.listInstance] -// - [clusterApi.patchCluster] -// - [clusterAlertSwitchApi.getClusterAlertDisabled] -// - [clusterAlertSwitchApi.setClusterAlertDisabled] -// - [clusterLogApi.queryAuditLogs] -// - [clusterLogApi.queryErrorLogs] -// - [clusterLogApi.queryPodLogs] -// - [clusterLogApi.queryRunningLogs] -// - [clusterLogApi.querySlowLogs] -// - [databaseApi.createDatabase] -// - [databaseApi.deleteDatabase] -// - [databaseApi.listDatabases] -// - [dmsApi.AlterVolumes] -// - [dmsApi.CreateVolumes] -// - [dmsApi.DataExport] -// - [dmsApi.DataImport] -// - [dmsApi.DropVolumes] -// - [dmsApi.GetObjectInfo] -// - [dmsApi.GetTaskList] -// - [dmsApi.GetTaskProgress] -// - [dmsApi.ListObjectNamesByType] -// - [dmsApi.ListObjectTypesInSchema] -// - [dmsApi.ListVolumes] -// - [dmsApi.SetDefaultVolumes] -// - [dmsApi.alterParameter] -// - [dmsApi.closeSessions] -// - [dmsApi.createDataSourceV2] -// - [dmsApi.deleteDataSourceV2] -// - [dmsApi.generateDDL] -// - [dmsApi.getDataSourceV2] -// - [dmsApi.getSchemaList] -// - [dmsApi.listDataSourceV2] -// - [dmsApi.listParameters] -// - [dmsApi.listQueryHistory] -// - [dmsApi.listSessions] -// - [dmsApi.query] -// - [dmsApi.showData] -// - [dmsApi.sqlExplain] -// - [dmsApi.tenantParameterHistory] -// - [dmsApi.testDataSourceV2] -// - [dmsApi.updateDataSourceV2] -// - [engineApi.engineActionInOrg] -// - [engineApi.listEnginesInEnv] -// - [engineApi.listEnginesInOrg] -// - [engineLicenseApi.listEngineLicenses] -// - [engineOptionApi.ListUpgradeableServiceVersion] -// - [engineOptionApi.getEngineOption] -// - [engineOptionApi.listEngineOptions] -// - [environmentApi.getEnvironment] -// - [environmentApi.listEnvNodeZone] -// - [environmentApi.listEnvironment] -// - [environmentApi.listNodeGroup] -// - [eventApi.queryClusterEvents] -// - [featureApi.listFeature] -// - [featureApi.readFeature] -// - [inspectionApi.createAutoInspection] -// - [inspectionApi.createInspectionScript] -// - [inspectionApi.deleteInspectionScript] -// - [inspectionApi.listAutoInspection] -// - [inspectionApi.listInspectionScripts] -// - [inspectionApi.listInspections] -// - [inspectionApi.updateAutoInspection] -// - [inspectionApi.updateInspection] -// - [inspectionApi.updateInspectionScript] -// - [invitationApi.acceptInvitation] -// - [invitationApi.createInvitation] -// - [invitationApi.deleteInvitation] -// - [invitationApi.listInvitation] -// - [invitationApi.readInvitation] -// - [invitationApi.rejectInvitation] -// - [invitationApi.resendInvitation] -// - [ipWhitelistApi.createIPWhitelist] -// - [ipWhitelistApi.listIPWhitelist] -// - [ipWhitelistApi.updateIPWhitelist] -// - [loadBalancerApi.getLoadBalancer] -// - [markClusterApi.markClusterRestoreCompleted] -// - [memberApi.addOrgMember] -// - [memberApi.deleteOrgMember] -// - [memberApi.listOrgMember] -// - [memberApi.listOrgMemberPermission] -// - [memberApi.patchOrgMember] -// - [memberApi.readOrgMember] -// - [metricsApi.queryClusterMetrics] -// - [oceanbaseApi.getTenant] -// - [oceanbaseApi.listTenants] -// - [opsrequestApi.cancelOps] -// - [opsrequestApi.clusterVolumeExpand] -// - [opsrequestApi.customOps] -// - [opsrequestApi.exposeCluster] -// - [opsrequestApi.horizontalScaleCluster] -// - [opsrequestApi.promoteCluster] -// - [opsrequestApi.rebuildInstance] -// - [opsrequestApi.reconfigureCluster] -// - [opsrequestApi.restartCluster] -// - [opsrequestApi.startCluster] -// - [opsrequestApi.stopCluster] -// - [opsrequestApi.updateClusterLicense] -// - [opsrequestApi.upgradeCluster] -// - [opsrequestApi.verticalScaleCluster] -// - [organizationApi.createOrg] -// - [organizationApi.freezeMember] -// - [organizationApi.listOrg] -// - [organizationApi.patchOrg] -// - [organizationApi.readOrg] -// - [organizationApi.unfreezeMember] -// - [paramTplApi.createParamTpl] -// - [paramTplApi.createParamTplFromCluster] -// - [paramTplApi.deleteParamTpl] -// - [paramTplApi.getClusterParamTpls] -// - [paramTplApi.listParamTpl] -// - [paramTplApi.patchParamTpl] -// - [paramTplApi.readParamTpl] -// - [parameterApi.listConfigurations] -// - [parameterApi.listParameterSpecs] -// - [parameterApi.listParametersHistory] -// - [providerApi.getCloudProvider] -// - [providerApi.listCloudProviders] -// - [recycleBinClusterApi.deleteRecycleBinCluster] -// - [recycleBinClusterApi.getRecycleBinCluster] -// - [recycleBinClusterApi.listRecycleBinCluster] -// - [recycleBinClusterApi.restoreRecycleBinCluster] -// - [regionApi.getRegion] -// - [regionApi.listRegions] -// - [restoreApi.GetRestoreLog] -// - [restoreApi.deleteRestoreObject] -// - [restoreApi.doRestore] -// - [restoreApi.getRestoreTimeRange] -// - [restoreApi.listClusterRestore] -// - [restoreApi.listRestores] -// - [restoreApi.restoreCluster] -// - [roleApi.batchAddRolePermissions] -// - [roleApi.batchRemoveRolePermissions] -// - [roleApi.createRole] -// - [roleApi.deleteRoleByName] -// - [roleApi.getRoleByName] -// - [roleApi.listPermissions] -// - [roleApi.listRolePermissions] -// - [roleApi.listRoles] -// - [roleApi.updateRoleByName] -// - [serviceVersionApi.ListServiceVersion] -// - [sqlEditorApi.runSQLOnCluster] -// - [storageClassApi.getStorageClassStats] -// - [tagApi.createTag] -// - [tagApi.deleteTags] -// - [tagApi.getTags] -// - [tagApi.listOrgTags] -// - [tagApi.updateTag] -// - [tlsApi.getTLSCertificate] -// - [tlsApi.tlsSwitcher] -// - [userApi.createUserApikey] -// - [userApi.deleteApikey] -// - [userApi.patchAPIkey] -// - [userApi.patchUser] -// - [userApi.phoneVerification] -// - [userApi.readUser] -// - [userApi.readUserApikeys] -// - [userApi.sendVerificationEmail] -// - [userApi.updateUserPassword] -// - [viewApi.getTreeView] -// - [viewApi.getViewByCluster] -// - [whitelistApi.deleteIPWhiteList] -// - [zoneApi.getZones] -// - [zoneApi.listZones] -package kbcloud +// - [accountApi.createAccount] +// - [accountApi.deleteAccount] +// - [accountApi.getDSN] +// - [accountApi.listAccounts] +// - [accountApi.updateAccount] +// - [accountApi.updateAccountPrivileges] +// - [alertConfigApi.getAlertConfig] +// - [alertConfigApi.setAlertConfig] +// - [alertInhibitApi.createAlertInhibit] +// - [alertInhibitApi.deleteAlertInhibit] +// - [alertInhibitApi.getAlertInhibit] +// - [alertInhibitApi.listAlertInhibits] +// - [alertInhibitApi.patchAlertInhibit] +// - [alertMetricsApi.listAlertMetrics] +// - [alertObjectApi.listAlertObjects] +// - [alertObjectApi.setAlertObjectStatus] +// - [alertObjectApi.setAlertObjectsStatus] +// - [alertReceiverApi.createAlertReceiver] +// - [alertReceiverApi.deleteAlertReceiver] +// - [alertReceiverApi.getAlertReceiver] +// - [alertReceiverApi.listAlertReceivers] +// - [alertReceiverApi.patchAlertReceiver] +// - [alertRuleApi.createAlertRule] +// - [alertRuleApi.deleteAlertRule] +// - [alertRuleApi.getAlertRule] +// - [alertRuleApi.listAlertRules] +// - [alertRuleApi.updateAlertRule] +// - [alertStrategyApi.createAlertStrategy] +// - [alertStrategyApi.deleteAlertStrategy] +// - [alertStrategyApi.listAlertStrategies] +// - [alertStrategyApi.patchAlertStrategy] +// - [alertStrategyApi.updateAlertStrategy] +// - [analyzeApi.analyzeBackup] +// - [analyzeApi.analyzeClusterParam] +// - [analyzeApi.analyzeClusterRestore] +// - [analyzeApi.analyzeLogs] +// - [analyzeApi.analyzeOps] +// - [analyzeApi.analyzeParam] +// - [analyzeApi.analyzeService] +// - [analyzeApi.analyzeSlowLogs] +// - [analyzeApi.analyzeView] +// - [autohealingApi.getAutohealing] +// - [backupApi.createClusterBackup] +// - [backupApi.deleteBackup] +// - [backupApi.downloadBackup] +// - [backupApi.downloadMutipleBackups] +// - [backupApi.getBackup] +// - [backupApi.getBackupLog] +// - [backupApi.getBackupStats] +// - [backupApi.getClusterBackupPolicy] +// - [backupApi.listBackups] +// - [backupApi.patchBackupPolicy] +// - [backupApi.viewBackup] +// - [backupRepoApi.deleteBackupRepo] +// - [backupRepoApi.getBackupRepo] +// - [backupRepoApi.listBackupRepos] +// - [backupRepoApi.updateBackupRepo] +// - [benchmarkApi.createPgbench] +// - [benchmarkApi.createSysbench] +// - [benchmarkApi.createTpcc] +// - [benchmarkApi.createYcsb] +// - [benchmarkApi.deleteBenchmark] +// - [benchmarkApi.getBenchmark] +// - [benchmarkApi.listBenchmark] +// - [classApi.createClass] +// - [classApi.deleteClass] +// - [classApi.listClasses] +// - [classApi.patchClass] +// - [clusterApi.createCluster] +// - [clusterApi.deleteCluster] +// - [clusterApi.describeClusterHaHistory] +// - [clusterApi.getCluster] +// - [clusterApi.getClusterByID] +// - [clusterApi.getClusterInstanceLog] +// - [clusterApi.getClusterManifest] +// - [clusterApi.getInstacesMetrics] +// - [clusterApi.listCluster] +// - [clusterApi.listEndpoints] +// - [clusterApi.listInstance] +// - [clusterApi.patchCluster] +// - [clusterAlertSwitchApi.getClusterAlertDisabled] +// - [clusterAlertSwitchApi.setClusterAlertDisabled] +// - [clusterLogApi.queryAuditLogs] +// - [clusterLogApi.queryErrorLogs] +// - [clusterLogApi.queryPodLogs] +// - [clusterLogApi.queryRunningLogs] +// - [clusterLogApi.querySlowLogs] +// - [databaseApi.createDatabase] +// - [databaseApi.deleteDatabase] +// - [databaseApi.listDatabases] +// - [dmsApi.AlterVolumes] +// - [dmsApi.CreateVolumes] +// - [dmsApi.DataExport] +// - [dmsApi.DataImport] +// - [dmsApi.DropVolumes] +// - [dmsApi.GetObjectInfo] +// - [dmsApi.GetTaskList] +// - [dmsApi.GetTaskProgress] +// - [dmsApi.ListObjectNamesByType] +// - [dmsApi.ListObjectTypesInSchema] +// - [dmsApi.ListVolumes] +// - [dmsApi.SetDefaultVolumes] +// - [dmsApi.alterParameter] +// - [dmsApi.closeSessions] +// - [dmsApi.createDataSourceV2] +// - [dmsApi.deleteDataSourceV2] +// - [dmsApi.generateDDL] +// - [dmsApi.getDataSourceV2] +// - [dmsApi.getSchemaList] +// - [dmsApi.listDataSourceV2] +// - [dmsApi.listParameters] +// - [dmsApi.listQueryHistory] +// - [dmsApi.listSessions] +// - [dmsApi.query] +// - [dmsApi.showData] +// - [dmsApi.sqlExplain] +// - [dmsApi.tenantParameterHistory] +// - [dmsApi.testDataSourceV2] +// - [dmsApi.updateDataSourceV2] +// - [engineApi.engineActionInOrg] +// - [engineApi.listEnginesInEnv] +// - [engineApi.listEnginesInOrg] +// - [engineLicenseApi.listEngineLicenses] +// - [engineOptionApi.ListUpgradeableServiceVersion] +// - [engineOptionApi.getEngineOption] +// - [engineOptionApi.listEngineOptions] +// - [environmentApi.filterEnvironment] +// - [environmentApi.getEnvironment] +// - [environmentApi.listEnvNodeZone] +// - [environmentApi.listEnvironment] +// - [environmentApi.listNodeGroup] +// - [eventApi.queryClusterEvents] +// - [featureApi.listFeature] +// - [featureApi.readFeature] +// - [inspectionApi.createAutoInspection] +// - [inspectionApi.createInspectionScript] +// - [inspectionApi.deleteInspectionScript] +// - [inspectionApi.listAutoInspection] +// - [inspectionApi.listInspectionScripts] +// - [inspectionApi.listInspections] +// - [inspectionApi.updateAutoInspection] +// - [inspectionApi.updateInspection] +// - [inspectionApi.updateInspectionScript] +// - [invitationApi.acceptInvitation] +// - [invitationApi.createInvitation] +// - [invitationApi.deleteInvitation] +// - [invitationApi.listInvitation] +// - [invitationApi.readInvitation] +// - [invitationApi.rejectInvitation] +// - [invitationApi.resendInvitation] +// - [ipWhitelistApi.createIPWhitelist] +// - [ipWhitelistApi.listIPWhitelist] +// - [ipWhitelistApi.updateIPWhitelist] +// - [loadBalancerApi.getLoadBalancer] +// - [markClusterApi.markClusterRestoreCompleted] +// - [memberApi.addOrgMember] +// - [memberApi.deleteOrgMember] +// - [memberApi.listOrgMember] +// - [memberApi.listOrgMemberPermission] +// - [memberApi.patchOrgMember] +// - [memberApi.readOrgMember] +// - [metricsApi.queryClusterMetrics] +// - [oceanbaseApi.getTenant] +// - [oceanbaseApi.listTenants] +// - [opsrequestApi.cancelOps] +// - [opsrequestApi.clusterVolumeExpand] +// - [opsrequestApi.customOps] +// - [opsrequestApi.exposeCluster] +// - [opsrequestApi.horizontalScaleCluster] +// - [opsrequestApi.promoteCluster] +// - [opsrequestApi.rebuildInstance] +// - [opsrequestApi.reconfigureCluster] +// - [opsrequestApi.restartCluster] +// - [opsrequestApi.startCluster] +// - [opsrequestApi.stopCluster] +// - [opsrequestApi.updateClusterLicense] +// - [opsrequestApi.upgradeCluster] +// - [opsrequestApi.verticalScaleCluster] +// - [organizationApi.createOrg] +// - [organizationApi.freezeMember] +// - [organizationApi.listOrg] +// - [organizationApi.patchOrg] +// - [organizationApi.readOrg] +// - [organizationApi.unfreezeMember] +// - [paramTplApi.createParamTpl] +// - [paramTplApi.createParamTplFromCluster] +// - [paramTplApi.deleteParamTpl] +// - [paramTplApi.getClusterParamTpls] +// - [paramTplApi.listParamTpl] +// - [paramTplApi.patchParamTpl] +// - [paramTplApi.readParamTpl] +// - [parameterApi.listConfigurations] +// - [parameterApi.listParameterSpecs] +// - [parameterApi.listParametersHistory] +// - [providerApi.getCloudProvider] +// - [providerApi.listCloudProviders] +// - [recycleBinClusterApi.deleteRecycleBinCluster] +// - [recycleBinClusterApi.getRecycleBinCluster] +// - [recycleBinClusterApi.listRecycleBinCluster] +// - [recycleBinClusterApi.restoreRecycleBinCluster] +// - [regionApi.getRegion] +// - [regionApi.listRegions] +// - [restoreApi.GetRestoreLog] +// - [restoreApi.deleteRestoreObject] +// - [restoreApi.doRestore] +// - [restoreApi.getRestoreTimeRange] +// - [restoreApi.listClusterRestore] +// - [restoreApi.listRestores] +// - [restoreApi.restoreCluster] +// - [roleApi.batchAddRolePermissions] +// - [roleApi.batchRemoveRolePermissions] +// - [roleApi.createRole] +// - [roleApi.deleteRoleByName] +// - [roleApi.getRoleByName] +// - [roleApi.listPermissions] +// - [roleApi.listRolePermissions] +// - [roleApi.listRoles] +// - [roleApi.updateRoleByName] +// - [serviceVersionApi.ListServiceVersion] +// - [sqlEditorApi.runSQLOnCluster] +// - [storageClassApi.getStorageClassStats] +// - [tagApi.createTag] +// - [tagApi.deleteTags] +// - [tagApi.getTags] +// - [tagApi.listOrgTags] +// - [tagApi.updateTag] +// - [tlsApi.getTLSCertificate] +// - [tlsApi.tlsSwitcher] +// - [userApi.createUserApikey] +// - [userApi.deleteApikey] +// - [userApi.patchAPIkey] +// - [userApi.patchUser] +// - [userApi.phoneVerification] +// - [userApi.readUser] +// - [userApi.readUserApikeys] +// - [userApi.sendVerificationEmail] +// - [userApi.updateUserPassword] +// - [viewApi.getTreeView] +// - [viewApi.getViewByCluster] +// - [whitelistApi.deleteIPWhiteList] +// - [zoneApi.getZones] +// - [zoneApi.listZones] +package kbcloud \ No newline at end of file diff --git a/api/kbcloud/model_account.go b/api/kbcloud/model_account.go index 2aa8836d..28a34947 100644 --- a/api/kbcloud/model_account.go +++ b/api/kbcloud/model_account.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Account Cluster account information + + +// Account Cluster account information type Account struct { // A list of privileges and their databases. PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` @@ -25,10 +30,11 @@ type Account struct { // Role name should be one of [SUPERUSER, BASICUSER]. Role AccountRoleType `json:"role"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAccount instantiates a new Account object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -49,7 +55,6 @@ func NewAccountWithDefaults() *Account { this.Role = role return &this } - // GetPrivilegesList returns the PrivilegesList field value if set, zero value otherwise. func (o *Account) GetPrivilegesList() []PrivilegeListItem { if o == nil || o.PrivilegesList == nil { @@ -78,6 +83,7 @@ func (o *Account) SetPrivilegesList(v []PrivilegeListItem) { o.PrivilegesList = v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *Account) GetComponent() string { if o == nil || o.Component == nil { @@ -106,6 +112,7 @@ func (o *Account) SetComponent(v string) { o.Component = &v } + // GetInstance returns the Instance field value if set, zero value otherwise. func (o *Account) GetInstance() string { if o == nil || o.Instance == nil { @@ -134,6 +141,7 @@ func (o *Account) SetInstance(v string) { o.Instance = &v } + // GetName returns the Name field value. func (o *Account) GetName() string { if o == nil { @@ -157,6 +165,7 @@ func (o *Account) SetName(v string) { o.Name = v } + // GetPassword returns the Password field value if set, zero value otherwise. func (o *Account) GetPassword() string { if o == nil || o.Password == nil { @@ -185,6 +194,7 @@ func (o *Account) SetPassword(v string) { o.Password = &v } + // GetRole returns the Role field value. func (o *Account) GetRole() AccountRoleType { if o == nil { @@ -208,6 +218,8 @@ func (o *Account) SetRole(v AccountRoleType) { o.Role = v } + + // MarshalJSON serializes the struct using spec logic. func (o Account) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -239,11 +251,11 @@ func (o Account) MarshalJSON() ([]byte, error) { func (o *Account) UnmarshalJSON(bytes []byte) (err error) { all := struct { PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` - Component *string `json:"component,omitempty"` - Instance *string `json:"instance,omitempty"` - Name *string `json:"name"` - Password *string `json:"password,omitempty"` - Role *AccountRoleType `json:"role"` + Component *string `json:"component,omitempty"` + Instance *string `json:"instance,omitempty"` + Name *string `json:"name"` + Password *string `json:"password,omitempty"` + Role *AccountRoleType `json:"role"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -256,7 +268,7 @@ func (o *Account) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"privilegesList", "component", "instance", "name", "password", "role"}) + common.DeleteKeys(additionalProperties, &[]string{ "privilegesList", "component", "instance", "name", "password", "role", }) } else { return err } diff --git a/api/kbcloud/model_account_list_item.go b/api/kbcloud/model_account_list_item.go index 82ac12c8..5877728e 100644 --- a/api/kbcloud/model_account_list_item.go +++ b/api/kbcloud/model_account_list_item.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AccountListItem Cluster account information. + + +// AccountListItem Cluster account information. type AccountListItem struct { // Component type. Component *string `json:"component,omitempty"` @@ -23,10 +28,11 @@ type AccountListItem struct { // A list of privileges and their databases. PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAccountListItem instantiates a new AccountListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewAccountListItemWithDefaults() *AccountListItem { this := AccountListItem{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *AccountListItem) GetComponent() string { if o == nil || o.Component == nil { @@ -73,6 +78,7 @@ func (o *AccountListItem) SetComponent(v string) { o.Component = &v } + // GetName returns the Name field value. func (o *AccountListItem) GetName() string { if o == nil { @@ -96,6 +102,7 @@ func (o *AccountListItem) SetName(v string) { o.Name = v } + // GetPassword returns the Password field value if set, zero value otherwise. func (o *AccountListItem) GetPassword() string { if o == nil || o.Password == nil { @@ -124,6 +131,7 @@ func (o *AccountListItem) SetPassword(v string) { o.Password = &v } + // GetRole returns the Role field value if set, zero value otherwise. func (o *AccountListItem) GetRole() AccountListRoleType { if o == nil || o.Role == nil { @@ -152,6 +160,7 @@ func (o *AccountListItem) SetRole(v AccountListRoleType) { o.Role = &v } + // GetPrivilegesList returns the PrivilegesList field value if set, zero value otherwise. func (o *AccountListItem) GetPrivilegesList() []PrivilegeListItem { if o == nil || o.PrivilegesList == nil { @@ -180,6 +189,8 @@ func (o *AccountListItem) SetPrivilegesList(v []PrivilegeListItem) { o.PrivilegesList = v } + + // MarshalJSON serializes the struct using spec logic. func (o AccountListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -209,11 +220,11 @@ func (o AccountListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AccountListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - Name *string `json:"name"` - Password *string `json:"password,omitempty"` - Role *AccountListRoleType `json:"role,omitempty"` - PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` + Component *string `json:"component,omitempty"` + Name *string `json:"name"` + Password *string `json:"password,omitempty"` + Role *AccountListRoleType `json:"role,omitempty"` + PrivilegesList []PrivilegeListItem `json:"privilegesList,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -223,7 +234,7 @@ func (o *AccountListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "name", "password", "role", "privilegesList"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "name", "password", "role", "privilegesList", }) } else { return err } @@ -232,7 +243,7 @@ func (o *AccountListItem) UnmarshalJSON(bytes []byte) (err error) { o.Component = all.Component o.Name = *all.Name o.Password = all.Password - if all.Role != nil && !all.Role.IsValid() { + if all.Role != nil &&!all.Role.IsValid() { hasInvalidField = true } else { o.Role = all.Role diff --git a/api/kbcloud/model_account_list_role_type.go b/api/kbcloud/model_account_list_role_type.go index e1f32453..2c2dd498 100644 --- a/api/kbcloud/model_account_list_role_type.go +++ b/api/kbcloud/model_account_list_role_type.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // AccountListRoleType The user role name, should be one of [ROOT, SUPERUSER, BASICUSER]. type AccountListRoleType string @@ -17,7 +22,7 @@ type AccountListRoleType string const ( AccountListRoleTypeSuperuser AccountListRoleType = "SUPERUSER" AccountListRoleTypeBasicuser AccountListRoleType = "BASICUSER" - AccountListRoleTypeRoot AccountListRoleType = "ROOT" + AccountListRoleTypeRoot AccountListRoleType = "ROOT" ) var allowedAccountListRoleTypeEnumValues = []AccountListRoleType{ diff --git a/api/kbcloud/model_account_option.go b/api/kbcloud/model_account_option.go index cf6317c4..1bbaed50 100644 --- a/api/kbcloud/model_account_option.go +++ b/api/kbcloud/model_account_option.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AccountOption struct { - Enabled bool `json:"enabled"` - Privileges []string `json:"privileges"` - AccountNamePattern string `json:"accountNamePattern"` - Create bool `json:"create"` - ResetPassword bool `json:"resetPassword"` - Delete bool `json:"delete"` + Enabled bool `json:"enabled"` + Privileges []string `json:"privileges"` + AccountNamePattern string `json:"accountNamePattern"` + Create bool `json:"create"` + ResetPassword bool `json:"resetPassword"` + Delete bool `json:"delete"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAccountOption instantiates a new AccountOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewAccountOptionWithDefaults() *AccountOption { this := AccountOption{} return &this } - // GetEnabled returns the Enabled field value. func (o *AccountOption) GetEnabled() bool { if o == nil { @@ -68,6 +73,7 @@ func (o *AccountOption) SetEnabled(v bool) { o.Enabled = v } + // GetPrivileges returns the Privileges field value. func (o *AccountOption) GetPrivileges() []string { if o == nil { @@ -91,6 +97,7 @@ func (o *AccountOption) SetPrivileges(v []string) { o.Privileges = v } + // GetAccountNamePattern returns the AccountNamePattern field value. func (o *AccountOption) GetAccountNamePattern() string { if o == nil { @@ -114,6 +121,7 @@ func (o *AccountOption) SetAccountNamePattern(v string) { o.AccountNamePattern = v } + // GetCreate returns the Create field value. func (o *AccountOption) GetCreate() bool { if o == nil { @@ -137,6 +145,7 @@ func (o *AccountOption) SetCreate(v bool) { o.Create = v } + // GetResetPassword returns the ResetPassword field value. func (o *AccountOption) GetResetPassword() bool { if o == nil { @@ -160,6 +169,7 @@ func (o *AccountOption) SetResetPassword(v bool) { o.ResetPassword = v } + // GetDelete returns the Delete field value. func (o *AccountOption) GetDelete() bool { if o == nil { @@ -183,6 +193,8 @@ func (o *AccountOption) SetDelete(v bool) { o.Delete = v } + + // MarshalJSON serializes the struct using spec logic. func (o AccountOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -205,12 +217,12 @@ func (o AccountOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AccountOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Enabled *bool `json:"enabled"` - Privileges *[]string `json:"privileges"` - AccountNamePattern *string `json:"accountNamePattern"` - Create *bool `json:"create"` - ResetPassword *bool `json:"resetPassword"` - Delete *bool `json:"delete"` + Enabled *bool `json:"enabled"` + Privileges *[]string `json:"privileges"` + AccountNamePattern *string `json:"accountNamePattern"` + Create *bool `json:"create"` + ResetPassword *bool `json:"resetPassword"` + Delete *bool `json:"delete"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -235,7 +247,7 @@ func (o *AccountOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled", "privileges", "accountNamePattern", "create", "resetPassword", "delete"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", "privileges", "accountNamePattern", "create", "resetPassword", "delete", }) } else { return err } diff --git a/api/kbcloud/model_account_role_type.go b/api/kbcloud/model_account_role_type.go index 9f6af35e..86f30863 100644 --- a/api/kbcloud/model_account_role_type.go +++ b/api/kbcloud/model_account_role_type.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // AccountRoleType Role name should be one of [SUPERUSER, BASICUSER]. type AccountRoleType string diff --git a/api/kbcloud/model_alert_cluster.go b/api/kbcloud/model_alert_cluster.go index 6666dfe4..99bdd317 100644 --- a/api/kbcloud/model_alert_cluster.go +++ b/api/kbcloud/model_alert_cluster.go @@ -2,21 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertCluster struct { Disabled bool `json:"disabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertCluster instantiates a new AlertCluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +40,6 @@ func NewAlertClusterWithDefaults() *AlertCluster { this := AlertCluster{} return &this } - // GetDisabled returns the Disabled field value. func (o *AlertCluster) GetDisabled() bool { if o == nil { @@ -58,6 +63,8 @@ func (o *AlertCluster) SetDisabled(v bool) { o.Disabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +92,7 @@ func (o *AlertCluster) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"disabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "disabled", }) } else { return err } diff --git a/api/kbcloud/model_alert_config.go b/api/kbcloud/model_alert_config.go index d6e8b722..d896ebb4 100644 --- a/api/kbcloud/model_alert_config.go +++ b/api/kbcloud/model_alert_config.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertConfig struct { // Time zone offset in seconds, e.g. offset of UTC+08:00 is +8 * 60 * 60 TimeZoneOffset int32 `json:"timeZoneOffset"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertConfig instantiates a new AlertConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewAlertConfigWithDefaults() *AlertConfig { this := AlertConfig{} return &this } - // GetTimeZoneOffset returns the TimeZoneOffset field value. func (o *AlertConfig) GetTimeZoneOffset() int32 { if o == nil { @@ -59,6 +64,8 @@ func (o *AlertConfig) SetTimeZoneOffset(v int32) { o.TimeZoneOffset = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *AlertConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"timeZoneOffset"}) + common.DeleteKeys(additionalProperties, &[]string{ "timeZoneOffset", }) } else { return err } diff --git a/api/kbcloud/model_alert_inhibit.go b/api/kbcloud/model_alert_inhibit.go index f1a57b3e..3c6da2a5 100644 --- a/api/kbcloud/model_alert_inhibit.go +++ b/api/kbcloud/model_alert_inhibit.go @@ -2,24 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// AlertInhibit Alert object information + +// AlertInhibit Alert object information type AlertInhibit struct { - Id *int32 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + OrgName *string `json:"orgName,omitempty"` SourceMatch map[string][]string `json:"sourceMatch,omitempty"` TargetMatch map[string][]string `json:"targetMatch,omitempty"` - Equal []string `json:"equal,omitempty"` + Equal []string `json:"equal,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertInhibit instantiates a new AlertInhibit object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +46,6 @@ func NewAlertInhibitWithDefaults() *AlertInhibit { this := AlertInhibit{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *AlertInhibit) GetId() int32 { if o == nil || o.Id == nil { @@ -65,6 +74,7 @@ func (o *AlertInhibit) SetId(v int32) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *AlertInhibit) GetName() string { if o == nil || o.Name == nil { @@ -93,6 +103,7 @@ func (o *AlertInhibit) SetName(v string) { o.Name = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertInhibit) GetDescription() string { if o == nil || o.Description == nil { @@ -121,6 +132,7 @@ func (o *AlertInhibit) SetDescription(v string) { o.Description = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertInhibit) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -149,6 +161,7 @@ func (o *AlertInhibit) SetOrgName(v string) { o.OrgName = &v } + // GetSourceMatch returns the SourceMatch field value if set, zero value otherwise. func (o *AlertInhibit) GetSourceMatch() map[string][]string { if o == nil || o.SourceMatch == nil { @@ -177,6 +190,7 @@ func (o *AlertInhibit) SetSourceMatch(v map[string][]string) { o.SourceMatch = v } + // GetTargetMatch returns the TargetMatch field value if set, zero value otherwise. func (o *AlertInhibit) GetTargetMatch() map[string][]string { if o == nil || o.TargetMatch == nil { @@ -205,6 +219,7 @@ func (o *AlertInhibit) SetTargetMatch(v map[string][]string) { o.TargetMatch = v } + // GetEqual returns the Equal field value if set, zero value otherwise. func (o *AlertInhibit) GetEqual() []string { if o == nil || o.Equal == nil { @@ -233,6 +248,8 @@ func (o *AlertInhibit) SetEqual(v []string) { o.Equal = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertInhibit) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -270,20 +287,20 @@ func (o AlertInhibit) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertInhibit) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + OrgName *string `json:"orgName,omitempty"` SourceMatch map[string][]string `json:"sourceMatch,omitempty"` TargetMatch map[string][]string `json:"targetMatch,omitempty"` - Equal []string `json:"equal,omitempty"` + Equal []string `json:"equal,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "description", "orgName", "sourceMatch", "targetMatch", "equal"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "description", "orgName", "sourceMatch", "targetMatch", "equal", }) } else { return err } diff --git a/api/kbcloud/model_alert_inhibit_list.go b/api/kbcloud/model_alert_inhibit_list.go index eaac2619..8fd0f48e 100644 --- a/api/kbcloud/model_alert_inhibit_list.go +++ b/api/kbcloud/model_alert_inhibit_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertInhibitList AlertInhibitList is a list of alert inhibit + + +// AlertInhibitList AlertInhibitList is a list of alert inhibit type AlertInhibitList struct { // Items is the list of alert inhibits in the list Items []AlertInhibit `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertInhibitList instantiates a new AlertInhibitList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertInhibitListWithDefaults() *AlertInhibitList { this := AlertInhibitList{} return &this } - // GetItems returns the Items field value. func (o *AlertInhibitList) GetItems() []AlertInhibit { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertInhibitList) SetItems(v []AlertInhibit) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertInhibitList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertInhibitList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertInhibitList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertInhibitList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertInhibitList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertInhibit `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertInhibit `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertInhibitList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_alert_metric.go b/api/kbcloud/model_alert_metric.go index 65ea405b..aab297b0 100644 --- a/api/kbcloud/model_alert_metric.go +++ b/api/kbcloud/model_alert_metric.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertMetric Alert metric information + + +// AlertMetric Alert metric information type AlertMetric struct { - Key string `json:"key"` - Threshold int32 `json:"threshold"` - Notation string `json:"notation"` - Category *string `json:"category,omitempty"` + Key string `json:"key"` + Threshold int32 `json:"threshold"` + Notation string `json:"notation"` + Category *string `json:"category,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertMetric instantiates a new AlertMetric object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewAlertMetricWithDefaults() *AlertMetric { this := AlertMetric{} return &this } - // GetKey returns the Key field value. func (o *AlertMetric) GetKey() string { if o == nil { @@ -64,6 +69,7 @@ func (o *AlertMetric) SetKey(v string) { o.Key = v } + // GetThreshold returns the Threshold field value. func (o *AlertMetric) GetThreshold() int32 { if o == nil { @@ -87,6 +93,7 @@ func (o *AlertMetric) SetThreshold(v int32) { o.Threshold = v } + // GetNotation returns the Notation field value. func (o *AlertMetric) GetNotation() string { if o == nil { @@ -110,6 +117,7 @@ func (o *AlertMetric) SetNotation(v string) { o.Notation = v } + // GetCategory returns the Category field value if set, zero value otherwise. func (o *AlertMetric) GetCategory() string { if o == nil || o.Category == nil { @@ -138,6 +146,8 @@ func (o *AlertMetric) SetCategory(v string) { o.Category = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertMetric) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -160,10 +170,10 @@ func (o AlertMetric) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertMetric) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Key *string `json:"key"` - Threshold *int32 `json:"threshold"` - Notation *string `json:"notation"` - Category *string `json:"category,omitempty"` + Key *string `json:"key"` + Threshold *int32 `json:"threshold"` + Notation *string `json:"notation"` + Category *string `json:"category,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -179,7 +189,7 @@ func (o *AlertMetric) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"key", "threshold", "notation", "category"}) + common.DeleteKeys(additionalProperties, &[]string{ "key", "threshold", "notation", "category", }) } else { return err } diff --git a/api/kbcloud/model_alert_metric_list.go b/api/kbcloud/model_alert_metric_list.go index 5783becc..b58f62c8 100644 --- a/api/kbcloud/model_alert_metric_list.go +++ b/api/kbcloud/model_alert_metric_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertMetricList AlertMetricList is a list of alert metric + + +// AlertMetricList AlertMetricList is a list of alert metric type AlertMetricList struct { // Items is the list of alert metric objects in the list Items []AlertMetric `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertMetricList instantiates a new AlertMetricList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertMetricListWithDefaults() *AlertMetricList { this := AlertMetricList{} return &this } - // GetItems returns the Items field value. func (o *AlertMetricList) GetItems() []AlertMetric { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertMetricList) SetItems(v []AlertMetric) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertMetricList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertMetricList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertMetricList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertMetricList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertMetricList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertMetric `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertMetric `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertMetricList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_alert_object.go b/api/kbcloud/model_alert_object.go index 1bba945f..3f2bbd9b 100644 --- a/api/kbcloud/model_alert_object.go +++ b/api/kbcloud/model_alert_object.go @@ -2,37 +2,43 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// AlertObject Alert object information + + +// AlertObject Alert object information type AlertObject struct { - Id *int32 `json:"id,omitempty"` - AlertName *string `json:"alertName,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Expr *string `json:"expr,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - Engine *string `json:"engine,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Pod *string `json:"pod,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Description *string `json:"description,omitempty"` - Fingerprint *string `json:"fingerprint,omitempty"` - StartsAt *time.Time `json:"startsAt,omitempty"` - EndsAt *time.Time `json:"endsAt,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - Count *int32 `json:"count,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + AlertName *string `json:"alertName,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Expr *string `json:"expr,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + Engine *string `json:"engine,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Pod *string `json:"pod,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + Description *string `json:"description,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + StartsAt *time.Time `json:"startsAt,omitempty"` + EndsAt *time.Time `json:"endsAt,omitempty"` + Status *AlertStatus `json:"status,omitempty"` + Count *int32 `json:"count,omitempty"` + OrgName *string `json:"orgName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertObject instantiates a new AlertObject object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -49,7 +55,6 @@ func NewAlertObjectWithDefaults() *AlertObject { this := AlertObject{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *AlertObject) GetId() int32 { if o == nil || o.Id == nil { @@ -78,6 +83,7 @@ func (o *AlertObject) SetId(v int32) { o.Id = &v } + // GetAlertName returns the AlertName field value if set, zero value otherwise. func (o *AlertObject) GetAlertName() string { if o == nil || o.AlertName == nil { @@ -106,6 +112,7 @@ func (o *AlertObject) SetAlertName(v string) { o.AlertName = &v } + // GetGroupName returns the GroupName field value if set, zero value otherwise. func (o *AlertObject) GetGroupName() string { if o == nil || o.GroupName == nil { @@ -134,6 +141,7 @@ func (o *AlertObject) SetGroupName(v string) { o.GroupName = &v } + // GetExpr returns the Expr field value if set, zero value otherwise. func (o *AlertObject) GetExpr() string { if o == nil || o.Expr == nil { @@ -162,6 +170,7 @@ func (o *AlertObject) SetExpr(v string) { o.Expr = &v } + // GetClusterName returns the ClusterName field value if set, zero value otherwise. func (o *AlertObject) GetClusterName() string { if o == nil || o.ClusterName == nil { @@ -190,6 +199,7 @@ func (o *AlertObject) SetClusterName(v string) { o.ClusterName = &v } + // GetEngine returns the Engine field value if set, zero value otherwise. func (o *AlertObject) GetEngine() string { if o == nil || o.Engine == nil { @@ -218,6 +228,7 @@ func (o *AlertObject) SetEngine(v string) { o.Engine = &v } + // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *AlertObject) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -246,6 +257,7 @@ func (o *AlertObject) SetNamespace(v string) { o.Namespace = &v } + // GetPod returns the Pod field value if set, zero value otherwise. func (o *AlertObject) GetPod() string { if o == nil || o.Pod == nil { @@ -274,6 +286,7 @@ func (o *AlertObject) SetPod(v string) { o.Pod = &v } + // GetSeverity returns the Severity field value if set, zero value otherwise. func (o *AlertObject) GetSeverity() AlertSeverity { if o == nil || o.Severity == nil { @@ -302,6 +315,7 @@ func (o *AlertObject) SetSeverity(v AlertSeverity) { o.Severity = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertObject) GetDescription() string { if o == nil || o.Description == nil { @@ -330,6 +344,7 @@ func (o *AlertObject) SetDescription(v string) { o.Description = &v } + // GetFingerprint returns the Fingerprint field value if set, zero value otherwise. func (o *AlertObject) GetFingerprint() string { if o == nil || o.Fingerprint == nil { @@ -358,6 +373,7 @@ func (o *AlertObject) SetFingerprint(v string) { o.Fingerprint = &v } + // GetStartsAt returns the StartsAt field value if set, zero value otherwise. func (o *AlertObject) GetStartsAt() time.Time { if o == nil || o.StartsAt == nil { @@ -386,6 +402,7 @@ func (o *AlertObject) SetStartsAt(v time.Time) { o.StartsAt = &v } + // GetEndsAt returns the EndsAt field value if set, zero value otherwise. func (o *AlertObject) GetEndsAt() time.Time { if o == nil || o.EndsAt == nil { @@ -414,6 +431,7 @@ func (o *AlertObject) SetEndsAt(v time.Time) { o.EndsAt = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *AlertObject) GetStatus() AlertStatus { if o == nil || o.Status == nil { @@ -442,6 +460,7 @@ func (o *AlertObject) SetStatus(v AlertStatus) { o.Status = &v } + // GetCount returns the Count field value if set, zero value otherwise. func (o *AlertObject) GetCount() int32 { if o == nil || o.Count == nil { @@ -470,6 +489,7 @@ func (o *AlertObject) SetCount(v int32) { o.Count = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertObject) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -498,6 +518,8 @@ func (o *AlertObject) SetOrgName(v string) { o.OrgName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertObject) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -570,29 +592,29 @@ func (o AlertObject) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertObject) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - AlertName *string `json:"alertName,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Expr *string `json:"expr,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - Engine *string `json:"engine,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Pod *string `json:"pod,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Description *string `json:"description,omitempty"` - Fingerprint *string `json:"fingerprint,omitempty"` - StartsAt *time.Time `json:"startsAt,omitempty"` - EndsAt *time.Time `json:"endsAt,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - Count *int32 `json:"count,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + AlertName *string `json:"alertName,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Expr *string `json:"expr,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + Engine *string `json:"engine,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Pod *string `json:"pod,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + Description *string `json:"description,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + StartsAt *time.Time `json:"startsAt,omitempty"` + EndsAt *time.Time `json:"endsAt,omitempty"` + Status *AlertStatus `json:"status,omitempty"` + Count *int32 `json:"count,omitempty"` + OrgName *string `json:"orgName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "alertName", "groupName", "expr", "clusterName", "engine", "namespace", "pod", "severity", "description", "fingerprint", "startsAt", "endsAt", "status", "count", "orgName"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "alertName", "groupName", "expr", "clusterName", "engine", "namespace", "pod", "severity", "description", "fingerprint", "startsAt", "endsAt", "status", "count", "orgName", }) } else { return err } @@ -606,7 +628,7 @@ func (o *AlertObject) UnmarshalJSON(bytes []byte) (err error) { o.Engine = all.Engine o.Namespace = all.Namespace o.Pod = all.Pod - if all.Severity != nil && !all.Severity.IsValid() { + if all.Severity != nil &&!all.Severity.IsValid() { hasInvalidField = true } else { o.Severity = all.Severity @@ -615,7 +637,7 @@ func (o *AlertObject) UnmarshalJSON(bytes []byte) (err error) { o.Fingerprint = all.Fingerprint o.StartsAt = all.StartsAt o.EndsAt = all.EndsAt - if all.Status != nil && !all.Status.IsValid() { + if all.Status != nil &&!all.Status.IsValid() { hasInvalidField = true } else { o.Status = all.Status diff --git a/api/kbcloud/model_alert_object_list.go b/api/kbcloud/model_alert_object_list.go index 135ce3b0..5eb358e2 100644 --- a/api/kbcloud/model_alert_object_list.go +++ b/api/kbcloud/model_alert_object_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertObjectList AlertObjectList is a list of alert object + + +// AlertObjectList AlertObjectList is a list of alert object type AlertObjectList struct { // Items is the list of alert objects in the list Items []AlertObject `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertObjectList instantiates a new AlertObjectList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertObjectListWithDefaults() *AlertObjectList { this := AlertObjectList{} return &this } - // GetItems returns the Items field value. func (o *AlertObjectList) GetItems() []AlertObject { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertObjectList) SetItems(v []AlertObject) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertObjectList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertObjectList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertObjectList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertObjectList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertObjectList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertObject `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertObject `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertObjectList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_alert_receiver.go b/api/kbcloud/model_alert_receiver.go index 6a556d8e..727844f0 100644 --- a/api/kbcloud/model_alert_receiver.go +++ b/api/kbcloud/model_alert_receiver.go @@ -2,30 +2,36 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// AlertReceiver Alert receiver information + + +// AlertReceiver Alert receiver information type AlertReceiver struct { - CreatedAt *time.Time `json:"createdAt,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Category *AlertReceiverCategory `json:"category,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Category *AlertReceiverCategory `json:"category,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` UserGroup *AlertReceiverUserGroup `json:"userGroup,omitempty"` // Webhook config of alert receiver WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` - OrgName *string `json:"orgName,omitempty"` + OrgName *string `json:"orgName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertReceiver instantiates a new AlertReceiver object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewAlertReceiverWithDefaults() *AlertReceiver { this := AlertReceiver{} return &this } - // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AlertReceiver) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -71,6 +76,7 @@ func (o *AlertReceiver) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *AlertReceiver) GetId() string { if o == nil || o.Id == nil { @@ -99,6 +105,7 @@ func (o *AlertReceiver) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *AlertReceiver) GetName() string { if o == nil || o.Name == nil { @@ -127,6 +134,7 @@ func (o *AlertReceiver) SetName(v string) { o.Name = &v } + // GetCategory returns the Category field value if set, zero value otherwise. func (o *AlertReceiver) GetCategory() AlertReceiverCategory { if o == nil || o.Category == nil { @@ -155,6 +163,7 @@ func (o *AlertReceiver) SetCategory(v AlertReceiverCategory) { o.Category = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AlertReceiver) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -183,6 +192,7 @@ func (o *AlertReceiver) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetUserGroup returns the UserGroup field value if set, zero value otherwise. func (o *AlertReceiver) GetUserGroup() AlertReceiverUserGroup { if o == nil || o.UserGroup == nil { @@ -211,6 +221,7 @@ func (o *AlertReceiver) SetUserGroup(v AlertReceiverUserGroup) { o.UserGroup = &v } + // GetWebhookConfig returns the WebhookConfig field value if set, zero value otherwise. func (o *AlertReceiver) GetWebhookConfig() WebhookConfig { if o == nil || o.WebhookConfig == nil { @@ -239,6 +250,7 @@ func (o *AlertReceiver) SetWebhookConfig(v WebhookConfig) { o.WebhookConfig = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertReceiver) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -267,6 +279,8 @@ func (o *AlertReceiver) SetOrgName(v string) { o.OrgName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertReceiver) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -315,21 +329,21 @@ func (o AlertReceiver) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertReceiver) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CreatedAt *time.Time `json:"createdAt,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Category *AlertReceiverCategory `json:"category,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - UserGroup *AlertReceiverUserGroup `json:"userGroup,omitempty"` - WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` - OrgName *string `json:"orgName,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Category *AlertReceiverCategory `json:"category,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UserGroup *AlertReceiverUserGroup `json:"userGroup,omitempty"` + WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` + OrgName *string `json:"orgName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"createdAt", "id", "name", "category", "updatedAt", "userGroup", "webhookConfig", "orgName"}) + common.DeleteKeys(additionalProperties, &[]string{ "createdAt", "id", "name", "category", "updatedAt", "userGroup", "webhookConfig", "orgName", }) } else { return err } @@ -338,17 +352,17 @@ func (o *AlertReceiver) UnmarshalJSON(bytes []byte) (err error) { o.CreatedAt = all.CreatedAt o.Id = all.Id o.Name = all.Name - if all.Category != nil && !all.Category.IsValid() { + if all.Category != nil &&!all.Category.IsValid() { hasInvalidField = true } else { o.Category = all.Category } o.UpdatedAt = all.UpdatedAt - if all.UserGroup != nil && all.UserGroup.UnparsedObject != nil && o.UnparsedObject == nil { + if all.UserGroup != nil && all.UserGroup.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.UserGroup = all.UserGroup - if all.WebhookConfig != nil && all.WebhookConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.WebhookConfig != nil && all.WebhookConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.WebhookConfig = all.WebhookConfig diff --git a/api/kbcloud/model_alert_receiver_category.go b/api/kbcloud/model_alert_receiver_category.go index 653678c1..f1672da2 100644 --- a/api/kbcloud/model_alert_receiver_category.go +++ b/api/kbcloud/model_alert_receiver_category.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertReceiverCategory string // List of AlertReceiverCategory. const ( - AlertReceiverCategoryFeishu AlertReceiverCategory = "feishu" - AlertReceiverCategoryWechat AlertReceiverCategory = "wechat" - AlertReceiverCategoryDingtalk AlertReceiverCategory = "dingtalk" + AlertReceiverCategoryFeishu AlertReceiverCategory = "feishu" + AlertReceiverCategoryWechat AlertReceiverCategory = "wechat" + AlertReceiverCategoryDingtalk AlertReceiverCategory = "dingtalk" AlertReceiverCategoryReceiverGroup AlertReceiverCategory = "receiver-group" - AlertReceiverCategoryWebhook AlertReceiverCategory = "webhook" + AlertReceiverCategoryWebhook AlertReceiverCategory = "webhook" ) var allowedAlertReceiverCategoryEnumValues = []AlertReceiverCategory{ diff --git a/api/kbcloud/model_alert_receiver_list.go b/api/kbcloud/model_alert_receiver_list.go index 9f37c6e5..53a73005 100644 --- a/api/kbcloud/model_alert_receiver_list.go +++ b/api/kbcloud/model_alert_receiver_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertReceiverList AlertReceiverList is a list of alert receivers + + +// AlertReceiverList AlertReceiverList is a list of alert receivers type AlertReceiverList struct { // Items is the list of alert receiver objects in the list Items []AlertReceiver `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertReceiverList instantiates a new AlertReceiverList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertReceiverListWithDefaults() *AlertReceiverList { this := AlertReceiverList{} return &this } - // GetItems returns the Items field value. func (o *AlertReceiverList) GetItems() []AlertReceiver { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertReceiverList) SetItems(v []AlertReceiver) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertReceiverList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertReceiverList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertReceiverList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertReceiverList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertReceiverList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertReceiver `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertReceiver `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertReceiverList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_alert_receiver_user_group.go b/api/kbcloud/model_alert_receiver_user_group.go index 2e4cab55..8d978b3d 100644 --- a/api/kbcloud/model_alert_receiver_user_group.go +++ b/api/kbcloud/model_alert_receiver_user_group.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AlertReceiverUserGroup struct { - EmailEnabled *bool `json:"emailEnabled,omitempty"` - Ids []string `json:"ids,omitempty"` - SmsEnabled *bool `json:"smsEnabled,omitempty"` + EmailEnabled *bool `json:"emailEnabled,omitempty"` + Ids []string `json:"ids,omitempty"` + SmsEnabled *bool `json:"smsEnabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertReceiverUserGroup instantiates a new AlertReceiverUserGroup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewAlertReceiverUserGroupWithDefaults() *AlertReceiverUserGroup { this := AlertReceiverUserGroup{} return &this } - // GetEmailEnabled returns the EmailEnabled field value if set, zero value otherwise. func (o *AlertReceiverUserGroup) GetEmailEnabled() bool { if o == nil || o.EmailEnabled == nil { @@ -60,6 +69,7 @@ func (o *AlertReceiverUserGroup) SetEmailEnabled(v bool) { o.EmailEnabled = &v } + // GetIds returns the Ids field value if set, zero value otherwise. func (o *AlertReceiverUserGroup) GetIds() []string { if o == nil || o.Ids == nil { @@ -88,6 +98,7 @@ func (o *AlertReceiverUserGroup) SetIds(v []string) { o.Ids = v } + // GetSmsEnabled returns the SmsEnabled field value if set, zero value otherwise. func (o *AlertReceiverUserGroup) GetSmsEnabled() bool { if o == nil || o.SmsEnabled == nil { @@ -116,6 +127,8 @@ func (o *AlertReceiverUserGroup) SetSmsEnabled(v bool) { o.SmsEnabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertReceiverUserGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -141,16 +154,16 @@ func (o AlertReceiverUserGroup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertReceiverUserGroup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EmailEnabled *bool `json:"emailEnabled,omitempty"` - Ids []string `json:"ids,omitempty"` - SmsEnabled *bool `json:"smsEnabled,omitempty"` + EmailEnabled *bool `json:"emailEnabled,omitempty"` + Ids []string `json:"ids,omitempty"` + SmsEnabled *bool `json:"smsEnabled,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"emailEnabled", "ids", "smsEnabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "emailEnabled", "ids", "smsEnabled", }) } else { return err } diff --git a/api/kbcloud/model_alert_rule.go b/api/kbcloud/model_alert_rule.go index 3fd14d8d..fdd5751c 100644 --- a/api/kbcloud/model_alert_rule.go +++ b/api/kbcloud/model_alert_rule.go @@ -2,35 +2,40 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertRule Alert rule information + + +// AlertRule Alert rule information type AlertRule struct { - Description *string `json:"description,omitempty"` - Summary *string `json:"summary,omitempty"` - AlertName string `json:"alertName"` - Expr *string `json:"expr,omitempty"` - For *string `json:"for,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Description *string `json:"description,omitempty"` + Summary *string `json:"summary,omitempty"` + AlertName string `json:"alertName"` + Expr *string `json:"expr,omitempty"` + For *string `json:"for,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` // Alert metric information - Metric *AlertMetric `json:"metric,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Metric *AlertMetric `json:"metric,omitempty"` + OrgName *string `json:"orgName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertRule instantiates a new AlertRule object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +57,6 @@ func NewAlertRuleWithDefaults() *AlertRule { this.Disabled = &disabled return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertRule) GetDescription() string { if o == nil || o.Description == nil { @@ -81,6 +85,7 @@ func (o *AlertRule) SetDescription(v string) { o.Description = &v } + // GetSummary returns the Summary field value if set, zero value otherwise. func (o *AlertRule) GetSummary() string { if o == nil || o.Summary == nil { @@ -109,6 +114,7 @@ func (o *AlertRule) SetSummary(v string) { o.Summary = &v } + // GetAlertName returns the AlertName field value. func (o *AlertRule) GetAlertName() string { if o == nil { @@ -132,6 +138,7 @@ func (o *AlertRule) SetAlertName(v string) { o.AlertName = v } + // GetExpr returns the Expr field value if set, zero value otherwise. func (o *AlertRule) GetExpr() string { if o == nil || o.Expr == nil { @@ -160,6 +167,7 @@ func (o *AlertRule) SetExpr(v string) { o.Expr = &v } + // GetFor returns the For field value if set, zero value otherwise. func (o *AlertRule) GetFor() string { if o == nil || o.For == nil { @@ -188,6 +196,7 @@ func (o *AlertRule) SetFor(v string) { o.For = &v } + // GetGroupName returns the GroupName field value if set, zero value otherwise. func (o *AlertRule) GetGroupName() string { if o == nil || o.GroupName == nil { @@ -216,6 +225,7 @@ func (o *AlertRule) SetGroupName(v string) { o.GroupName = &v } + // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *AlertRule) GetDisabled() bool { if o == nil || o.Disabled == nil { @@ -244,6 +254,7 @@ func (o *AlertRule) SetDisabled(v bool) { o.Disabled = &v } + // GetSeverity returns the Severity field value if set, zero value otherwise. func (o *AlertRule) GetSeverity() AlertSeverity { if o == nil || o.Severity == nil { @@ -272,6 +283,7 @@ func (o *AlertRule) SetSeverity(v AlertSeverity) { o.Severity = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AlertRule) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -300,6 +312,7 @@ func (o *AlertRule) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AlertRule) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -328,6 +341,7 @@ func (o *AlertRule) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetMetric returns the Metric field value if set, zero value otherwise. func (o *AlertRule) GetMetric() AlertMetric { if o == nil || o.Metric == nil { @@ -356,6 +370,7 @@ func (o *AlertRule) SetMetric(v AlertMetric) { o.Metric = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertRule) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -384,6 +399,8 @@ func (o *AlertRule) SetOrgName(v string) { o.OrgName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertRule) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -442,18 +459,18 @@ func (o AlertRule) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertRule) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Description *string `json:"description,omitempty"` - Summary *string `json:"summary,omitempty"` - AlertName *string `json:"alertName"` - Expr *string `json:"expr,omitempty"` - For *string `json:"for,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - Metric *AlertMetric `json:"metric,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Description *string `json:"description,omitempty"` + Summary *string `json:"summary,omitempty"` + AlertName *string `json:"alertName"` + Expr *string `json:"expr,omitempty"` + For *string `json:"for,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Metric *AlertMetric `json:"metric,omitempty"` + OrgName *string `json:"orgName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -463,7 +480,7 @@ func (o *AlertRule) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "summary", "alertName", "expr", "for", "groupName", "disabled", "severity", "createdAt", "updatedAt", "metric", "orgName"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "summary", "alertName", "expr", "for", "groupName", "disabled", "severity", "createdAt", "updatedAt", "metric", "orgName", }) } else { return err } @@ -476,14 +493,14 @@ func (o *AlertRule) UnmarshalJSON(bytes []byte) (err error) { o.For = all.For o.GroupName = all.GroupName o.Disabled = all.Disabled - if all.Severity != nil && !all.Severity.IsValid() { + if all.Severity != nil &&!all.Severity.IsValid() { hasInvalidField = true } else { o.Severity = all.Severity } o.CreatedAt = all.CreatedAt o.UpdatedAt = all.UpdatedAt - if all.Metric != nil && all.Metric.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Metric != nil && all.Metric.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Metric = all.Metric diff --git a/api/kbcloud/model_alert_rule_group.go b/api/kbcloud/model_alert_rule_group.go index 7c10d547..638db9a8 100644 --- a/api/kbcloud/model_alert_rule_group.go +++ b/api/kbcloud/model_alert_rule_group.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AlertRuleGroup struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Rules []AlertRule `json:"rules,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertRuleGroup instantiates a new AlertRuleGroup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewAlertRuleGroupWithDefaults() *AlertRuleGroup { this := AlertRuleGroup{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *AlertRuleGroup) GetName() string { if o == nil || o.Name == nil { @@ -59,6 +68,7 @@ func (o *AlertRuleGroup) SetName(v string) { o.Name = &v } + // GetRules returns the Rules field value if set, zero value otherwise. func (o *AlertRuleGroup) GetRules() []AlertRule { if o == nil || o.Rules == nil { @@ -87,6 +97,8 @@ func (o *AlertRuleGroup) SetRules(v []AlertRule) { o.Rules = v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertRuleGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,7 +121,7 @@ func (o AlertRuleGroup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertRuleGroup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Rules []AlertRule `json:"rules,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +129,7 @@ func (o *AlertRuleGroup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "rules"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "rules", }) } else { return err } diff --git a/api/kbcloud/model_alert_rule_list.go b/api/kbcloud/model_alert_rule_list.go index 9163501a..a7f00e50 100644 --- a/api/kbcloud/model_alert_rule_list.go +++ b/api/kbcloud/model_alert_rule_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertRuleList AlertRuleList is a list of alert rules + + +// AlertRuleList AlertRuleList is a list of alert rules type AlertRuleList struct { // Items is the list of alert rule objects in the list Items []AlertRuleGroup `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertRuleList instantiates a new AlertRuleList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertRuleListWithDefaults() *AlertRuleList { this := AlertRuleList{} return &this } - // GetItems returns the Items field value. func (o *AlertRuleList) GetItems() []AlertRuleGroup { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertRuleList) SetItems(v []AlertRuleGroup) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertRuleList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertRuleList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertRuleList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertRuleList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertRuleList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertRuleGroup `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertRuleGroup `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertRuleList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_alert_severity.go b/api/kbcloud/model_alert_severity.go index 06d986c3..4397974d 100644 --- a/api/kbcloud/model_alert_severity.go +++ b/api/kbcloud/model_alert_severity.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertSeverity string // List of AlertSeverity. const ( AlertSeverityCritical AlertSeverity = "critical" - AlertSeverityWarning AlertSeverity = "warning" - AlertSeverityInfo AlertSeverity = "info" + AlertSeverityWarning AlertSeverity = "warning" + AlertSeverityInfo AlertSeverity = "info" ) var allowedAlertSeverityEnumValues = []AlertSeverity{ diff --git a/api/kbcloud/model_alert_status.go b/api/kbcloud/model_alert_status.go index 7937459d..b871b166 100644 --- a/api/kbcloud/model_alert_status.go +++ b/api/kbcloud/model_alert_status.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type AlertStatus string // List of AlertStatus. const ( AlertStatusResolved AlertStatus = "resolved" - AlertStatusFiring AlertStatus = "firing" + AlertStatusFiring AlertStatus = "firing" ) var allowedAlertStatusEnumValues = []AlertStatus{ diff --git a/api/kbcloud/model_alert_strategy.go b/api/kbcloud/model_alert_strategy.go index 4a6609b6..fabf77be 100644 --- a/api/kbcloud/model_alert_strategy.go +++ b/api/kbcloud/model_alert_strategy.go @@ -2,39 +2,44 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertStrategy Alert strategy information + + +// AlertStrategy Alert strategy information type AlertStrategy struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - ReceiverIds []int32 `json:"receiverIds"` - Receivers []AlertReceiver `json:"receivers,omitempty"` - Envs []string `json:"envs,omitempty"` - Severities []string `json:"severities,omitempty"` - Rules []string `json:"rules,omitempty"` - RuleObjs []AlertRule `json:"ruleObjs,omitempty"` - Engines []string `json:"engines,omitempty"` - Clusters []string `json:"clusters,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - RepeatInterval *string `json:"repeatInterval,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + ReceiverIds []int32 `json:"receiverIds"` + Receivers []AlertReceiver `json:"receivers,omitempty"` + Envs []string `json:"envs,omitempty"` + Severities []string `json:"severities,omitempty"` + Rules []string `json:"rules,omitempty"` + RuleObjs []AlertRule `json:"ruleObjs,omitempty"` + Engines []string `json:"engines,omitempty"` + Clusters []string `json:"clusters,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + RepeatInterval *string `json:"repeatInterval,omitempty"` MuteTimeInterval *AlertStrategyMuteTimeInterval `json:"muteTimeInterval,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertStrategy instantiates a new AlertStrategy object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +61,6 @@ func NewAlertStrategyWithDefaults() *AlertStrategy { this.Disabled = &disabled return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *AlertStrategy) GetId() int32 { if o == nil || o.Id == nil { @@ -85,6 +89,7 @@ func (o *AlertStrategy) SetId(v int32) { o.Id = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AlertStrategy) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -113,6 +118,7 @@ func (o *AlertStrategy) SetOrgName(v string) { o.OrgName = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *AlertStrategy) GetName() string { if o == nil || o.Name == nil { @@ -141,6 +147,7 @@ func (o *AlertStrategy) SetName(v string) { o.Name = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *AlertStrategy) GetDescription() string { if o == nil || o.Description == nil { @@ -169,6 +176,7 @@ func (o *AlertStrategy) SetDescription(v string) { o.Description = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AlertStrategy) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -197,6 +205,7 @@ func (o *AlertStrategy) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AlertStrategy) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -225,6 +234,7 @@ func (o *AlertStrategy) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetReceiverIds returns the ReceiverIds field value. func (o *AlertStrategy) GetReceiverIds() []int32 { if o == nil { @@ -248,6 +258,7 @@ func (o *AlertStrategy) SetReceiverIds(v []int32) { o.ReceiverIds = v } + // GetReceivers returns the Receivers field value if set, zero value otherwise. func (o *AlertStrategy) GetReceivers() []AlertReceiver { if o == nil || o.Receivers == nil { @@ -276,6 +287,7 @@ func (o *AlertStrategy) SetReceivers(v []AlertReceiver) { o.Receivers = v } + // GetEnvs returns the Envs field value if set, zero value otherwise. func (o *AlertStrategy) GetEnvs() []string { if o == nil || o.Envs == nil { @@ -304,6 +316,7 @@ func (o *AlertStrategy) SetEnvs(v []string) { o.Envs = v } + // GetSeverities returns the Severities field value if set, zero value otherwise. func (o *AlertStrategy) GetSeverities() []string { if o == nil || o.Severities == nil { @@ -332,6 +345,7 @@ func (o *AlertStrategy) SetSeverities(v []string) { o.Severities = v } + // GetRules returns the Rules field value if set, zero value otherwise. func (o *AlertStrategy) GetRules() []string { if o == nil || o.Rules == nil { @@ -360,6 +374,7 @@ func (o *AlertStrategy) SetRules(v []string) { o.Rules = v } + // GetRuleObjs returns the RuleObjs field value if set, zero value otherwise. func (o *AlertStrategy) GetRuleObjs() []AlertRule { if o == nil || o.RuleObjs == nil { @@ -388,6 +403,7 @@ func (o *AlertStrategy) SetRuleObjs(v []AlertRule) { o.RuleObjs = v } + // GetEngines returns the Engines field value if set, zero value otherwise. func (o *AlertStrategy) GetEngines() []string { if o == nil || o.Engines == nil { @@ -416,6 +432,7 @@ func (o *AlertStrategy) SetEngines(v []string) { o.Engines = v } + // GetClusters returns the Clusters field value if set, zero value otherwise. func (o *AlertStrategy) GetClusters() []string { if o == nil || o.Clusters == nil { @@ -444,6 +461,7 @@ func (o *AlertStrategy) SetClusters(v []string) { o.Clusters = v } + // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *AlertStrategy) GetDisabled() bool { if o == nil || o.Disabled == nil { @@ -472,6 +490,7 @@ func (o *AlertStrategy) SetDisabled(v bool) { o.Disabled = &v } + // GetRepeatInterval returns the RepeatInterval field value if set, zero value otherwise. func (o *AlertStrategy) GetRepeatInterval() string { if o == nil || o.RepeatInterval == nil { @@ -500,6 +519,7 @@ func (o *AlertStrategy) SetRepeatInterval(v string) { o.RepeatInterval = &v } + // GetMuteTimeInterval returns the MuteTimeInterval field value if set, zero value otherwise. func (o *AlertStrategy) GetMuteTimeInterval() AlertStrategyMuteTimeInterval { if o == nil || o.MuteTimeInterval == nil { @@ -528,6 +548,8 @@ func (o *AlertStrategy) SetMuteTimeInterval(v AlertStrategyMuteTimeInterval) { o.MuteTimeInterval = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertStrategy) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -601,22 +623,22 @@ func (o AlertStrategy) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertStrategy) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - ReceiverIds *[]int32 `json:"receiverIds"` - Receivers []AlertReceiver `json:"receivers,omitempty"` - Envs []string `json:"envs,omitempty"` - Severities []string `json:"severities,omitempty"` - Rules []string `json:"rules,omitempty"` - RuleObjs []AlertRule `json:"ruleObjs,omitempty"` - Engines []string `json:"engines,omitempty"` - Clusters []string `json:"clusters,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - RepeatInterval *string `json:"repeatInterval,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + ReceiverIds *[]int32 `json:"receiverIds"` + Receivers []AlertReceiver `json:"receivers,omitempty"` + Envs []string `json:"envs,omitempty"` + Severities []string `json:"severities,omitempty"` + Rules []string `json:"rules,omitempty"` + RuleObjs []AlertRule `json:"ruleObjs,omitempty"` + Engines []string `json:"engines,omitempty"` + Clusters []string `json:"clusters,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + RepeatInterval *string `json:"repeatInterval,omitempty"` MuteTimeInterval *AlertStrategyMuteTimeInterval `json:"muteTimeInterval,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -627,7 +649,7 @@ func (o *AlertStrategy) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "orgName", "name", "description", "createdAt", "updatedAt", "receiverIds", "receivers", "envs", "severities", "rules", "ruleObjs", "engines", "clusters", "disabled", "repeatInterval", "muteTimeInterval"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "orgName", "name", "description", "createdAt", "updatedAt", "receiverIds", "receivers", "envs", "severities", "rules", "ruleObjs", "engines", "clusters", "disabled", "repeatInterval", "muteTimeInterval", }) } else { return err } @@ -649,7 +671,7 @@ func (o *AlertStrategy) UnmarshalJSON(bytes []byte) (err error) { o.Clusters = all.Clusters o.Disabled = all.Disabled o.RepeatInterval = all.RepeatInterval - if all.MuteTimeInterval != nil && all.MuteTimeInterval.UnparsedObject != nil && o.UnparsedObject == nil { + if all.MuteTimeInterval != nil && all.MuteTimeInterval.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.MuteTimeInterval = all.MuteTimeInterval diff --git a/api/kbcloud/model_alert_strategy_list.go b/api/kbcloud/model_alert_strategy_list.go index 2a3b8f9f..c2f78506 100644 --- a/api/kbcloud/model_alert_strategy_list.go +++ b/api/kbcloud/model_alert_strategy_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// AlertStrategyList AlertStrategyList is a list of alert strategies + + +// AlertStrategyList AlertStrategyList is a list of alert strategies type AlertStrategyList struct { // Items is the list of alert strategy objects in the list Items []AlertStrategy `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertStrategyList instantiates a new AlertStrategyList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewAlertStrategyListWithDefaults() *AlertStrategyList { this := AlertStrategyList{} return &this } - // GetItems returns the Items field value. func (o *AlertStrategyList) GetItems() []AlertStrategy { if o == nil { @@ -62,6 +67,7 @@ func (o *AlertStrategyList) SetItems(v []AlertStrategy) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *AlertStrategyList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *AlertStrategyList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertStrategyList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o AlertStrategyList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertStrategyList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]AlertStrategy `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]AlertStrategy `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *AlertStrategyList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_alert_strategy_mute_time_interval.go b/api/kbcloud/model_alert_strategy_mute_time_interval.go index 65ec5f34..41cae4c5 100644 --- a/api/kbcloud/model_alert_strategy_mute_time_interval.go +++ b/api/kbcloud/model_alert_strategy_mute_time_interval.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AlertStrategyMuteTimeInterval struct { - Weekdays []int32 `json:"weekdays,omitempty"` - Times *AlertStrategyMuteTimeIntervalTimes `json:"times,omitempty"` + Weekdays []int32 `json:"weekdays,omitempty"` + Times *AlertStrategyMuteTimeIntervalTimes `json:"times,omitempty"` // Only mute once for `onceMinutes` minutes OnceMinutes *int32 `json:"onceMinutes,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertStrategyMuteTimeInterval instantiates a new AlertStrategyMuteTimeInterval object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewAlertStrategyMuteTimeIntervalWithDefaults() *AlertStrategyMuteTimeInterv this := AlertStrategyMuteTimeInterval{} return &this } - // GetWeekdays returns the Weekdays field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeInterval) GetWeekdays() []int32 { if o == nil || o.Weekdays == nil { @@ -61,6 +70,7 @@ func (o *AlertStrategyMuteTimeInterval) SetWeekdays(v []int32) { o.Weekdays = v } + // GetTimes returns the Times field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeInterval) GetTimes() AlertStrategyMuteTimeIntervalTimes { if o == nil || o.Times == nil { @@ -89,6 +99,7 @@ func (o *AlertStrategyMuteTimeInterval) SetTimes(v AlertStrategyMuteTimeInterval o.Times = &v } + // GetOnceMinutes returns the OnceMinutes field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeInterval) GetOnceMinutes() int32 { if o == nil || o.OnceMinutes == nil { @@ -117,6 +128,8 @@ func (o *AlertStrategyMuteTimeInterval) SetOnceMinutes(v int32) { o.OnceMinutes = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertStrategyMuteTimeInterval) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -142,23 +155,23 @@ func (o AlertStrategyMuteTimeInterval) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AlertStrategyMuteTimeInterval) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Weekdays []int32 `json:"weekdays,omitempty"` - Times *AlertStrategyMuteTimeIntervalTimes `json:"times,omitempty"` - OnceMinutes *int32 `json:"onceMinutes,omitempty"` + Weekdays []int32 `json:"weekdays,omitempty"` + Times *AlertStrategyMuteTimeIntervalTimes `json:"times,omitempty"` + OnceMinutes *int32 `json:"onceMinutes,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"weekdays", "times", "onceMinutes"}) + common.DeleteKeys(additionalProperties, &[]string{ "weekdays", "times", "onceMinutes", }) } else { return err } hasInvalidField := false o.Weekdays = all.Weekdays - if all.Times != nil && all.Times.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Times != nil && all.Times.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Times = all.Times diff --git a/api/kbcloud/model_alert_strategy_mute_time_interval_times.go b/api/kbcloud/model_alert_strategy_mute_time_interval_times.go index 21810d71..1d2a3594 100644 --- a/api/kbcloud/model_alert_strategy_mute_time_interval_times.go +++ b/api/kbcloud/model_alert_strategy_mute_time_interval_times.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AlertStrategyMuteTimeIntervalTimes struct { // Mute start time, e.g. '17:00', should be in UTC time. StartTime *string `json:"startTime,omitempty"` // Mute end time, e.g. '24:00', should be in UTC time. EndTime *string `json:"endTime,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAlertStrategyMuteTimeIntervalTimes instantiates a new AlertStrategyMuteTimeIntervalTimes object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewAlertStrategyMuteTimeIntervalTimesWithDefaults() *AlertStrategyMuteTimeI this := AlertStrategyMuteTimeIntervalTimes{} return &this } - // GetStartTime returns the StartTime field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeIntervalTimes) GetStartTime() string { if o == nil || o.StartTime == nil { @@ -61,6 +70,7 @@ func (o *AlertStrategyMuteTimeIntervalTimes) SetStartTime(v string) { o.StartTime = &v } + // GetEndTime returns the EndTime field value if set, zero value otherwise. func (o *AlertStrategyMuteTimeIntervalTimes) GetEndTime() string { if o == nil || o.EndTime == nil { @@ -89,6 +99,8 @@ func (o *AlertStrategyMuteTimeIntervalTimes) SetEndTime(v string) { o.EndTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AlertStrategyMuteTimeIntervalTimes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,14 +124,14 @@ func (o AlertStrategyMuteTimeIntervalTimes) MarshalJSON() ([]byte, error) { func (o *AlertStrategyMuteTimeIntervalTimes) UnmarshalJSON(bytes []byte) (err error) { all := struct { StartTime *string `json:"startTime,omitempty"` - EndTime *string `json:"endTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"startTime", "endTime"}) + common.DeleteKeys(additionalProperties, &[]string{ "startTime", "endTime", }) } else { return err } diff --git a/api/kbcloud/model_analysis_result.go b/api/kbcloud/model_analysis_result.go index d41d01e9..8faf76c0 100644 --- a/api/kbcloud/model_analysis_result.go +++ b/api/kbcloud/model_analysis_result.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type AnalysisResult struct { Explanation *string `json:"explanation,omitempty"` - Error *string `json:"error,omitempty"` + Error *string `json:"error,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAnalysisResult instantiates a new AnalysisResult object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewAnalysisResultWithDefaults() *AnalysisResult { this := AnalysisResult{} return &this } - // GetExplanation returns the Explanation field value if set, zero value otherwise. func (o *AnalysisResult) GetExplanation() string { if o == nil || o.Explanation == nil { @@ -59,6 +68,7 @@ func (o *AnalysisResult) SetExplanation(v string) { o.Explanation = &v } + // GetError returns the Error field value if set, zero value otherwise. func (o *AnalysisResult) GetError() string { if o == nil || o.Error == nil { @@ -87,6 +97,8 @@ func (o *AnalysisResult) SetError(v string) { o.Error = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AnalysisResult) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,14 +122,14 @@ func (o AnalysisResult) MarshalJSON() ([]byte, error) { func (o *AnalysisResult) UnmarshalJSON(bytes []byte) (err error) { all := struct { Explanation *string `json:"explanation,omitempty"` - Error *string `json:"error,omitempty"` + Error *string `json:"error,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"explanation", "error"}) + common.DeleteKeys(additionalProperties, &[]string{ "explanation", "error", }) } else { return err } diff --git a/api/kbcloud/model_api_error_response.go b/api/kbcloud/model_api_error_response.go index d2448cbc..5084575e 100644 --- a/api/kbcloud/model_api_error_response.go +++ b/api/kbcloud/model_api_error_response.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// APIErrorResponse API error response. + + +// APIErrorResponse API error response. type APIErrorResponse struct { // The HTTP status code. Code int32 `json:"code"` @@ -19,10 +24,11 @@ type APIErrorResponse struct { // The message for the error. Message *string `json:"message,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAPIErrorResponse instantiates a new APIErrorResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewAPIErrorResponseWithDefaults() *APIErrorResponse { this := APIErrorResponse{} return &this } - // GetCode returns the Code field value. func (o *APIErrorResponse) GetCode() int32 { if o == nil { @@ -64,6 +69,7 @@ func (o *APIErrorResponse) SetCode(v int32) { o.Code = v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *APIErrorResponse) GetReason() string { if o == nil || o.Reason == nil { @@ -92,6 +98,7 @@ func (o *APIErrorResponse) SetReason(v string) { o.Reason = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *APIErrorResponse) GetMessage() string { if o == nil || o.Message == nil { @@ -120,6 +127,8 @@ func (o *APIErrorResponse) SetMessage(v string) { o.Message = &v } + + // MarshalJSON serializes the struct using spec logic. func (o APIErrorResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o APIErrorResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *APIErrorResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Code *int32 `json:"code"` - Reason *string `json:"reason,omitempty"` + Code *int32 `json:"code"` + Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *APIErrorResponse) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"code", "reason", "message"}) + common.DeleteKeys(additionalProperties, &[]string{ "code", "reason", "message", }) } else { return err } diff --git a/api/kbcloud/model_apikey.go b/api/kbcloud/model_apikey.go index 2bfd9b12..ecc1b6e9 100644 --- a/api/kbcloud/model_apikey.go +++ b/api/kbcloud/model_apikey.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Apikey APIKey is the key for API access + + +// Apikey APIKey is the key for API access type Apikey struct { // The name of the APIKey AccessKey string `json:"accessKey"` @@ -22,10 +26,11 @@ type Apikey struct { // The create time of APIKey CreateAt time.Time `json:"createAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewApikey instantiates a new Apikey object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +51,6 @@ func NewApikeyWithDefaults() *Apikey { this := Apikey{} return &this } - // GetAccessKey returns the AccessKey field value. func (o *Apikey) GetAccessKey() string { if o == nil { @@ -70,6 +74,7 @@ func (o *Apikey) SetAccessKey(v string) { o.AccessKey = v } + // GetDescription returns the Description field value. func (o *Apikey) GetDescription() string { if o == nil { @@ -93,6 +98,7 @@ func (o *Apikey) SetDescription(v string) { o.Description = v } + // GetExpiredAt returns the ExpiredAt field value. func (o *Apikey) GetExpiredAt() time.Time { if o == nil { @@ -116,6 +122,7 @@ func (o *Apikey) SetExpiredAt(v time.Time) { o.ExpiredAt = v } + // GetCreateAt returns the CreateAt field value. func (o *Apikey) GetCreateAt() time.Time { if o == nil { @@ -139,6 +146,8 @@ func (o *Apikey) SetCreateAt(v time.Time) { o.CreateAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o Apikey) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -167,10 +176,10 @@ func (o Apikey) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Apikey) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AccessKey *string `json:"accessKey"` - Description *string `json:"description"` - ExpiredAt *time.Time `json:"expiredAt"` - CreateAt *time.Time `json:"createAt"` + AccessKey *string `json:"accessKey"` + Description *string `json:"description"` + ExpiredAt *time.Time `json:"expiredAt"` + CreateAt *time.Time `json:"createAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -189,7 +198,7 @@ func (o *Apikey) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accessKey", "description", "expiredAt", "createAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "accessKey", "description", "expiredAt", "createAt", }) } else { return err } diff --git a/api/kbcloud/model_apikey_create.go b/api/kbcloud/model_apikey_create.go index e8877c03..bbf5e93b 100644 --- a/api/kbcloud/model_apikey_create.go +++ b/api/kbcloud/model_apikey_create.go @@ -2,26 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ApikeyCreate APIKeyCreate is the payload for creating an APIKey + + +// ApikeyCreate APIKeyCreate is the payload for creating an APIKey type ApikeyCreate struct { // The description of the APIKey Description string `json:"description"` // The expired time of the APIKey ExpiredAt time.Time `json:"expiredAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewApikeyCreate instantiates a new ApikeyCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +45,6 @@ func NewApikeyCreateWithDefaults() *ApikeyCreate { this := ApikeyCreate{} return &this } - // GetDescription returns the Description field value. func (o *ApikeyCreate) GetDescription() string { if o == nil { @@ -64,6 +68,7 @@ func (o *ApikeyCreate) SetDescription(v string) { o.Description = v } + // GetExpiredAt returns the ExpiredAt field value. func (o *ApikeyCreate) GetExpiredAt() time.Time { if o == nil { @@ -87,6 +92,8 @@ func (o *ApikeyCreate) SetExpiredAt(v time.Time) { o.ExpiredAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o ApikeyCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,8 +116,8 @@ func (o ApikeyCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ApikeyCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Description *string `json:"description"` - ExpiredAt *time.Time `json:"expiredAt"` + Description *string `json:"description"` + ExpiredAt *time.Time `json:"expiredAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -123,7 +130,7 @@ func (o *ApikeyCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "expiredAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "expiredAt", }) } else { return err } diff --git a/api/kbcloud/model_apikey_list.go b/api/kbcloud/model_apikey_list.go index 43f62a01..36f6cdaa 100644 --- a/api/kbcloud/model_apikey_list.go +++ b/api/kbcloud/model_apikey_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ApikeyList APIKeys is a list of APIKey objects + + +// ApikeyList APIKeys is a list of APIKey objects type ApikeyList struct { // Items is the list of APIKey objects in the list Items []Apikey `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewApikeyList instantiates a new ApikeyList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewApikeyListWithDefaults() *ApikeyList { this := ApikeyList{} return &this } - // GetItems returns the Items field value. func (o *ApikeyList) GetItems() []Apikey { if o == nil { @@ -62,6 +67,7 @@ func (o *ApikeyList) SetItems(v []Apikey) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *ApikeyList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *ApikeyList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ApikeyList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o ApikeyList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ApikeyList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Apikey `json:"items"` + Items *[]Apikey `json:"items"` PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,14 +129,14 @@ func (o *ApikeyList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_apikey_with_sk.go b/api/kbcloud/model_apikey_with_sk.go index c3e7a747..f35c9f9d 100644 --- a/api/kbcloud/model_apikey_with_sk.go +++ b/api/kbcloud/model_apikey_with_sk.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ApikeyWithSK APIKeyWithSK is the response for creating an APIKey + + +// ApikeyWithSK APIKeyWithSK is the response for creating an APIKey type ApikeyWithSK struct { // The accessKey of the APIKey AccessKey string `json:"accessKey"` @@ -24,10 +28,11 @@ type ApikeyWithSK struct { // The create time of APIKey CreateAt time.Time `json:"createAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewApikeyWithSK instantiates a new ApikeyWithSK object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -49,7 +54,6 @@ func NewApikeyWithSKWithDefaults() *ApikeyWithSK { this := ApikeyWithSK{} return &this } - // GetAccessKey returns the AccessKey field value. func (o *ApikeyWithSK) GetAccessKey() string { if o == nil { @@ -73,6 +77,7 @@ func (o *ApikeyWithSK) SetAccessKey(v string) { o.AccessKey = v } + // GetSecretKey returns the SecretKey field value. func (o *ApikeyWithSK) GetSecretKey() string { if o == nil { @@ -96,6 +101,7 @@ func (o *ApikeyWithSK) SetSecretKey(v string) { o.SecretKey = v } + // GetDescription returns the Description field value. func (o *ApikeyWithSK) GetDescription() string { if o == nil { @@ -119,6 +125,7 @@ func (o *ApikeyWithSK) SetDescription(v string) { o.Description = v } + // GetExpiredAt returns the ExpiredAt field value. func (o *ApikeyWithSK) GetExpiredAt() time.Time { if o == nil { @@ -142,6 +149,7 @@ func (o *ApikeyWithSK) SetExpiredAt(v time.Time) { o.ExpiredAt = v } + // GetCreateAt returns the CreateAt field value. func (o *ApikeyWithSK) GetCreateAt() time.Time { if o == nil { @@ -165,6 +173,8 @@ func (o *ApikeyWithSK) SetCreateAt(v time.Time) { o.CreateAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o ApikeyWithSK) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -194,11 +204,11 @@ func (o ApikeyWithSK) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ApikeyWithSK) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AccessKey *string `json:"accessKey"` - SecretKey *string `json:"secretKey"` - Description *string `json:"description"` - ExpiredAt *time.Time `json:"expiredAt"` - CreateAt *time.Time `json:"createAt"` + AccessKey *string `json:"accessKey"` + SecretKey *string `json:"secretKey"` + Description *string `json:"description"` + ExpiredAt *time.Time `json:"expiredAt"` + CreateAt *time.Time `json:"createAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -220,7 +230,7 @@ func (o *ApikeyWithSK) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accessKey", "secretKey", "description", "expiredAt", "createAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "accessKey", "secretKey", "description", "expiredAt", "createAt", }) } else { return err } diff --git a/api/kbcloud/model_auto_inspection.go b/api/kbcloud/model_auto_inspection.go index 84ea433a..f5f02096 100644 --- a/api/kbcloud/model_auto_inspection.go +++ b/api/kbcloud/model_auto_inspection.go @@ -2,35 +2,41 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type AutoInspection struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` - Creator *string `json:"creator,omitempty"` - Schedule *string `json:"schedule,omitempty"` + Creator *string `json:"creator,omitempty"` + Schedule *string `json:"schedule,omitempty"` // Specifies the unit of time for the auto inspection schedule. - RunEvery *AutoInspectionRunUnit `json:"runEvery,omitempty"` - DaysOfWeek []int32 `json:"daysOfWeek,omitempty"` - DaysOfMonth []int32 `json:"daysOfMonth,omitempty"` - Hour *int32 `json:"hour,omitempty"` - Minute *int32 `json:"minute,omitempty"` - SavedDays *int32 `json:"savedDays,omitempty"` - NextRunTime *time.Time `json:"nextRunTime,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + RunEvery *AutoInspectionRunUnit `json:"runEvery,omitempty"` + DaysOfWeek []int32 `json:"daysOfWeek,omitempty"` + DaysOfMonth []int32 `json:"daysOfMonth,omitempty"` + Hour *int32 `json:"hour,omitempty"` + Minute *int32 `json:"minute,omitempty"` + SavedDays *int32 `json:"savedDays,omitempty"` + NextRunTime *time.Time `json:"nextRunTime,omitempty"` + Enabled *bool `json:"enabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAutoInspection instantiates a new AutoInspection object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +53,6 @@ func NewAutoInspectionWithDefaults() *AutoInspection { this := AutoInspection{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *AutoInspection) GetId() int32 { if o == nil || o.Id == nil { @@ -76,6 +81,7 @@ func (o *AutoInspection) SetId(v int32) { o.Id = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *AutoInspection) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -104,6 +110,7 @@ func (o *AutoInspection) SetOrgName(v string) { o.OrgName = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AutoInspection) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -132,6 +139,7 @@ func (o *AutoInspection) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AutoInspection) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -160,6 +168,7 @@ func (o *AutoInspection) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetCreator returns the Creator field value if set, zero value otherwise. func (o *AutoInspection) GetCreator() string { if o == nil || o.Creator == nil { @@ -188,6 +197,7 @@ func (o *AutoInspection) SetCreator(v string) { o.Creator = &v } + // GetSchedule returns the Schedule field value if set, zero value otherwise. func (o *AutoInspection) GetSchedule() string { if o == nil || o.Schedule == nil { @@ -216,6 +226,7 @@ func (o *AutoInspection) SetSchedule(v string) { o.Schedule = &v } + // GetRunEvery returns the RunEvery field value if set, zero value otherwise. func (o *AutoInspection) GetRunEvery() AutoInspectionRunUnit { if o == nil || o.RunEvery == nil { @@ -244,6 +255,7 @@ func (o *AutoInspection) SetRunEvery(v AutoInspectionRunUnit) { o.RunEvery = &v } + // GetDaysOfWeek returns the DaysOfWeek field value if set, zero value otherwise. func (o *AutoInspection) GetDaysOfWeek() []int32 { if o == nil || o.DaysOfWeek == nil { @@ -272,6 +284,7 @@ func (o *AutoInspection) SetDaysOfWeek(v []int32) { o.DaysOfWeek = v } + // GetDaysOfMonth returns the DaysOfMonth field value if set, zero value otherwise. func (o *AutoInspection) GetDaysOfMonth() []int32 { if o == nil || o.DaysOfMonth == nil { @@ -300,6 +313,7 @@ func (o *AutoInspection) SetDaysOfMonth(v []int32) { o.DaysOfMonth = v } + // GetHour returns the Hour field value if set, zero value otherwise. func (o *AutoInspection) GetHour() int32 { if o == nil || o.Hour == nil { @@ -328,6 +342,7 @@ func (o *AutoInspection) SetHour(v int32) { o.Hour = &v } + // GetMinute returns the Minute field value if set, zero value otherwise. func (o *AutoInspection) GetMinute() int32 { if o == nil || o.Minute == nil { @@ -356,6 +371,7 @@ func (o *AutoInspection) SetMinute(v int32) { o.Minute = &v } + // GetSavedDays returns the SavedDays field value if set, zero value otherwise. func (o *AutoInspection) GetSavedDays() int32 { if o == nil || o.SavedDays == nil { @@ -384,6 +400,7 @@ func (o *AutoInspection) SetSavedDays(v int32) { o.SavedDays = &v } + // GetNextRunTime returns the NextRunTime field value if set, zero value otherwise. func (o *AutoInspection) GetNextRunTime() time.Time { if o == nil || o.NextRunTime == nil { @@ -412,6 +429,7 @@ func (o *AutoInspection) SetNextRunTime(v time.Time) { o.NextRunTime = &v } + // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *AutoInspection) GetEnabled() bool { if o == nil || o.Enabled == nil { @@ -440,6 +458,8 @@ func (o *AutoInspection) SetEnabled(v bool) { o.Enabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AutoInspection) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -510,27 +530,27 @@ func (o AutoInspection) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AutoInspection) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Creator *string `json:"creator,omitempty"` - Schedule *string `json:"schedule,omitempty"` - RunEvery *AutoInspectionRunUnit `json:"runEvery,omitempty"` - DaysOfWeek []int32 `json:"daysOfWeek,omitempty"` - DaysOfMonth []int32 `json:"daysOfMonth,omitempty"` - Hour *int32 `json:"hour,omitempty"` - Minute *int32 `json:"minute,omitempty"` - SavedDays *int32 `json:"savedDays,omitempty"` - NextRunTime *time.Time `json:"nextRunTime,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Creator *string `json:"creator,omitempty"` + Schedule *string `json:"schedule,omitempty"` + RunEvery *AutoInspectionRunUnit `json:"runEvery,omitempty"` + DaysOfWeek []int32 `json:"daysOfWeek,omitempty"` + DaysOfMonth []int32 `json:"daysOfMonth,omitempty"` + Hour *int32 `json:"hour,omitempty"` + Minute *int32 `json:"minute,omitempty"` + SavedDays *int32 `json:"savedDays,omitempty"` + NextRunTime *time.Time `json:"nextRunTime,omitempty"` + Enabled *bool `json:"enabled,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "orgName", "updatedAt", "createdAt", "creator", "schedule", "runEvery", "daysOfWeek", "daysOfMonth", "hour", "minute", "savedDays", "nextRunTime", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "orgName", "updatedAt", "createdAt", "creator", "schedule", "runEvery", "daysOfWeek", "daysOfMonth", "hour", "minute", "savedDays", "nextRunTime", "enabled", }) } else { return err } @@ -542,7 +562,7 @@ func (o *AutoInspection) UnmarshalJSON(bytes []byte) (err error) { o.CreatedAt = all.CreatedAt o.Creator = all.Creator o.Schedule = all.Schedule - if all.RunEvery != nil && !all.RunEvery.IsValid() { + if all.RunEvery != nil &&!all.RunEvery.IsValid() { hasInvalidField = true } else { o.RunEvery = all.RunEvery diff --git a/api/kbcloud/model_auto_inspection_run_unit.go b/api/kbcloud/model_auto_inspection_run_unit.go index 0c98102d..71b32845 100644 --- a/api/kbcloud/model_auto_inspection_run_unit.go +++ b/api/kbcloud/model_auto_inspection_run_unit.go @@ -2,22 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // AutoInspectionRunUnit Specifies the unit of time for the auto inspection schedule. type AutoInspectionRunUnit string // List of AutoInspectionRunUnit. const ( - AutoInspectionRunUnitHour AutoInspectionRunUnit = "hour" - AutoInspectionRunUnitDay AutoInspectionRunUnit = "day" - AutoInspectionRunUnitWeek AutoInspectionRunUnit = "week" + AutoInspectionRunUnitHour AutoInspectionRunUnit = "hour" + AutoInspectionRunUnitDay AutoInspectionRunUnit = "day" + AutoInspectionRunUnitWeek AutoInspectionRunUnit = "week" AutoInspectionRunUnitMonth AutoInspectionRunUnit = "month" ) diff --git a/api/kbcloud/model_autohealing_list_item.go b/api/kbcloud/model_autohealing_list_item.go index 779caf66..78711c83 100644 --- a/api/kbcloud/model_autohealing_list_item.go +++ b/api/kbcloud/model_autohealing_list_item.go @@ -2,16 +2,21 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type AutohealingListItem struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` // component to be rebuilt @@ -23,18 +28,19 @@ type AutohealingListItem struct { // current phase of rebuild job Phase *string `json:"phase,omitempty"` // whether the job is started - Started *bool `json:"started,omitempty"` + Started *bool `json:"started,omitempty"` StartMessage *string `json:"startMessage,omitempty"` // whether the job is finished - Finished *bool `json:"finished,omitempty"` - FinishMessage *string `json:"finishMessage,omitempty"` - BackupName *string `json:"backupName,omitempty"` + Finished *bool `json:"finished,omitempty"` + FinishMessage *string `json:"finishMessage,omitempty"` + BackupName *string `json:"backupName,omitempty"` RebuildInstanceOpsRequestName *string `json:"rebuildInstanceOpsRequestName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewAutohealingListItem instantiates a new AutohealingListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -51,7 +57,6 @@ func NewAutohealingListItemWithDefaults() *AutohealingListItem { this := AutohealingListItem{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *AutohealingListItem) GetName() string { if o == nil || o.Name == nil { @@ -80,6 +85,7 @@ func (o *AutohealingListItem) SetName(v string) { o.Name = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *AutohealingListItem) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -108,6 +114,7 @@ func (o *AutohealingListItem) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *AutohealingListItem) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -136,6 +143,7 @@ func (o *AutohealingListItem) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *AutohealingListItem) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -164,6 +172,7 @@ func (o *AutohealingListItem) SetComponentName(v string) { o.ComponentName = &v } + // GetPodName returns the PodName field value if set, zero value otherwise. func (o *AutohealingListItem) GetPodName() string { if o == nil || o.PodName == nil { @@ -192,6 +201,7 @@ func (o *AutohealingListItem) SetPodName(v string) { o.PodName = &v } + // GetStartTime returns the StartTime field value if set, zero value otherwise. func (o *AutohealingListItem) GetStartTime() time.Time { if o == nil || o.StartTime == nil { @@ -220,6 +230,7 @@ func (o *AutohealingListItem) SetStartTime(v time.Time) { o.StartTime = &v } + // GetPhase returns the Phase field value if set, zero value otherwise. func (o *AutohealingListItem) GetPhase() string { if o == nil || o.Phase == nil { @@ -248,6 +259,7 @@ func (o *AutohealingListItem) SetPhase(v string) { o.Phase = &v } + // GetStarted returns the Started field value if set, zero value otherwise. func (o *AutohealingListItem) GetStarted() bool { if o == nil || o.Started == nil { @@ -276,6 +288,7 @@ func (o *AutohealingListItem) SetStarted(v bool) { o.Started = &v } + // GetStartMessage returns the StartMessage field value if set, zero value otherwise. func (o *AutohealingListItem) GetStartMessage() string { if o == nil || o.StartMessage == nil { @@ -304,6 +317,7 @@ func (o *AutohealingListItem) SetStartMessage(v string) { o.StartMessage = &v } + // GetFinished returns the Finished field value if set, zero value otherwise. func (o *AutohealingListItem) GetFinished() bool { if o == nil || o.Finished == nil { @@ -332,6 +346,7 @@ func (o *AutohealingListItem) SetFinished(v bool) { o.Finished = &v } + // GetFinishMessage returns the FinishMessage field value if set, zero value otherwise. func (o *AutohealingListItem) GetFinishMessage() string { if o == nil || o.FinishMessage == nil { @@ -360,6 +375,7 @@ func (o *AutohealingListItem) SetFinishMessage(v string) { o.FinishMessage = &v } + // GetBackupName returns the BackupName field value if set, zero value otherwise. func (o *AutohealingListItem) GetBackupName() string { if o == nil || o.BackupName == nil { @@ -388,6 +404,7 @@ func (o *AutohealingListItem) SetBackupName(v string) { o.BackupName = &v } + // GetRebuildInstanceOpsRequestName returns the RebuildInstanceOpsRequestName field value if set, zero value otherwise. func (o *AutohealingListItem) GetRebuildInstanceOpsRequestName() string { if o == nil || o.RebuildInstanceOpsRequestName == nil { @@ -416,6 +433,8 @@ func (o *AutohealingListItem) SetRebuildInstanceOpsRequestName(v string) { o.RebuildInstanceOpsRequestName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o AutohealingListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -483,26 +502,26 @@ func (o AutohealingListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AutohealingListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - ComponentName *string `json:"componentName,omitempty"` - PodName *string `json:"podName,omitempty"` - StartTime *time.Time `json:"startTime,omitempty"` - Phase *string `json:"phase,omitempty"` - Started *bool `json:"started,omitempty"` - StartMessage *string `json:"startMessage,omitempty"` - Finished *bool `json:"finished,omitempty"` - FinishMessage *string `json:"finishMessage,omitempty"` - BackupName *string `json:"backupName,omitempty"` - RebuildInstanceOpsRequestName *string `json:"rebuildInstanceOpsRequestName,omitempty"` + Name *string `json:"name,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + ComponentName *string `json:"componentName,omitempty"` + PodName *string `json:"podName,omitempty"` + StartTime *time.Time `json:"startTime,omitempty"` + Phase *string `json:"phase,omitempty"` + Started *bool `json:"started,omitempty"` + StartMessage *string `json:"startMessage,omitempty"` + Finished *bool `json:"finished,omitempty"` + FinishMessage *string `json:"finishMessage,omitempty"` + BackupName *string `json:"backupName,omitempty"` + RebuildInstanceOpsRequestName *string `json:"rebuildInstanceOpsRequestName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "createdAt", "updatedAt", "componentName", "podName", "startTime", "phase", "started", "startMessage", "finished", "finishMessage", "backupName", "rebuildInstanceOpsRequestName"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "createdAt", "updatedAt", "componentName", "podName", "startTime", "phase", "started", "startMessage", "finished", "finishMessage", "backupName", "rebuildInstanceOpsRequestName", }) } else { return err } diff --git a/api/kbcloud/model_backup.go b/api/kbcloud/model_backup.go index db9a1a78..2cb84560 100644 --- a/api/kbcloud/model_backup.go +++ b/api/kbcloud/model_backup.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Backup backup is the payload for KubeBlocks cluster backup + + +// Backup backup is the payload for KubeBlocks cluster backup type Backup struct { // autoBackup or not AutoBackup bool `json:"autoBackup"` @@ -46,9 +50,9 @@ type Backup struct { // timeRangeStart records the start time of the backup. TimeRangeStart *time.Time `json:"timeRangeStart,omitempty"` // Backup total size. A string with capacity units in the form of "1Gi", "1Mi", "1Ki". - TotalSize string `json:"totalSize"` + TotalSize string `json:"totalSize"` FailureReason *string `json:"failureReason,omitempty"` - Extras *string `json:"extras,omitempty"` + Extras *string `json:"extras,omitempty"` // backup target pods TargetPods []string `json:"targetPods,omitempty"` // the path of backup files @@ -70,10 +74,11 @@ type Backup struct { // the cluster engine Engine *string `json:"engine,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackup instantiates a new Backup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -104,7 +109,6 @@ func NewBackupWithDefaults() *Backup { this := Backup{} return &this } - // GetAutoBackup returns the AutoBackup field value. func (o *Backup) GetAutoBackup() bool { if o == nil { @@ -128,6 +132,7 @@ func (o *Backup) SetAutoBackup(v bool) { o.AutoBackup = v } + // GetBackupMethod returns the BackupMethod field value. func (o *Backup) GetBackupMethod() string { if o == nil { @@ -151,6 +156,7 @@ func (o *Backup) SetBackupMethod(v string) { o.BackupMethod = v } + // GetBackupPolicyName returns the BackupPolicyName field value. func (o *Backup) GetBackupPolicyName() string { if o == nil { @@ -174,6 +180,7 @@ func (o *Backup) SetBackupPolicyName(v string) { o.BackupPolicyName = v } + // GetBackupRepo returns the BackupRepo field value if set, zero value otherwise. func (o *Backup) GetBackupRepo() string { if o == nil || o.BackupRepo == nil { @@ -202,6 +209,7 @@ func (o *Backup) SetBackupRepo(v string) { o.BackupRepo = &v } + // GetBackupType returns the BackupType field value. func (o *Backup) GetBackupType() BackupType { if o == nil { @@ -225,6 +233,7 @@ func (o *Backup) SetBackupType(v BackupType) { o.BackupType = v } + // GetCompletionTimestamp returns the CompletionTimestamp field value. func (o *Backup) GetCompletionTimestamp() time.Time { if o == nil { @@ -248,6 +257,7 @@ func (o *Backup) SetCompletionTimestamp(v time.Time) { o.CompletionTimestamp = v } + // GetCreationTimestamp returns the CreationTimestamp field value. func (o *Backup) GetCreationTimestamp() time.Time { if o == nil { @@ -271,6 +281,7 @@ func (o *Backup) SetCreationTimestamp(v time.Time) { o.CreationTimestamp = v } + // GetDuration returns the Duration field value. func (o *Backup) GetDuration() string { if o == nil { @@ -294,6 +305,7 @@ func (o *Backup) SetDuration(v string) { o.Duration = v } + // GetName returns the Name field value. func (o *Backup) GetName() string { if o == nil { @@ -317,6 +329,7 @@ func (o *Backup) SetName(v string) { o.Name = v } + // GetOrgName returns the OrgName field value. func (o *Backup) GetOrgName() string { if o == nil { @@ -340,6 +353,7 @@ func (o *Backup) SetOrgName(v string) { o.OrgName = v } + // GetSnapshotVolumes returns the SnapshotVolumes field value. func (o *Backup) GetSnapshotVolumes() bool { if o == nil { @@ -363,6 +377,7 @@ func (o *Backup) SetSnapshotVolumes(v bool) { o.SnapshotVolumes = v } + // GetSourceCluster returns the SourceCluster field value. func (o *Backup) GetSourceCluster() string { if o == nil { @@ -386,6 +401,7 @@ func (o *Backup) SetSourceCluster(v string) { o.SourceCluster = v } + // GetStartTimestamp returns the StartTimestamp field value. func (o *Backup) GetStartTimestamp() time.Time { if o == nil { @@ -409,6 +425,7 @@ func (o *Backup) SetStartTimestamp(v time.Time) { o.StartTimestamp = v } + // GetStatus returns the Status field value. func (o *Backup) GetStatus() BackupStatus { if o == nil { @@ -432,6 +449,7 @@ func (o *Backup) SetStatus(v BackupStatus) { o.Status = v } + // GetTimeRangeEnd returns the TimeRangeEnd field value if set, zero value otherwise. func (o *Backup) GetTimeRangeEnd() time.Time { if o == nil || o.TimeRangeEnd == nil { @@ -460,6 +478,7 @@ func (o *Backup) SetTimeRangeEnd(v time.Time) { o.TimeRangeEnd = &v } + // GetTimeRangeStart returns the TimeRangeStart field value if set, zero value otherwise. func (o *Backup) GetTimeRangeStart() time.Time { if o == nil || o.TimeRangeStart == nil { @@ -488,6 +507,7 @@ func (o *Backup) SetTimeRangeStart(v time.Time) { o.TimeRangeStart = &v } + // GetTotalSize returns the TotalSize field value. func (o *Backup) GetTotalSize() string { if o == nil { @@ -511,6 +531,7 @@ func (o *Backup) SetTotalSize(v string) { o.TotalSize = v } + // GetFailureReason returns the FailureReason field value if set, zero value otherwise. func (o *Backup) GetFailureReason() string { if o == nil || o.FailureReason == nil { @@ -539,6 +560,7 @@ func (o *Backup) SetFailureReason(v string) { o.FailureReason = &v } + // GetExtras returns the Extras field value if set, zero value otherwise. func (o *Backup) GetExtras() string { if o == nil || o.Extras == nil { @@ -567,6 +589,7 @@ func (o *Backup) SetExtras(v string) { o.Extras = &v } + // GetTargetPods returns the TargetPods field value if set, zero value otherwise. func (o *Backup) GetTargetPods() []string { if o == nil || o.TargetPods == nil { @@ -595,6 +618,7 @@ func (o *Backup) SetTargetPods(v []string) { o.TargetPods = v } + // GetPath returns the Path field value if set, zero value otherwise. func (o *Backup) GetPath() string { if o == nil || o.Path == nil { @@ -623,6 +647,7 @@ func (o *Backup) SetPath(v string) { o.Path = &v } + // GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. func (o *Backup) GetRetentionPeriod() string { if o == nil || o.RetentionPeriod == nil { @@ -651,6 +676,7 @@ func (o *Backup) SetRetentionPeriod(v string) { o.RetentionPeriod = &v } + // GetExpiration returns the Expiration field value if set, zero value otherwise. func (o *Backup) GetExpiration() time.Time { if o == nil || o.Expiration == nil { @@ -679,6 +705,7 @@ func (o *Backup) SetExpiration(v time.Time) { o.Expiration = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *Backup) GetId() string { if o == nil || o.Id == nil { @@ -707,6 +734,7 @@ func (o *Backup) SetId(v string) { o.Id = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *Backup) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -735,6 +763,7 @@ func (o *Backup) SetClusterId(v string) { o.ClusterId = &v } + // GetCloudProvider returns the CloudProvider field value if set, zero value otherwise. func (o *Backup) GetCloudProvider() string { if o == nil || o.CloudProvider == nil { @@ -763,6 +792,7 @@ func (o *Backup) SetCloudProvider(v string) { o.CloudProvider = &v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *Backup) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -791,6 +821,7 @@ func (o *Backup) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetEnvironmentName returns the EnvironmentName field value if set, zero value otherwise. func (o *Backup) GetEnvironmentName() string { if o == nil || o.EnvironmentName == nil { @@ -819,6 +850,7 @@ func (o *Backup) SetEnvironmentName(v string) { o.EnvironmentName = &v } + // GetEngine returns the Engine field value if set, zero value otherwise. func (o *Backup) GetEngine() string { if o == nil || o.Engine == nil { @@ -847,6 +879,8 @@ func (o *Backup) SetEngine(v string) { o.Engine = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Backup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -946,35 +980,35 @@ func (o Backup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Backup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AutoBackup *bool `json:"autoBackup"` - BackupMethod *string `json:"backupMethod"` - BackupPolicyName *string `json:"backupPolicyName"` - BackupRepo *string `json:"backupRepo,omitempty"` - BackupType *BackupType `json:"backupType"` - CompletionTimestamp *time.Time `json:"completionTimestamp"` - CreationTimestamp *time.Time `json:"creationTimestamp"` - Duration *string `json:"duration"` - Name *string `json:"name"` - OrgName *string `json:"orgName"` - SnapshotVolumes *bool `json:"snapshotVolumes"` - SourceCluster *string `json:"sourceCluster"` - StartTimestamp *time.Time `json:"startTimestamp"` - Status *BackupStatus `json:"status"` - TimeRangeEnd *time.Time `json:"timeRangeEnd,omitempty"` - TimeRangeStart *time.Time `json:"timeRangeStart,omitempty"` - TotalSize *string `json:"totalSize"` - FailureReason *string `json:"failureReason,omitempty"` - Extras *string `json:"extras,omitempty"` - TargetPods []string `json:"targetPods,omitempty"` - Path *string `json:"path,omitempty"` - RetentionPeriod *string `json:"retentionPeriod,omitempty"` - Expiration *time.Time `json:"expiration,omitempty"` - Id *string `json:"id,omitempty"` - ClusterId *string `json:"clusterId,omitempty"` - CloudProvider *string `json:"cloudProvider,omitempty"` - CloudRegion *string `json:"cloudRegion,omitempty"` - EnvironmentName *string `json:"environmentName,omitempty"` - Engine *string `json:"engine,omitempty"` + AutoBackup *bool `json:"autoBackup"` + BackupMethod *string `json:"backupMethod"` + BackupPolicyName *string `json:"backupPolicyName"` + BackupRepo *string `json:"backupRepo,omitempty"` + BackupType *BackupType `json:"backupType"` + CompletionTimestamp *time.Time `json:"completionTimestamp"` + CreationTimestamp *time.Time `json:"creationTimestamp"` + Duration *string `json:"duration"` + Name *string `json:"name"` + OrgName *string `json:"orgName"` + SnapshotVolumes *bool `json:"snapshotVolumes"` + SourceCluster *string `json:"sourceCluster"` + StartTimestamp *time.Time `json:"startTimestamp"` + Status *BackupStatus `json:"status"` + TimeRangeEnd *time.Time `json:"timeRangeEnd,omitempty"` + TimeRangeStart *time.Time `json:"timeRangeStart,omitempty"` + TotalSize *string `json:"totalSize"` + FailureReason *string `json:"failureReason,omitempty"` + Extras *string `json:"extras,omitempty"` + TargetPods []string `json:"targetPods,omitempty"` + Path *string `json:"path,omitempty"` + RetentionPeriod *string `json:"retentionPeriod,omitempty"` + Expiration *time.Time `json:"expiration,omitempty"` + Id *string `json:"id,omitempty"` + ClusterId *string `json:"clusterId,omitempty"` + CloudProvider *string `json:"cloudProvider,omitempty"` + CloudRegion *string `json:"cloudRegion,omitempty"` + EnvironmentName *string `json:"environmentName,omitempty"` + Engine *string `json:"engine,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -1023,7 +1057,7 @@ func (o *Backup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"autoBackup", "backupMethod", "backupPolicyName", "backupRepo", "backupType", "completionTimestamp", "creationTimestamp", "duration", "name", "orgName", "snapshotVolumes", "sourceCluster", "startTimestamp", "status", "timeRangeEnd", "timeRangeStart", "totalSize", "failureReason", "extras", "targetPods", "path", "retentionPeriod", "expiration", "id", "clusterId", "cloudProvider", "cloudRegion", "environmentName", "engine"}) + common.DeleteKeys(additionalProperties, &[]string{ "autoBackup", "backupMethod", "backupPolicyName", "backupRepo", "backupType", "completionTimestamp", "creationTimestamp", "duration", "name", "orgName", "snapshotVolumes", "sourceCluster", "startTimestamp", "status", "timeRangeEnd", "timeRangeStart", "totalSize", "failureReason", "extras", "targetPods", "path", "retentionPeriod", "expiration", "id", "clusterId", "cloudProvider", "cloudRegion", "environmentName", "engine", }) } else { return err } diff --git a/api/kbcloud/model_backup_create.go b/api/kbcloud/model_backup_create.go index 1fbcf0c6..04054d49 100644 --- a/api/kbcloud/model_backup_create.go +++ b/api/kbcloud/model_backup_create.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupCreate BackupCreate is the payload to create a KubeBlocks cluster backup + + +// BackupCreate BackupCreate is the payload to create a KubeBlocks cluster backup type BackupCreate struct { // name of the backup, if not specified, a name will be generated automatically Name *string `json:"name,omitempty"` // specified the backup method BackupMethod string `json:"backupMethod"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupCreate instantiates a new BackupCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewBackupCreateWithDefaults() *BackupCreate { this := BackupCreate{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *BackupCreate) GetName() string { if o == nil || o.Name == nil { @@ -67,6 +72,7 @@ func (o *BackupCreate) SetName(v string) { o.Name = &v } + // GetBackupMethod returns the BackupMethod field value. func (o *BackupCreate) GetBackupMethod() string { if o == nil { @@ -90,6 +96,8 @@ func (o *BackupCreate) SetBackupMethod(v string) { o.BackupMethod = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o BackupCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` BackupMethod *string `json:"backupMethod"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,7 +129,7 @@ func (o *BackupCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "backupMethod"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "backupMethod", }) } else { return err } diff --git a/api/kbcloud/model_backup_download.go b/api/kbcloud/model_backup_download.go index 1e7eaa25..9d5727f9 100644 --- a/api/kbcloud/model_backup_download.go +++ b/api/kbcloud/model_backup_download.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupDownload struct { // the paths of file to download Filepaths []string `json:"filepaths,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupDownload instantiates a new BackupDownload object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewBackupDownloadWithDefaults() *BackupDownload { this := BackupDownload{} return &this } - // GetFilepaths returns the Filepaths field value if set, zero value otherwise. func (o *BackupDownload) GetFilepaths() []string { if o == nil || o.Filepaths == nil { @@ -59,6 +68,8 @@ func (o *BackupDownload) SetFilepaths(v []string) { o.Filepaths = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupDownload) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *BackupDownload) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"filepaths"}) + common.DeleteKeys(additionalProperties, &[]string{ "filepaths", }) } else { return err } diff --git a/api/kbcloud/model_backup_list.go b/api/kbcloud/model_backup_list.go index 3329779d..1f08401a 100644 --- a/api/kbcloud/model_backup_list.go +++ b/api/kbcloud/model_backup_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupList BackupList is a list of backups + + +// BackupList BackupList is a list of backups type BackupList struct { // Items is the list of backup policy objects in the list Items []Backup `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupList instantiates a new BackupList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewBackupListWithDefaults() *BackupList { this := BackupList{} return &this } - // GetItems returns the Items field value. func (o *BackupList) GetItems() []Backup { if o == nil { @@ -62,6 +67,7 @@ func (o *BackupList) SetItems(v []Backup) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *BackupList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *BackupList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o BackupList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Backup `json:"items"` + Items *[]Backup `json:"items"` PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,14 +129,14 @@ func (o *BackupList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_backup_log.go b/api/kbcloud/model_backup_log.go index a83286eb..18144752 100644 --- a/api/kbcloud/model_backup_log.go +++ b/api/kbcloud/model_backup_log.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// BackupLog backup workload logs +// BackupLog backup workload logs type BackupLog struct { // items is the list of backupLogByPod objects Items []BackupLogByPod `json:"items,omitempty"` // backup id BackupId *string `json:"backupId,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupLog instantiates a new BackupLog object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewBackupLogWithDefaults() *BackupLog { this := BackupLog{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *BackupLog) GetItems() []BackupLogByPod { if o == nil || o.Items == nil { @@ -62,6 +71,7 @@ func (o *BackupLog) SetItems(v []BackupLogByPod) { o.Items = v } + // GetBackupId returns the BackupId field value if set, zero value otherwise. func (o *BackupLog) GetBackupId() string { if o == nil || o.BackupId == nil { @@ -90,6 +100,8 @@ func (o *BackupLog) SetBackupId(v string) { o.BackupId = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupLog) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o BackupLog) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupLog) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items []BackupLogByPod `json:"items,omitempty"` - BackupId *string `json:"backupId,omitempty"` + Items []BackupLogByPod `json:"items,omitempty"` + BackupId *string `json:"backupId,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "backupId"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "backupId", }) } else { return err } diff --git a/api/kbcloud/model_backup_log_by_pod.go b/api/kbcloud/model_backup_log_by_pod.go index 42f41932..8ea9991e 100644 --- a/api/kbcloud/model_backup_log_by_pod.go +++ b/api/kbcloud/model_backup_log_by_pod.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// BackupLogByPod info of backup workload log + + +// BackupLogByPod info of backup workload log type BackupLogByPod struct { // logs of the backup workload Log *string `json:"log,omitempty"` @@ -19,10 +24,11 @@ type BackupLogByPod struct { // Date/time when the backup pod was created. CreationTimestamp *time.Time `json:"creationTimestamp,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupLogByPod instantiates a new BackupLogByPod object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewBackupLogByPodWithDefaults() *BackupLogByPod { this := BackupLogByPod{} return &this } - // GetLog returns the Log field value if set, zero value otherwise. func (o *BackupLogByPod) GetLog() string { if o == nil || o.Log == nil { @@ -68,6 +73,7 @@ func (o *BackupLogByPod) SetLog(v string) { o.Log = &v } + // GetPodName returns the PodName field value if set, zero value otherwise. func (o *BackupLogByPod) GetPodName() string { if o == nil || o.PodName == nil { @@ -96,6 +102,7 @@ func (o *BackupLogByPod) SetPodName(v string) { o.PodName = &v } + // GetCreationTimestamp returns the CreationTimestamp field value if set, zero value otherwise. func (o *BackupLogByPod) GetCreationTimestamp() time.Time { if o == nil || o.CreationTimestamp == nil { @@ -124,6 +131,8 @@ func (o *BackupLogByPod) SetCreationTimestamp(v time.Time) { o.CreationTimestamp = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupLogByPod) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,8 +162,8 @@ func (o BackupLogByPod) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupLogByPod) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Log *string `json:"log,omitempty"` - PodName *string `json:"podName,omitempty"` + Log *string `json:"log,omitempty"` + PodName *string `json:"podName,omitempty"` CreationTimestamp *time.Time `json:"creationTimestamp,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -162,7 +171,7 @@ func (o *BackupLogByPod) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"log", "podName", "creationTimestamp"}) + common.DeleteKeys(additionalProperties, &[]string{ "log", "podName", "creationTimestamp", }) } else { return err } diff --git a/api/kbcloud/model_backup_method_option.go b/api/kbcloud/model_backup_method_option.go index 9f6eac8a..22c554fe 100644 --- a/api/kbcloud/model_backup_method_option.go +++ b/api/kbcloud/model_backup_method_option.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type BackupMethodOption struct { - Name string `json:"name"` + Name string `json:"name"` Description *LocalizedDescription `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupMethodOption instantiates a new BackupMethodOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewBackupMethodOptionWithDefaults() *BackupMethodOption { this := BackupMethodOption{} return &this } - // GetName returns the Name field value. func (o *BackupMethodOption) GetName() string { if o == nil { @@ -59,6 +64,7 @@ func (o *BackupMethodOption) SetName(v string) { o.Name = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *BackupMethodOption) GetDescription() LocalizedDescription { if o == nil || o.Description == nil { @@ -87,6 +93,8 @@ func (o *BackupMethodOption) SetDescription(v LocalizedDescription) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupMethodOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -107,7 +115,7 @@ func (o BackupMethodOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupMethodOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` Description *LocalizedDescription `json:"description,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,14 +126,14 @@ func (o *BackupMethodOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "description", }) } else { return err } hasInvalidField := false o.Name = *all.Name - if all.Description != nil && all.Description.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Description != nil && all.Description.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Description = all.Description diff --git a/api/kbcloud/model_backup_option.go b/api/kbcloud/model_backup_option.go index 7cbb9411..108027f2 100644 --- a/api/kbcloud/model_backup_option.go +++ b/api/kbcloud/model_backup_option.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupOption struct { - DefaultMethod *string `json:"defaultMethod,omitempty"` - FullMethod []BackupMethodOption `json:"fullMethod,omitempty"` + DefaultMethod *string `json:"defaultMethod,omitempty"` + FullMethod []BackupMethodOption `json:"fullMethod,omitempty"` ContinuousMethod []BackupMethodOption `json:"continuousMethod,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupOption instantiates a new BackupOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewBackupOptionWithDefaults() *BackupOption { this := BackupOption{} return &this } - // GetDefaultMethod returns the DefaultMethod field value if set, zero value otherwise. func (o *BackupOption) GetDefaultMethod() string { if o == nil || o.DefaultMethod == nil { @@ -60,6 +69,7 @@ func (o *BackupOption) SetDefaultMethod(v string) { o.DefaultMethod = &v } + // GetFullMethod returns the FullMethod field value if set, zero value otherwise. func (o *BackupOption) GetFullMethod() []BackupMethodOption { if o == nil || o.FullMethod == nil { @@ -88,6 +98,7 @@ func (o *BackupOption) SetFullMethod(v []BackupMethodOption) { o.FullMethod = v } + // GetContinuousMethod returns the ContinuousMethod field value if set, zero value otherwise. func (o *BackupOption) GetContinuousMethod() []BackupMethodOption { if o == nil || o.ContinuousMethod == nil { @@ -116,6 +127,8 @@ func (o *BackupOption) SetContinuousMethod(v []BackupMethodOption) { o.ContinuousMethod = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -141,8 +154,8 @@ func (o BackupOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - DefaultMethod *string `json:"defaultMethod,omitempty"` - FullMethod []BackupMethodOption `json:"fullMethod,omitempty"` + DefaultMethod *string `json:"defaultMethod,omitempty"` + FullMethod []BackupMethodOption `json:"fullMethod,omitempty"` ContinuousMethod []BackupMethodOption `json:"continuousMethod,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -150,7 +163,7 @@ func (o *BackupOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"defaultMethod", "fullMethod", "continuousMethod"}) + common.DeleteKeys(additionalProperties, &[]string{ "defaultMethod", "fullMethod", "continuousMethod", }) } else { return err } diff --git a/api/kbcloud/model_backup_policy.go b/api/kbcloud/model_backup_policy.go index 40b0e664..12fd9ef7 100644 --- a/api/kbcloud/model_backup_policy.go +++ b/api/kbcloud/model_backup_policy.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// BackupPolicy BackupPolicy is the payload for KubeBlocks cluster backup policy + + +// BackupPolicy BackupPolicy is the payload for KubeBlocks cluster backup policy type BackupPolicy struct { // specify whether to use auto backup AutoBackup *bool `json:"autoBackup,omitempty"` @@ -29,10 +34,11 @@ type BackupPolicy struct { // the time to do next backup NextBackupTime *time.Time `json:"nextBackupTime,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupPolicy instantiates a new BackupPolicy object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -57,7 +63,6 @@ func NewBackupPolicyWithDefaults() *BackupPolicy { this.PitrEnabled = &pitrEnabled return &this } - // GetAutoBackup returns the AutoBackup field value if set, zero value otherwise. func (o *BackupPolicy) GetAutoBackup() bool { if o == nil || o.AutoBackup == nil { @@ -86,6 +91,7 @@ func (o *BackupPolicy) SetAutoBackup(v bool) { o.AutoBackup = &v } + // GetAutoBackupMethod returns the AutoBackupMethod field value if set, zero value otherwise. func (o *BackupPolicy) GetAutoBackupMethod() string { if o == nil || o.AutoBackupMethod == nil { @@ -114,6 +120,7 @@ func (o *BackupPolicy) SetAutoBackupMethod(v string) { o.AutoBackupMethod = &v } + // GetPitrEnabled returns the PitrEnabled field value if set, zero value otherwise. func (o *BackupPolicy) GetPitrEnabled() bool { if o == nil || o.PitrEnabled == nil { @@ -142,6 +149,7 @@ func (o *BackupPolicy) SetPitrEnabled(v bool) { o.PitrEnabled = &v } + // GetCronExpression returns the CronExpression field value if set, zero value otherwise. func (o *BackupPolicy) GetCronExpression() string { if o == nil || o.CronExpression == nil { @@ -170,6 +178,7 @@ func (o *BackupPolicy) SetCronExpression(v string) { o.CronExpression = &v } + // GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. func (o *BackupPolicy) GetRetentionPeriod() string { if o == nil || o.RetentionPeriod == nil { @@ -198,6 +207,7 @@ func (o *BackupPolicy) SetRetentionPeriod(v string) { o.RetentionPeriod = &v } + // GetBackupRepo returns the BackupRepo field value if set, zero value otherwise. func (o *BackupPolicy) GetBackupRepo() string { if o == nil || o.BackupRepo == nil { @@ -226,6 +236,7 @@ func (o *BackupPolicy) SetBackupRepo(v string) { o.BackupRepo = &v } + // GetRetentionPolicy returns the RetentionPolicy field value if set, zero value otherwise. func (o *BackupPolicy) GetRetentionPolicy() BackupRetentionPolicy { if o == nil || o.RetentionPolicy == nil { @@ -254,6 +265,7 @@ func (o *BackupPolicy) SetRetentionPolicy(v BackupRetentionPolicy) { o.RetentionPolicy = &v } + // GetNextBackupTime returns the NextBackupTime field value if set, zero value otherwise. func (o *BackupPolicy) GetNextBackupTime() time.Time { if o == nil || o.NextBackupTime == nil { @@ -282,6 +294,8 @@ func (o *BackupPolicy) SetNextBackupTime(v time.Time) { o.NextBackupTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupPolicy) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -326,21 +340,21 @@ func (o BackupPolicy) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupPolicy) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AutoBackup *bool `json:"autoBackup,omitempty"` - AutoBackupMethod *string `json:"autoBackupMethod,omitempty"` - PitrEnabled *bool `json:"pitrEnabled,omitempty"` - CronExpression *string `json:"cronExpression,omitempty"` - RetentionPeriod *string `json:"retentionPeriod,omitempty"` - BackupRepo *string `json:"backupRepo,omitempty"` - RetentionPolicy *BackupRetentionPolicy `json:"retentionPolicy,omitempty"` - NextBackupTime *time.Time `json:"nextBackupTime,omitempty"` + AutoBackup *bool `json:"autoBackup,omitempty"` + AutoBackupMethod *string `json:"autoBackupMethod,omitempty"` + PitrEnabled *bool `json:"pitrEnabled,omitempty"` + CronExpression *string `json:"cronExpression,omitempty"` + RetentionPeriod *string `json:"retentionPeriod,omitempty"` + BackupRepo *string `json:"backupRepo,omitempty"` + RetentionPolicy *BackupRetentionPolicy `json:"retentionPolicy,omitempty"` + NextBackupTime *time.Time `json:"nextBackupTime,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"autoBackup", "autoBackupMethod", "pitrEnabled", "cronExpression", "retentionPeriod", "backupRepo", "retentionPolicy", "nextBackupTime"}) + common.DeleteKeys(additionalProperties, &[]string{ "autoBackup", "autoBackupMethod", "pitrEnabled", "cronExpression", "retentionPeriod", "backupRepo", "retentionPolicy", "nextBackupTime", }) } else { return err } @@ -352,7 +366,7 @@ func (o *BackupPolicy) UnmarshalJSON(bytes []byte) (err error) { o.CronExpression = all.CronExpression o.RetentionPeriod = all.RetentionPeriod o.BackupRepo = all.BackupRepo - if all.RetentionPolicy != nil && !all.RetentionPolicy.IsValid() { + if all.RetentionPolicy != nil &&!all.RetentionPolicy.IsValid() { hasInvalidField = true } else { o.RetentionPolicy = all.RetentionPolicy diff --git a/api/kbcloud/model_backup_repo.go b/api/kbcloud/model_backup_repo.go index b675b239..8976365e 100644 --- a/api/kbcloud/model_backup_repo.go +++ b/api/kbcloud/model_backup_repo.go @@ -2,17 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" - "github.com/google/uuid" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupRepo backupRepo is the payload for KubeBlocks cluster backup repo + + +// BackupRepo backupRepo is the payload for KubeBlocks cluster backup repo type BackupRepo struct { // the access method for backup repo AccessMethod BackupRepoAccessMethod `json:"accessMethod"` @@ -45,10 +48,11 @@ type BackupRepo struct { // failedMessage specifies the message of the backupRepo failure FailedMessage *string `json:"failedMessage,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepo instantiates a new BackupRepo object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -76,7 +80,6 @@ func NewBackupRepoWithDefaults() *BackupRepo { this.AccessMethod = accessMethod return &this } - // GetAccessMethod returns the AccessMethod field value. func (o *BackupRepo) GetAccessMethod() BackupRepoAccessMethod { if o == nil { @@ -100,6 +103,7 @@ func (o *BackupRepo) SetAccessMethod(v BackupRepoAccessMethod) { o.AccessMethod = v } + // GetId returns the Id field value if set, zero value otherwise. func (o *BackupRepo) GetId() string { if o == nil || o.Id == nil { @@ -128,6 +132,7 @@ func (o *BackupRepo) SetId(v string) { o.Id = &v } + // GetBackupNums returns the BackupNums field value if set, zero value otherwise. func (o *BackupRepo) GetBackupNums() int32 { if o == nil || o.BackupNums == nil { @@ -156,6 +161,7 @@ func (o *BackupRepo) SetBackupNums(v int32) { o.BackupNums = &v } + // GetConfig returns the Config field value. func (o *BackupRepo) GetConfig() map[string]string { if o == nil { @@ -179,6 +185,7 @@ func (o *BackupRepo) SetConfig(v map[string]string) { o.Config = v } + // GetCreatedAt returns the CreatedAt field value. func (o *BackupRepo) GetCreatedAt() time.Time { if o == nil { @@ -202,6 +209,7 @@ func (o *BackupRepo) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDefault returns the Default field value. func (o *BackupRepo) GetDefault() bool { if o == nil { @@ -225,6 +233,7 @@ func (o *BackupRepo) SetDefault(v bool) { o.Default = v } + // GetEnvironmentId returns the EnvironmentId field value. func (o *BackupRepo) GetEnvironmentId() uuid.UUID { if o == nil { @@ -248,6 +257,7 @@ func (o *BackupRepo) SetEnvironmentId(v uuid.UUID) { o.EnvironmentId = v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *BackupRepo) GetEnvironmentName() string { if o == nil { @@ -271,6 +281,7 @@ func (o *BackupRepo) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetName returns the Name field value. func (o *BackupRepo) GetName() string { if o == nil { @@ -294,6 +305,7 @@ func (o *BackupRepo) SetName(v string) { o.Name = v } + // GetStatus returns the Status field value. func (o *BackupRepo) GetStatus() string { if o == nil { @@ -317,6 +329,7 @@ func (o *BackupRepo) SetStatus(v string) { o.Status = v } + // GetStorageId returns the StorageId field value if set, zero value otherwise. func (o *BackupRepo) GetStorageId() string { if o == nil || o.StorageId == nil { @@ -345,6 +358,7 @@ func (o *BackupRepo) SetStorageId(v string) { o.StorageId = &v } + // GetStorageProvider returns the StorageProvider field value. func (o *BackupRepo) GetStorageProvider() string { if o == nil { @@ -368,6 +382,7 @@ func (o *BackupRepo) SetStorageProvider(v string) { o.StorageProvider = v } + // GetTotalSize returns the TotalSize field value if set, zero value otherwise. func (o *BackupRepo) GetTotalSize() string { if o == nil || o.TotalSize == nil { @@ -396,6 +411,7 @@ func (o *BackupRepo) SetTotalSize(v string) { o.TotalSize = &v } + // GetFailedReason returns the FailedReason field value if set, zero value otherwise. func (o *BackupRepo) GetFailedReason() string { if o == nil || o.FailedReason == nil { @@ -424,6 +440,7 @@ func (o *BackupRepo) SetFailedReason(v string) { o.FailedReason = &v } + // GetFailedMessage returns the FailedMessage field value if set, zero value otherwise. func (o *BackupRepo) GetFailedMessage() string { if o == nil || o.FailedMessage == nil { @@ -452,6 +469,8 @@ func (o *BackupRepo) SetFailedMessage(v string) { o.FailedMessage = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -499,21 +518,21 @@ func (o BackupRepo) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupRepo) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AccessMethod *BackupRepoAccessMethod `json:"accessMethod"` - Id *string `json:"id,omitempty"` - BackupNums *int32 `json:"backupNums,omitempty"` - Config *map[string]string `json:"config"` - CreatedAt *time.Time `json:"createdAt"` - Default *bool `json:"default"` - EnvironmentId *uuid.UUID `json:"environmentId"` - EnvironmentName *string `json:"environmentName"` - Name *string `json:"name"` - Status *string `json:"status"` - StorageId *string `json:"storageID,omitempty"` - StorageProvider *string `json:"storageProvider"` - TotalSize *string `json:"totalSize,omitempty"` - FailedReason *string `json:"failedReason,omitempty"` - FailedMessage *string `json:"failedMessage,omitempty"` + AccessMethod *BackupRepoAccessMethod `json:"accessMethod"` + Id *string `json:"id,omitempty"` + BackupNums *int32 `json:"backupNums,omitempty"` + Config *map[string]string `json:"config"` + CreatedAt *time.Time `json:"createdAt"` + Default *bool `json:"default"` + EnvironmentId *uuid.UUID `json:"environmentId"` + EnvironmentName *string `json:"environmentName"` + Name *string `json:"name"` + Status *string `json:"status"` + StorageId *string `json:"storageID,omitempty"` + StorageProvider *string `json:"storageProvider"` + TotalSize *string `json:"totalSize,omitempty"` + FailedReason *string `json:"failedReason,omitempty"` + FailedMessage *string `json:"failedMessage,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -547,7 +566,7 @@ func (o *BackupRepo) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accessMethod", "id", "backupNums", "config", "createdAt", "default", "environmentId", "environmentName", "name", "status", "storageID", "storageProvider", "totalSize", "failedReason", "failedMessage"}) + common.DeleteKeys(additionalProperties, &[]string{ "accessMethod", "id", "backupNums", "config", "createdAt", "default", "environmentId", "environmentName", "name", "status", "storageID", "storageProvider", "totalSize", "failedReason", "failedMessage", }) } else { return err } diff --git a/api/kbcloud/model_backup_repo_access_method.go b/api/kbcloud/model_backup_repo_access_method.go index 70fd4cc2..b90a5878 100644 --- a/api/kbcloud/model_backup_repo_access_method.go +++ b/api/kbcloud/model_backup_repo_access_method.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupRepoAccessMethod the access method for backup repo type BackupRepoAccessMethod string // List of BackupRepoAccessMethod. const ( BackupRepoAccessMethodMount BackupRepoAccessMethod = "Mount" - BackupRepoAccessMethodTool BackupRepoAccessMethod = "Tool" + BackupRepoAccessMethodTool BackupRepoAccessMethod = "Tool" ) var allowedBackupRepoAccessMethodEnumValues = []BackupRepoAccessMethod{ diff --git a/api/kbcloud/model_backup_repo_list.go b/api/kbcloud/model_backup_repo_list.go index e9be54c6..861e896e 100644 --- a/api/kbcloud/model_backup_repo_list.go +++ b/api/kbcloud/model_backup_repo_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BackupRepoList BackupRepoList is a list of backupRepo + + +// BackupRepoList BackupRepoList is a list of backupRepo type BackupRepoList struct { // Items is the list of backupRepo objects in the list Items []BackupRepo `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepoList instantiates a new BackupRepoList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewBackupRepoListWithDefaults() *BackupRepoList { this := BackupRepoList{} return &this } - // GetItems returns the Items field value. func (o *BackupRepoList) GetItems() []BackupRepo { if o == nil { @@ -62,6 +67,7 @@ func (o *BackupRepoList) SetItems(v []BackupRepo) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *BackupRepoList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *BackupRepoList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepoList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o BackupRepoList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupRepoList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]BackupRepo `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]BackupRepo `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *BackupRepoList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_backup_repo_update.go b/api/kbcloud/model_backup_repo_update.go index 48b8e9d4..778e81fb 100644 --- a/api/kbcloud/model_backup_repo_update.go +++ b/api/kbcloud/model_backup_repo_update.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// BackupRepoUpdate BackupRepoUpdate is the payload to update a KubeBlocks cluster backup repo +// BackupRepoUpdate BackupRepoUpdate is the payload to update a KubeBlocks cluster backup repo type BackupRepoUpdate struct { // default specifies whether the backupRepo is the default backupRepo Default *bool `json:"default,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupRepoUpdate instantiates a new BackupRepoUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewBackupRepoUpdateWithDefaults() *BackupRepoUpdate { this := BackupRepoUpdate{} return &this } - // GetDefault returns the Default field value if set, zero value otherwise. func (o *BackupRepoUpdate) GetDefault() bool { if o == nil || o.Default == nil { @@ -60,6 +69,8 @@ func (o *BackupRepoUpdate) SetDefault(v bool) { o.Default = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupRepoUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *BackupRepoUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"default"}) + common.DeleteKeys(additionalProperties, &[]string{ "default", }) } else { return err } diff --git a/api/kbcloud/model_backup_retention_policy.go b/api/kbcloud/model_backup_retention_policy.go index 06788ad5..2f121c6b 100644 --- a/api/kbcloud/model_backup_retention_policy.go +++ b/api/kbcloud/model_backup_retention_policy.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupRetentionPolicy backup retention policy when cluster is deleted type BackupRetentionPolicy string // List of BackupRetentionPolicy. const ( - BackupRetentionPolicyAll BackupRetentionPolicy = "All" + BackupRetentionPolicyAll BackupRetentionPolicy = "All" BackupRetentionPolicyLastOne BackupRetentionPolicy = "LastOne" BackupRetentionPolicyWipeOut BackupRetentionPolicy = "WipeOut" ) diff --git a/api/kbcloud/model_backup_stats.go b/api/kbcloud/model_backup_stats.go index 33d16e75..f8d104b2 100644 --- a/api/kbcloud/model_backup_stats.go +++ b/api/kbcloud/model_backup_stats.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// BackupStats Backup statistic info + + +// BackupStats Backup statistic info type BackupStats struct { // Number of backups for each defferent status BackupStatsStatus []BackupStatsStatus `json:"backupStatsStatus,omitempty"` @@ -21,10 +26,11 @@ type BackupStats struct { // backup status of the latest backup LatestBackupStatus common.NullableString `json:"latestBackupStatus,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupStats instantiates a new BackupStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewBackupStatsWithDefaults() *BackupStats { this := BackupStats{} return &this } - // GetBackupStatsStatus returns the BackupStatsStatus field value if set, zero value otherwise. func (o *BackupStats) GetBackupStatsStatus() []BackupStatsStatus { if o == nil || o.BackupStatsStatus == nil { @@ -70,6 +75,7 @@ func (o *BackupStats) SetBackupStatsStatus(v []BackupStatsStatus) { o.BackupStatsStatus = v } + // GetBackupStatsEngine returns the BackupStatsEngine field value if set, zero value otherwise. func (o *BackupStats) GetBackupStatsEngine() []BackupStatsEngine { if o == nil || o.BackupStatsEngine == nil { @@ -98,6 +104,7 @@ func (o *BackupStats) SetBackupStatsEngine(v []BackupStatsEngine) { o.BackupStatsEngine = v } + // GetLatestBackupTime returns the LatestBackupTime field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BackupStats) GetLatestBackupTime() time.Time { if o == nil || o.LatestBackupTime.Get() == nil { @@ -111,7 +118,7 @@ func (o *BackupStats) GetLatestBackupTime() time.Time { // 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 *BackupStats) GetLatestBackupTimeOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.LatestBackupTime.Get(), o.LatestBackupTime.IsSet() @@ -126,7 +133,6 @@ func (o *BackupStats) HasLatestBackupTime() bool { func (o *BackupStats) SetLatestBackupTime(v time.Time) { o.LatestBackupTime.Set(&v) } - // SetLatestBackupTimeNil sets the value for LatestBackupTime to be an explicit nil. func (o *BackupStats) SetLatestBackupTimeNil() { o.LatestBackupTime.Set(nil) @@ -137,6 +143,7 @@ func (o *BackupStats) UnsetLatestBackupTime() { o.LatestBackupTime.Unset() } + // GetLatestBackupStatus returns the LatestBackupStatus field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BackupStats) GetLatestBackupStatus() string { if o == nil || o.LatestBackupStatus.Get() == nil { @@ -150,7 +157,7 @@ func (o *BackupStats) GetLatestBackupStatus() string { // 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 *BackupStats) GetLatestBackupStatusOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.LatestBackupStatus.Get(), o.LatestBackupStatus.IsSet() @@ -165,7 +172,6 @@ func (o *BackupStats) HasLatestBackupStatus() bool { func (o *BackupStats) SetLatestBackupStatus(v string) { o.LatestBackupStatus.Set(&v) } - // SetLatestBackupStatusNil sets the value for LatestBackupStatus to be an explicit nil. func (o *BackupStats) SetLatestBackupStatusNil() { o.LatestBackupStatus.Set(nil) @@ -176,6 +182,8 @@ func (o *BackupStats) UnsetLatestBackupStatus() { o.LatestBackupStatus.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o BackupStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -204,9 +212,9 @@ func (o BackupStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - BackupStatsStatus []BackupStatsStatus `json:"backupStatsStatus,omitempty"` - BackupStatsEngine []BackupStatsEngine `json:"backupStatsEngine,omitempty"` - LatestBackupTime common.NullableTime `json:"latestBackupTime,omitempty"` + BackupStatsStatus []BackupStatsStatus `json:"backupStatsStatus,omitempty"` + BackupStatsEngine []BackupStatsEngine `json:"backupStatsEngine,omitempty"` + LatestBackupTime common.NullableTime `json:"latestBackupTime,omitempty"` LatestBackupStatus common.NullableString `json:"latestBackupStatus,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -214,7 +222,7 @@ func (o *BackupStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"backupStatsStatus", "backupStatsEngine", "latestBackupTime", "latestBackupStatus"}) + common.DeleteKeys(additionalProperties, &[]string{ "backupStatsStatus", "backupStatsEngine", "latestBackupTime", "latestBackupStatus", }) } else { return err } diff --git a/api/kbcloud/model_backup_stats_engine.go b/api/kbcloud/model_backup_stats_engine.go index f9ec1272..9f961ede 100644 --- a/api/kbcloud/model_backup_stats_engine.go +++ b/api/kbcloud/model_backup_stats_engine.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// BackupStatsEngine Totalsize and number of backups for the engine + + +// BackupStatsEngine Totalsize and number of backups for the engine type BackupStatsEngine struct { // Engine name EngineName *string `json:"engineName,omitempty"` @@ -15,10 +24,11 @@ type BackupStatsEngine struct { // The number of backups for each engine BackupNum *int64 `json:"backupNum,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupStatsEngine instantiates a new BackupStatsEngine object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewBackupStatsEngineWithDefaults() *BackupStatsEngine { this := BackupStatsEngine{} return &this } - // GetEngineName returns the EngineName field value if set, zero value otherwise. func (o *BackupStatsEngine) GetEngineName() string { if o == nil || o.EngineName == nil { @@ -64,6 +73,7 @@ func (o *BackupStatsEngine) SetEngineName(v string) { o.EngineName = &v } + // GetBackupSize returns the BackupSize field value if set, zero value otherwise. func (o *BackupStatsEngine) GetBackupSize() string { if o == nil || o.BackupSize == nil { @@ -92,6 +102,7 @@ func (o *BackupStatsEngine) SetBackupSize(v string) { o.BackupSize = &v } + // GetBackupNum returns the BackupNum field value if set, zero value otherwise. func (o *BackupStatsEngine) GetBackupNum() int64 { if o == nil || o.BackupNum == nil { @@ -120,6 +131,8 @@ func (o *BackupStatsEngine) SetBackupNum(v int64) { o.BackupNum = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupStatsEngine) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -147,14 +160,14 @@ func (o *BackupStatsEngine) UnmarshalJSON(bytes []byte) (err error) { all := struct { EngineName *string `json:"engineName,omitempty"` BackupSize *string `json:"backupSize,omitempty"` - BackupNum *int64 `json:"backupNum,omitempty"` + BackupNum *int64 `json:"backupNum,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "backupSize", "backupNum"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "backupSize", "backupNum", }) } else { return err } diff --git a/api/kbcloud/model_backup_stats_status.go b/api/kbcloud/model_backup_stats_status.go index 1562cfae..cef508f7 100644 --- a/api/kbcloud/model_backup_stats_status.go +++ b/api/kbcloud/model_backup_stats_status.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// BackupStatsStatus Number of backups for the status +// BackupStatsStatus Number of backups for the status type BackupStatsStatus struct { // Backup status Status *string `json:"status,omitempty"` // Number of backups for each status BackupNum *int64 `json:"backupNum,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupStatsStatus instantiates a new BackupStatsStatus object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewBackupStatsStatusWithDefaults() *BackupStatsStatus { this := BackupStatsStatus{} return &this } - // GetStatus returns the Status field value if set, zero value otherwise. func (o *BackupStatsStatus) GetStatus() string { if o == nil || o.Status == nil { @@ -62,6 +71,7 @@ func (o *BackupStatsStatus) SetStatus(v string) { o.Status = &v } + // GetBackupNum returns the BackupNum field value if set, zero value otherwise. func (o *BackupStatsStatus) GetBackupNum() int64 { if o == nil || o.BackupNum == nil { @@ -90,6 +100,8 @@ func (o *BackupStatsStatus) SetBackupNum(v int64) { o.BackupNum = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupStatsStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o BackupStatsStatus) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BackupStatsStatus) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Status *string `json:"status,omitempty"` - BackupNum *int64 `json:"backupNum,omitempty"` + Status *string `json:"status,omitempty"` + BackupNum *int64 `json:"backupNum,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"status", "backupNum"}) + common.DeleteKeys(additionalProperties, &[]string{ "status", "backupNum", }) } else { return err } diff --git a/api/kbcloud/model_backup_status.go b/api/kbcloud/model_backup_status.go index 1f633581..1c4f1e02 100644 --- a/api/kbcloud/model_backup_status.go +++ b/api/kbcloud/model_backup_status.go @@ -2,25 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupStatus The current status. Valid values are New, InProgress, Completed, Failed. type BackupStatus string // List of BackupStatus. const ( - BackupStatusNew BackupStatus = "New" + BackupStatusNew BackupStatus = "New" BackupStatusInProgress BackupStatus = "InProgress" - BackupStatusRunning BackupStatus = "Running" - BackupStatusCompleted BackupStatus = "Completed" - BackupStatusFailed BackupStatus = "Failed" - BackupStatusDeleting BackupStatus = "Deleting" + BackupStatusRunning BackupStatus = "Running" + BackupStatusCompleted BackupStatus = "Completed" + BackupStatusFailed BackupStatus = "Failed" + BackupStatusDeleting BackupStatus = "Deleting" ) var allowedBackupStatusEnumValues = []BackupStatus{ diff --git a/api/kbcloud/model_backup_type.go b/api/kbcloud/model_backup_type.go index e249cdeb..9908c1ed 100644 --- a/api/kbcloud/model_backup_type.go +++ b/api/kbcloud/model_backup_type.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BackupType the type of backup type BackupType string // List of BackupType. const ( - BackupTypeFull BackupType = "Full" - BackupTypeIncremental BackupType = "Incremental" + BackupTypeFull BackupType = "Full" + BackupTypeIncremental BackupType = "Incremental" BackupTypeDifferential BackupType = "Differential" - BackupTypeContinuous BackupType = "Continuous" + BackupTypeContinuous BackupType = "Continuous" ) var allowedBackupTypeEnumValues = []BackupType{ diff --git a/api/kbcloud/model_backup_view.go b/api/kbcloud/model_backup_view.go index f6cf7c09..bb84dbb7 100644 --- a/api/kbcloud/model_backup_view.go +++ b/api/kbcloud/model_backup_view.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type BackupView struct { // the paths of file to view Filepaths []string `json:"filepaths,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBackupView instantiates a new BackupView object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewBackupViewWithDefaults() *BackupView { this := BackupView{} return &this } - // GetFilepaths returns the Filepaths field value if set, zero value otherwise. func (o *BackupView) GetFilepaths() []string { if o == nil || o.Filepaths == nil { @@ -59,6 +68,8 @@ func (o *BackupView) SetFilepaths(v []string) { o.Filepaths = v } + + // MarshalJSON serializes the struct using spec logic. func (o BackupView) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *BackupView) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"filepaths"}) + common.DeleteKeys(additionalProperties, &[]string{ "filepaths", }) } else { return err } diff --git a/api/kbcloud/model_bench_option.go b/api/kbcloud/model_bench_option.go index b57db4ad..ad5c6033 100644 --- a/api/kbcloud/model_bench_option.go +++ b/api/kbcloud/model_bench_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type BenchOption struct { - Pgbench bool `json:"pgbench"` + Pgbench bool `json:"pgbench"` Sysbench bool `json:"sysbench"` - Tpcc bool `json:"tpcc"` - Ycsb bool `json:"ycsb"` + Tpcc bool `json:"tpcc"` + Ycsb bool `json:"ycsb"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBenchOption instantiates a new BenchOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewBenchOptionWithDefaults() *BenchOption { this := BenchOption{} return &this } - // GetPgbench returns the Pgbench field value. func (o *BenchOption) GetPgbench() bool { if o == nil { @@ -64,6 +69,7 @@ func (o *BenchOption) SetPgbench(v bool) { o.Pgbench = v } + // GetSysbench returns the Sysbench field value. func (o *BenchOption) GetSysbench() bool { if o == nil { @@ -87,6 +93,7 @@ func (o *BenchOption) SetSysbench(v bool) { o.Sysbench = v } + // GetTpcc returns the Tpcc field value. func (o *BenchOption) GetTpcc() bool { if o == nil { @@ -110,6 +117,7 @@ func (o *BenchOption) SetTpcc(v bool) { o.Tpcc = v } + // GetYcsb returns the Ycsb field value. func (o *BenchOption) GetYcsb() bool { if o == nil { @@ -133,6 +141,8 @@ func (o *BenchOption) SetYcsb(v bool) { o.Ycsb = v } + + // MarshalJSON serializes the struct using spec logic. func (o BenchOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,10 +163,10 @@ func (o BenchOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BenchOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Pgbench *bool `json:"pgbench"` + Pgbench *bool `json:"pgbench"` Sysbench *bool `json:"sysbench"` - Tpcc *bool `json:"tpcc"` - Ycsb *bool `json:"ycsb"` + Tpcc *bool `json:"tpcc"` + Ycsb *bool `json:"ycsb"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -175,7 +185,7 @@ func (o *BenchOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"pgbench", "sysbench", "tpcc", "ycsb"}) + common.DeleteKeys(additionalProperties, &[]string{ "pgbench", "sysbench", "tpcc", "ycsb", }) } else { return err } diff --git a/api/kbcloud/model_benchmark.go b/api/kbcloud/model_benchmark.go index bd3fcda6..5f28cf14 100644 --- a/api/kbcloud/model_benchmark.go +++ b/api/kbcloud/model_benchmark.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Benchmark Benchmark is the benchmark object + + +// Benchmark Benchmark is the benchmark object type Benchmark struct { // ID of benchmark Id *string `json:"id,omitempty"` @@ -43,10 +48,11 @@ type Benchmark struct { // the status of benchmark Status *BenchmarkStatus `json:"status,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBenchmark instantiates a new Benchmark object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -63,7 +69,6 @@ func NewBenchmarkWithDefaults() *Benchmark { this := Benchmark{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Benchmark) GetId() string { if o == nil || o.Id == nil { @@ -92,6 +97,7 @@ func (o *Benchmark) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Benchmark) GetName() string { if o == nil || o.Name == nil { @@ -120,6 +126,7 @@ func (o *Benchmark) SetName(v string) { o.Name = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *Benchmark) GetType() BenchmarkType { if o == nil || o.Type == nil { @@ -148,6 +155,7 @@ func (o *Benchmark) SetType(v BenchmarkType) { o.Type = &v } + // GetConfig returns the Config field value if set, zero value otherwise. func (o *Benchmark) GetConfig() string { if o == nil || o.Config == nil { @@ -176,6 +184,7 @@ func (o *Benchmark) SetConfig(v string) { o.Config = &v } + // GetPrepareLog returns the PrepareLog field value if set, zero value otherwise. func (o *Benchmark) GetPrepareLog() string { if o == nil || o.PrepareLog == nil { @@ -204,6 +213,7 @@ func (o *Benchmark) SetPrepareLog(v string) { o.PrepareLog = &v } + // GetRunLog returns the RunLog field value if set, zero value otherwise. func (o *Benchmark) GetRunLog() string { if o == nil || o.RunLog == nil { @@ -232,6 +242,7 @@ func (o *Benchmark) SetRunLog(v string) { o.RunLog = &v } + // GetCleanupLog returns the CleanupLog field value if set, zero value otherwise. func (o *Benchmark) GetCleanupLog() string { if o == nil || o.CleanupLog == nil { @@ -260,6 +271,7 @@ func (o *Benchmark) SetCleanupLog(v string) { o.CleanupLog = &v } + // GetResult returns the Result field value if set, zero value otherwise. func (o *Benchmark) GetResult() string { if o == nil || o.Result == nil { @@ -288,6 +300,7 @@ func (o *Benchmark) SetResult(v string) { o.Result = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *Benchmark) GetMessage() string { if o == nil || o.Message == nil { @@ -316,6 +329,7 @@ func (o *Benchmark) SetMessage(v string) { o.Message = &v } + // GetCluster returns the Cluster field value if set, zero value otherwise. func (o *Benchmark) GetCluster() string { if o == nil || o.Cluster == nil { @@ -344,6 +358,7 @@ func (o *Benchmark) SetCluster(v string) { o.Cluster = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *Benchmark) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -372,6 +387,7 @@ func (o *Benchmark) SetClusterId(v string) { o.ClusterId = &v } + // GetDatabase returns the Database field value if set, zero value otherwise. func (o *Benchmark) GetDatabase() string { if o == nil || o.Database == nil { @@ -400,6 +416,7 @@ func (o *Benchmark) SetDatabase(v string) { o.Database = &v } + // GetCompletionTimestamp returns the CompletionTimestamp field value if set, zero value otherwise. func (o *Benchmark) GetCompletionTimestamp() time.Time { if o == nil || o.CompletionTimestamp == nil { @@ -428,6 +445,7 @@ func (o *Benchmark) SetCompletionTimestamp(v time.Time) { o.CompletionTimestamp = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Benchmark) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -456,6 +474,7 @@ func (o *Benchmark) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Benchmark) GetStatus() BenchmarkStatus { if o == nil || o.Status == nil { @@ -484,6 +503,8 @@ func (o *Benchmark) SetStatus(v BenchmarkStatus) { o.Status = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Benchmark) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -553,28 +574,28 @@ func (o Benchmark) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Benchmark) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *BenchmarkType `json:"type,omitempty"` - Config *string `json:"config,omitempty"` - PrepareLog *string `json:"prepareLog,omitempty"` - RunLog *string `json:"runLog,omitempty"` - CleanupLog *string `json:"cleanupLog,omitempty"` - Result *string `json:"result,omitempty"` - Message *string `json:"message,omitempty"` - Cluster *string `json:"cluster,omitempty"` - ClusterId *string `json:"clusterID,omitempty"` - Database *string `json:"database,omitempty"` - CompletionTimestamp *time.Time `json:"completionTimestamp,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Status *BenchmarkStatus `json:"status,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *BenchmarkType `json:"type,omitempty"` + Config *string `json:"config,omitempty"` + PrepareLog *string `json:"prepareLog,omitempty"` + RunLog *string `json:"runLog,omitempty"` + CleanupLog *string `json:"cleanupLog,omitempty"` + Result *string `json:"result,omitempty"` + Message *string `json:"message,omitempty"` + Cluster *string `json:"cluster,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + Database *string `json:"database,omitempty"` + CompletionTimestamp *time.Time `json:"completionTimestamp,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Status *BenchmarkStatus `json:"status,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "type", "config", "prepareLog", "runLog", "cleanupLog", "result", "message", "cluster", "clusterID", "database", "completionTimestamp", "createdAt", "status"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "type", "config", "prepareLog", "runLog", "cleanupLog", "result", "message", "cluster", "clusterID", "database", "completionTimestamp", "createdAt", "status", }) } else { return err } @@ -582,7 +603,7 @@ func (o *Benchmark) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField := false o.Id = all.Id o.Name = all.Name - if all.Type != nil && !all.Type.IsValid() { + if all.Type != nil &&!all.Type.IsValid() { hasInvalidField = true } else { o.Type = all.Type @@ -598,7 +619,7 @@ func (o *Benchmark) UnmarshalJSON(bytes []byte) (err error) { o.Database = all.Database o.CompletionTimestamp = all.CompletionTimestamp o.CreatedAt = all.CreatedAt - if all.Status != nil && !all.Status.IsValid() { + if all.Status != nil &&!all.Status.IsValid() { hasInvalidField = true } else { o.Status = all.Status diff --git a/api/kbcloud/model_benchmark_list.go b/api/kbcloud/model_benchmark_list.go index f1f51f59..4b55a76b 100644 --- a/api/kbcloud/model_benchmark_list.go +++ b/api/kbcloud/model_benchmark_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// BenchmarkList BenchmarkList is a list of benchmarks + + +// BenchmarkList BenchmarkList is a list of benchmarks type BenchmarkList struct { // Items is the list of benchmark objects in the list Items []Benchmark `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewBenchmarkList instantiates a new BenchmarkList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewBenchmarkListWithDefaults() *BenchmarkList { this := BenchmarkList{} return &this } - // GetItems returns the Items field value. func (o *BenchmarkList) GetItems() []Benchmark { if o == nil { @@ -62,6 +67,7 @@ func (o *BenchmarkList) SetItems(v []Benchmark) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *BenchmarkList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *BenchmarkList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o BenchmarkList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o BenchmarkList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *BenchmarkList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Benchmark `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]Benchmark `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *BenchmarkList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_benchmark_status.go b/api/kbcloud/model_benchmark_status.go index be2494bc..461e1603 100644 --- a/api/kbcloud/model_benchmark_status.go +++ b/api/kbcloud/model_benchmark_status.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BenchmarkStatus the status of benchmark type BenchmarkStatus string // List of BenchmarkStatus. const ( - BenchmarkStatusPending BenchmarkStatus = "Pending" - BenchmarkStatusRunning BenchmarkStatus = "Running" + BenchmarkStatusPending BenchmarkStatus = "Pending" + BenchmarkStatusRunning BenchmarkStatus = "Running" BenchmarkStatusCompleted BenchmarkStatus = "Completed" - BenchmarkStatusFailed BenchmarkStatus = "Failed" + BenchmarkStatusFailed BenchmarkStatus = "Failed" ) var allowedBenchmarkStatusEnumValues = []BenchmarkStatus{ diff --git a/api/kbcloud/model_benchmark_type.go b/api/kbcloud/model_benchmark_type.go index d61ebb23..eedad8a8 100644 --- a/api/kbcloud/model_benchmark_type.go +++ b/api/kbcloud/model_benchmark_type.go @@ -2,24 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // BenchmarkType Type of benchmark type BenchmarkType string // List of BenchmarkType. const ( - BenchmarkTypePgbench BenchmarkType = "pgbench" + BenchmarkTypePgbench BenchmarkType = "pgbench" BenchmarkTypeSysbench BenchmarkType = "sysbench" - BenchmarkTypeTpcc BenchmarkType = "tpcc" - BenchmarkTypeTpch BenchmarkType = "tpch" - BenchmarkTypeYcsb BenchmarkType = "ycsb" + BenchmarkTypeTpcc BenchmarkType = "tpcc" + BenchmarkTypeTpch BenchmarkType = "tpch" + BenchmarkTypeYcsb BenchmarkType = "ycsb" ) var allowedBenchmarkTypeEnumValues = []BenchmarkType{ diff --git a/api/kbcloud/model_class.go b/api/kbcloud/model_class.go index 7bd2de9f..a853c928 100644 --- a/api/kbcloud/model_class.go +++ b/api/kbcloud/model_class.go @@ -2,28 +2,38 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Class struct { - Engine *string `json:"engine,omitempty"` - Code *string `json:"code,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` - Mode *string `json:"mode,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - CpuRequest *float64 `json:"cpuRequest,omitempty"` - CpuLimit *float64 `json:"cpuLimit,omitempty"` - Memory *float64 `json:"memory,omitempty"` - MemoryRequest *float64 `json:"memoryRequest,omitempty"` - MemoryLimit *float64 `json:"memoryLimit,omitempty"` - Component *string `json:"component,omitempty"` - Series *ClassSeries `json:"series,omitempty"` + Engine *string `json:"engine,omitempty"` + Code *string `json:"code,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` + Mode *string `json:"mode,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + CpuRequest *float64 `json:"cpuRequest,omitempty"` + CpuLimit *float64 `json:"cpuLimit,omitempty"` + Memory *float64 `json:"memory,omitempty"` + MemoryRequest *float64 `json:"memoryRequest,omitempty"` + MemoryLimit *float64 `json:"memoryLimit,omitempty"` + Component *string `json:"component,omitempty"` + Series *ClassSeries `json:"series,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClass instantiates a new Class object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +50,6 @@ func NewClassWithDefaults() *Class { this := Class{} return &this } - // GetEngine returns the Engine field value if set, zero value otherwise. func (o *Class) GetEngine() string { if o == nil || o.Engine == nil { @@ -69,6 +78,7 @@ func (o *Class) SetEngine(v string) { o.Engine = &v } + // GetCode returns the Code field value if set, zero value otherwise. func (o *Class) GetCode() string { if o == nil || o.Code == nil { @@ -97,6 +107,7 @@ func (o *Class) SetCode(v string) { o.Code = &v } + // GetCodeShort returns the CodeShort field value if set, zero value otherwise. func (o *Class) GetCodeShort() string { if o == nil || o.CodeShort == nil { @@ -125,6 +136,7 @@ func (o *Class) SetCodeShort(v string) { o.CodeShort = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *Class) GetMode() string { if o == nil || o.Mode == nil { @@ -153,6 +165,7 @@ func (o *Class) SetMode(v string) { o.Mode = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *Class) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -181,6 +194,7 @@ func (o *Class) SetCpu(v float64) { o.Cpu = &v } + // GetCpuRequest returns the CpuRequest field value if set, zero value otherwise. func (o *Class) GetCpuRequest() float64 { if o == nil || o.CpuRequest == nil { @@ -209,6 +223,7 @@ func (o *Class) SetCpuRequest(v float64) { o.CpuRequest = &v } + // GetCpuLimit returns the CpuLimit field value if set, zero value otherwise. func (o *Class) GetCpuLimit() float64 { if o == nil || o.CpuLimit == nil { @@ -237,6 +252,7 @@ func (o *Class) SetCpuLimit(v float64) { o.CpuLimit = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *Class) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -265,6 +281,7 @@ func (o *Class) SetMemory(v float64) { o.Memory = &v } + // GetMemoryRequest returns the MemoryRequest field value if set, zero value otherwise. func (o *Class) GetMemoryRequest() float64 { if o == nil || o.MemoryRequest == nil { @@ -293,6 +310,7 @@ func (o *Class) SetMemoryRequest(v float64) { o.MemoryRequest = &v } + // GetMemoryLimit returns the MemoryLimit field value if set, zero value otherwise. func (o *Class) GetMemoryLimit() float64 { if o == nil || o.MemoryLimit == nil { @@ -321,6 +339,7 @@ func (o *Class) SetMemoryLimit(v float64) { o.MemoryLimit = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *Class) GetComponent() string { if o == nil || o.Component == nil { @@ -349,6 +368,7 @@ func (o *Class) SetComponent(v string) { o.Component = &v } + // GetSeries returns the Series field value if set, zero value otherwise. func (o *Class) GetSeries() ClassSeries { if o == nil || o.Series == nil { @@ -377,6 +397,8 @@ func (o *Class) SetSeries(v ClassSeries) { o.Series = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Class) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -429,25 +451,25 @@ func (o Class) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Class) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Engine *string `json:"engine,omitempty"` - Code *string `json:"code,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` - Mode *string `json:"mode,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - CpuRequest *float64 `json:"cpuRequest,omitempty"` - CpuLimit *float64 `json:"cpuLimit,omitempty"` - Memory *float64 `json:"memory,omitempty"` - MemoryRequest *float64 `json:"memoryRequest,omitempty"` - MemoryLimit *float64 `json:"memoryLimit,omitempty"` - Component *string `json:"component,omitempty"` - Series *ClassSeries `json:"series,omitempty"` + Engine *string `json:"engine,omitempty"` + Code *string `json:"code,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` + Mode *string `json:"mode,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + CpuRequest *float64 `json:"cpuRequest,omitempty"` + CpuLimit *float64 `json:"cpuLimit,omitempty"` + Memory *float64 `json:"memory,omitempty"` + MemoryRequest *float64 `json:"memoryRequest,omitempty"` + MemoryLimit *float64 `json:"memoryLimit,omitempty"` + Component *string `json:"component,omitempty"` + Series *ClassSeries `json:"series,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engine", "code", "codeShort", "mode", "cpu", "cpuRequest", "cpuLimit", "memory", "memoryRequest", "memoryLimit", "component", "series"}) + common.DeleteKeys(additionalProperties, &[]string{ "engine", "code", "codeShort", "mode", "cpu", "cpuRequest", "cpuLimit", "memory", "memoryRequest", "memoryLimit", "component", "series", }) } else { return err } @@ -464,7 +486,7 @@ func (o *Class) UnmarshalJSON(bytes []byte) (err error) { o.MemoryRequest = all.MemoryRequest o.MemoryLimit = all.MemoryLimit o.Component = all.Component - if all.Series != nil && !all.Series.IsValid() { + if all.Series != nil &&!all.Series.IsValid() { hasInvalidField = true } else { o.Series = all.Series diff --git a/api/kbcloud/model_class_series.go b/api/kbcloud/model_class_series.go index 724eb2f9..3331a78d 100644 --- a/api/kbcloud/model_class_series.go +++ b/api/kbcloud/model_class_series.go @@ -2,19 +2,24 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ClassSeries string // List of ClassSeries. const ( - ClassSeriesGeneral ClassSeries = "general" + ClassSeriesGeneral ClassSeries = "general" ClassSeriesExclusive ClassSeries = "exclusive" ) diff --git a/api/kbcloud/model_cluster.go b/api/kbcloud/model_cluster.go index 4432848d..ad0c4e32 100644 --- a/api/kbcloud/model_cluster.go +++ b/api/kbcloud/model_cluster.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Cluster KubeBlocks cluster information + + +// Cluster KubeBlocks cluster information type Cluster struct { // Cluster ID Id interface{} `json:"id,omitempty"` @@ -34,7 +38,7 @@ type Cluster struct { // Hash of cluster. Name must be unique within an Org Hash *string `json:"hash,omitempty"` // Cluster Application Engine - Engine string `json:"engine"` + Engine string `json:"engine"` License *ClusterLicense `json:"license,omitempty"` // Items is the list of parameter template in the list ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` @@ -96,13 +100,12 @@ type Cluster struct { NodeGroup common.NullableString `json:"nodeGroup,omitempty"` // Cluster main component codeShort CodeShort *string `json:"codeShort,omitempty"` - // Display name of cluster. - DisplayName *string `json:"displayName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewCluster instantiates a new Cluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -162,7 +165,6 @@ func NewClusterWithDefaults() *Cluster { this.PodAntiAffinityEnabled = &podAntiAffinityEnabled return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Cluster) GetId() interface{} { if o == nil || o.Id == nil { @@ -191,6 +193,7 @@ func (o *Cluster) SetId(v interface{}) { o.Id = v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *Cluster) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -219,6 +222,7 @@ func (o *Cluster) SetOrgName(v string) { o.OrgName = &v } + // GetCloudProvider returns the CloudProvider field value if set, zero value otherwise. func (o *Cluster) GetCloudProvider() string { if o == nil || o.CloudProvider == nil { @@ -247,6 +251,7 @@ func (o *Cluster) SetCloudProvider(v string) { o.CloudProvider = &v } + // GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. func (o *Cluster) GetEnvironmentId() string { if o == nil || o.EnvironmentId == nil { @@ -275,6 +280,7 @@ func (o *Cluster) SetEnvironmentId(v string) { o.EnvironmentId = &v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *Cluster) GetEnvironmentName() string { if o == nil { @@ -298,6 +304,7 @@ func (o *Cluster) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetEnvironmentType returns the EnvironmentType field value if set, zero value otherwise. func (o *Cluster) GetEnvironmentType() string { if o == nil || o.EnvironmentType == nil { @@ -326,6 +333,7 @@ func (o *Cluster) SetEnvironmentType(v string) { o.EnvironmentType = &v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *Cluster) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -354,6 +362,7 @@ func (o *Cluster) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *Cluster) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -382,6 +391,7 @@ func (o *Cluster) SetNamespace(v string) { o.Namespace = &v } + // GetName returns the Name field value. func (o *Cluster) GetName() string { if o == nil { @@ -405,6 +415,7 @@ func (o *Cluster) SetName(v string) { o.Name = v } + // GetHash returns the Hash field value if set, zero value otherwise. func (o *Cluster) GetHash() string { if o == nil || o.Hash == nil { @@ -433,6 +444,7 @@ func (o *Cluster) SetHash(v string) { o.Hash = &v } + // GetEngine returns the Engine field value. func (o *Cluster) GetEngine() string { if o == nil { @@ -456,6 +468,7 @@ func (o *Cluster) SetEngine(v string) { o.Engine = v } + // GetLicense returns the License field value if set, zero value otherwise. func (o *Cluster) GetLicense() ClusterLicense { if o == nil || o.License == nil { @@ -484,6 +497,7 @@ func (o *Cluster) SetLicense(v ClusterLicense) { o.License = &v } + // GetParamTpls returns the ParamTpls field value if set, zero value otherwise. func (o *Cluster) GetParamTpls() []ParamTplsItem { if o == nil || o.ParamTpls == nil { @@ -512,6 +526,7 @@ func (o *Cluster) SetParamTpls(v []ParamTplsItem) { o.ParamTpls = v } + // GetValues returns the Values field value if set, zero value otherwise. func (o *Cluster) GetValues() map[string]interface{} { if o == nil || o.Values == nil { @@ -540,6 +555,7 @@ func (o *Cluster) SetValues(v map[string]interface{}) { o.Values = v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *Cluster) GetVersion() string { if o == nil || o.Version == nil { @@ -568,6 +584,7 @@ func (o *Cluster) SetVersion(v string) { o.Version = &v } + // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *Cluster) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -596,6 +613,7 @@ func (o *Cluster) SetReplicas(v int32) { o.Replicas = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *Cluster) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -624,6 +642,7 @@ func (o *Cluster) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *Cluster) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -652,6 +671,7 @@ func (o *Cluster) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *Cluster) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -680,6 +700,7 @@ func (o *Cluster) SetStorage(v float64) { o.Storage = &v } + // GetTerminationPolicy returns the TerminationPolicy field value if set, zero value otherwise. func (o *Cluster) GetTerminationPolicy() ClusterTerminationPolicy { if o == nil || o.TerminationPolicy == nil { @@ -708,6 +729,7 @@ func (o *Cluster) SetTerminationPolicy(v ClusterTerminationPolicy) { o.TerminationPolicy = &v } + // GetMonitorEnabled returns the MonitorEnabled field value if set, zero value otherwise. func (o *Cluster) GetMonitorEnabled() bool { if o == nil || o.MonitorEnabled == nil { @@ -736,6 +758,7 @@ func (o *Cluster) SetMonitorEnabled(v bool) { o.MonitorEnabled = &v } + // GetVpcEndpointEnabled returns the VpcEndpointEnabled field value if set, zero value otherwise. func (o *Cluster) GetVpcEndpointEnabled() bool { if o == nil || o.VpcEndpointEnabled == nil { @@ -764,6 +787,7 @@ func (o *Cluster) SetVpcEndpointEnabled(v bool) { o.VpcEndpointEnabled = &v } + // GetInternetEndpointEnabled returns the InternetEndpointEnabled field value if set, zero value otherwise. func (o *Cluster) GetInternetEndpointEnabled() bool { if o == nil || o.InternetEndpointEnabled == nil { @@ -792,6 +816,7 @@ func (o *Cluster) SetInternetEndpointEnabled(v bool) { o.InternetEndpointEnabled = &v } + // GetTlsEnabled returns the TlsEnabled field value if set, zero value otherwise. func (o *Cluster) GetTlsEnabled() bool { if o == nil || o.TlsEnabled == nil { @@ -820,6 +845,7 @@ func (o *Cluster) SetTlsEnabled(v bool) { o.TlsEnabled = &v } + // GetNodePortEnabled returns the NodePortEnabled field value if set, zero value otherwise. func (o *Cluster) GetNodePortEnabled() bool { if o == nil || o.NodePortEnabled == nil { @@ -848,6 +874,7 @@ func (o *Cluster) SetNodePortEnabled(v bool) { o.NodePortEnabled = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Cluster) GetStatus() string { if o == nil || o.Status == nil { @@ -876,6 +903,7 @@ func (o *Cluster) SetStatus(v string) { o.Status = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Cluster) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -904,6 +932,7 @@ func (o *Cluster) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Cluster) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -932,6 +961,7 @@ func (o *Cluster) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetCreateOnlySet returns the CreateOnlySet field value if set, zero value otherwise. func (o *Cluster) GetCreateOnlySet() bool { if o == nil || o.CreateOnlySet == nil { @@ -960,6 +990,7 @@ func (o *Cluster) SetCreateOnlySet(v bool) { o.CreateOnlySet = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *Cluster) GetMode() string { if o == nil || o.Mode == nil { @@ -988,6 +1019,7 @@ func (o *Cluster) SetMode(v string) { o.Mode = &v } + // GetProxyEnabled returns the ProxyEnabled field value if set, zero value otherwise. func (o *Cluster) GetProxyEnabled() bool { if o == nil || o.ProxyEnabled == nil { @@ -1016,6 +1048,7 @@ func (o *Cluster) SetProxyEnabled(v bool) { o.ProxyEnabled = &v } + // GetComponents returns the Components field value if set, zero value otherwise. func (o *Cluster) GetComponents() []ComponentsItem { if o == nil || o.Components == nil { @@ -1044,6 +1077,7 @@ func (o *Cluster) SetComponents(v []ComponentsItem) { o.Components = v } + // GetExtra returns the Extra field value if set, zero value otherwise. func (o *Cluster) GetExtra() map[string]interface{} { if o == nil || o.Extra == nil { @@ -1072,6 +1106,7 @@ func (o *Cluster) SetExtra(v map[string]interface{}) { o.Extra = v } + // GetInitOptions returns the InitOptions field value if set, zero value otherwise. func (o *Cluster) GetInitOptions() []InitOptionsItem { if o == nil || o.InitOptions == nil { @@ -1100,6 +1135,7 @@ func (o *Cluster) SetInitOptions(v []InitOptionsItem) { o.InitOptions = v } + // GetExtraInfo returns the ExtraInfo field value if set, zero value otherwise. func (o *Cluster) GetExtraInfo() map[string]interface{} { if o == nil || o.ExtraInfo == nil { @@ -1128,6 +1164,7 @@ func (o *Cluster) SetExtraInfo(v map[string]interface{}) { o.ExtraInfo = v } + // GetTolerations returns the Tolerations field value if set, zero value otherwise. func (o *Cluster) GetTolerations() string { if o == nil || o.Tolerations == nil { @@ -1156,6 +1193,7 @@ func (o *Cluster) SetTolerations(v string) { o.Tolerations = &v } + // GetSingleZone returns the SingleZone field value if set, zero value otherwise. func (o *Cluster) GetSingleZone() bool { if o == nil || o.SingleZone == nil { @@ -1184,6 +1222,7 @@ func (o *Cluster) SetSingleZone(v bool) { o.SingleZone = &v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *Cluster) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -1212,6 +1251,7 @@ func (o *Cluster) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetPodAntiAffinityEnabled returns the PodAntiAffinityEnabled field value if set, zero value otherwise. func (o *Cluster) GetPodAntiAffinityEnabled() bool { if o == nil || o.PodAntiAffinityEnabled == nil { @@ -1240,6 +1280,7 @@ func (o *Cluster) SetPodAntiAffinityEnabled(v bool) { o.PodAntiAffinityEnabled = &v } + // GetBackup returns the Backup field value if set, zero value otherwise. func (o *Cluster) GetBackup() ClusterBackup { if o == nil || o.Backup == nil { @@ -1268,6 +1309,7 @@ func (o *Cluster) SetBackup(v ClusterBackup) { o.Backup = &v } + // GetNodeGroup returns the NodeGroup field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Cluster) GetNodeGroup() string { if o == nil || o.NodeGroup.Get() == nil { @@ -1281,7 +1323,7 @@ func (o *Cluster) GetNodeGroup() string { // 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 *Cluster) GetNodeGroupOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.NodeGroup.Get(), o.NodeGroup.IsSet() @@ -1296,7 +1338,6 @@ func (o *Cluster) HasNodeGroup() bool { func (o *Cluster) SetNodeGroup(v string) { o.NodeGroup.Set(&v) } - // SetNodeGroupNil sets the value for NodeGroup to be an explicit nil. func (o *Cluster) SetNodeGroupNil() { o.NodeGroup.Set(nil) @@ -1307,6 +1348,7 @@ func (o *Cluster) UnsetNodeGroup() { o.NodeGroup.Unset() } + // GetCodeShort returns the CodeShort field value if set, zero value otherwise. func (o *Cluster) GetCodeShort() string { if o == nil || o.CodeShort == nil { @@ -1335,33 +1377,7 @@ func (o *Cluster) SetCodeShort(v string) { o.CodeShort = &v } -// GetDisplayName returns the DisplayName field value if set, zero value otherwise. -func (o *Cluster) GetDisplayName() string { - if o == nil || o.DisplayName == nil { - 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 *Cluster) GetDisplayNameOk() (*string, bool) { - if o == nil || o.DisplayName == nil { - return nil, false - } - return o.DisplayName, true -} - -// HasDisplayName returns a boolean if a field has been set. -func (o *Cluster) HasDisplayName() bool { - return o != nil && o.DisplayName != nil -} - -// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. -func (o *Cluster) SetDisplayName(v string) { - o.DisplayName = &v -} // MarshalJSON serializes the struct using spec logic. func (o Cluster) MarshalJSON() ([]byte, error) { @@ -1497,9 +1513,6 @@ func (o Cluster) MarshalJSON() ([]byte, error) { if o.CodeShort != nil { toSerialize["codeShort"] = o.CodeShort } - if o.DisplayName != nil { - toSerialize["displayName"] = o.DisplayName - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1510,49 +1523,48 @@ func (o Cluster) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id interface{} `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - CloudProvider *string `json:"cloudProvider,omitempty"` - EnvironmentId *string `json:"environmentId,omitempty"` - EnvironmentName *string `json:"environmentName"` - EnvironmentType *string `json:"environmentType,omitempty"` - CloudRegion *string `json:"cloudRegion,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Name *string `json:"name"` - Hash *string `json:"hash,omitempty"` - Engine *string `json:"engine"` - License *ClusterLicense `json:"license,omitempty"` - ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` - Values map[string]interface{} `json:"Values,omitempty"` - Version *string `json:"version,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *float64 `json:"storage,omitempty"` - TerminationPolicy *ClusterTerminationPolicy `json:"terminationPolicy,omitempty"` - MonitorEnabled *bool `json:"monitorEnabled,omitempty"` - VpcEndpointEnabled *bool `json:"vpcEndpointEnabled,omitempty"` - InternetEndpointEnabled *bool `json:"internetEndpointEnabled,omitempty"` - TlsEnabled *bool `json:"tlsEnabled,omitempty"` - NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` - Status *string `json:"status,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreateOnlySet *bool `json:"createOnlySet,omitempty"` - Mode *string `json:"mode,omitempty"` - ProxyEnabled *bool `json:"proxyEnabled,omitempty"` - Components []ComponentsItem `json:"components,omitempty"` - Extra map[string]interface{} `json:"extra,omitempty"` - InitOptions []InitOptionsItem `json:"initOptions,omitempty"` - ExtraInfo map[string]interface{} `json:"extraInfo,omitempty"` - Tolerations *string `json:"tolerations,omitempty"` - SingleZone *bool `json:"singleZone,omitempty"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` - Backup *ClusterBackup `json:"backup,omitempty"` - NodeGroup common.NullableString `json:"nodeGroup,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` - DisplayName *string `json:"displayName,omitempty"` + Id interface{} `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + CloudProvider *string `json:"cloudProvider,omitempty"` + EnvironmentId *string `json:"environmentId,omitempty"` + EnvironmentName *string `json:"environmentName"` + EnvironmentType *string `json:"environmentType,omitempty"` + CloudRegion *string `json:"cloudRegion,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name"` + Hash *string `json:"hash,omitempty"` + Engine *string `json:"engine"` + License *ClusterLicense `json:"license,omitempty"` + ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` + Values map[string]interface{} `json:"Values,omitempty"` + Version *string `json:"version,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *float64 `json:"storage,omitempty"` + TerminationPolicy *ClusterTerminationPolicy `json:"terminationPolicy,omitempty"` + MonitorEnabled *bool `json:"monitorEnabled,omitempty"` + VpcEndpointEnabled *bool `json:"vpcEndpointEnabled,omitempty"` + InternetEndpointEnabled *bool `json:"internetEndpointEnabled,omitempty"` + TlsEnabled *bool `json:"tlsEnabled,omitempty"` + NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` + Status *string `json:"status,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreateOnlySet *bool `json:"createOnlySet,omitempty"` + Mode *string `json:"mode,omitempty"` + ProxyEnabled *bool `json:"proxyEnabled,omitempty"` + Components []ComponentsItem `json:"components,omitempty"` + Extra map[string]interface{} `json:"extra,omitempty"` + InitOptions []InitOptionsItem `json:"initOptions,omitempty"` + ExtraInfo map[string]interface{} `json:"extraInfo,omitempty"` + Tolerations *string `json:"tolerations,omitempty"` + SingleZone *bool `json:"singleZone,omitempty"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` + Backup *ClusterBackup `json:"backup,omitempty"` + NodeGroup common.NullableString `json:"nodeGroup,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -1568,7 +1580,7 @@ func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "orgName", "cloudProvider", "environmentId", "environmentName", "environmentType", "cloudRegion", "namespace", "name", "hash", "engine", "license", "paramTpls", "Values", "version", "replicas", "cpu", "memory", "storage", "terminationPolicy", "monitorEnabled", "vpcEndpointEnabled", "internetEndpointEnabled", "tlsEnabled", "nodePortEnabled", "status", "createdAt", "updatedAt", "createOnlySet", "mode", "proxyEnabled", "components", "extra", "initOptions", "extraInfo", "tolerations", "singleZone", "availabilityZones", "podAntiAffinityEnabled", "backup", "nodeGroup", "codeShort", "displayName"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "orgName", "cloudProvider", "environmentId", "environmentName", "environmentType", "cloudRegion", "namespace", "name", "hash", "engine", "license", "paramTpls", "Values", "version", "replicas", "cpu", "memory", "storage", "terminationPolicy", "monitorEnabled", "vpcEndpointEnabled", "internetEndpointEnabled", "tlsEnabled", "nodePortEnabled", "status", "createdAt", "updatedAt", "createOnlySet", "mode", "proxyEnabled", "components", "extra", "initOptions", "extraInfo", "tolerations", "singleZone", "availabilityZones", "podAntiAffinityEnabled", "backup", "nodeGroup", "codeShort", }) } else { return err } @@ -1585,7 +1597,7 @@ func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { o.Name = *all.Name o.Hash = all.Hash o.Engine = *all.Engine - if all.License != nil && all.License.UnparsedObject != nil && o.UnparsedObject == nil { + if all.License != nil && all.License.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.License = all.License @@ -1596,7 +1608,7 @@ func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { o.Cpu = all.Cpu o.Memory = all.Memory o.Storage = all.Storage - if all.TerminationPolicy != nil && !all.TerminationPolicy.IsValid() { + if all.TerminationPolicy != nil &&!all.TerminationPolicy.IsValid() { hasInvalidField = true } else { o.TerminationPolicy = all.TerminationPolicy @@ -1620,13 +1632,12 @@ func (o *Cluster) UnmarshalJSON(bytes []byte) (err error) { o.SingleZone = all.SingleZone o.AvailabilityZones = all.AvailabilityZones o.PodAntiAffinityEnabled = all.PodAntiAffinityEnabled - if all.Backup != nil && all.Backup.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Backup != nil && all.Backup.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Backup = all.Backup o.NodeGroup = all.NodeGroup o.CodeShort = all.CodeShort - o.DisplayName = all.DisplayName if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/kbcloud/model_cluster_backup.go b/api/kbcloud/model_cluster_backup.go index 83248010..285b8d21 100644 --- a/api/kbcloud/model_cluster_backup.go +++ b/api/kbcloud/model_cluster_backup.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ClusterBackup clusterBackup is the payload for cluster backup +// ClusterBackup clusterBackup is the payload for cluster backup type ClusterBackup struct { // PITREnabled or not PitrEnabled *bool `json:"PITREnabled,omitempty"` @@ -25,10 +34,11 @@ type ClusterBackup struct { // snapshotVolumes specifies whether to take snapshots of persistent volumes to back up SnapshotVolumes common.NullableBool `json:"snapshotVolumes,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterBackup instantiates a new ClusterBackup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +63,6 @@ func NewClusterBackupWithDefaults() *ClusterBackup { this.AutoBackup = &autoBackup return &this } - // GetPitrEnabled returns the PitrEnabled field value if set, zero value otherwise. func (o *ClusterBackup) GetPitrEnabled() bool { if o == nil || o.PitrEnabled == nil { @@ -82,6 +91,7 @@ func (o *ClusterBackup) SetPitrEnabled(v bool) { o.PitrEnabled = &v } + // GetAutoBackup returns the AutoBackup field value if set, zero value otherwise. func (o *ClusterBackup) GetAutoBackup() bool { if o == nil || o.AutoBackup == nil { @@ -110,6 +120,7 @@ func (o *ClusterBackup) SetAutoBackup(v bool) { o.AutoBackup = &v } + // GetAutoBackupMethod returns the AutoBackupMethod field value if set, zero value otherwise. func (o *ClusterBackup) GetAutoBackupMethod() string { if o == nil || o.AutoBackupMethod == nil { @@ -138,6 +149,7 @@ func (o *ClusterBackup) SetAutoBackupMethod(v string) { o.AutoBackupMethod = &v } + // GetBackupRepo returns the BackupRepo field value if set, zero value otherwise. func (o *ClusterBackup) GetBackupRepo() string { if o == nil || o.BackupRepo == nil { @@ -166,6 +178,7 @@ func (o *ClusterBackup) SetBackupRepo(v string) { o.BackupRepo = &v } + // GetCronExpression returns the CronExpression field value if set, zero value otherwise. func (o *ClusterBackup) GetCronExpression() string { if o == nil || o.CronExpression == nil { @@ -194,6 +207,7 @@ func (o *ClusterBackup) SetCronExpression(v string) { o.CronExpression = &v } + // GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. func (o *ClusterBackup) GetRetentionPeriod() string { if o == nil || o.RetentionPeriod == nil { @@ -222,6 +236,7 @@ func (o *ClusterBackup) SetRetentionPeriod(v string) { o.RetentionPeriod = &v } + // GetRetentionPolicy returns the RetentionPolicy field value if set, zero value otherwise. func (o *ClusterBackup) GetRetentionPolicy() BackupRetentionPolicy { if o == nil || o.RetentionPolicy == nil { @@ -250,6 +265,7 @@ func (o *ClusterBackup) SetRetentionPolicy(v BackupRetentionPolicy) { o.RetentionPolicy = &v } + // GetSnapshotVolumes returns the SnapshotVolumes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ClusterBackup) GetSnapshotVolumes() bool { if o == nil || o.SnapshotVolumes.Get() == nil { @@ -263,7 +279,7 @@ func (o *ClusterBackup) GetSnapshotVolumes() bool { // 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 *ClusterBackup) GetSnapshotVolumesOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return o.SnapshotVolumes.Get(), o.SnapshotVolumes.IsSet() @@ -278,7 +294,6 @@ func (o *ClusterBackup) HasSnapshotVolumes() bool { func (o *ClusterBackup) SetSnapshotVolumes(v bool) { o.SnapshotVolumes.Set(&v) } - // SetSnapshotVolumesNil sets the value for SnapshotVolumes to be an explicit nil. func (o *ClusterBackup) SetSnapshotVolumesNil() { o.SnapshotVolumes.Set(nil) @@ -289,6 +304,8 @@ func (o *ClusterBackup) UnsetSnapshotVolumes() { o.SnapshotVolumes.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterBackup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -329,21 +346,21 @@ func (o ClusterBackup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterBackup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - PitrEnabled *bool `json:"PITREnabled,omitempty"` - AutoBackup *bool `json:"autoBackup,omitempty"` - AutoBackupMethod *string `json:"autoBackupMethod,omitempty"` - BackupRepo *string `json:"backupRepo,omitempty"` - CronExpression *string `json:"cronExpression,omitempty"` - RetentionPeriod *string `json:"retentionPeriod,omitempty"` - RetentionPolicy *BackupRetentionPolicy `json:"retentionPolicy,omitempty"` - SnapshotVolumes common.NullableBool `json:"snapshotVolumes,omitempty"` + PitrEnabled *bool `json:"PITREnabled,omitempty"` + AutoBackup *bool `json:"autoBackup,omitempty"` + AutoBackupMethod *string `json:"autoBackupMethod,omitempty"` + BackupRepo *string `json:"backupRepo,omitempty"` + CronExpression *string `json:"cronExpression,omitempty"` + RetentionPeriod *string `json:"retentionPeriod,omitempty"` + RetentionPolicy *BackupRetentionPolicy `json:"retentionPolicy,omitempty"` + SnapshotVolumes common.NullableBool `json:"snapshotVolumes,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"PITREnabled", "autoBackup", "autoBackupMethod", "backupRepo", "cronExpression", "retentionPeriod", "retentionPolicy", "snapshotVolumes"}) + common.DeleteKeys(additionalProperties, &[]string{ "PITREnabled", "autoBackup", "autoBackupMethod", "backupRepo", "cronExpression", "retentionPeriod", "retentionPolicy", "snapshotVolumes", }) } else { return err } @@ -355,7 +372,7 @@ func (o *ClusterBackup) UnmarshalJSON(bytes []byte) (err error) { o.BackupRepo = all.BackupRepo o.CronExpression = all.CronExpression o.RetentionPeriod = all.RetentionPeriod - if all.RetentionPolicy != nil && !all.RetentionPolicy.IsValid() { + if all.RetentionPolicy != nil &&!all.RetentionPolicy.IsValid() { hasInvalidField = true } else { o.RetentionPolicy = all.RetentionPolicy diff --git a/api/kbcloud/model_cluster_execution_log.go b/api/kbcloud/model_cluster_execution_log.go index 2438c8af..5fec8b18 100644 --- a/api/kbcloud/model_cluster_execution_log.go +++ b/api/kbcloud/model_cluster_execution_log.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ClusterExecutionLog Log entry for cluster execution + + +// ClusterExecutionLog Log entry for cluster execution type ClusterExecutionLog struct { // Timestamp of the execution Timestamp int64 `json:"timestamp"` @@ -27,10 +32,11 @@ type ClusterExecutionLog struct { // Additional information Extra map[string]interface{} `json:"extra"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterExecutionLog instantiates a new ClusterExecutionLog object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -54,7 +60,6 @@ func NewClusterExecutionLogWithDefaults() *ClusterExecutionLog { this := ClusterExecutionLog{} return &this } - // GetTimestamp returns the Timestamp field value. func (o *ClusterExecutionLog) GetTimestamp() int64 { if o == nil { @@ -78,6 +83,7 @@ func (o *ClusterExecutionLog) SetTimestamp(v int64) { o.Timestamp = v } + // GetClient returns the Client field value. func (o *ClusterExecutionLog) GetClient() string { if o == nil { @@ -101,6 +107,7 @@ func (o *ClusterExecutionLog) SetClient(v string) { o.Client = v } + // GetDbName returns the DbName field value. func (o *ClusterExecutionLog) GetDbName() string { if o == nil { @@ -124,6 +131,7 @@ func (o *ClusterExecutionLog) SetDbName(v string) { o.DbName = v } + // GetUser returns the User field value. func (o *ClusterExecutionLog) GetUser() string { if o == nil { @@ -147,6 +155,7 @@ func (o *ClusterExecutionLog) SetUser(v string) { o.User = v } + // GetExecutionTime returns the ExecutionTime field value. func (o *ClusterExecutionLog) GetExecutionTime() float64 { if o == nil { @@ -170,6 +179,7 @@ func (o *ClusterExecutionLog) SetExecutionTime(v float64) { o.ExecutionTime = v } + // GetCommand returns the Command field value. func (o *ClusterExecutionLog) GetCommand() string { if o == nil { @@ -193,6 +203,7 @@ func (o *ClusterExecutionLog) SetCommand(v string) { o.Command = v } + // GetExtra returns the Extra field value. func (o *ClusterExecutionLog) GetExtra() map[string]interface{} { if o == nil { @@ -216,6 +227,8 @@ func (o *ClusterExecutionLog) SetExtra(v map[string]interface{}) { o.Extra = v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterExecutionLog) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -239,13 +252,13 @@ func (o ClusterExecutionLog) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterExecutionLog) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Timestamp *int64 `json:"timestamp"` - Client *string `json:"client"` - DbName *string `json:"dbName"` - User *string `json:"user"` - ExecutionTime *float64 `json:"executionTime"` - Command *string `json:"command"` - Extra *map[string]interface{} `json:"extra"` + Timestamp *int64 `json:"timestamp"` + Client *string `json:"client"` + DbName *string `json:"dbName"` + User *string `json:"user"` + ExecutionTime *float64 `json:"executionTime"` + Command *string `json:"command"` + Extra *map[string]interface{} `json:"extra"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -273,7 +286,7 @@ func (o *ClusterExecutionLog) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"timestamp", "client", "dbName", "user", "executionTime", "command", "extra"}) + common.DeleteKeys(additionalProperties, &[]string{ "timestamp", "client", "dbName", "user", "executionTime", "command", "extra", }) } else { return err } diff --git a/api/kbcloud/model_cluster_license.go b/api/kbcloud/model_cluster_license.go index ea68f184..02727259 100644 --- a/api/kbcloud/model_cluster_license.go +++ b/api/kbcloud/model_cluster_license.go @@ -2,25 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - _io "io" - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type ClusterLicense struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` - Key *_io.Reader `json:"key,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` + Key *_io.Reader `json:"key,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterLicense instantiates a new ClusterLicense object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +42,6 @@ func NewClusterLicenseWithDefaults() *ClusterLicense { this := ClusterLicense{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *ClusterLicense) GetId() string { if o == nil || o.Id == nil { @@ -66,6 +70,7 @@ func (o *ClusterLicense) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *ClusterLicense) GetName() string { if o == nil || o.Name == nil { @@ -94,6 +99,7 @@ func (o *ClusterLicense) SetName(v string) { o.Name = &v } + // GetExpiredAt returns the ExpiredAt field value if set, zero value otherwise. func (o *ClusterLicense) GetExpiredAt() time.Time { if o == nil || o.ExpiredAt == nil { @@ -122,6 +128,7 @@ func (o *ClusterLicense) SetExpiredAt(v time.Time) { o.ExpiredAt = &v } + // GetKey returns the Key field value if set, zero value otherwise. func (o *ClusterLicense) GetKey() _io.Reader { if o == nil || o.Key == nil { @@ -150,6 +157,8 @@ func (o *ClusterLicense) SetKey(v _io.Reader) { o.Key = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterLicense) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -182,17 +191,17 @@ func (o ClusterLicense) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterLicense) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` - Key *_io.Reader `json:"key,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` + Key *_io.Reader `json:"key,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "expiredAt", "key"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "expiredAt", "key", }) } else { return err } diff --git a/api/kbcloud/model_cluster_list.go b/api/kbcloud/model_cluster_list.go index ac916931..05668a49 100644 --- a/api/kbcloud/model_cluster_list.go +++ b/api/kbcloud/model_cluster_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ClusterList ClusterList is a list of KubeBlocks clusters + + +// ClusterList ClusterList is a list of KubeBlocks clusters type ClusterList struct { // Items is the list of KubeBlocks cluster objects in the list Items []ClusterListItem `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterList instantiates a new ClusterList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewClusterListWithDefaults() *ClusterList { this := ClusterList{} return &this } - // GetItems returns the Items field value. func (o *ClusterList) GetItems() []ClusterListItem { if o == nil { @@ -62,6 +67,7 @@ func (o *ClusterList) SetItems(v []ClusterListItem) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *ClusterList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *ClusterList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o ClusterList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]ClusterListItem `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]ClusterListItem `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *ClusterList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_cluster_list_item.go b/api/kbcloud/model_cluster_list_item.go index 20635d82..bf1f3ba7 100644 --- a/api/kbcloud/model_cluster_list_item.go +++ b/api/kbcloud/model_cluster_list_item.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ClusterListItem KubeBlocks cluster information + + +// ClusterListItem KubeBlocks cluster information type ClusterListItem struct { // Cloud Provider CloudProvider string `json:"cloudProvider"` @@ -50,10 +54,11 @@ type ClusterListItem struct { // Org Name OrgName *string `json:"orgName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterListItem instantiates a new ClusterListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -80,7 +85,6 @@ func NewClusterListItemWithDefaults() *ClusterListItem { this := ClusterListItem{} return &this } - // GetCloudProvider returns the CloudProvider field value. func (o *ClusterListItem) GetCloudProvider() string { if o == nil { @@ -104,6 +108,7 @@ func (o *ClusterListItem) SetCloudProvider(v string) { o.CloudProvider = v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *ClusterListItem) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -132,6 +137,7 @@ func (o *ClusterListItem) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *ClusterListItem) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -160,6 +166,7 @@ func (o *ClusterListItem) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetCreatedAt returns the CreatedAt field value. func (o *ClusterListItem) GetCreatedAt() time.Time { if o == nil { @@ -183,6 +190,7 @@ func (o *ClusterListItem) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *ClusterListItem) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -211,6 +219,7 @@ func (o *ClusterListItem) SetDisplayName(v string) { o.DisplayName = &v } + // GetEngine returns the Engine field value. func (o *ClusterListItem) GetEngine() string { if o == nil { @@ -234,6 +243,7 @@ func (o *ClusterListItem) SetEngine(v string) { o.Engine = v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *ClusterListItem) GetMode() string { if o == nil || o.Mode == nil { @@ -262,6 +272,7 @@ func (o *ClusterListItem) SetMode(v string) { o.Mode = &v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *ClusterListItem) GetEnvironmentName() string { if o == nil { @@ -285,6 +296,7 @@ func (o *ClusterListItem) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetId returns the Id field value. func (o *ClusterListItem) GetId() string { if o == nil { @@ -308,6 +320,7 @@ func (o *ClusterListItem) SetId(v string) { o.Id = v } + // GetName returns the Name field value. func (o *ClusterListItem) GetName() string { if o == nil { @@ -331,6 +344,7 @@ func (o *ClusterListItem) SetName(v string) { o.Name = v } + // GetStatus returns the Status field value. func (o *ClusterListItem) GetStatus() string { if o == nil { @@ -354,6 +368,7 @@ func (o *ClusterListItem) SetStatus(v string) { o.Status = v } + // GetTerminationPolicy returns the TerminationPolicy field value. func (o *ClusterListItem) GetTerminationPolicy() string { if o == nil { @@ -377,6 +392,7 @@ func (o *ClusterListItem) SetTerminationPolicy(v string) { o.TerminationPolicy = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *ClusterListItem) GetUpdatedAt() time.Time { if o == nil { @@ -400,6 +416,7 @@ func (o *ClusterListItem) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetVersion returns the Version field value. func (o *ClusterListItem) GetVersion() string { if o == nil { @@ -423,6 +440,7 @@ func (o *ClusterListItem) SetVersion(v string) { o.Version = v } + // GetClassCode returns the ClassCode field value if set, zero value otherwise. func (o *ClusterListItem) GetClassCode() string { if o == nil || o.ClassCode == nil { @@ -451,6 +469,7 @@ func (o *ClusterListItem) SetClassCode(v string) { o.ClassCode = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *ClusterListItem) GetStorage() string { if o == nil || o.Storage == nil { @@ -479,6 +498,7 @@ func (o *ClusterListItem) SetStorage(v string) { o.Storage = &v } + // GetCodeShort returns the CodeShort field value if set, zero value otherwise. func (o *ClusterListItem) GetCodeShort() string { if o == nil || o.CodeShort == nil { @@ -507,6 +527,7 @@ func (o *ClusterListItem) SetCodeShort(v string) { o.CodeShort = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *ClusterListItem) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -535,6 +556,8 @@ func (o *ClusterListItem) SetOrgName(v string) { o.OrgName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -593,24 +616,24 @@ func (o ClusterListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CloudProvider *string `json:"cloudProvider"` - CloudRegion *string `json:"cloudRegion,omitempty"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - CreatedAt *time.Time `json:"createdAt"` - DisplayName *string `json:"displayName,omitempty"` - Engine *string `json:"engine"` - Mode *string `json:"mode,omitempty"` - EnvironmentName *string `json:"environmentName"` - Id *string `json:"id"` - Name *string `json:"name"` - Status *string `json:"status"` - TerminationPolicy *string `json:"terminationPolicy"` - UpdatedAt *time.Time `json:"updatedAt"` - Version *string `json:"version"` - ClassCode *string `json:"classCode,omitempty"` - Storage *string `json:"storage,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` - OrgName *string `json:"orgName,omitempty"` + CloudProvider *string `json:"cloudProvider"` + CloudRegion *string `json:"cloudRegion,omitempty"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + CreatedAt *time.Time `json:"createdAt"` + DisplayName *string `json:"displayName,omitempty"` + Engine *string `json:"engine"` + Mode *string `json:"mode,omitempty"` + EnvironmentName *string `json:"environmentName"` + Id *string `json:"id"` + Name *string `json:"name"` + Status *string `json:"status"` + TerminationPolicy *string `json:"terminationPolicy"` + UpdatedAt *time.Time `json:"updatedAt"` + Version *string `json:"version"` + ClassCode *string `json:"classCode,omitempty"` + Storage *string `json:"storage,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` + OrgName *string `json:"orgName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -647,7 +670,7 @@ func (o *ClusterListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cloudProvider", "cloudRegion", "availabilityZones", "createdAt", "displayName", "engine", "mode", "environmentName", "id", "name", "status", "terminationPolicy", "updatedAt", "version", "classCode", "storage", "codeShort", "orgName"}) + common.DeleteKeys(additionalProperties, &[]string{ "cloudProvider", "cloudRegion", "availabilityZones", "createdAt", "displayName", "engine", "mode", "environmentName", "id", "name", "status", "terminationPolicy", "updatedAt", "version", "classCode", "storage", "codeShort", "orgName", }) } else { return err } diff --git a/api/kbcloud/model_cluster_metrics.go b/api/kbcloud/model_cluster_metrics.go index 6b554654..fb90bda2 100644 --- a/api/kbcloud/model_cluster_metrics.go +++ b/api/kbcloud/model_cluster_metrics.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ClusterMetrics Cluster metrics +// ClusterMetrics Cluster metrics type ClusterMetrics struct { - Value []interface{} `json:"value,omitempty"` + Value []interface{} `json:"value,omitempty"` Values [][]interface{} `json:"values,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterMetrics instantiates a new ClusterMetrics object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,10 +41,9 @@ func NewClusterMetricsWithDefaults() *ClusterMetrics { this := ClusterMetrics{} return &this } - // GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ClusterMetrics) GetValue() []interface{} { - if o == nil { + if o == nil { var ret []interface{} return ret } @@ -61,6 +70,7 @@ func (o *ClusterMetrics) SetValue(v []interface{}) { o.Value = v } + // GetValues returns the Values field value if set, zero value otherwise. func (o *ClusterMetrics) GetValues() [][]interface{} { if o == nil || o.Values == nil { @@ -89,6 +99,8 @@ func (o *ClusterMetrics) SetValues(v [][]interface{}) { o.Values = v } + + // MarshalJSON serializes the struct using spec logic. func (o ClusterMetrics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +123,7 @@ func (o ClusterMetrics) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterMetrics) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Value []interface{} `json:"value,omitempty"` + Value []interface{} `json:"value,omitempty"` Values [][]interface{} `json:"values,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +131,7 @@ func (o *ClusterMetrics) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"value", "values"}) + common.DeleteKeys(additionalProperties, &[]string{ "value", "values", }) } else { return err } diff --git a/api/kbcloud/model_cluster_termination_policy.go b/api/kbcloud/model_cluster_termination_policy.go index bf21c1f4..3996ad93 100644 --- a/api/kbcloud/model_cluster_termination_policy.go +++ b/api/kbcloud/model_cluster_termination_policy.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // ClusterTerminationPolicy The termination policy of cluster. type ClusterTerminationPolicy string // List of ClusterTerminationPolicy. const ( ClusterTerminationPolicyDoNotTerminate ClusterTerminationPolicy = "DoNotTerminate" - ClusterTerminationPolicyHalt ClusterTerminationPolicy = "Halt" - ClusterTerminationPolicyDelete ClusterTerminationPolicy = "Delete" - ClusterTerminationPolicyWipeOut ClusterTerminationPolicy = "WipeOut" + ClusterTerminationPolicyHalt ClusterTerminationPolicy = "Halt" + ClusterTerminationPolicyDelete ClusterTerminationPolicy = "Delete" + ClusterTerminationPolicyWipeOut ClusterTerminationPolicy = "WipeOut" ) var allowedClusterTerminationPolicyEnumValues = []ClusterTerminationPolicy{ diff --git a/api/kbcloud/model_cluster_update.go b/api/kbcloud/model_cluster_update.go index e683a05c..96c88ed4 100644 --- a/api/kbcloud/model_cluster_update.go +++ b/api/kbcloud/model_cluster_update.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// ClusterUpdate ClusterUpdate is the payload to update a KubeBlocks cluster + +// ClusterUpdate ClusterUpdate is the payload to update a KubeBlocks cluster type ClusterUpdate struct { // The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Replicas *int32 `json:"replicas,omitempty"` @@ -28,13 +37,12 @@ type ClusterUpdate struct { ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` // Tolerations of cluster Tolerations *string `json:"tolerations,omitempty"` - // Display name of cluster. - DisplayName *string `json:"displayName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewClusterUpdate instantiates a new ClusterUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +63,6 @@ func NewClusterUpdateWithDefaults() *ClusterUpdate { this.TerminationPolicy = &terminationPolicy return &this } - // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *ClusterUpdate) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -84,6 +91,7 @@ func (o *ClusterUpdate) SetReplicas(v int32) { o.Replicas = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *ClusterUpdate) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -112,6 +120,7 @@ func (o *ClusterUpdate) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *ClusterUpdate) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -140,6 +149,7 @@ func (o *ClusterUpdate) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *ClusterUpdate) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -168,6 +178,7 @@ func (o *ClusterUpdate) SetStorage(v float64) { o.Storage = &v } + // GetTerminationPolicy returns the TerminationPolicy field value if set, zero value otherwise. func (o *ClusterUpdate) GetTerminationPolicy() ClusterTerminationPolicy { if o == nil || o.TerminationPolicy == nil { @@ -196,6 +207,7 @@ func (o *ClusterUpdate) SetTerminationPolicy(v ClusterTerminationPolicy) { o.TerminationPolicy = &v } + // GetMonitorEnabled returns the MonitorEnabled field value if set, zero value otherwise. func (o *ClusterUpdate) GetMonitorEnabled() bool { if o == nil || o.MonitorEnabled == nil { @@ -224,6 +236,7 @@ func (o *ClusterUpdate) SetMonitorEnabled(v bool) { o.MonitorEnabled = &v } + // GetVpcEndpointEnabled returns the VpcEndpointEnabled field value if set, zero value otherwise. func (o *ClusterUpdate) GetVpcEndpointEnabled() bool { if o == nil || o.VpcEndpointEnabled == nil { @@ -252,6 +265,7 @@ func (o *ClusterUpdate) SetVpcEndpointEnabled(v bool) { o.VpcEndpointEnabled = &v } + // GetInternetEndpointEnabled returns the InternetEndpointEnabled field value if set, zero value otherwise. func (o *ClusterUpdate) GetInternetEndpointEnabled() bool { if o == nil || o.InternetEndpointEnabled == nil { @@ -280,6 +294,7 @@ func (o *ClusterUpdate) SetInternetEndpointEnabled(v bool) { o.InternetEndpointEnabled = &v } + // GetParamTpls returns the ParamTpls field value if set, zero value otherwise. func (o *ClusterUpdate) GetParamTpls() []ParamTplsItem { if o == nil || o.ParamTpls == nil { @@ -308,6 +323,7 @@ func (o *ClusterUpdate) SetParamTpls(v []ParamTplsItem) { o.ParamTpls = v } + // GetTolerations returns the Tolerations field value if set, zero value otherwise. func (o *ClusterUpdate) GetTolerations() string { if o == nil || o.Tolerations == nil { @@ -336,33 +352,7 @@ func (o *ClusterUpdate) SetTolerations(v string) { o.Tolerations = &v } -// GetDisplayName returns the DisplayName field value if set, zero value otherwise. -func (o *ClusterUpdate) GetDisplayName() string { - if o == nil || o.DisplayName == nil { - 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 *ClusterUpdate) GetDisplayNameOk() (*string, bool) { - if o == nil || o.DisplayName == nil { - return nil, false - } - return o.DisplayName, true -} - -// HasDisplayName returns a boolean if a field has been set. -func (o *ClusterUpdate) HasDisplayName() bool { - return o != nil && o.DisplayName != nil -} -// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. -func (o *ClusterUpdate) SetDisplayName(v string) { - o.DisplayName = &v -} // MarshalJSON serializes the struct using spec logic. func (o ClusterUpdate) MarshalJSON() ([]byte, error) { @@ -400,9 +390,6 @@ func (o ClusterUpdate) MarshalJSON() ([]byte, error) { if o.Tolerations != nil { toSerialize["tolerations"] = o.Tolerations } - if o.DisplayName != nil { - toSerialize["displayName"] = o.DisplayName - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -413,24 +400,23 @@ func (o ClusterUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ClusterUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Replicas *int32 `json:"replicas,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *float64 `json:"storage,omitempty"` - TerminationPolicy *ClusterTerminationPolicy `json:"terminationPolicy,omitempty"` - MonitorEnabled *bool `json:"monitorEnabled,omitempty"` - VpcEndpointEnabled *bool `json:"vpcEndpointEnabled,omitempty"` - InternetEndpointEnabled *bool `json:"internetEndpointEnabled,omitempty"` - ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` - Tolerations *string `json:"tolerations,omitempty"` - DisplayName *string `json:"displayName,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *float64 `json:"storage,omitempty"` + TerminationPolicy *ClusterTerminationPolicy `json:"terminationPolicy,omitempty"` + MonitorEnabled *bool `json:"monitorEnabled,omitempty"` + VpcEndpointEnabled *bool `json:"vpcEndpointEnabled,omitempty"` + InternetEndpointEnabled *bool `json:"internetEndpointEnabled,omitempty"` + ParamTpls []ParamTplsItem `json:"paramTpls,omitempty"` + Tolerations *string `json:"tolerations,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"replicas", "cpu", "memory", "storage", "terminationPolicy", "monitorEnabled", "vpcEndpointEnabled", "internetEndpointEnabled", "paramTpls", "tolerations", "displayName"}) + common.DeleteKeys(additionalProperties, &[]string{ "replicas", "cpu", "memory", "storage", "terminationPolicy", "monitorEnabled", "vpcEndpointEnabled", "internetEndpointEnabled", "paramTpls", "tolerations", }) } else { return err } @@ -440,7 +426,7 @@ func (o *ClusterUpdate) UnmarshalJSON(bytes []byte) (err error) { o.Cpu = all.Cpu o.Memory = all.Memory o.Storage = all.Storage - if all.TerminationPolicy != nil && !all.TerminationPolicy.IsValid() { + if all.TerminationPolicy != nil &&!all.TerminationPolicy.IsValid() { hasInvalidField = true } else { o.TerminationPolicy = all.TerminationPolicy @@ -450,7 +436,6 @@ func (o *ClusterUpdate) UnmarshalJSON(bytes []byte) (err error) { o.InternetEndpointEnabled = all.InternetEndpointEnabled o.ParamTpls = all.ParamTpls o.Tolerations = all.Tolerations - o.DisplayName = all.DisplayName if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/kbcloud/model_component_ops_option.go b/api/kbcloud/model_component_ops_option.go index 354caa55..5f0623f8 100644 --- a/api/kbcloud/model_component_ops_option.go +++ b/api/kbcloud/model_component_ops_option.go @@ -2,28 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOpsOption struct { Component string `json:"component"` - DisableHa *bool `json:"disableHA,omitempty"` + DisableHa *bool `json:"disableHA,omitempty"` // parameter for rebuild instance ops InPlace *bool `json:"inPlace,omitempty"` // indicate whether backup is required when Inplace is true - NeedBackupWhenInPlace *bool `json:"needBackupWhenInPlace,omitempty"` - RestoreEnv []ComponentOpsOptionRestoreEnvItem `json:"restoreEnv,omitempty"` - DependentCustomOps *ComponentOpsOptionDependentCustomOps `json:"dependentCustomOps,omitempty"` + NeedBackupWhenInPlace *bool `json:"needBackupWhenInPlace,omitempty"` + RestoreEnv []ComponentOpsOptionRestoreEnvItem `json:"restoreEnv,omitempty"` + DependentCustomOps *ComponentOpsOptionDependentCustomOps `json:"dependentCustomOps,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOpsOption instantiates a new ComponentOpsOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +59,6 @@ func NewComponentOpsOptionWithDefaults() *ComponentOpsOption { this.NeedBackupWhenInPlace = &needBackupWhenInPlace return &this } - // GetComponent returns the Component field value. func (o *ComponentOpsOption) GetComponent() string { if o == nil { @@ -77,6 +82,7 @@ func (o *ComponentOpsOption) SetComponent(v string) { o.Component = v } + // GetDisableHa returns the DisableHa field value if set, zero value otherwise. func (o *ComponentOpsOption) GetDisableHa() bool { if o == nil || o.DisableHa == nil { @@ -105,6 +111,7 @@ func (o *ComponentOpsOption) SetDisableHa(v bool) { o.DisableHa = &v } + // GetInPlace returns the InPlace field value if set, zero value otherwise. func (o *ComponentOpsOption) GetInPlace() bool { if o == nil || o.InPlace == nil { @@ -133,6 +140,7 @@ func (o *ComponentOpsOption) SetInPlace(v bool) { o.InPlace = &v } + // GetNeedBackupWhenInPlace returns the NeedBackupWhenInPlace field value if set, zero value otherwise. func (o *ComponentOpsOption) GetNeedBackupWhenInPlace() bool { if o == nil || o.NeedBackupWhenInPlace == nil { @@ -161,6 +169,7 @@ func (o *ComponentOpsOption) SetNeedBackupWhenInPlace(v bool) { o.NeedBackupWhenInPlace = &v } + // GetRestoreEnv returns the RestoreEnv field value if set, zero value otherwise. func (o *ComponentOpsOption) GetRestoreEnv() []ComponentOpsOptionRestoreEnvItem { if o == nil || o.RestoreEnv == nil { @@ -189,6 +198,7 @@ func (o *ComponentOpsOption) SetRestoreEnv(v []ComponentOpsOptionRestoreEnvItem) o.RestoreEnv = v } + // GetDependentCustomOps returns the DependentCustomOps field value if set, zero value otherwise. func (o *ComponentOpsOption) GetDependentCustomOps() ComponentOpsOptionDependentCustomOps { if o == nil || o.DependentCustomOps == nil { @@ -217,6 +227,8 @@ func (o *ComponentOpsOption) SetDependentCustomOps(v ComponentOpsOptionDependent o.DependentCustomOps = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOpsOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -249,12 +261,12 @@ func (o ComponentOpsOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOpsOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` - DisableHa *bool `json:"disableHA,omitempty"` - InPlace *bool `json:"inPlace,omitempty"` - NeedBackupWhenInPlace *bool `json:"needBackupWhenInPlace,omitempty"` - RestoreEnv []ComponentOpsOptionRestoreEnvItem `json:"restoreEnv,omitempty"` - DependentCustomOps *ComponentOpsOptionDependentCustomOps `json:"dependentCustomOps,omitempty"` + Component *string `json:"component"` + DisableHa *bool `json:"disableHA,omitempty"` + InPlace *bool `json:"inPlace,omitempty"` + NeedBackupWhenInPlace *bool `json:"needBackupWhenInPlace,omitempty"` + RestoreEnv []ComponentOpsOptionRestoreEnvItem `json:"restoreEnv,omitempty"` + DependentCustomOps *ComponentOpsOptionDependentCustomOps `json:"dependentCustomOps,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -264,7 +276,7 @@ func (o *ComponentOpsOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "disableHA", "inPlace", "needBackupWhenInPlace", "restoreEnv", "dependentCustomOps"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "disableHA", "inPlace", "needBackupWhenInPlace", "restoreEnv", "dependentCustomOps", }) } else { return err } @@ -275,7 +287,7 @@ func (o *ComponentOpsOption) UnmarshalJSON(bytes []byte) (err error) { o.InPlace = all.InPlace o.NeedBackupWhenInPlace = all.NeedBackupWhenInPlace o.RestoreEnv = all.RestoreEnv - if all.DependentCustomOps != nil && all.DependentCustomOps.UnparsedObject != nil && o.UnparsedObject == nil { + if all.DependentCustomOps != nil && all.DependentCustomOps.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.DependentCustomOps = all.DependentCustomOps diff --git a/api/kbcloud/model_component_ops_option_dependent_custom_ops.go b/api/kbcloud/model_component_ops_option_dependent_custom_ops.go index 81824ea3..689d6649 100644 --- a/api/kbcloud/model_component_ops_option_dependent_custom_ops.go +++ b/api/kbcloud/model_component_ops_option_dependent_custom_ops.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentOpsOptionDependentCustomOps struct { // opsDefinition name OpsDefName *string `json:"opsDefName,omitempty"` @@ -22,10 +31,11 @@ type ComponentOpsOptionDependentCustomOps struct { // custom ops parameters Params []ComponentOpsOptionDependentCustomOpsParamsItem `json:"params,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOpsOptionDependentCustomOps instantiates a new ComponentOpsOptionDependentCustomOps object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +52,6 @@ func NewComponentOpsOptionDependentCustomOpsWithDefaults() *ComponentOpsOptionDe this := ComponentOpsOptionDependentCustomOps{} return &this } - // GetOpsDefName returns the OpsDefName field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOps) GetOpsDefName() string { if o == nil || o.OpsDefName == nil { @@ -71,6 +80,7 @@ func (o *ComponentOpsOptionDependentCustomOps) SetOpsDefName(v string) { o.OpsDefName = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOps) GetComponent() string { if o == nil || o.Component == nil { @@ -99,6 +109,7 @@ func (o *ComponentOpsOptionDependentCustomOps) SetComponent(v string) { o.Component = &v } + // GetWhen returns the When field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOps) GetWhen() string { if o == nil || o.When == nil { @@ -127,6 +138,7 @@ func (o *ComponentOpsOptionDependentCustomOps) SetWhen(v string) { o.When = &v } + // GetParams returns the Params field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOps) GetParams() []ComponentOpsOptionDependentCustomOpsParamsItem { if o == nil || o.Params == nil { @@ -155,6 +167,8 @@ func (o *ComponentOpsOptionDependentCustomOps) SetParams(v []ComponentOpsOptionD o.Params = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOpsOptionDependentCustomOps) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -183,17 +197,17 @@ func (o ComponentOpsOptionDependentCustomOps) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOpsOptionDependentCustomOps) UnmarshalJSON(bytes []byte) (err error) { all := struct { - OpsDefName *string `json:"opsDefName,omitempty"` - Component *string `json:"component,omitempty"` - When *string `json:"when,omitempty"` - Params []ComponentOpsOptionDependentCustomOpsParamsItem `json:"params,omitempty"` + OpsDefName *string `json:"opsDefName,omitempty"` + Component *string `json:"component,omitempty"` + When *string `json:"when,omitempty"` + Params []ComponentOpsOptionDependentCustomOpsParamsItem `json:"params,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"opsDefName", "component", "when", "params"}) + common.DeleteKeys(additionalProperties, &[]string{ "opsDefName", "component", "when", "params", }) } else { return err } diff --git a/api/kbcloud/model_component_ops_option_dependent_custom_ops_params_item.go b/api/kbcloud/model_component_ops_option_dependent_custom_ops_params_item.go index dd0dbbc3..ec24bb76 100644 --- a/api/kbcloud/model_component_ops_option_dependent_custom_ops_params_item.go +++ b/api/kbcloud/model_component_ops_option_dependent_custom_ops_params_item.go @@ -2,14 +2,23 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentOpsOptionDependentCustomOpsParamsItem struct { // parameter name. Name *string `json:"name,omitempty"` - // parameter value, you can define a go template expression to refer the variable of the current ops. + // parameter value, you can define a go template expression to refer the variable of the current ops. // available built-in objects that can be referenced in the expression include: // - cluster: cluster record // - params: ops input parameters @@ -18,10 +27,11 @@ type ComponentOpsOptionDependentCustomOpsParamsItem struct { // Value *string `json:"value,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOpsOptionDependentCustomOpsParamsItem instantiates a new ComponentOpsOptionDependentCustomOpsParamsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +48,6 @@ func NewComponentOpsOptionDependentCustomOpsParamsItemWithDefaults() *ComponentO this := ComponentOpsOptionDependentCustomOpsParamsItem{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOpsParamsItem) GetName() string { if o == nil || o.Name == nil { @@ -67,6 +76,7 @@ func (o *ComponentOpsOptionDependentCustomOpsParamsItem) SetName(v string) { o.Name = &v } + // GetValue returns the Value field value if set, zero value otherwise. func (o *ComponentOpsOptionDependentCustomOpsParamsItem) GetValue() string { if o == nil || o.Value == nil { @@ -95,6 +105,8 @@ func (o *ComponentOpsOptionDependentCustomOpsParamsItem) SetValue(v string) { o.Value = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOpsOptionDependentCustomOpsParamsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -117,7 +129,7 @@ func (o ComponentOpsOptionDependentCustomOpsParamsItem) MarshalJSON() ([]byte, e // UnmarshalJSON deserializes the given payload. func (o *ComponentOpsOptionDependentCustomOpsParamsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -125,7 +137,7 @@ func (o *ComponentOpsOptionDependentCustomOpsParamsItem) UnmarshalJSON(bytes []b } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "value", }) } else { return err } diff --git a/api/kbcloud/model_component_ops_option_restore_env_item.go b/api/kbcloud/model_component_ops_option_restore_env_item.go index c3c658da..c4fe9789 100644 --- a/api/kbcloud/model_component_ops_option_restore_env_item.go +++ b/api/kbcloud/model_component_ops_option_restore_env_item.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOpsOptionRestoreEnvItem struct { // env name Name string `json:"name"` // env value Value string `json:"value"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOpsOptionRestoreEnvItem instantiates a new ComponentOpsOptionRestoreEnvItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewComponentOpsOptionRestoreEnvItemWithDefaults() *ComponentOpsOptionRestor this := ComponentOpsOptionRestoreEnvItem{} return &this } - // GetName returns the Name field value. func (o *ComponentOpsOptionRestoreEnvItem) GetName() string { if o == nil { @@ -62,6 +67,7 @@ func (o *ComponentOpsOptionRestoreEnvItem) SetName(v string) { o.Name = v } + // GetValue returns the Value field value. func (o *ComponentOpsOptionRestoreEnvItem) GetValue() string { if o == nil { @@ -85,6 +91,8 @@ func (o *ComponentOpsOptionRestoreEnvItem) SetValue(v string) { o.Value = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOpsOptionRestoreEnvItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -103,7 +111,7 @@ func (o ComponentOpsOptionRestoreEnvItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOpsOptionRestoreEnvItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` Value *string `json:"value"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +125,7 @@ func (o *ComponentOpsOptionRestoreEnvItem) UnmarshalJSON(bytes []byte) (err erro } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "value", }) } else { return err } diff --git a/api/kbcloud/model_component_option.go b/api/kbcloud/model_component_option.go index afb36a0f..9513ebf2 100644 --- a/api/kbcloud/model_component_option.go +++ b/api/kbcloud/model_component_option.go @@ -2,32 +2,38 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOption struct { // component type Name string `json:"name"` // Determine whether the componentDef of kb-cluster belongs to this component type through this matching regularization. // if not set, componentDef must be equal to component type. // - MatchRegex *string `json:"matchRegex,omitempty"` - Title LocalizedDescription `json:"title"` - Order int32 `json:"order"` - RoleOrder []string `json:"roleOrder"` - Version *ComponentOptionVersion `json:"version,omitempty"` + MatchRegex *string `json:"matchRegex,omitempty"` + Title LocalizedDescription `json:"title"` + Order int32 `json:"order"` + RoleOrder []string `json:"roleOrder"` + Version *ComponentOptionVersion `json:"version,omitempty"` // Main component flag Main *bool `json:"main,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOption instantiates a new ComponentOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -48,7 +54,6 @@ func NewComponentOptionWithDefaults() *ComponentOption { this := ComponentOption{} return &this } - // GetName returns the Name field value. func (o *ComponentOption) GetName() string { if o == nil { @@ -72,6 +77,7 @@ func (o *ComponentOption) SetName(v string) { o.Name = v } + // GetMatchRegex returns the MatchRegex field value if set, zero value otherwise. func (o *ComponentOption) GetMatchRegex() string { if o == nil || o.MatchRegex == nil { @@ -100,6 +106,7 @@ func (o *ComponentOption) SetMatchRegex(v string) { o.MatchRegex = &v } + // GetTitle returns the Title field value. func (o *ComponentOption) GetTitle() LocalizedDescription { if o == nil { @@ -123,6 +130,7 @@ func (o *ComponentOption) SetTitle(v LocalizedDescription) { o.Title = v } + // GetOrder returns the Order field value. func (o *ComponentOption) GetOrder() int32 { if o == nil { @@ -146,6 +154,7 @@ func (o *ComponentOption) SetOrder(v int32) { o.Order = v } + // GetRoleOrder returns the RoleOrder field value. func (o *ComponentOption) GetRoleOrder() []string { if o == nil { @@ -169,6 +178,7 @@ func (o *ComponentOption) SetRoleOrder(v []string) { o.RoleOrder = v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *ComponentOption) GetVersion() ComponentOptionVersion { if o == nil || o.Version == nil { @@ -197,6 +207,7 @@ func (o *ComponentOption) SetVersion(v ComponentOptionVersion) { o.Version = &v } + // GetMain returns the Main field value if set, zero value otherwise. func (o *ComponentOption) GetMain() bool { if o == nil || o.Main == nil { @@ -225,6 +236,8 @@ func (o *ComponentOption) SetMain(v bool) { o.Main = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -254,13 +267,13 @@ func (o ComponentOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - MatchRegex *string `json:"matchRegex,omitempty"` - Title *LocalizedDescription `json:"title"` - Order *int32 `json:"order"` - RoleOrder *[]string `json:"roleOrder"` - Version *ComponentOptionVersion `json:"version,omitempty"` - Main *bool `json:"main,omitempty"` + Name *string `json:"name"` + MatchRegex *string `json:"matchRegex,omitempty"` + Title *LocalizedDescription `json:"title"` + Order *int32 `json:"order"` + RoleOrder *[]string `json:"roleOrder"` + Version *ComponentOptionVersion `json:"version,omitempty"` + Main *bool `json:"main,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -279,7 +292,7 @@ func (o *ComponentOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "matchRegex", "title", "order", "roleOrder", "version", "main"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "matchRegex", "title", "order", "roleOrder", "version", "main", }) } else { return err } @@ -293,7 +306,7 @@ func (o *ComponentOption) UnmarshalJSON(bytes []byte) (err error) { o.Title = *all.Title o.Order = *all.Order o.RoleOrder = *all.RoleOrder - if all.Version != nil && all.Version.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Version != nil && all.Version.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Version = all.Version diff --git a/api/kbcloud/model_component_option_version.go b/api/kbcloud/model_component_option_version.go index d6a2240f..c8cb1ed8 100644 --- a/api/kbcloud/model_component_option_version.go +++ b/api/kbcloud/model_component_option_version.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOptionVersion struct { // component version name - ComponentVersionName string `json:"componentVersionName"` - MinorVersion *ComponentOptionVersionMinorVersion `json:"minorVersion,omitempty"` - MajorVersion ComponentOptionVersionMajorVersion `json:"majorVersion"` + ComponentVersionName string `json:"componentVersionName"` + MinorVersion *ComponentOptionVersionMinorVersion `json:"minorVersion,omitempty"` + MajorVersion ComponentOptionVersionMajorVersion `json:"majorVersion"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOptionVersion instantiates a new ComponentOptionVersion object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewComponentOptionVersionWithDefaults() *ComponentOptionVersion { this := ComponentOptionVersion{} return &this } - // GetComponentVersionName returns the ComponentVersionName field value. func (o *ComponentOptionVersion) GetComponentVersionName() string { if o == nil { @@ -62,6 +67,7 @@ func (o *ComponentOptionVersion) SetComponentVersionName(v string) { o.ComponentVersionName = v } + // GetMinorVersion returns the MinorVersion field value if set, zero value otherwise. func (o *ComponentOptionVersion) GetMinorVersion() ComponentOptionVersionMinorVersion { if o == nil || o.MinorVersion == nil { @@ -90,6 +96,7 @@ func (o *ComponentOptionVersion) SetMinorVersion(v ComponentOptionVersionMinorVe o.MinorVersion = &v } + // GetMajorVersion returns the MajorVersion field value. func (o *ComponentOptionVersion) GetMajorVersion() ComponentOptionVersionMajorVersion { if o == nil { @@ -113,6 +120,8 @@ func (o *ComponentOptionVersion) SetMajorVersion(v ComponentOptionVersionMajorVe o.MajorVersion = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOptionVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -134,9 +143,9 @@ func (o ComponentOptionVersion) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOptionVersion) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ComponentVersionName *string `json:"componentVersionName"` - MinorVersion *ComponentOptionVersionMinorVersion `json:"minorVersion,omitempty"` - MajorVersion *ComponentOptionVersionMajorVersion `json:"majorVersion"` + ComponentVersionName *string `json:"componentVersionName"` + MinorVersion *ComponentOptionVersionMinorVersion `json:"minorVersion,omitempty"` + MajorVersion *ComponentOptionVersionMajorVersion `json:"majorVersion"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,14 +158,14 @@ func (o *ComponentOptionVersion) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"componentVersionName", "minorVersion", "majorVersion"}) + common.DeleteKeys(additionalProperties, &[]string{ "componentVersionName", "minorVersion", "majorVersion", }) } else { return err } hasInvalidField := false o.ComponentVersionName = *all.ComponentVersionName - if all.MinorVersion != nil && all.MinorVersion.UnparsedObject != nil && o.UnparsedObject == nil { + if all.MinorVersion != nil && all.MinorVersion.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.MinorVersion = all.MinorVersion diff --git a/api/kbcloud/model_component_option_version_major_version.go b/api/kbcloud/model_component_option_version_major_version.go index 681f3b06..54c8257f 100644 --- a/api/kbcloud/model_component_option_version_major_version.go +++ b/api/kbcloud/model_component_option_version_major_version.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ComponentOptionVersionMajorVersion struct { // default major version. Default *string `json:"default,omitempty"` - // ServiceVersion uses semver syntax(X Y.Z), such MySQL 5.7.4 and PG 14.8.0. + // ServiceVersion uses semver syntax(X Y.Z), such MySQL 5.7.4 and PG 14.8.0. // Currently supports [X, X.Y, X.Y.Z] formats to determine major versions of the engine from the serviceVersion // - Rule string `json:"rule"` + Rule string `json:"rule"` VersionMapping []ComponentOptionVersionMajorVersionVersionMappingItem `json:"versionMapping,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOptionVersionMajorVersion instantiates a new ComponentOptionVersionMajorVersion object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewComponentOptionVersionMajorVersionWithDefaults() *ComponentOptionVersion this := ComponentOptionVersionMajorVersion{} return &this } - // GetDefault returns the Default field value if set, zero value otherwise. func (o *ComponentOptionVersionMajorVersion) GetDefault() string { if o == nil || o.Default == nil { @@ -69,6 +74,7 @@ func (o *ComponentOptionVersionMajorVersion) SetDefault(v string) { o.Default = &v } + // GetRule returns the Rule field value. func (o *ComponentOptionVersionMajorVersion) GetRule() string { if o == nil { @@ -92,6 +98,7 @@ func (o *ComponentOptionVersionMajorVersion) SetRule(v string) { o.Rule = v } + // GetVersionMapping returns the VersionMapping field value if set, zero value otherwise. func (o *ComponentOptionVersionMajorVersion) GetVersionMapping() []ComponentOptionVersionMajorVersionVersionMappingItem { if o == nil || o.VersionMapping == nil { @@ -120,6 +127,8 @@ func (o *ComponentOptionVersionMajorVersion) SetVersionMapping(v []ComponentOpti o.VersionMapping = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOptionVersionMajorVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o ComponentOptionVersionMajorVersion) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOptionVersionMajorVersion) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Default *string `json:"default,omitempty"` - Rule *string `json:"rule"` + Default *string `json:"default,omitempty"` + Rule *string `json:"rule"` VersionMapping []ComponentOptionVersionMajorVersionVersionMappingItem `json:"versionMapping,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *ComponentOptionVersionMajorVersion) UnmarshalJSON(bytes []byte) (err er } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"default", "rule", "versionMapping"}) + common.DeleteKeys(additionalProperties, &[]string{ "default", "rule", "versionMapping", }) } else { return err } diff --git a/api/kbcloud/model_component_option_version_major_version_version_mapping_item.go b/api/kbcloud/model_component_option_version_major_version_version_mapping_item.go index 3fefbd96..8029ddd2 100644 --- a/api/kbcloud/model_component_option_version_major_version_version_mapping_item.go +++ b/api/kbcloud/model_component_option_version_major_version_version_mapping_item.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ComponentOptionVersionMajorVersionVersionMappingItem Configure the mapping relationship with the main component's major versions. +// ComponentOptionVersionMajorVersionVersionMappingItem Configure the mapping relationship with the main component's major versions. type ComponentOptionVersionMajorVersionVersionMappingItem struct { // major version of the main component MainComponentMajorVersion *string `json:"mainComponentMajorVersion,omitempty"` // major versions of the current component Versions []string `json:"versions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOptionVersionMajorVersionVersionMappingItem instantiates a new ComponentOptionVersionMajorVersionVersionMappingItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewComponentOptionVersionMajorVersionVersionMappingItemWithDefaults() *Comp this := ComponentOptionVersionMajorVersionVersionMappingItem{} return &this } - // GetMainComponentMajorVersion returns the MainComponentMajorVersion field value if set, zero value otherwise. func (o *ComponentOptionVersionMajorVersionVersionMappingItem) GetMainComponentMajorVersion() string { if o == nil || o.MainComponentMajorVersion == nil { @@ -62,6 +71,7 @@ func (o *ComponentOptionVersionMajorVersionVersionMappingItem) SetMainComponentM o.MainComponentMajorVersion = &v } + // GetVersions returns the Versions field value if set, zero value otherwise. func (o *ComponentOptionVersionMajorVersionVersionMappingItem) GetVersions() []string { if o == nil || o.Versions == nil { @@ -90,6 +100,8 @@ func (o *ComponentOptionVersionMajorVersionVersionMappingItem) SetVersions(v []s o.Versions = v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOptionVersionMajorVersionVersionMappingItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o ComponentOptionVersionMajorVersionVersionMappingItem) MarshalJSON() ([]b // UnmarshalJSON deserializes the given payload. func (o *ComponentOptionVersionMajorVersionVersionMappingItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - MainComponentMajorVersion *string `json:"mainComponentMajorVersion,omitempty"` - Versions []string `json:"versions,omitempty"` + MainComponentMajorVersion *string `json:"mainComponentMajorVersion,omitempty"` + Versions []string `json:"versions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"mainComponentMajorVersion", "versions"}) + common.DeleteKeys(additionalProperties, &[]string{ "mainComponentMajorVersion", "versions", }) } else { return err } diff --git a/api/kbcloud/model_component_option_version_minor_version.go b/api/kbcloud/model_component_option_version_minor_version.go index 793b7c4a..5581be01 100644 --- a/api/kbcloud/model_component_option_version_minor_version.go +++ b/api/kbcloud/model_component_option_version_minor_version.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentOptionVersionMinorVersion struct { // determine whether minor version can be rolled back. Rollback *bool `json:"rollback,omitempty"` // disable roll back the preRelease minor version. DisableRollbackPreRelease *bool `json:"disableRollbackPreRelease,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentOptionVersionMinorVersion instantiates a new ComponentOptionVersionMinorVersion object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewComponentOptionVersionMinorVersionWithDefaults() *ComponentOptionVersion this := ComponentOptionVersionMinorVersion{} return &this } - // GetRollback returns the Rollback field value if set, zero value otherwise. func (o *ComponentOptionVersionMinorVersion) GetRollback() bool { if o == nil || o.Rollback == nil { @@ -61,6 +70,7 @@ func (o *ComponentOptionVersionMinorVersion) SetRollback(v bool) { o.Rollback = &v } + // GetDisableRollbackPreRelease returns the DisableRollbackPreRelease field value if set, zero value otherwise. func (o *ComponentOptionVersionMinorVersion) GetDisableRollbackPreRelease() bool { if o == nil || o.DisableRollbackPreRelease == nil { @@ -89,6 +99,8 @@ func (o *ComponentOptionVersionMinorVersion) SetDisableRollbackPreRelease(v bool o.DisableRollbackPreRelease = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentOptionVersionMinorVersion) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +123,7 @@ func (o ComponentOptionVersionMinorVersion) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentOptionVersionMinorVersion) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Rollback *bool `json:"rollback,omitempty"` + Rollback *bool `json:"rollback,omitempty"` DisableRollbackPreRelease *bool `json:"disableRollbackPreRelease,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +131,7 @@ func (o *ComponentOptionVersionMinorVersion) UnmarshalJSON(bytes []byte) (err er } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"rollback", "disableRollbackPreRelease"}) + common.DeleteKeys(additionalProperties, &[]string{ "rollback", "disableRollbackPreRelease", }) } else { return err } diff --git a/api/kbcloud/model_components_item.go b/api/kbcloud/model_components_item.go index 05b43b92..2d2ce035 100644 --- a/api/kbcloud/model_components_item.go +++ b/api/kbcloud/model_components_item.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentsItem struct { // component name Name *string `json:"name,omitempty"` @@ -18,8 +27,8 @@ type ComponentsItem struct { // enable monitor Monitor *bool `json:"monitor,omitempty"` // The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. - Replicas *int32 `json:"replicas,omitempty"` - ClassCode *string `json:"classCode,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + ClassCode *string `json:"classCode,omitempty"` ClassSeries *string `json:"classSeries,omitempty"` // CPU cores. Cpu *float64 `json:"cpu,omitempty"` @@ -28,15 +37,16 @@ type ComponentsItem struct { // Storage Storage *string `json:"storage,omitempty"` // StorageClass name - StorageClass *string `json:"storageClass,omitempty"` - Volumes []ComponentsItemVolumesItem `json:"volumes,omitempty"` + StorageClass *string `json:"storageClass,omitempty"` + Volumes []ComponentsItemVolumesItem `json:"volumes,omitempty"` // Cluster main component codeShort CodeShort *string `json:"codeShort,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentsItem instantiates a new ComponentsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +63,6 @@ func NewComponentsItemWithDefaults() *ComponentsItem { this := ComponentsItem{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *ComponentsItem) GetName() string { if o == nil || o.Name == nil { @@ -82,6 +91,7 @@ func (o *ComponentsItem) SetName(v string) { o.Name = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ComponentsItem) GetComponent() string { if o == nil || o.Component == nil { @@ -110,6 +120,7 @@ func (o *ComponentsItem) SetComponent(v string) { o.Component = &v } + // GetComponentDef returns the ComponentDef field value if set, zero value otherwise. func (o *ComponentsItem) GetComponentDef() string { if o == nil || o.ComponentDef == nil { @@ -138,6 +149,7 @@ func (o *ComponentsItem) SetComponentDef(v string) { o.ComponentDef = &v } + // GetCompNum returns the CompNum field value if set, zero value otherwise. func (o *ComponentsItem) GetCompNum() int32 { if o == nil || o.CompNum == nil { @@ -166,6 +178,7 @@ func (o *ComponentsItem) SetCompNum(v int32) { o.CompNum = &v } + // GetMonitor returns the Monitor field value if set, zero value otherwise. func (o *ComponentsItem) GetMonitor() bool { if o == nil || o.Monitor == nil { @@ -194,6 +207,7 @@ func (o *ComponentsItem) SetMonitor(v bool) { o.Monitor = &v } + // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *ComponentsItem) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -222,6 +236,7 @@ func (o *ComponentsItem) SetReplicas(v int32) { o.Replicas = &v } + // GetClassCode returns the ClassCode field value if set, zero value otherwise. func (o *ComponentsItem) GetClassCode() string { if o == nil || o.ClassCode == nil { @@ -250,6 +265,7 @@ func (o *ComponentsItem) SetClassCode(v string) { o.ClassCode = &v } + // GetClassSeries returns the ClassSeries field value if set, zero value otherwise. func (o *ComponentsItem) GetClassSeries() string { if o == nil || o.ClassSeries == nil { @@ -278,6 +294,7 @@ func (o *ComponentsItem) SetClassSeries(v string) { o.ClassSeries = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *ComponentsItem) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -306,6 +323,7 @@ func (o *ComponentsItem) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *ComponentsItem) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -334,6 +352,7 @@ func (o *ComponentsItem) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *ComponentsItem) GetStorage() string { if o == nil || o.Storage == nil { @@ -362,6 +381,7 @@ func (o *ComponentsItem) SetStorage(v string) { o.Storage = &v } + // GetStorageClass returns the StorageClass field value if set, zero value otherwise. func (o *ComponentsItem) GetStorageClass() string { if o == nil || o.StorageClass == nil { @@ -390,6 +410,7 @@ func (o *ComponentsItem) SetStorageClass(v string) { o.StorageClass = &v } + // GetVolumes returns the Volumes field value if set, zero value otherwise. func (o *ComponentsItem) GetVolumes() []ComponentsItemVolumesItem { if o == nil || o.Volumes == nil { @@ -418,6 +439,7 @@ func (o *ComponentsItem) SetVolumes(v []ComponentsItemVolumesItem) { o.Volumes = v } + // GetCodeShort returns the CodeShort field value if set, zero value otherwise. func (o *ComponentsItem) GetCodeShort() string { if o == nil || o.CodeShort == nil { @@ -446,6 +468,8 @@ func (o *ComponentsItem) SetCodeShort(v string) { o.CodeShort = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -504,27 +528,27 @@ func (o ComponentsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Component *string `json:"component,omitempty"` - ComponentDef *string `json:"componentDef,omitempty"` - CompNum *int32 `json:"compNum,omitempty"` - Monitor *bool `json:"monitor,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - ClassCode *string `json:"classCode,omitempty"` - ClassSeries *string `json:"classSeries,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *string `json:"storage,omitempty"` - StorageClass *string `json:"storageClass,omitempty"` - Volumes []ComponentsItemVolumesItem `json:"volumes,omitempty"` - CodeShort *string `json:"codeShort,omitempty"` + Name *string `json:"name,omitempty"` + Component *string `json:"component,omitempty"` + ComponentDef *string `json:"componentDef,omitempty"` + CompNum *int32 `json:"compNum,omitempty"` + Monitor *bool `json:"monitor,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + ClassCode *string `json:"classCode,omitempty"` + ClassSeries *string `json:"classSeries,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *string `json:"storage,omitempty"` + StorageClass *string `json:"storageClass,omitempty"` + Volumes []ComponentsItemVolumesItem `json:"volumes,omitempty"` + CodeShort *string `json:"codeShort,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "component", "componentDef", "compNum", "monitor", "replicas", "classCode", "classSeries", "cpu", "memory", "storage", "storageClass", "volumes", "codeShort"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "component", "componentDef", "compNum", "monitor", "replicas", "classCode", "classSeries", "cpu", "memory", "storage", "storageClass", "volumes", "codeShort", }) } else { return err } diff --git a/api/kbcloud/model_components_item_volumes_item.go b/api/kbcloud/model_components_item_volumes_item.go index 41c309e1..1a23645c 100644 --- a/api/kbcloud/model_components_item_volumes_item.go +++ b/api/kbcloud/model_components_item_volumes_item.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ComponentsItemVolumesItem struct { // volume name Name *string `json:"name,omitempty"` // Storage size, the unit is Gi. Storage *float64 `json:"storage,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewComponentsItemVolumesItem instantiates a new ComponentsItemVolumesItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewComponentsItemVolumesItemWithDefaults() *ComponentsItemVolumesItem { this := ComponentsItemVolumesItem{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *ComponentsItemVolumesItem) GetName() string { if o == nil || o.Name == nil { @@ -61,6 +70,7 @@ func (o *ComponentsItemVolumesItem) SetName(v string) { o.Name = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *ComponentsItemVolumesItem) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -89,6 +99,8 @@ func (o *ComponentsItemVolumesItem) SetStorage(v float64) { o.Storage = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ComponentsItemVolumesItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +123,7 @@ func (o ComponentsItemVolumesItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ComponentsItemVolumesItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Storage *float64 `json:"storage,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +131,7 @@ func (o *ComponentsItemVolumesItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "storage"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "storage", }) } else { return err } diff --git a/api/kbcloud/model_configuration.go b/api/kbcloud/model_configuration.go index fdaa4f58..b0ef58b7 100644 --- a/api/kbcloud/model_configuration.go +++ b/api/kbcloud/model_configuration.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Configuration Cluster parameters configuration, include the file name and content of the parameters + + +// Configuration Cluster parameters configuration, include the file name and content of the parameters type Configuration struct { // The name of the configuration file FileName string `json:"fileName"` // The content of the configuration file Content string `json:"content"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewConfiguration instantiates a new Configuration object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewConfigurationWithDefaults() *Configuration { this := Configuration{} return &this } - // GetFileName returns the FileName field value. func (o *Configuration) GetFileName() string { if o == nil { @@ -63,6 +68,7 @@ func (o *Configuration) SetFileName(v string) { o.FileName = v } + // GetContent returns the Content field value. func (o *Configuration) GetContent() string { if o == nil { @@ -86,6 +92,8 @@ func (o *Configuration) SetContent(v string) { o.Content = v } + + // MarshalJSON serializes the struct using spec logic. func (o Configuration) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -105,7 +113,7 @@ func (o Configuration) MarshalJSON() ([]byte, error) { func (o *Configuration) UnmarshalJSON(bytes []byte) (err error) { all := struct { FileName *string `json:"fileName"` - Content *string `json:"content"` + Content *string `json:"content"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *Configuration) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"fileName", "content"}) + common.DeleteKeys(additionalProperties, &[]string{ "fileName", "content", }) } else { return err } diff --git a/api/kbcloud/model_configuration_list.go b/api/kbcloud/model_configuration_list.go index 456856f9..48076e6d 100644 --- a/api/kbcloud/model_configuration_list.go +++ b/api/kbcloud/model_configuration_list.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ConfigurationList A list of cluster parameters configuration +// ConfigurationList A list of cluster parameters configuration type ConfigurationList struct { Items []Configuration `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewConfigurationList instantiates a new ConfigurationList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewConfigurationListWithDefaults() *ConfigurationList { this := ConfigurationList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ConfigurationList) GetItems() []Configuration { if o == nil || o.Items == nil { @@ -59,6 +68,8 @@ func (o *ConfigurationList) SetItems(v []Configuration) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ConfigurationList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *ConfigurationList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_configuration_with_regex.go b/api/kbcloud/model_configuration_with_regex.go index 8ab5ddae..1c088ac3 100644 --- a/api/kbcloud/model_configuration_with_regex.go +++ b/api/kbcloud/model_configuration_with_regex.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ConfigurationWithRegex Cluster parameters configuration, include the file name and content of the parameters + + +// ConfigurationWithRegex Cluster parameters configuration, include the file name and content of the parameters type ConfigurationWithRegex struct { // The name of the configuration file FileName string `json:"fileName"` @@ -19,10 +24,11 @@ type ConfigurationWithRegex struct { // the template regex Regex string `json:"regex"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewConfigurationWithRegex instantiates a new ConfigurationWithRegex object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewConfigurationWithRegexWithDefaults() *ConfigurationWithRegex { this := ConfigurationWithRegex{} return &this } - // GetFileName returns the FileName field value. func (o *ConfigurationWithRegex) GetFileName() string { if o == nil { @@ -66,6 +71,7 @@ func (o *ConfigurationWithRegex) SetFileName(v string) { o.FileName = v } + // GetContent returns the Content field value. func (o *ConfigurationWithRegex) GetContent() string { if o == nil { @@ -89,6 +95,7 @@ func (o *ConfigurationWithRegex) SetContent(v string) { o.Content = v } + // GetRegex returns the Regex field value. func (o *ConfigurationWithRegex) GetRegex() string { if o == nil { @@ -112,6 +119,8 @@ func (o *ConfigurationWithRegex) SetRegex(v string) { o.Regex = v } + + // MarshalJSON serializes the struct using spec logic. func (o ConfigurationWithRegex) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -132,8 +141,8 @@ func (o ConfigurationWithRegex) MarshalJSON() ([]byte, error) { func (o *ConfigurationWithRegex) UnmarshalJSON(bytes []byte) (err error) { all := struct { FileName *string `json:"fileName"` - Content *string `json:"content"` - Regex *string `json:"regex"` + Content *string `json:"content"` + Regex *string `json:"regex"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,7 +158,7 @@ func (o *ConfigurationWithRegex) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"fileName", "content", "regex"}) + common.DeleteKeys(additionalProperties, &[]string{ "fileName", "content", "regex", }) } else { return err } diff --git a/api/kbcloud/model_cpu.go b/api/kbcloud/model_cpu.go index 5cdbe52e..312c53d5 100644 --- a/api/kbcloud/model_cpu.go +++ b/api/kbcloud/model_cpu.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type CPU struct { - CpuCapacity *string `json:"cpu_capacity,omitempty"` + CpuCapacity *string `json:"cpu_capacity,omitempty"` CpuCapacityMax *string `json:"cpu_capacity_max,omitempty"` - CpuAssigned *string `json:"cpu_assigned,omitempty"` + CpuAssigned *string `json:"cpu_assigned,omitempty"` CpuAssignedMax *string `json:"cpu_assigned_max,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewCPU instantiates a new CPU object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewCPUWithDefaults() *CPU { this := CPU{} return &this } - // GetCpuCapacity returns the CpuCapacity field value if set, zero value otherwise. func (o *CPU) GetCpuCapacity() string { if o == nil || o.CpuCapacity == nil { @@ -61,6 +70,7 @@ func (o *CPU) SetCpuCapacity(v string) { o.CpuCapacity = &v } + // GetCpuCapacityMax returns the CpuCapacityMax field value if set, zero value otherwise. func (o *CPU) GetCpuCapacityMax() string { if o == nil || o.CpuCapacityMax == nil { @@ -89,6 +99,7 @@ func (o *CPU) SetCpuCapacityMax(v string) { o.CpuCapacityMax = &v } + // GetCpuAssigned returns the CpuAssigned field value if set, zero value otherwise. func (o *CPU) GetCpuAssigned() string { if o == nil || o.CpuAssigned == nil { @@ -117,6 +128,7 @@ func (o *CPU) SetCpuAssigned(v string) { o.CpuAssigned = &v } + // GetCpuAssignedMax returns the CpuAssignedMax field value if set, zero value otherwise. func (o *CPU) GetCpuAssignedMax() string { if o == nil || o.CpuAssignedMax == nil { @@ -145,6 +157,8 @@ func (o *CPU) SetCpuAssignedMax(v string) { o.CpuAssignedMax = &v } + + // MarshalJSON serializes the struct using spec logic. func (o CPU) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -173,9 +187,9 @@ func (o CPU) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *CPU) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CpuCapacity *string `json:"cpu_capacity,omitempty"` + CpuCapacity *string `json:"cpu_capacity,omitempty"` CpuCapacityMax *string `json:"cpu_capacity_max,omitempty"` - CpuAssigned *string `json:"cpu_assigned,omitempty"` + CpuAssigned *string `json:"cpu_assigned,omitempty"` CpuAssignedMax *string `json:"cpu_assigned_max,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -183,7 +197,7 @@ func (o *CPU) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cpu_capacity", "cpu_capacity_max", "cpu_assigned", "cpu_assigned_max"}) + common.DeleteKeys(additionalProperties, &[]string{ "cpu_capacity", "cpu_capacity_max", "cpu_assigned", "cpu_assigned_max", }) } else { return err } diff --git a/api/kbcloud/model_dashboard_option.go b/api/kbcloud/model_dashboard_option.go index f8c2911c..358beecb 100644 --- a/api/kbcloud/model_dashboard_option.go +++ b/api/kbcloud/model_dashboard_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type DashboardOption struct { - Component string `json:"component"` - DashboardUid string `json:"dashboardUid"` - Variables map[string]string `json:"variables"` + Component string `json:"component"` + DashboardUid string `json:"dashboardUid"` + Variables map[string]string `json:"variables"` InstancePanels []DashboardOptionInstancePanelsItem `json:"instancePanels"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDashboardOption instantiates a new DashboardOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewDashboardOptionWithDefaults() *DashboardOption { this := DashboardOption{} return &this } - // GetComponent returns the Component field value. func (o *DashboardOption) GetComponent() string { if o == nil { @@ -64,6 +69,7 @@ func (o *DashboardOption) SetComponent(v string) { o.Component = v } + // GetDashboardUid returns the DashboardUid field value. func (o *DashboardOption) GetDashboardUid() string { if o == nil { @@ -87,6 +93,7 @@ func (o *DashboardOption) SetDashboardUid(v string) { o.DashboardUid = v } + // GetVariables returns the Variables field value. func (o *DashboardOption) GetVariables() map[string]string { if o == nil { @@ -110,6 +117,7 @@ func (o *DashboardOption) SetVariables(v map[string]string) { o.Variables = v } + // GetInstancePanels returns the InstancePanels field value. func (o *DashboardOption) GetInstancePanels() []DashboardOptionInstancePanelsItem { if o == nil { @@ -133,6 +141,8 @@ func (o *DashboardOption) SetInstancePanels(v []DashboardOptionInstancePanelsIte o.InstancePanels = v } + + // MarshalJSON serializes the struct using spec logic. func (o DashboardOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,9 +163,9 @@ func (o DashboardOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DashboardOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` - DashboardUid *string `json:"dashboardUid"` - Variables *map[string]string `json:"variables"` + Component *string `json:"component"` + DashboardUid *string `json:"dashboardUid"` + Variables *map[string]string `json:"variables"` InstancePanels *[]DashboardOptionInstancePanelsItem `json:"instancePanels"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -175,7 +185,7 @@ func (o *DashboardOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "dashboardUid", "variables", "instancePanels"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "dashboardUid", "variables", "instancePanels", }) } else { return err } diff --git a/api/kbcloud/model_dashboard_option_instance_panels_item.go b/api/kbcloud/model_dashboard_option_instance_panels_item.go index fda9c40d..d8a49891 100644 --- a/api/kbcloud/model_dashboard_option_instance_panels_item.go +++ b/api/kbcloud/model_dashboard_option_instance_panels_item.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type DashboardOptionInstancePanelsItem struct { - Role *string `json:"role,omitempty"` + Role *string `json:"role,omitempty"` Panels []DashboardOptionInstancePanelsItemPanelsItem `json:"panels,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDashboardOptionInstancePanelsItem instantiates a new DashboardOptionInstancePanelsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewDashboardOptionInstancePanelsItemWithDefaults() *DashboardOptionInstance this := DashboardOptionInstancePanelsItem{} return &this } - // GetRole returns the Role field value if set, zero value otherwise. func (o *DashboardOptionInstancePanelsItem) GetRole() string { if o == nil || o.Role == nil { @@ -59,6 +68,7 @@ func (o *DashboardOptionInstancePanelsItem) SetRole(v string) { o.Role = &v } + // GetPanels returns the Panels field value if set, zero value otherwise. func (o *DashboardOptionInstancePanelsItem) GetPanels() []DashboardOptionInstancePanelsItemPanelsItem { if o == nil || o.Panels == nil { @@ -87,6 +97,8 @@ func (o *DashboardOptionInstancePanelsItem) SetPanels(v []DashboardOptionInstanc o.Panels = v } + + // MarshalJSON serializes the struct using spec logic. func (o DashboardOptionInstancePanelsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,7 +121,7 @@ func (o DashboardOptionInstancePanelsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DashboardOptionInstancePanelsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Role *string `json:"role,omitempty"` + Role *string `json:"role,omitempty"` Panels []DashboardOptionInstancePanelsItemPanelsItem `json:"panels,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +129,7 @@ func (o *DashboardOptionInstancePanelsItem) UnmarshalJSON(bytes []byte) (err err } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"role", "panels"}) + common.DeleteKeys(additionalProperties, &[]string{ "role", "panels", }) } else { return err } diff --git a/api/kbcloud/model_dashboard_option_instance_panels_item_panels_item.go b/api/kbcloud/model_dashboard_option_instance_panels_item_panels_item.go index 7d6cc24f..817cd20d 100644 --- a/api/kbcloud/model_dashboard_option_instance_panels_item_panels_item.go +++ b/api/kbcloud/model_dashboard_option_instance_panels_item_panels_item.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type DashboardOptionInstancePanelsItemPanelsItem struct { Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDashboardOptionInstancePanelsItemPanelsItem instantiates a new DashboardOptionInstancePanelsItemPanelsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewDashboardOptionInstancePanelsItemPanelsItemWithDefaults() *DashboardOpti this := DashboardOptionInstancePanelsItemPanelsItem{} return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *DashboardOptionInstancePanelsItemPanelsItem) GetDescription() string { if o == nil || o.Description == nil { @@ -59,6 +68,7 @@ func (o *DashboardOptionInstancePanelsItemPanelsItem) SetDescription(v string) { o.Description = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *DashboardOptionInstancePanelsItemPanelsItem) GetId() string { if o == nil || o.Id == nil { @@ -87,6 +97,8 @@ func (o *DashboardOptionInstancePanelsItemPanelsItem) SetId(v string) { o.Id = &v } + + // MarshalJSON serializes the struct using spec logic. func (o DashboardOptionInstancePanelsItemPanelsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,14 +122,14 @@ func (o DashboardOptionInstancePanelsItemPanelsItem) MarshalJSON() ([]byte, erro func (o *DashboardOptionInstancePanelsItemPanelsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "id"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "id", }) } else { return err } diff --git a/api/kbcloud/model_data_disk.go b/api/kbcloud/model_data_disk.go index 1ec175a9..645a3c1d 100644 --- a/api/kbcloud/model_data_disk.go +++ b/api/kbcloud/model_data_disk.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type DataDisk struct { - DataDiskCapacity *string `json:"data_disk_capacity,omitempty"` - DataDiskAllocated *string `json:"data_disk_allocated,omitempty"` - DataDiskInUse *string `json:"data_disk_in_use,omitempty"` + DataDiskCapacity *string `json:"data_disk_capacity,omitempty"` + DataDiskAllocated *string `json:"data_disk_allocated,omitempty"` + DataDiskInUse *string `json:"data_disk_in_use,omitempty"` DataDiskHealthStatus *string `json:"data_disk_health_status,omitempty"` DataDiskAbnormalTime *string `json:"data_disk_abnormal_time,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDataDisk instantiates a new DataDisk object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewDataDiskWithDefaults() *DataDisk { this := DataDisk{} return &this } - // GetDataDiskCapacity returns the DataDiskCapacity field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskCapacity() string { if o == nil || o.DataDiskCapacity == nil { @@ -62,6 +71,7 @@ func (o *DataDisk) SetDataDiskCapacity(v string) { o.DataDiskCapacity = &v } + // GetDataDiskAllocated returns the DataDiskAllocated field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskAllocated() string { if o == nil || o.DataDiskAllocated == nil { @@ -90,6 +100,7 @@ func (o *DataDisk) SetDataDiskAllocated(v string) { o.DataDiskAllocated = &v } + // GetDataDiskInUse returns the DataDiskInUse field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskInUse() string { if o == nil || o.DataDiskInUse == nil { @@ -118,6 +129,7 @@ func (o *DataDisk) SetDataDiskInUse(v string) { o.DataDiskInUse = &v } + // GetDataDiskHealthStatus returns the DataDiskHealthStatus field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskHealthStatus() string { if o == nil || o.DataDiskHealthStatus == nil { @@ -146,6 +158,7 @@ func (o *DataDisk) SetDataDiskHealthStatus(v string) { o.DataDiskHealthStatus = &v } + // GetDataDiskAbnormalTime returns the DataDiskAbnormalTime field value if set, zero value otherwise. func (o *DataDisk) GetDataDiskAbnormalTime() string { if o == nil || o.DataDiskAbnormalTime == nil { @@ -174,6 +187,8 @@ func (o *DataDisk) SetDataDiskAbnormalTime(v string) { o.DataDiskAbnormalTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o DataDisk) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -205,9 +220,9 @@ func (o DataDisk) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DataDisk) UnmarshalJSON(bytes []byte) (err error) { all := struct { - DataDiskCapacity *string `json:"data_disk_capacity,omitempty"` - DataDiskAllocated *string `json:"data_disk_allocated,omitempty"` - DataDiskInUse *string `json:"data_disk_in_use,omitempty"` + DataDiskCapacity *string `json:"data_disk_capacity,omitempty"` + DataDiskAllocated *string `json:"data_disk_allocated,omitempty"` + DataDiskInUse *string `json:"data_disk_in_use,omitempty"` DataDiskHealthStatus *string `json:"data_disk_health_status,omitempty"` DataDiskAbnormalTime *string `json:"data_disk_abnormal_time,omitempty"` }{} @@ -216,7 +231,7 @@ func (o *DataDisk) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"data_disk_capacity", "data_disk_allocated", "data_disk_in_use", "data_disk_health_status", "data_disk_abnormal_time"}) + common.DeleteKeys(additionalProperties, &[]string{ "data_disk_capacity", "data_disk_allocated", "data_disk_in_use", "data_disk_health_status", "data_disk_abnormal_time", }) } else { return err } diff --git a/api/kbcloud/model_database.go b/api/kbcloud/model_database.go index ae18279b..cac1624b 100644 --- a/api/kbcloud/model_database.go +++ b/api/kbcloud/model_database.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Database Cluster database information + + +// Database Cluster database information type Database struct { // component type Component *string `json:"component,omitempty"` @@ -23,10 +28,11 @@ type Database struct { // Description of the database. Description *string `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatabase instantiates a new Database object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewDatabaseWithDefaults() *Database { this := Database{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *Database) GetComponent() string { if o == nil || o.Component == nil { @@ -73,6 +78,7 @@ func (o *Database) SetComponent(v string) { o.Component = &v } + // GetName returns the Name field value. func (o *Database) GetName() string { if o == nil { @@ -96,6 +102,7 @@ func (o *Database) SetName(v string) { o.Name = v } + // GetAccountName returns the AccountName field value if set, zero value otherwise. func (o *Database) GetAccountName() string { if o == nil || o.AccountName == nil { @@ -124,6 +131,7 @@ func (o *Database) SetAccountName(v string) { o.AccountName = &v } + // GetCharset returns the Charset field value if set, zero value otherwise. func (o *Database) GetCharset() string { if o == nil || o.Charset == nil { @@ -152,6 +160,7 @@ func (o *Database) SetCharset(v string) { o.Charset = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Database) GetDescription() string { if o == nil || o.Description == nil { @@ -180,6 +189,8 @@ func (o *Database) SetDescription(v string) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Database) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -209,10 +220,10 @@ func (o Database) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Database) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - Name *string `json:"name"` + Component *string `json:"component,omitempty"` + Name *string `json:"name"` AccountName *string `json:"accountName,omitempty"` - Charset *string `json:"charset,omitempty"` + Charset *string `json:"charset,omitempty"` Description *string `json:"description,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -223,7 +234,7 @@ func (o *Database) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "name", "accountName", "charset", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "name", "accountName", "charset", "description", }) } else { return err } diff --git a/api/kbcloud/model_database_item.go b/api/kbcloud/model_database_item.go index e2b88769..69a895bc 100644 --- a/api/kbcloud/model_database_item.go +++ b/api/kbcloud/model_database_item.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// DatabaseItem Cluster database information + + +// DatabaseItem Cluster database information type DatabaseItem struct { // Specify the name of database, which must be unique. Name string `json:"name"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatabaseItem instantiates a new DatabaseItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewDatabaseItemWithDefaults() *DatabaseItem { this := DatabaseItem{} return &this } - // GetName returns the Name field value. func (o *DatabaseItem) GetName() string { if o == nil { @@ -60,6 +65,8 @@ func (o *DatabaseItem) SetName(v string) { o.Name = v } + + // MarshalJSON serializes the struct using spec logic. func (o DatabaseItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *DatabaseItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", }) } else { return err } diff --git a/api/kbcloud/model_database_list.go b/api/kbcloud/model_database_list.go index f5fc4443..0519206b 100644 --- a/api/kbcloud/model_database_list.go +++ b/api/kbcloud/model_database_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// DatabaseList DatabaesList is a list of Databaes + + +// DatabaseList DatabaesList is a list of Databaes type DatabaseList struct { // Items is the list of Databases objects in the list Items []DatabaseItem `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatabaseList instantiates a new DatabaseList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewDatabaseListWithDefaults() *DatabaseList { this := DatabaseList{} return &this } - // GetItems returns the Items field value. func (o *DatabaseList) GetItems() []DatabaseItem { if o == nil { @@ -60,6 +65,8 @@ func (o *DatabaseList) SetItems(v []DatabaseItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o DatabaseList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *DatabaseList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_database_option.go b/api/kbcloud/model_database_option.go index 0310e74d..14346342 100644 --- a/api/kbcloud/model_database_option.go +++ b/api/kbcloud/model_database_option.go @@ -2,21 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type DatabaseOption struct { Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatabaseOption instantiates a new DatabaseOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +40,6 @@ func NewDatabaseOptionWithDefaults() *DatabaseOption { this := DatabaseOption{} return &this } - // GetEnabled returns the Enabled field value. func (o *DatabaseOption) GetEnabled() bool { if o == nil { @@ -58,6 +63,8 @@ func (o *DatabaseOption) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o DatabaseOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +92,7 @@ func (o *DatabaseOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", }) } else { return err } diff --git a/api/kbcloud/model_datasource.go b/api/kbcloud/model_datasource.go index e5cc76ed..987cded6 100644 --- a/api/kbcloud/model_datasource.go +++ b/api/kbcloud/model_datasource.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type Datasource struct { // the id of datasource Id *string `json:"id,omitempty"` // the name of datasource Name *string `json:"name,omitempty"` // the database type - Type string `json:"type"` + Type string `json:"type"` Options map[string]interface{} `json:"options,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDatasource instantiates a new Datasource object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewDatasourceWithDefaults() *Datasource { this := Datasource{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Datasource) GetId() string { if o == nil || o.Id == nil { @@ -69,6 +74,7 @@ func (o *Datasource) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Datasource) GetName() string { if o == nil || o.Name == nil { @@ -97,6 +103,7 @@ func (o *Datasource) SetName(v string) { o.Name = &v } + // GetType returns the Type field value. func (o *Datasource) GetType() string { if o == nil { @@ -120,6 +127,7 @@ func (o *Datasource) SetType(v string) { o.Type = v } + // GetOptions returns the Options field value if set, zero value otherwise. func (o *Datasource) GetOptions() map[string]interface{} { if o == nil || o.Options == nil { @@ -148,6 +156,8 @@ func (o *Datasource) SetOptions(v map[string]interface{}) { o.Options = v } + + // MarshalJSON serializes the struct using spec logic. func (o Datasource) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -174,9 +184,9 @@ func (o Datasource) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Datasource) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type"` Options map[string]interface{} `json:"options,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -187,7 +197,7 @@ func (o *Datasource) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "type", "options"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "type", "options", }) } else { return err } diff --git a/api/kbcloud/model_dms_import_form_data.go b/api/kbcloud/model_dms_import_form_data.go index dc7e4043..e917f562 100644 --- a/api/kbcloud/model_dms_import_form_data.go +++ b/api/kbcloud/model_dms_import_form_data.go @@ -2,24 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - _io "io" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// DmsImportFormData the data of the import task + + +// DmsImportFormData the data of the import task type DmsImportFormData struct { // the data file, csv or other format File _io.Reader `json:"file"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDmsImportFormData instantiates a new DmsImportFormData object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +42,6 @@ func NewDmsImportFormDataWithDefaults() *DmsImportFormData { this := DmsImportFormData{} return &this } - // GetFile returns the File field value. func (o *DmsImportFormData) GetFile() _io.Reader { if o == nil { @@ -61,6 +65,8 @@ func (o *DmsImportFormData) SetFile(v _io.Reader) { o.File = v } + + // MarshalJSON serializes the struct using spec logic. func (o DmsImportFormData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -88,7 +94,7 @@ func (o *DmsImportFormData) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"file"}) + common.DeleteKeys(additionalProperties, &[]string{ "file", }) } else { return err } diff --git a/api/kbcloud/model_dms_option.go b/api/kbcloud/model_dms_option.go index 0682a397..1688f8a7 100644 --- a/api/kbcloud/model_dms_option.go +++ b/api/kbcloud/model_dms_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type DmsOption struct { - Enabled bool `json:"enabled"` - Protocol string `json:"protocol"` - Feature map[string]interface{} `json:"feature,omitempty"` - TableMetadata []interface{} `json:"tableMetadata,omitempty"` + Enabled bool `json:"enabled"` + Protocol string `json:"protocol"` + Feature map[string]interface{} `json:"feature,omitempty"` + TableMetadata []interface{} `json:"tableMetadata,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDmsOption instantiates a new DmsOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewDmsOptionWithDefaults() *DmsOption { this := DmsOption{} return &this } - // GetEnabled returns the Enabled field value. func (o *DmsOption) GetEnabled() bool { if o == nil { @@ -62,6 +67,7 @@ func (o *DmsOption) SetEnabled(v bool) { o.Enabled = v } + // GetProtocol returns the Protocol field value. func (o *DmsOption) GetProtocol() string { if o == nil { @@ -85,6 +91,7 @@ func (o *DmsOption) SetProtocol(v string) { o.Protocol = v } + // GetFeature returns the Feature field value if set, zero value otherwise. func (o *DmsOption) GetFeature() map[string]interface{} { if o == nil || o.Feature == nil { @@ -113,6 +120,7 @@ func (o *DmsOption) SetFeature(v map[string]interface{}) { o.Feature = v } + // GetTableMetadata returns the TableMetadata field value if set, zero value otherwise. func (o *DmsOption) GetTableMetadata() []interface{} { if o == nil || o.TableMetadata == nil { @@ -141,6 +149,8 @@ func (o *DmsOption) SetTableMetadata(v []interface{}) { o.TableMetadata = v } + + // MarshalJSON serializes the struct using spec logic. func (o DmsOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -165,10 +175,10 @@ func (o DmsOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DmsOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Enabled *bool `json:"enabled"` - Protocol *string `json:"protocol"` - Feature map[string]interface{} `json:"feature,omitempty"` - TableMetadata []interface{} `json:"tableMetadata,omitempty"` + Enabled *bool `json:"enabled"` + Protocol *string `json:"protocol"` + Feature map[string]interface{} `json:"feature,omitempty"` + TableMetadata []interface{} `json:"tableMetadata,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -181,7 +191,7 @@ func (o *DmsOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled", "protocol", "feature", "tableMetadata"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", "protocol", "feature", "tableMetadata", }) } else { return err } diff --git a/api/kbcloud/model_dms_task_info.go b/api/kbcloud/model_dms_task_info.go index 370e863d..b008d9e3 100644 --- a/api/kbcloud/model_dms_task_info.go +++ b/api/kbcloud/model_dms_task_info.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type DmsTaskInfo struct { // task id Id *string `json:"id,omitempty"` @@ -20,14 +25,15 @@ type DmsTaskInfo struct { // task status Status *string `json:"status,omitempty"` // task type - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDmsTaskInfo instantiates a new DmsTaskInfo object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewDmsTaskInfoWithDefaults() *DmsTaskInfo { this := DmsTaskInfo{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *DmsTaskInfo) GetId() string { if o == nil || o.Id == nil { @@ -73,6 +78,7 @@ func (o *DmsTaskInfo) SetId(v string) { o.Id = &v } + // GetDatasource returns the Datasource field value if set, zero value otherwise. func (o *DmsTaskInfo) GetDatasource() string { if o == nil || o.Datasource == nil { @@ -101,6 +107,7 @@ func (o *DmsTaskInfo) SetDatasource(v string) { o.Datasource = &v } + // GetMessage returns the Message field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DmsTaskInfo) GetMessage() string { if o == nil || o.Message.Get() == nil { @@ -114,7 +121,7 @@ func (o *DmsTaskInfo) GetMessage() string { // 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 *DmsTaskInfo) GetMessageOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Message.Get(), o.Message.IsSet() @@ -129,7 +136,6 @@ func (o *DmsTaskInfo) HasMessage() bool { func (o *DmsTaskInfo) SetMessage(v string) { o.Message.Set(&v) } - // SetMessageNil sets the value for Message to be an explicit nil. func (o *DmsTaskInfo) SetMessageNil() { o.Message.Set(nil) @@ -140,6 +146,7 @@ func (o *DmsTaskInfo) UnsetMessage() { o.Message.Unset() } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *DmsTaskInfo) GetStatus() string { if o == nil || o.Status == nil { @@ -168,6 +175,7 @@ func (o *DmsTaskInfo) SetStatus(v string) { o.Status = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *DmsTaskInfo) GetType() string { if o == nil || o.Type == nil { @@ -196,6 +204,7 @@ func (o *DmsTaskInfo) SetType(v string) { o.Type = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *DmsTaskInfo) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -224,6 +233,7 @@ func (o *DmsTaskInfo) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *DmsTaskInfo) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -252,6 +262,8 @@ func (o *DmsTaskInfo) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o DmsTaskInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -297,20 +309,20 @@ func (o DmsTaskInfo) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DmsTaskInfo) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Datasource *string `json:"datasource,omitempty"` - Message common.NullableString `json:"message,omitempty"` - Status *string `json:"status,omitempty"` - Type *string `json:"type,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *string `json:"id,omitempty"` + Datasource *string `json:"datasource,omitempty"` + Message common.NullableString `json:"message,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "datasource", "message", "status", "type", "updatedAt", "createdAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "datasource", "message", "status", "type", "updatedAt", "createdAt", }) } else { return err } diff --git a/api/kbcloud/model_dms_task_list.go b/api/kbcloud/model_dms_task_list.go index a63bc227..6d43ef3f 100644 --- a/api/kbcloud/model_dms_task_list.go +++ b/api/kbcloud/model_dms_task_list.go @@ -2,17 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type DmsTaskList struct { Tasks []DmsTaskInfo `json:"tasks,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewDmsTaskList instantiates a new DmsTaskList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -29,7 +39,6 @@ func NewDmsTaskListWithDefaults() *DmsTaskList { this := DmsTaskList{} return &this } - // GetTasks returns the Tasks field value if set, zero value otherwise. func (o *DmsTaskList) GetTasks() []DmsTaskInfo { if o == nil || o.Tasks == nil { @@ -58,6 +67,8 @@ func (o *DmsTaskList) SetTasks(v []DmsTaskInfo) { o.Tasks = v } + + // MarshalJSON serializes the struct using spec logic. func (o DmsTaskList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -84,7 +95,7 @@ func (o *DmsTaskList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"tasks"}) + common.DeleteKeys(additionalProperties, &[]string{ "tasks", }) } else { return err } diff --git a/api/kbcloud/model_endpoint.go b/api/kbcloud/model_endpoint.go index 7d33e1d1..ff89f752 100644 --- a/api/kbcloud/model_endpoint.go +++ b/api/kbcloud/model_endpoint.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Endpoint Endpoint is the information of cluster endpoints + + +// Endpoint Endpoint is the information of cluster endpoints type Endpoint struct { // title of the endpoint Title string `json:"title"` @@ -33,10 +38,11 @@ type Endpoint struct { // Whether the endpoint is mutable Mutable bool `json:"mutable"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEndpoint instantiates a new Endpoint object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -62,7 +68,6 @@ func NewEndpointWithDefaults() *Endpoint { this := Endpoint{} return &this } - // GetTitle returns the Title field value. func (o *Endpoint) GetTitle() string { if o == nil { @@ -86,6 +91,7 @@ func (o *Endpoint) SetTitle(v string) { o.Title = v } + // GetComponent returns the Component field value. func (o *Endpoint) GetComponent() string { if o == nil { @@ -109,6 +115,7 @@ func (o *Endpoint) SetComponent(v string) { o.Component = v } + // GetHosts returns the Hosts field value. func (o *Endpoint) GetHosts() []string { if o == nil { @@ -132,6 +139,7 @@ func (o *Endpoint) SetHosts(v []string) { o.Hosts = v } + // GetPort returns the Port field value. func (o *Endpoint) GetPort() int32 { if o == nil { @@ -155,6 +163,7 @@ func (o *Endpoint) SetPort(v int32) { o.Port = v } + // GetType returns the Type field value. func (o *Endpoint) GetType() EndpointType { if o == nil { @@ -178,6 +187,7 @@ func (o *Endpoint) SetType(v EndpointType) { o.Type = v } + // GetNetworkType returns the NetworkType field value. func (o *Endpoint) GetNetworkType() EndpointNetworkType { if o == nil { @@ -201,6 +211,7 @@ func (o *Endpoint) SetNetworkType(v EndpointNetworkType) { o.NetworkType = v } + // GetServiceName returns the ServiceName field value. func (o *Endpoint) GetServiceName() string { if o == nil { @@ -224,6 +235,7 @@ func (o *Endpoint) SetServiceName(v string) { o.ServiceName = v } + // GetPortName returns the PortName field value. func (o *Endpoint) GetPortName() string { if o == nil { @@ -247,6 +259,7 @@ func (o *Endpoint) SetPortName(v string) { o.PortName = v } + // GetInstances returns the Instances field value if set, zero value otherwise. func (o *Endpoint) GetInstances() []string { if o == nil || o.Instances == nil { @@ -275,6 +288,7 @@ func (o *Endpoint) SetInstances(v []string) { o.Instances = v } + // GetMutable returns the Mutable field value. func (o *Endpoint) GetMutable() bool { if o == nil { @@ -298,6 +312,8 @@ func (o *Endpoint) SetMutable(v bool) { o.Mutable = v } + + // MarshalJSON serializes the struct using spec logic. func (o Endpoint) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -326,16 +342,16 @@ func (o Endpoint) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Endpoint) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Title *string `json:"title"` - Component *string `json:"component"` - Hosts *[]string `json:"hosts"` - Port *int32 `json:"port"` - Type *EndpointType `json:"type"` + Title *string `json:"title"` + Component *string `json:"component"` + Hosts *[]string `json:"hosts"` + Port *int32 `json:"port"` + Type *EndpointType `json:"type"` NetworkType *EndpointNetworkType `json:"networkType"` - ServiceName *string `json:"serviceName"` - PortName *string `json:"portName"` - Instances []string `json:"instances,omitempty"` - Mutable *bool `json:"mutable"` + ServiceName *string `json:"serviceName"` + PortName *string `json:"portName"` + Instances []string `json:"instances,omitempty"` + Mutable *bool `json:"mutable"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -369,7 +385,7 @@ func (o *Endpoint) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"title", "component", "hosts", "port", "type", "networkType", "serviceName", "portName", "instances", "mutable"}) + common.DeleteKeys(additionalProperties, &[]string{ "title", "component", "hosts", "port", "type", "networkType", "serviceName", "portName", "instances", "mutable", }) } else { return err } diff --git a/api/kbcloud/model_endpoint_list.go b/api/kbcloud/model_endpoint_list.go index 1c34961d..34f06de0 100644 --- a/api/kbcloud/model_endpoint_list.go +++ b/api/kbcloud/model_endpoint_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EndpointList struct { // Items is the list of endpoint objects in the list Items []Endpoint `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEndpointList instantiates a new EndpointList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewEndpointListWithDefaults() *EndpointList { this := EndpointList{} return &this } - // GetItems returns the Items field value. func (o *EndpointList) GetItems() []Endpoint { if o == nil { @@ -59,6 +64,8 @@ func (o *EndpointList) SetItems(v []Endpoint) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EndpointList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *EndpointList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_endpoint_network_type.go b/api/kbcloud/model_endpoint_network_type.go index 639a5ed0..9607a271 100644 --- a/api/kbcloud/model_endpoint_network_type.go +++ b/api/kbcloud/model_endpoint_network_type.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EndpointNetworkType Network type of endpoint type EndpointNetworkType string diff --git a/api/kbcloud/model_endpoint_option.go b/api/kbcloud/model_endpoint_option.go index a3fff271..bc01496e 100644 --- a/api/kbcloud/model_endpoint_option.go +++ b/api/kbcloud/model_endpoint_option.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EndpointOption struct { - Title LocalizedDescription `json:"title"` - Component string `json:"component"` - PortName string `json:"portName"` - Type []string `json:"type"` - Port int32 `json:"port"` + Title LocalizedDescription `json:"title"` + Component string `json:"component"` + PortName string `json:"portName"` + Type []string `json:"type"` + Port int32 `json:"port"` // whether the endpoint supports system use, such as health check, dms, databases & accounts management etc. SupportsSystemUse *bool `json:"supportsSystemUse,omitempty"` // service name pattern, e.g. ClusterName-ComponentName or .ClusterName` @@ -27,10 +32,11 @@ type EndpointOption struct { // selector of k8s service Selector map[string]string `json:"selector,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEndpointOption instantiates a new EndpointOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +62,6 @@ func NewEndpointOptionWithDefaults() *EndpointOption { this.ServicePattern = &servicePattern return &this } - // GetTitle returns the Title field value. func (o *EndpointOption) GetTitle() LocalizedDescription { if o == nil { @@ -80,6 +85,7 @@ func (o *EndpointOption) SetTitle(v LocalizedDescription) { o.Title = v } + // GetComponent returns the Component field value. func (o *EndpointOption) GetComponent() string { if o == nil { @@ -103,6 +109,7 @@ func (o *EndpointOption) SetComponent(v string) { o.Component = v } + // GetPortName returns the PortName field value. func (o *EndpointOption) GetPortName() string { if o == nil { @@ -126,6 +133,7 @@ func (o *EndpointOption) SetPortName(v string) { o.PortName = v } + // GetType returns the Type field value. func (o *EndpointOption) GetType() []string { if o == nil { @@ -149,6 +157,7 @@ func (o *EndpointOption) SetType(v []string) { o.Type = v } + // GetPort returns the Port field value. func (o *EndpointOption) GetPort() int32 { if o == nil { @@ -172,6 +181,7 @@ func (o *EndpointOption) SetPort(v int32) { o.Port = v } + // GetSupportsSystemUse returns the SupportsSystemUse field value if set, zero value otherwise. func (o *EndpointOption) GetSupportsSystemUse() bool { if o == nil || o.SupportsSystemUse == nil { @@ -200,6 +210,7 @@ func (o *EndpointOption) SetSupportsSystemUse(v bool) { o.SupportsSystemUse = &v } + // GetServicePattern returns the ServicePattern field value if set, zero value otherwise. func (o *EndpointOption) GetServicePattern() EngineOptionsServicePattern { if o == nil || o.ServicePattern == nil { @@ -228,6 +239,7 @@ func (o *EndpointOption) SetServicePattern(v EngineOptionsServicePattern) { o.ServicePattern = &v } + // GetServiceNameRegex returns the ServiceNameRegex field value if set, zero value otherwise. func (o *EndpointOption) GetServiceNameRegex() string { if o == nil || o.ServiceNameRegex == nil { @@ -256,6 +268,7 @@ func (o *EndpointOption) SetServiceNameRegex(v string) { o.ServiceNameRegex = &v } + // GetServiceName returns the ServiceName field value if set, zero value otherwise. func (o *EndpointOption) GetServiceName() string { if o == nil || o.ServiceName == nil { @@ -284,6 +297,7 @@ func (o *EndpointOption) SetServiceName(v string) { o.ServiceName = &v } + // GetSelector returns the Selector field value if set, zero value otherwise. func (o *EndpointOption) GetSelector() map[string]string { if o == nil || o.Selector == nil { @@ -312,6 +326,8 @@ func (o *EndpointOption) SetSelector(v map[string]string) { o.Selector = v } + + // MarshalJSON serializes the struct using spec logic. func (o EndpointOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -348,16 +364,16 @@ func (o EndpointOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EndpointOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Title *LocalizedDescription `json:"title"` - Component *string `json:"component"` - PortName *string `json:"portName"` - Type *[]string `json:"type"` - Port *int32 `json:"port"` - SupportsSystemUse *bool `json:"supportsSystemUse,omitempty"` - ServicePattern *EngineOptionsServicePattern `json:"servicePattern,omitempty"` - ServiceNameRegex *string `json:"serviceNameRegex,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` - Selector map[string]string `json:"selector,omitempty"` + Title *LocalizedDescription `json:"title"` + Component *string `json:"component"` + PortName *string `json:"portName"` + Type *[]string `json:"type"` + Port *int32 `json:"port"` + SupportsSystemUse *bool `json:"supportsSystemUse,omitempty"` + ServicePattern *EngineOptionsServicePattern `json:"servicePattern,omitempty"` + ServiceNameRegex *string `json:"serviceNameRegex,omitempty"` + ServiceName *string `json:"serviceName,omitempty"` + Selector map[string]string `json:"selector,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -379,7 +395,7 @@ func (o *EndpointOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"title", "component", "portName", "type", "port", "supportsSystemUse", "servicePattern", "serviceNameRegex", "serviceName", "selector"}) + common.DeleteKeys(additionalProperties, &[]string{ "title", "component", "portName", "type", "port", "supportsSystemUse", "servicePattern", "serviceNameRegex", "serviceName", "selector", }) } else { return err } @@ -394,7 +410,7 @@ func (o *EndpointOption) UnmarshalJSON(bytes []byte) (err error) { o.Type = *all.Type o.Port = *all.Port o.SupportsSystemUse = all.SupportsSystemUse - if all.ServicePattern != nil && !all.ServicePattern.IsValid() { + if all.ServicePattern != nil &&!all.ServicePattern.IsValid() { hasInvalidField = true } else { o.ServicePattern = all.ServicePattern diff --git a/api/kbcloud/model_endpoint_type.go b/api/kbcloud/model_endpoint_type.go index d6183036..5a64a2c4 100644 --- a/api/kbcloud/model_endpoint_type.go +++ b/api/kbcloud/model_endpoint_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EndpointType Type of endpoint type EndpointType string // List of EndpointType. const ( - EndpointTypeClusterIp EndpointType = "ClusterIP" - EndpointTypeNodePort EndpointType = "NodePort" + EndpointTypeClusterIp EndpointType = "ClusterIP" + EndpointTypeNodePort EndpointType = "NodePort" EndpointTypeLoadBalancer EndpointType = "LoadBalancer" ) diff --git a/api/kbcloud/model_engine.go b/api/kbcloud/model_engine.go index 27045ab6..f5a7b1f7 100644 --- a/api/kbcloud/model_engine.go +++ b/api/kbcloud/model_engine.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Engine struct { // engine ID Id *string `json:"id,omitempty"` @@ -34,10 +43,11 @@ type Engine struct { // clusterversion in the engines ClusterVersions []string `json:"clusterVersions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngine instantiates a new Engine object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -54,7 +64,6 @@ func NewEngineWithDefaults() *Engine { this := Engine{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Engine) GetId() string { if o == nil || o.Id == nil { @@ -83,6 +92,7 @@ func (o *Engine) SetId(v string) { o.Id = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Engine) GetDescription() string { if o == nil || o.Description == nil { @@ -111,6 +121,7 @@ func (o *Engine) SetDescription(v string) { o.Description = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Engine) GetName() string { if o == nil || o.Name == nil { @@ -139,6 +150,7 @@ func (o *Engine) SetName(v string) { o.Name = &v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *Engine) GetVersion() string { if o == nil || o.Version == nil { @@ -167,6 +179,7 @@ func (o *Engine) SetVersion(v string) { o.Version = &v } + // GetKbVersionConstraint returns the KbVersionConstraint field value if set, zero value otherwise. func (o *Engine) GetKbVersionConstraint() string { if o == nil || o.KbVersionConstraint == nil { @@ -195,6 +208,7 @@ func (o *Engine) SetKbVersionConstraint(v string) { o.KbVersionConstraint = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *Engine) GetType() EngineType { if o == nil || o.Type == nil { @@ -223,6 +237,7 @@ func (o *Engine) SetType(v EngineType) { o.Type = &v } + // GetInstalled returns the Installed field value if set, zero value otherwise. func (o *Engine) GetInstalled() bool { if o == nil || o.Installed == nil { @@ -251,6 +266,7 @@ func (o *Engine) SetInstalled(v bool) { o.Installed = &v } + // GetProvider returns the Provider field value if set, zero value otherwise. func (o *Engine) GetProvider() string { if o == nil || o.Provider == nil { @@ -279,6 +295,7 @@ func (o *Engine) SetProvider(v string) { o.Provider = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Engine) GetStatus() EngineStatus { if o == nil || o.Status == nil { @@ -307,6 +324,7 @@ func (o *Engine) SetStatus(v EngineStatus) { o.Status = &v } + // GetAvailableVersion returns the AvailableVersion field value if set, zero value otherwise. func (o *Engine) GetAvailableVersion() []string { if o == nil || o.AvailableVersion == nil { @@ -335,6 +353,7 @@ func (o *Engine) SetAvailableVersion(v []string) { o.AvailableVersion = v } + // GetUpgradeHistory returns the UpgradeHistory field value if set, zero value otherwise. func (o *Engine) GetUpgradeHistory() string { if o == nil || o.UpgradeHistory == nil { @@ -363,6 +382,7 @@ func (o *Engine) SetUpgradeHistory(v string) { o.UpgradeHistory = &v } + // GetErrMsg returns the ErrMsg field value if set, zero value otherwise. func (o *Engine) GetErrMsg() string { if o == nil || o.ErrMsg == nil { @@ -391,6 +411,7 @@ func (o *Engine) SetErrMsg(v string) { o.ErrMsg = &v } + // GetClusterVersions returns the ClusterVersions field value if set, zero value otherwise. func (o *Engine) GetClusterVersions() []string { if o == nil || o.ClusterVersions == nil { @@ -419,6 +440,8 @@ func (o *Engine) SetClusterVersions(v []string) { o.ClusterVersions = v } + + // MarshalJSON serializes the struct using spec logic. func (o Engine) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -474,26 +497,26 @@ func (o Engine) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Engine) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - Version *string `json:"version,omitempty"` - KbVersionConstraint *string `json:"kbVersionConstraint,omitempty"` - Type *EngineType `json:"type,omitempty"` - Installed *bool `json:"installed,omitempty"` - Provider *string `json:"provider,omitempty"` - Status *EngineStatus `json:"status,omitempty"` - AvailableVersion []string `json:"availableVersion,omitempty"` - UpgradeHistory *string `json:"upgradeHistory,omitempty"` - ErrMsg *string `json:"errMsg,omitempty"` - ClusterVersions []string `json:"clusterVersions,omitempty"` + Id *string `json:"id,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + KbVersionConstraint *string `json:"kbVersionConstraint,omitempty"` + Type *EngineType `json:"type,omitempty"` + Installed *bool `json:"installed,omitempty"` + Provider *string `json:"provider,omitempty"` + Status *EngineStatus `json:"status,omitempty"` + AvailableVersion []string `json:"availableVersion,omitempty"` + UpgradeHistory *string `json:"upgradeHistory,omitempty"` + ErrMsg *string `json:"errMsg,omitempty"` + ClusterVersions []string `json:"clusterVersions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "description", "name", "version", "kbVersionConstraint", "type", "installed", "provider", "status", "availableVersion", "upgradeHistory", "errMsg", "clusterVersions"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "description", "name", "version", "kbVersionConstraint", "type", "installed", "provider", "status", "availableVersion", "upgradeHistory", "errMsg", "clusterVersions", }) } else { return err } @@ -504,14 +527,14 @@ func (o *Engine) UnmarshalJSON(bytes []byte) (err error) { o.Name = all.Name o.Version = all.Version o.KbVersionConstraint = all.KbVersionConstraint - if all.Type != nil && !all.Type.IsValid() { + if all.Type != nil &&!all.Type.IsValid() { hasInvalidField = true } else { o.Type = all.Type } o.Installed = all.Installed o.Provider = all.Provider - if all.Status != nil && !all.Status.IsValid() { + if all.Status != nil &&!all.Status.IsValid() { hasInvalidField = true } else { o.Status = all.Status diff --git a/api/kbcloud/model_engine_license.go b/api/kbcloud/model_engine_license.go index d690df9a..222dd9dc 100644 --- a/api/kbcloud/model_engine_license.go +++ b/api/kbcloud/model_engine_license.go @@ -2,29 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineLicense struct { - EngineName string `json:"engineName"` - Name string `json:"name"` - Key *string `json:"key,omitempty"` - Description *string `json:"description,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Id *int32 `json:"id,omitempty"` - IdString *string `json:"idString,omitempty"` + EngineName string `json:"engineName"` + Name string `json:"name"` + Key *string `json:"key,omitempty"` + Description *string `json:"description,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *int32 `json:"id,omitempty"` + IdString *string `json:"idString,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineLicense instantiates a new EngineLicense object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +48,6 @@ func NewEngineLicenseWithDefaults() *EngineLicense { this := EngineLicense{} return &this } - // GetEngineName returns the EngineName field value. func (o *EngineLicense) GetEngineName() string { if o == nil { @@ -67,6 +71,7 @@ func (o *EngineLicense) SetEngineName(v string) { o.EngineName = v } + // GetName returns the Name field value. func (o *EngineLicense) GetName() string { if o == nil { @@ -90,6 +95,7 @@ func (o *EngineLicense) SetName(v string) { o.Name = v } + // GetKey returns the Key field value if set, zero value otherwise. func (o *EngineLicense) GetKey() string { if o == nil || o.Key == nil { @@ -118,6 +124,7 @@ func (o *EngineLicense) SetKey(v string) { o.Key = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *EngineLicense) GetDescription() string { if o == nil || o.Description == nil { @@ -146,6 +153,7 @@ func (o *EngineLicense) SetDescription(v string) { o.Description = &v } + // GetExpiredAt returns the ExpiredAt field value if set, zero value otherwise. func (o *EngineLicense) GetExpiredAt() time.Time { if o == nil || o.ExpiredAt == nil { @@ -174,6 +182,7 @@ func (o *EngineLicense) SetExpiredAt(v time.Time) { o.ExpiredAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *EngineLicense) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -202,6 +211,7 @@ func (o *EngineLicense) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *EngineLicense) GetId() int32 { if o == nil || o.Id == nil { @@ -230,6 +240,7 @@ func (o *EngineLicense) SetId(v int32) { o.Id = &v } + // GetIdString returns the IdString field value if set, zero value otherwise. func (o *EngineLicense) GetIdString() string { if o == nil || o.IdString == nil { @@ -258,6 +269,8 @@ func (o *EngineLicense) SetIdString(v string) { o.IdString = &v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineLicense) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -302,14 +315,14 @@ func (o EngineLicense) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineLicense) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EngineName *string `json:"engineName"` - Name *string `json:"name"` - Key *string `json:"key,omitempty"` - Description *string `json:"description,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Id *int32 `json:"id,omitempty"` - IdString *string `json:"idString,omitempty"` + EngineName *string `json:"engineName"` + Name *string `json:"name"` + Key *string `json:"key,omitempty"` + Description *string `json:"description,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Id *int32 `json:"id,omitempty"` + IdString *string `json:"idString,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -322,7 +335,7 @@ func (o *EngineLicense) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "name", "key", "description", "expiredAt", "createdAt", "id", "idString"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "name", "key", "description", "expiredAt", "createdAt", "id", "idString", }) } else { return err } diff --git a/api/kbcloud/model_engine_license_list.go b/api/kbcloud/model_engine_license_list.go index fedcf73c..9e49f0de 100644 --- a/api/kbcloud/model_engine_license_list.go +++ b/api/kbcloud/model_engine_license_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineLicenseList struct { // Items is the list of engineLicense objects in the list Items []EngineLicense `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineLicenseList instantiates a new EngineLicenseList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewEngineLicenseListWithDefaults() *EngineLicenseList { this := EngineLicenseList{} return &this } - // GetItems returns the Items field value. func (o *EngineLicenseList) GetItems() []EngineLicense { if o == nil { @@ -59,6 +64,8 @@ func (o *EngineLicenseList) SetItems(v []EngineLicense) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineLicenseList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *EngineLicenseList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_engine_option.go b/api/kbcloud/model_engine_option.go index e961337d..262b7ebd 100644 --- a/api/kbcloud/model_engine_option.go +++ b/api/kbcloud/model_engine_option.go @@ -2,45 +2,51 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOption struct { - EngineName string `json:"engineName"` - Title string `json:"title"` - Description LocalizedDescription `json:"description"` - Versions []string `json:"versions"` - Components []ComponentOption `json:"components"` - Modes []ModeOption `json:"modes"` - Account AccountOption `json:"account"` - Database *DatabaseOption `json:"database,omitempty"` - Dms DmsOption `json:"dms"` - Backup BackupOption `json:"backup"` - Bench BenchOption `json:"bench"` - Endpoints []EndpointOption `json:"endpoints"` - Promote []ComponentOpsOption `json:"promote"` - Stop []ComponentOpsOption `json:"stop"` - Start []ComponentOpsOption `json:"start"` - Restart []ComponentOpsOption `json:"restart"` - Hscale []ComponentOpsOption `json:"hscale"` - Vscale []ComponentOpsOption `json:"vscale"` - License *EngineOptionLicense `json:"license,omitempty"` + EngineName string `json:"engineName"` + Title string `json:"title"` + Description LocalizedDescription `json:"description"` + Versions []string `json:"versions"` + Components []ComponentOption `json:"components"` + Modes []ModeOption `json:"modes"` + Account AccountOption `json:"account"` + Database *DatabaseOption `json:"database,omitempty"` + Dms DmsOption `json:"dms"` + Backup BackupOption `json:"backup"` + Bench BenchOption `json:"bench"` + Endpoints []EndpointOption `json:"endpoints"` + Promote []ComponentOpsOption `json:"promote"` + Stop []ComponentOpsOption `json:"stop"` + Start []ComponentOpsOption `json:"start"` + Restart []ComponentOpsOption `json:"restart"` + Hscale []ComponentOpsOption `json:"hscale"` + Vscale []ComponentOpsOption `json:"vscale"` + License *EngineOptionLicense `json:"license,omitempty"` StorageExpansion []ComponentOpsOption `json:"storageExpansion"` - RebuildInstance []ComponentOpsOption `json:"rebuildInstance,omitempty"` - Metrics MetricsOption `json:"metrics"` - Dashboards []DashboardOption `json:"dashboards"` - Logs []LogOption `json:"logs"` - Parameters []ParameterOption `json:"parameters"` + RebuildInstance []ComponentOpsOption `json:"rebuildInstance,omitempty"` + Metrics MetricsOption `json:"metrics"` + Dashboards []DashboardOption `json:"dashboards"` + Logs []LogOption `json:"logs"` + Parameters []ParameterOption `json:"parameters"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineOption instantiates a new EngineOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -79,7 +85,6 @@ func NewEngineOptionWithDefaults() *EngineOption { this := EngineOption{} return &this } - // GetEngineName returns the EngineName field value. func (o *EngineOption) GetEngineName() string { if o == nil { @@ -103,6 +108,7 @@ func (o *EngineOption) SetEngineName(v string) { o.EngineName = v } + // GetTitle returns the Title field value. func (o *EngineOption) GetTitle() string { if o == nil { @@ -126,6 +132,7 @@ func (o *EngineOption) SetTitle(v string) { o.Title = v } + // GetDescription returns the Description field value. func (o *EngineOption) GetDescription() LocalizedDescription { if o == nil { @@ -149,6 +156,7 @@ func (o *EngineOption) SetDescription(v LocalizedDescription) { o.Description = v } + // GetVersions returns the Versions field value. func (o *EngineOption) GetVersions() []string { if o == nil { @@ -172,6 +180,7 @@ func (o *EngineOption) SetVersions(v []string) { o.Versions = v } + // GetComponents returns the Components field value. func (o *EngineOption) GetComponents() []ComponentOption { if o == nil { @@ -195,6 +204,7 @@ func (o *EngineOption) SetComponents(v []ComponentOption) { o.Components = v } + // GetModes returns the Modes field value. func (o *EngineOption) GetModes() []ModeOption { if o == nil { @@ -218,6 +228,7 @@ func (o *EngineOption) SetModes(v []ModeOption) { o.Modes = v } + // GetAccount returns the Account field value. func (o *EngineOption) GetAccount() AccountOption { if o == nil { @@ -241,6 +252,7 @@ func (o *EngineOption) SetAccount(v AccountOption) { o.Account = v } + // GetDatabase returns the Database field value if set, zero value otherwise. func (o *EngineOption) GetDatabase() DatabaseOption { if o == nil || o.Database == nil { @@ -269,6 +281,7 @@ func (o *EngineOption) SetDatabase(v DatabaseOption) { o.Database = &v } + // GetDms returns the Dms field value. func (o *EngineOption) GetDms() DmsOption { if o == nil { @@ -292,6 +305,7 @@ func (o *EngineOption) SetDms(v DmsOption) { o.Dms = v } + // GetBackup returns the Backup field value. func (o *EngineOption) GetBackup() BackupOption { if o == nil { @@ -315,6 +329,7 @@ func (o *EngineOption) SetBackup(v BackupOption) { o.Backup = v } + // GetBench returns the Bench field value. func (o *EngineOption) GetBench() BenchOption { if o == nil { @@ -338,6 +353,7 @@ func (o *EngineOption) SetBench(v BenchOption) { o.Bench = v } + // GetEndpoints returns the Endpoints field value. func (o *EngineOption) GetEndpoints() []EndpointOption { if o == nil { @@ -361,6 +377,7 @@ func (o *EngineOption) SetEndpoints(v []EndpointOption) { o.Endpoints = v } + // GetPromote returns the Promote field value. func (o *EngineOption) GetPromote() []ComponentOpsOption { if o == nil { @@ -384,6 +401,7 @@ func (o *EngineOption) SetPromote(v []ComponentOpsOption) { o.Promote = v } + // GetStop returns the Stop field value. func (o *EngineOption) GetStop() []ComponentOpsOption { if o == nil { @@ -407,6 +425,7 @@ func (o *EngineOption) SetStop(v []ComponentOpsOption) { o.Stop = v } + // GetStart returns the Start field value. func (o *EngineOption) GetStart() []ComponentOpsOption { if o == nil { @@ -430,6 +449,7 @@ func (o *EngineOption) SetStart(v []ComponentOpsOption) { o.Start = v } + // GetRestart returns the Restart field value. func (o *EngineOption) GetRestart() []ComponentOpsOption { if o == nil { @@ -453,6 +473,7 @@ func (o *EngineOption) SetRestart(v []ComponentOpsOption) { o.Restart = v } + // GetHscale returns the Hscale field value. func (o *EngineOption) GetHscale() []ComponentOpsOption { if o == nil { @@ -476,6 +497,7 @@ func (o *EngineOption) SetHscale(v []ComponentOpsOption) { o.Hscale = v } + // GetVscale returns the Vscale field value. func (o *EngineOption) GetVscale() []ComponentOpsOption { if o == nil { @@ -499,6 +521,7 @@ func (o *EngineOption) SetVscale(v []ComponentOpsOption) { o.Vscale = v } + // GetLicense returns the License field value if set, zero value otherwise. func (o *EngineOption) GetLicense() EngineOptionLicense { if o == nil || o.License == nil { @@ -527,6 +550,7 @@ func (o *EngineOption) SetLicense(v EngineOptionLicense) { o.License = &v } + // GetStorageExpansion returns the StorageExpansion field value. func (o *EngineOption) GetStorageExpansion() []ComponentOpsOption { if o == nil { @@ -550,6 +574,7 @@ func (o *EngineOption) SetStorageExpansion(v []ComponentOpsOption) { o.StorageExpansion = v } + // GetRebuildInstance returns the RebuildInstance field value if set, zero value otherwise. func (o *EngineOption) GetRebuildInstance() []ComponentOpsOption { if o == nil || o.RebuildInstance == nil { @@ -578,6 +603,7 @@ func (o *EngineOption) SetRebuildInstance(v []ComponentOpsOption) { o.RebuildInstance = v } + // GetMetrics returns the Metrics field value. func (o *EngineOption) GetMetrics() MetricsOption { if o == nil { @@ -601,6 +627,7 @@ func (o *EngineOption) SetMetrics(v MetricsOption) { o.Metrics = v } + // GetDashboards returns the Dashboards field value. func (o *EngineOption) GetDashboards() []DashboardOption { if o == nil { @@ -624,6 +651,7 @@ func (o *EngineOption) SetDashboards(v []DashboardOption) { o.Dashboards = v } + // GetLogs returns the Logs field value. func (o *EngineOption) GetLogs() []LogOption { if o == nil { @@ -647,6 +675,7 @@ func (o *EngineOption) SetLogs(v []LogOption) { o.Logs = v } + // GetParameters returns the Parameters field value. func (o *EngineOption) GetParameters() []ParameterOption { if o == nil { @@ -670,6 +699,8 @@ func (o *EngineOption) SetParameters(v []ParameterOption) { o.Parameters = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -717,31 +748,31 @@ func (o EngineOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EngineName *string `json:"engineName"` - Title *string `json:"title"` - Description *LocalizedDescription `json:"description"` - Versions *[]string `json:"versions"` - Components *[]ComponentOption `json:"components"` - Modes *[]ModeOption `json:"modes"` - Account *AccountOption `json:"account"` - Database *DatabaseOption `json:"database,omitempty"` - Dms *DmsOption `json:"dms"` - Backup *BackupOption `json:"backup"` - Bench *BenchOption `json:"bench"` - Endpoints *[]EndpointOption `json:"endpoints"` - Promote *[]ComponentOpsOption `json:"promote"` - Stop *[]ComponentOpsOption `json:"stop"` - Start *[]ComponentOpsOption `json:"start"` - Restart *[]ComponentOpsOption `json:"restart"` - Hscale *[]ComponentOpsOption `json:"hscale"` - Vscale *[]ComponentOpsOption `json:"vscale"` - License *EngineOptionLicense `json:"license,omitempty"` + EngineName *string `json:"engineName"` + Title *string `json:"title"` + Description *LocalizedDescription `json:"description"` + Versions *[]string `json:"versions"` + Components *[]ComponentOption `json:"components"` + Modes *[]ModeOption `json:"modes"` + Account *AccountOption `json:"account"` + Database *DatabaseOption `json:"database,omitempty"` + Dms *DmsOption `json:"dms"` + Backup *BackupOption `json:"backup"` + Bench *BenchOption `json:"bench"` + Endpoints *[]EndpointOption `json:"endpoints"` + Promote *[]ComponentOpsOption `json:"promote"` + Stop *[]ComponentOpsOption `json:"stop"` + Start *[]ComponentOpsOption `json:"start"` + Restart *[]ComponentOpsOption `json:"restart"` + Hscale *[]ComponentOpsOption `json:"hscale"` + Vscale *[]ComponentOpsOption `json:"vscale"` + License *EngineOptionLicense `json:"license,omitempty"` StorageExpansion *[]ComponentOpsOption `json:"storageExpansion"` - RebuildInstance []ComponentOpsOption `json:"rebuildInstance,omitempty"` - Metrics *MetricsOption `json:"metrics"` - Dashboards *[]DashboardOption `json:"dashboards"` - Logs *[]LogOption `json:"logs"` - Parameters *[]ParameterOption `json:"parameters"` + RebuildInstance []ComponentOpsOption `json:"rebuildInstance,omitempty"` + Metrics *MetricsOption `json:"metrics"` + Dashboards *[]DashboardOption `json:"dashboards"` + Logs *[]LogOption `json:"logs"` + Parameters *[]ParameterOption `json:"parameters"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -814,7 +845,7 @@ func (o *EngineOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"engineName", "title", "description", "versions", "components", "modes", "account", "database", "dms", "backup", "bench", "endpoints", "promote", "stop", "start", "restart", "hscale", "vscale", "license", "storageExpansion", "rebuildInstance", "metrics", "dashboards", "logs", "parameters"}) + common.DeleteKeys(additionalProperties, &[]string{ "engineName", "title", "description", "versions", "components", "modes", "account", "database", "dms", "backup", "bench", "endpoints", "promote", "stop", "start", "restart", "hscale", "vscale", "license", "storageExpansion", "rebuildInstance", "metrics", "dashboards", "logs", "parameters", }) } else { return err } @@ -833,7 +864,7 @@ func (o *EngineOption) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField = true } o.Account = *all.Account - if all.Database != nil && all.Database.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Database != nil && all.Database.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Database = all.Database @@ -856,7 +887,7 @@ func (o *EngineOption) UnmarshalJSON(bytes []byte) (err error) { o.Restart = *all.Restart o.Hscale = *all.Hscale o.Vscale = *all.Vscale - if all.License != nil && all.License.UnparsedObject != nil && o.UnparsedObject == nil { + if all.License != nil && all.License.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.License = all.License diff --git a/api/kbcloud/model_engine_option_license.go b/api/kbcloud/model_engine_option_license.go index f2993841..82e2fab3 100644 --- a/api/kbcloud/model_engine_option_license.go +++ b/api/kbcloud/model_engine_option_license.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOptionLicense struct { // Indicate whether the current cluster requires users to input the license Required *bool `json:"required,omitempty"` // support to refer the cluster name with variable ${clusterName} SecretName string `json:"secretName"` // the license file name - FileName string `json:"fileName"` + FileName string `json:"fileName"` Components []LicenseOption `json:"components,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineOptionLicense instantiates a new EngineOptionLicense object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewEngineOptionLicenseWithDefaults() *EngineOptionLicense { this := EngineOptionLicense{} return &this } - // GetRequired returns the Required field value if set, zero value otherwise. func (o *EngineOptionLicense) GetRequired() bool { if o == nil || o.Required == nil { @@ -70,6 +75,7 @@ func (o *EngineOptionLicense) SetRequired(v bool) { o.Required = &v } + // GetSecretName returns the SecretName field value. func (o *EngineOptionLicense) GetSecretName() string { if o == nil { @@ -93,6 +99,7 @@ func (o *EngineOptionLicense) SetSecretName(v string) { o.SecretName = v } + // GetFileName returns the FileName field value. func (o *EngineOptionLicense) GetFileName() string { if o == nil { @@ -116,6 +123,7 @@ func (o *EngineOptionLicense) SetFileName(v string) { o.FileName = v } + // GetComponents returns the Components field value if set, zero value otherwise. func (o *EngineOptionLicense) GetComponents() []LicenseOption { if o == nil || o.Components == nil { @@ -144,6 +152,8 @@ func (o *EngineOptionLicense) SetComponents(v []LicenseOption) { o.Components = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineOptionLicense) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -168,9 +178,9 @@ func (o EngineOptionLicense) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineOptionLicense) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Required *bool `json:"required,omitempty"` - SecretName *string `json:"secretName"` - FileName *string `json:"fileName"` + Required *bool `json:"required,omitempty"` + SecretName *string `json:"secretName"` + FileName *string `json:"fileName"` Components []LicenseOption `json:"components,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -184,7 +194,7 @@ func (o *EngineOptionLicense) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"required", "secretName", "fileName", "components"}) + common.DeleteKeys(additionalProperties, &[]string{ "required", "secretName", "fileName", "components", }) } else { return err } diff --git a/api/kbcloud/model_engine_option_list.go b/api/kbcloud/model_engine_option_list.go index 31f73a24..2a6c75b4 100644 --- a/api/kbcloud/model_engine_option_list.go +++ b/api/kbcloud/model_engine_option_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type EngineOptionList struct { // Items is the list of engineOption objects in the list Items []EngineOption `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineOptionList instantiates a new EngineOptionList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewEngineOptionListWithDefaults() *EngineOptionList { this := EngineOptionList{} return &this } - // GetItems returns the Items field value. func (o *EngineOptionList) GetItems() []EngineOption { if o == nil { @@ -59,6 +64,8 @@ func (o *EngineOptionList) SetItems(v []EngineOption) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineOptionList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *EngineOptionList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_engine_options_metrics_query_type.go b/api/kbcloud/model_engine_options_metrics_query_type.go index 2ebfadf5..8a199251 100644 --- a/api/kbcloud/model_engine_options_metrics_query_type.go +++ b/api/kbcloud/model_engine_options_metrics_query_type.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EngineOptionsMetricsQueryType Specifies the type of metrics query to be performed. // 'instant' for a single point in time, 'range' for a time range. +// type EngineOptionsMetricsQueryType string // List of EngineOptionsMetricsQueryType. const ( EngineOptionsMetricsQueryTypeInstant EngineOptionsMetricsQueryType = "instant" - EngineOptionsMetricsQueryTypeRange EngineOptionsMetricsQueryType = "range" + EngineOptionsMetricsQueryTypeRange EngineOptionsMetricsQueryType = "range" ) var allowedEngineOptionsMetricsQueryTypeEnumValues = []EngineOptionsMetricsQueryType{ diff --git a/api/kbcloud/model_engine_options_service_pattern.go b/api/kbcloud/model_engine_options_service_pattern.go index 6dda4e99..ad184030 100644 --- a/api/kbcloud/model_engine_options_service_pattern.go +++ b/api/kbcloud/model_engine_options_service_pattern.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EngineOptionsServicePattern service name pattern, e.g. ClusterName-ComponentName or .ClusterName` type EngineOptionsServicePattern string // List of EngineOptionsServicePattern. const ( - EngineOptionsServicePatternClusterComponent EngineOptionsServicePattern = "cluster-component" - EngineOptionsServicePatternCluster EngineOptionsServicePattern = "cluster" + EngineOptionsServicePatternClusterComponent EngineOptionsServicePattern = "cluster-component" + EngineOptionsServicePatternCluster EngineOptionsServicePattern = "cluster" EngineOptionsServicePatternClusterComponentService EngineOptionsServicePattern = "cluster-component-service" ) diff --git a/api/kbcloud/model_engine_service_versions.go b/api/kbcloud/model_engine_service_versions.go index b0b2f88e..1bb50249 100644 --- a/api/kbcloud/model_engine_service_versions.go +++ b/api/kbcloud/model_engine_service_versions.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type EngineServiceVersions struct { // component type, refer to componentDef and support NamePrefix - Component *string `json:"component,omitempty"` - UpgradeableVersions []string `json:"upgradeableVersions,omitempty"` - Versions []EngineServiceVersionsVersionsItem `json:"versions,omitempty"` + Component *string `json:"component,omitempty"` + UpgradeableVersions []string `json:"upgradeableVersions,omitempty"` + Versions []EngineServiceVersionsVersionsItem `json:"versions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineServiceVersions instantiates a new EngineServiceVersions object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewEngineServiceVersionsWithDefaults() *EngineServiceVersions { this := EngineServiceVersions{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *EngineServiceVersions) GetComponent() string { if o == nil || o.Component == nil { @@ -61,6 +70,7 @@ func (o *EngineServiceVersions) SetComponent(v string) { o.Component = &v } + // GetUpgradeableVersions returns the UpgradeableVersions field value if set, zero value otherwise. func (o *EngineServiceVersions) GetUpgradeableVersions() []string { if o == nil || o.UpgradeableVersions == nil { @@ -89,6 +99,7 @@ func (o *EngineServiceVersions) SetUpgradeableVersions(v []string) { o.UpgradeableVersions = v } + // GetVersions returns the Versions field value if set, zero value otherwise. func (o *EngineServiceVersions) GetVersions() []EngineServiceVersionsVersionsItem { if o == nil || o.Versions == nil { @@ -117,6 +128,8 @@ func (o *EngineServiceVersions) SetVersions(v []EngineServiceVersionsVersionsIte o.Versions = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineServiceVersions) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -142,16 +155,16 @@ func (o EngineServiceVersions) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineServiceVersions) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - UpgradeableVersions []string `json:"upgradeableVersions,omitempty"` - Versions []EngineServiceVersionsVersionsItem `json:"versions,omitempty"` + Component *string `json:"component,omitempty"` + UpgradeableVersions []string `json:"upgradeableVersions,omitempty"` + Versions []EngineServiceVersionsVersionsItem `json:"versions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "upgradeableVersions", "versions"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "upgradeableVersions", "versions", }) } else { return err } diff --git a/api/kbcloud/model_engine_service_versions_versions_item.go b/api/kbcloud/model_engine_service_versions_versions_item.go index 5596c779..d60eb8aa 100644 --- a/api/kbcloud/model_engine_service_versions_versions_item.go +++ b/api/kbcloud/model_engine_service_versions_versions_item.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type EngineServiceVersionsVersionsItem struct { - MajorVersion *string `json:"majorVersion,omitempty"` + MajorVersion *string `json:"majorVersion,omitempty"` MinorVersions []string `json:"minorVersions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEngineServiceVersionsVersionsItem instantiates a new EngineServiceVersionsVersionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewEngineServiceVersionsVersionsItemWithDefaults() *EngineServiceVersionsVe this := EngineServiceVersionsVersionsItem{} return &this } - // GetMajorVersion returns the MajorVersion field value if set, zero value otherwise. func (o *EngineServiceVersionsVersionsItem) GetMajorVersion() string { if o == nil || o.MajorVersion == nil { @@ -59,6 +68,7 @@ func (o *EngineServiceVersionsVersionsItem) SetMajorVersion(v string) { o.MajorVersion = &v } + // GetMinorVersions returns the MinorVersions field value if set, zero value otherwise. func (o *EngineServiceVersionsVersionsItem) GetMinorVersions() []string { if o == nil || o.MinorVersions == nil { @@ -87,6 +97,8 @@ func (o *EngineServiceVersionsVersionsItem) SetMinorVersions(v []string) { o.MinorVersions = v } + + // MarshalJSON serializes the struct using spec logic. func (o EngineServiceVersionsVersionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -109,7 +121,7 @@ func (o EngineServiceVersionsVersionsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EngineServiceVersionsVersionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - MajorVersion *string `json:"majorVersion,omitempty"` + MajorVersion *string `json:"majorVersion,omitempty"` MinorVersions []string `json:"minorVersions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +129,7 @@ func (o *EngineServiceVersionsVersionsItem) UnmarshalJSON(bytes []byte) (err err } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"majorVersion", "minorVersions"}) + common.DeleteKeys(additionalProperties, &[]string{ "majorVersion", "minorVersions", }) } else { return err } diff --git a/api/kbcloud/model_engine_status.go b/api/kbcloud/model_engine_status.go index d88852f9..a41d70e6 100644 --- a/api/kbcloud/model_engine_status.go +++ b/api/kbcloud/model_engine_status.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EngineStatus engine addon status in K8s type EngineStatus string // List of EngineStatus. const ( - EngineStatusDisabled EngineStatus = "Disabled" - EngineStatusEnabled EngineStatus = "Enabled" - EngineStatusFailed EngineStatus = "Failed" - EngineStatusEnabling EngineStatus = "Enabling" + EngineStatusDisabled EngineStatus = "Disabled" + EngineStatusEnabled EngineStatus = "Enabled" + EngineStatusFailed EngineStatus = "Failed" + EngineStatusEnabling EngineStatus = "Enabling" EngineStatusDisabling EngineStatus = "Disabling" ) diff --git a/api/kbcloud/model_engine_type.go b/api/kbcloud/model_engine_type.go index b3741323..f3434c06 100644 --- a/api/kbcloud/model_engine_type.go +++ b/api/kbcloud/model_engine_type.go @@ -2,29 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EngineType engine type type EngineType string // List of EngineType. const ( - EngineTypeRdbms EngineType = "RDBMS" + EngineTypeRdbms EngineType = "RDBMS" EngineTypeSearchEngine EngineType = "search-engine" - EngineTypeKeyValue EngineType = "key-value" - EngineTypeTimeSeries EngineType = "time-series" - EngineTypeStreaming EngineType = "streaming" - EngineTypeLlm EngineType = "LLM" - EngineTypeVector EngineType = "vector" - EngineTypeDocument EngineType = "document" - EngineTypeGraph EngineType = "graph" - EngineTypeOther EngineType = "other" + EngineTypeKeyValue EngineType = "key-value" + EngineTypeTimeSeries EngineType = "time-series" + EngineTypeStreaming EngineType = "streaming" + EngineTypeLlm EngineType = "LLM" + EngineTypeVector EngineType = "vector" + EngineTypeDocument EngineType = "document" + EngineTypeGraph EngineType = "graph" + EngineTypeOther EngineType = "other" ) var allowedEngineTypeEnumValues = []EngineType{ diff --git a/api/kbcloud/model_environment.go b/api/kbcloud/model_environment.go index 3db65ca8..8fff1d54 100644 --- a/api/kbcloud/model_environment.go +++ b/api/kbcloud/model_environment.go @@ -2,17 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" - "github.com/google/uuid" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Environment Environment info + + +// Environment Environment info type Environment struct { // Provider Provider string `json:"provider"` @@ -49,10 +52,11 @@ type Environment struct { // Enable pod antiaffinity for cluster PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironment instantiates a new Environment object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -83,7 +87,6 @@ func NewEnvironmentWithDefaults() *Environment { this.PodAntiAffinityEnabled = &podAntiAffinityEnabled return &this } - // GetProvider returns the Provider field value. func (o *Environment) GetProvider() string { if o == nil { @@ -107,6 +110,7 @@ func (o *Environment) SetProvider(v string) { o.Provider = v } + // GetRegion returns the Region field value. func (o *Environment) GetRegion() string { if o == nil { @@ -130,6 +134,7 @@ func (o *Environment) SetRegion(v string) { o.Region = v } + // GetAvailabilityZones returns the AvailabilityZones field value. func (o *Environment) GetAvailabilityZones() []string { if o == nil { @@ -153,6 +158,7 @@ func (o *Environment) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetNetworkConfig returns the NetworkConfig field value if set, zero value otherwise. func (o *Environment) GetNetworkConfig() NetworkConfig { if o == nil || o.NetworkConfig == nil { @@ -181,6 +187,7 @@ func (o *Environment) SetNetworkConfig(v NetworkConfig) { o.NetworkConfig = &v } + // GetCreatedAt returns the CreatedAt field value. func (o *Environment) GetCreatedAt() time.Time { if o == nil { @@ -204,6 +211,7 @@ func (o *Environment) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Environment) GetDescription() string { if o == nil || o.Description == nil { @@ -232,6 +240,7 @@ func (o *Environment) SetDescription(v string) { o.Description = &v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *Environment) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -260,6 +269,7 @@ func (o *Environment) SetDisplayName(v string) { o.DisplayName = &v } + // GetId returns the Id field value. func (o *Environment) GetId() uuid.UUID { if o == nil { @@ -283,6 +293,7 @@ func (o *Environment) SetId(v uuid.UUID) { o.Id = v } + // GetName returns the Name field value. func (o *Environment) GetName() string { if o == nil { @@ -306,6 +317,7 @@ func (o *Environment) SetName(v string) { o.Name = v } + // GetOrgName returns the OrgName field value. func (o *Environment) GetOrgName() string { if o == nil { @@ -329,6 +341,7 @@ func (o *Environment) SetOrgName(v string) { o.OrgName = v } + // GetState returns the State field value. func (o *Environment) GetState() EnvironmentState { if o == nil { @@ -352,6 +365,7 @@ func (o *Environment) SetState(v EnvironmentState) { o.State = v } + // GetType returns the Type field value. func (o *Environment) GetType() EnvironmentType { if o == nil { @@ -375,6 +389,7 @@ func (o *Environment) SetType(v EnvironmentType) { o.Type = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Environment) GetUpdatedAt() time.Time { if o == nil { @@ -398,6 +413,7 @@ func (o *Environment) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetImageRegistry returns the ImageRegistry field value if set, zero value otherwise. func (o *Environment) GetImageRegistry() string { if o == nil || o.ImageRegistry == nil { @@ -426,6 +442,7 @@ func (o *Environment) SetImageRegistry(v string) { o.ImageRegistry = &v } + // GetExtraInfo returns the ExtraInfo field value if set, zero value otherwise. func (o *Environment) GetExtraInfo() string { if o == nil || o.ExtraInfo == nil { @@ -454,6 +471,7 @@ func (o *Environment) SetExtraInfo(v string) { o.ExtraInfo = &v } + // GetNamespaces returns the Namespaces field value if set, zero value otherwise. func (o *Environment) GetNamespaces() []string { if o == nil || o.Namespaces == nil { @@ -482,6 +500,7 @@ func (o *Environment) SetNamespaces(v []string) { o.Namespaces = v } + // GetPodAntiAffinityEnabled returns the PodAntiAffinityEnabled field value if set, zero value otherwise. func (o *Environment) GetPodAntiAffinityEnabled() bool { if o == nil || o.PodAntiAffinityEnabled == nil { @@ -510,6 +529,8 @@ func (o *Environment) SetPodAntiAffinityEnabled(v bool) { o.PodAntiAffinityEnabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Environment) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -565,23 +586,23 @@ func (o Environment) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Environment) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Provider *string `json:"provider"` - Region *string `json:"region"` - AvailabilityZones *[]string `json:"availabilityZones"` - NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"` - CreatedAt *time.Time `json:"createdAt"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Id *uuid.UUID `json:"id"` - Name *string `json:"name"` - OrgName *string `json:"orgName"` - State *EnvironmentState `json:"state"` - Type *EnvironmentType `json:"type"` - UpdatedAt *time.Time `json:"updatedAt"` - ImageRegistry *string `json:"imageRegistry,omitempty"` - ExtraInfo *string `json:"extraInfo,omitempty"` - Namespaces []string `json:"namespaces,omitempty"` - PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` + Provider *string `json:"provider"` + Region *string `json:"region"` + AvailabilityZones *[]string `json:"availabilityZones"` + NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"` + CreatedAt *time.Time `json:"createdAt"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Id *uuid.UUID `json:"id"` + Name *string `json:"name"` + OrgName *string `json:"orgName"` + State *EnvironmentState `json:"state"` + Type *EnvironmentType `json:"type"` + UpdatedAt *time.Time `json:"updatedAt"` + ImageRegistry *string `json:"imageRegistry,omitempty"` + ExtraInfo *string `json:"extraInfo,omitempty"` + Namespaces []string `json:"namespaces,omitempty"` + PodAntiAffinityEnabled *bool `json:"podAntiAffinityEnabled,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -618,7 +639,7 @@ func (o *Environment) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"provider", "region", "availabilityZones", "networkConfig", "createdAt", "description", "displayName", "id", "name", "orgName", "state", "type", "updatedAt", "imageRegistry", "extraInfo", "namespaces", "podAntiAffinityEnabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "provider", "region", "availabilityZones", "networkConfig", "createdAt", "description", "displayName", "id", "name", "orgName", "state", "type", "updatedAt", "imageRegistry", "extraInfo", "namespaces", "podAntiAffinityEnabled", }) } else { return err } @@ -627,7 +648,7 @@ func (o *Environment) UnmarshalJSON(bytes []byte) (err error) { o.Provider = *all.Provider o.Region = *all.Region o.AvailabilityZones = *all.AvailabilityZones - if all.NetworkConfig != nil && all.NetworkConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.NetworkConfig != nil && all.NetworkConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.NetworkConfig = all.NetworkConfig diff --git a/api/kbcloud/model_environment_list.go b/api/kbcloud/model_environment_list.go index 98d0c142..43ce681b 100644 --- a/api/kbcloud/model_environment_list.go +++ b/api/kbcloud/model_environment_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EnvironmentList EnvironmentList is a list of Environments + + +// EnvironmentList EnvironmentList is a list of Environments type EnvironmentList struct { // Items is the list of Environment objects in the list Items []Environment `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEnvironmentList instantiates a new EnvironmentList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewEnvironmentListWithDefaults() *EnvironmentList { this := EnvironmentList{} return &this } - // GetItems returns the Items field value. func (o *EnvironmentList) GetItems() []Environment { if o == nil { @@ -62,6 +67,7 @@ func (o *EnvironmentList) SetItems(v []Environment) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *EnvironmentList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *EnvironmentList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o EnvironmentList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o EnvironmentList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EnvironmentList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Environment `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]Environment `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *EnvironmentList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_environment_state.go b/api/kbcloud/model_environment_state.go index e8d4b24d..94723c4a 100644 --- a/api/kbcloud/model_environment_state.go +++ b/api/kbcloud/model_environment_state.go @@ -2,29 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EnvironmentState Output only. State of the Environment resource type EnvironmentState string // List of EnvironmentState. const ( - EnvironmentStatePending EnvironmentState = "PENDING" - EnvironmentStateRegistered EnvironmentState = "REGISTERED" + EnvironmentStatePending EnvironmentState = "PENDING" + EnvironmentStateRegistered EnvironmentState = "REGISTERED" EnvironmentStateProvisioning EnvironmentState = "PROVISIONING" - EnvironmentStateNotready EnvironmentState = "NOTREADY" - EnvironmentStateReady EnvironmentState = "READY" - EnvironmentStateWarning EnvironmentState = "WARNING" - EnvironmentStateUnreachable EnvironmentState = "UNREACHABLE" - EnvironmentStateDeleting EnvironmentState = "DELETING" - EnvironmentStateOutofstock EnvironmentState = "OUTOFSTOCK" - EnvironmentStateUpdating EnvironmentState = "UPDATING" + EnvironmentStateNotready EnvironmentState = "NOTREADY" + EnvironmentStateReady EnvironmentState = "READY" + EnvironmentStateWarning EnvironmentState = "WARNING" + EnvironmentStateUnreachable EnvironmentState = "UNREACHABLE" + EnvironmentStateOutofstock EnvironmentState = "OUTOFSTOCK" ) var allowedEnvironmentStateEnumValues = []EnvironmentState{ @@ -35,9 +38,7 @@ var allowedEnvironmentStateEnumValues = []EnvironmentState{ EnvironmentStateReady, EnvironmentStateWarning, EnvironmentStateUnreachable, - EnvironmentStateDeleting, EnvironmentStateOutofstock, - EnvironmentStateUpdating, } // GetAllowedValues returns the list of possible values. diff --git a/api/kbcloud/model_environment_type.go b/api/kbcloud/model_environment_type.go index 3e1ff104..568d1c83 100644 --- a/api/kbcloud/model_environment_type.go +++ b/api/kbcloud/model_environment_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EnvironmentType Type of this environment type EnvironmentType string // List of EnvironmentType. const ( - EnvironmentTypePublic EnvironmentType = "public" + EnvironmentTypePublic EnvironmentType = "public" EnvironmentTypePrivate EnvironmentType = "private" ) diff --git a/api/kbcloud/model_event.go b/api/kbcloud/model_event.go index d5e11926..bb722789 100644 --- a/api/kbcloud/model_event.go +++ b/api/kbcloud/model_event.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Event event is the information of operation event + + +// Event event is the information of operation event type Event struct { // ID of the event Id *string `json:"id,omitempty"` @@ -43,10 +48,11 @@ type Event struct { // event created time CreatedAt *time.Time `json:"createdAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEvent instantiates a new Event object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -63,7 +69,6 @@ func NewEventWithDefaults() *Event { this := Event{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Event) GetId() string { if o == nil || o.Id == nil { @@ -92,6 +97,7 @@ func (o *Event) SetId(v string) { o.Id = &v } + // GetResourceId returns the ResourceId field value if set, zero value otherwise. func (o *Event) GetResourceId() string { if o == nil || o.ResourceId == nil { @@ -120,6 +126,7 @@ func (o *Event) SetResourceId(v string) { o.ResourceId = &v } + // GetResourceType returns the ResourceType field value if set, zero value otherwise. func (o *Event) GetResourceType() EventResourceType { if o == nil || o.ResourceType == nil { @@ -148,6 +155,7 @@ func (o *Event) SetResourceType(v EventResourceType) { o.ResourceType = &v } + // GetResourceName returns the ResourceName field value if set, zero value otherwise. func (o *Event) GetResourceName() string { if o == nil || o.ResourceName == nil { @@ -176,6 +184,7 @@ func (o *Event) SetResourceName(v string) { o.ResourceName = &v } + // GetOperator returns the Operator field value if set, zero value otherwise. func (o *Event) GetOperator() string { if o == nil || o.Operator == nil { @@ -204,6 +213,7 @@ func (o *Event) SetOperator(v string) { o.Operator = &v } + // GetOperatorId returns the OperatorId field value if set, zero value otherwise. func (o *Event) GetOperatorId() string { if o == nil || o.OperatorId == nil { @@ -232,6 +242,7 @@ func (o *Event) SetOperatorId(v string) { o.OperatorId = &v } + // GetDetails returns the Details field value if set, zero value otherwise. func (o *Event) GetDetails() string { if o == nil || o.Details == nil { @@ -260,6 +271,7 @@ func (o *Event) SetDetails(v string) { o.Details = &v } + // GetHasTask returns the HasTask field value if set, zero value otherwise. func (o *Event) GetHasTask() bool { if o == nil || o.HasTask == nil { @@ -288,6 +300,7 @@ func (o *Event) SetHasTask(v bool) { o.HasTask = &v } + // GetResult returns the Result field value if set, zero value otherwise. func (o *Event) GetResult() string { if o == nil || o.Result == nil { @@ -316,6 +329,7 @@ func (o *Event) SetResult(v string) { o.Result = &v } + // GetEventName returns the EventName field value if set, zero value otherwise. func (o *Event) GetEventName() string { if o == nil || o.EventName == nil { @@ -344,6 +358,7 @@ func (o *Event) SetEventName(v string) { o.EventName = &v } + // GetResultStatus returns the ResultStatus field value if set, zero value otherwise. func (o *Event) GetResultStatus() EventResultStatus { if o == nil || o.ResultStatus == nil { @@ -372,6 +387,7 @@ func (o *Event) SetResultStatus(v EventResultStatus) { o.ResultStatus = &v } + // GetSource returns the Source field value if set, zero value otherwise. func (o *Event) GetSource() EventSource { if o == nil || o.Source == nil { @@ -400,6 +416,7 @@ func (o *Event) SetSource(v EventSource) { o.Source = &v } + // GetEnd returns the End field value if set, zero value otherwise. func (o *Event) GetEnd() time.Time { if o == nil || o.End == nil { @@ -428,6 +445,7 @@ func (o *Event) SetEnd(v time.Time) { o.End = &v } + // GetStart returns the Start field value if set, zero value otherwise. func (o *Event) GetStart() time.Time { if o == nil || o.Start == nil { @@ -456,6 +474,7 @@ func (o *Event) SetStart(v time.Time) { o.Start = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Event) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -484,6 +503,8 @@ func (o *Event) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Event) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -557,28 +578,28 @@ func (o Event) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Event) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` + Id *string `json:"id,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` ResourceType *EventResourceType `json:"resourceType,omitempty"` - ResourceName *string `json:"resourceName,omitempty"` - Operator *string `json:"operator,omitempty"` - OperatorId *string `json:"operatorId,omitempty"` - Details *string `json:"details,omitempty"` - HasTask *bool `json:"hasTask,omitempty"` - Result *string `json:"result,omitempty"` - EventName *string `json:"eventName,omitempty"` + ResourceName *string `json:"resourceName,omitempty"` + Operator *string `json:"operator,omitempty"` + OperatorId *string `json:"operatorId,omitempty"` + Details *string `json:"details,omitempty"` + HasTask *bool `json:"hasTask,omitempty"` + Result *string `json:"result,omitempty"` + EventName *string `json:"eventName,omitempty"` ResultStatus *EventResultStatus `json:"resultStatus,omitempty"` - Source *EventSource `json:"source,omitempty"` - End *time.Time `json:"end,omitempty"` - Start *time.Time `json:"start,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` + Source *EventSource `json:"source,omitempty"` + End *time.Time `json:"end,omitempty"` + Start *time.Time `json:"start,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "resourceId", "resourceType", "resourceName", "operator", "operatorId", "details", "hasTask", "result", "eventName", "resultStatus", "source", "end", "start", "createdAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "resourceId", "resourceType", "resourceName", "operator", "operatorId", "details", "hasTask", "result", "eventName", "resultStatus", "source", "end", "start", "createdAt", }) } else { return err } @@ -586,7 +607,7 @@ func (o *Event) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField := false o.Id = all.Id o.ResourceId = all.ResourceId - if all.ResourceType != nil && !all.ResourceType.IsValid() { + if all.ResourceType != nil &&!all.ResourceType.IsValid() { hasInvalidField = true } else { o.ResourceType = all.ResourceType @@ -598,12 +619,12 @@ func (o *Event) UnmarshalJSON(bytes []byte) (err error) { o.HasTask = all.HasTask o.Result = all.Result o.EventName = all.EventName - if all.ResultStatus != nil && !all.ResultStatus.IsValid() { + if all.ResultStatus != nil &&!all.ResultStatus.IsValid() { hasInvalidField = true } else { o.ResultStatus = all.ResultStatus } - if all.Source != nil && !all.Source.IsValid() { + if all.Source != nil &&!all.Source.IsValid() { hasInvalidField = true } else { o.Source = all.Source diff --git a/api/kbcloud/model_event_list.go b/api/kbcloud/model_event_list.go index 780e1f51..1fca876d 100644 --- a/api/kbcloud/model_event_list.go +++ b/api/kbcloud/model_event_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// EventList EventList is a list of operation event objects + + +// EventList EventList is a list of operation event objects type EventList struct { // Items is the list of operation event objects in the list Items []Event `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewEventList instantiates a new EventList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewEventListWithDefaults() *EventList { this := EventList{} return &this } - // GetItems returns the Items field value. func (o *EventList) GetItems() []Event { if o == nil { @@ -60,6 +65,8 @@ func (o *EventList) SetItems(v []Event) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o EventList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *EventList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_event_resource_type.go b/api/kbcloud/model_event_resource_type.go index bac4b20b..1d0210fe 100644 --- a/api/kbcloud/model_event_resource_type.go +++ b/api/kbcloud/model_event_resource_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EventResourceType Type of the resource type EventResourceType string // List of EventResourceType. const ( EventResourceTypeCluster EventResourceType = "cluster" - EventResourceTypeRole EventResourceType = "role" + EventResourceTypeRole EventResourceType = "role" ) var allowedEventResourceTypeEnumValues = []EventResourceType{ diff --git a/api/kbcloud/model_event_result_status.go b/api/kbcloud/model_event_result_status.go index 49c523bc..65447af8 100644 --- a/api/kbcloud/model_event_result_status.go +++ b/api/kbcloud/model_event_result_status.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EventResultStatus result status of the operation event type EventResultStatus string // List of EventResultStatus. const ( EventResultStatusSuccess EventResultStatus = "success" - EventResultStatusFailed EventResultStatus = "failed" + EventResultStatusFailed EventResultStatus = "failed" ) var allowedEventResultStatusEnumValues = []EventResultStatus{ diff --git a/api/kbcloud/model_event_source.go b/api/kbcloud/model_event_source.go index a3af120b..34ecc321 100644 --- a/api/kbcloud/model_event_source.go +++ b/api/kbcloud/model_event_source.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // EventSource event source type EventSource string // List of EventSource. const ( - EventSourceUser EventSource = "user" + EventSourceUser EventSource = "user" EventSourceSystem EventSource = "system" ) diff --git a/api/kbcloud/model_feature.go b/api/kbcloud/model_feature.go index 8da63a93..4945b06c 100644 --- a/api/kbcloud/model_feature.go +++ b/api/kbcloud/model_feature.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type Feature struct { // Name of a feature Name string `json:"name"` @@ -18,10 +23,11 @@ type Feature struct { // Indicates the maturity level of a feature PreRelease FeaturePreReleaseType `json:"preRelease"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFeature instantiates a new Feature object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewFeatureWithDefaults() *Feature { this := Feature{} return &this } - // GetName returns the Name field value. func (o *Feature) GetName() string { if o == nil { @@ -65,6 +70,7 @@ func (o *Feature) SetName(v string) { o.Name = v } + // GetEnabled returns the Enabled field value. func (o *Feature) GetEnabled() bool { if o == nil { @@ -88,6 +94,7 @@ func (o *Feature) SetEnabled(v bool) { o.Enabled = v } + // GetPreRelease returns the PreRelease field value. func (o *Feature) GetPreRelease() FeaturePreReleaseType { if o == nil { @@ -111,6 +118,8 @@ func (o *Feature) SetPreRelease(v FeaturePreReleaseType) { o.PreRelease = v } + + // MarshalJSON serializes the struct using spec logic. func (o Feature) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -130,8 +139,8 @@ func (o Feature) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Feature) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Enabled *bool `json:"enabled"` + Name *string `json:"name"` + Enabled *bool `json:"enabled"` PreRelease *FeaturePreReleaseType `json:"preRelease"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -148,7 +157,7 @@ func (o *Feature) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "enabled", "preRelease"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "enabled", "preRelease", }) } else { return err } diff --git a/api/kbcloud/model_feature_list.go b/api/kbcloud/model_feature_list.go index e31baf03..161b6d6e 100644 --- a/api/kbcloud/model_feature_list.go +++ b/api/kbcloud/model_feature_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// FeatureList A list of feature + + +// FeatureList A list of feature type FeatureList struct { // The list of feature Items []Feature `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFeatureList instantiates a new FeatureList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewFeatureListWithDefaults() *FeatureList { this := FeatureList{} return &this } - // GetItems returns the Items field value. func (o *FeatureList) GetItems() []Feature { if o == nil { @@ -60,6 +65,8 @@ func (o *FeatureList) SetItems(v []Feature) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o FeatureList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *FeatureList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_feature_pre_release_type.go b/api/kbcloud/model_feature_pre_release_type.go index ee669167..e0fd0b75 100644 --- a/api/kbcloud/model_feature_pre_release_type.go +++ b/api/kbcloud/model_feature_pre_release_type.go @@ -2,22 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // FeaturePreReleaseType Indicates the maturity level of a feature type FeaturePreReleaseType string // List of FeaturePreReleaseType. const ( - FeaturePreReleaseTypeAlpha FeaturePreReleaseType = "ALPHA" - FeaturePreReleaseTypeBeta FeaturePreReleaseType = "BETA" - FeaturePreReleaseTypeEmpty FeaturePreReleaseType = "" + FeaturePreReleaseTypeAlpha FeaturePreReleaseType = "ALPHA" + FeaturePreReleaseTypeBeta FeaturePreReleaseType = "BETA" + FeaturePreReleaseTypeEmpty FeaturePreReleaseType = "" FeaturePreReleaseTypeDeprecated FeaturePreReleaseType = "DEPRECATED" ) diff --git a/api/kbcloud/model_file_entry.go b/api/kbcloud/model_file_entry.go index 40cc244f..5f517080 100644 --- a/api/kbcloud/model_file_entry.go +++ b/api/kbcloud/model_file_entry.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// FileEntry the entry of files + + +// FileEntry the entry of files type FileEntry struct { // description the entry type IsDir *bool `json:"IsDir,omitempty"` @@ -17,10 +26,11 @@ type FileEntry struct { // the size of entry Size *int64 `json:"size,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFileEntry instantiates a new FileEntry object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewFileEntryWithDefaults() *FileEntry { this := FileEntry{} return &this } - // GetIsDir returns the IsDir field value if set, zero value otherwise. func (o *FileEntry) GetIsDir() bool { if o == nil || o.IsDir == nil { @@ -66,6 +75,7 @@ func (o *FileEntry) SetIsDir(v bool) { o.IsDir = &v } + // GetFullPath returns the FullPath field value if set, zero value otherwise. func (o *FileEntry) GetFullPath() string { if o == nil || o.FullPath == nil { @@ -94,6 +104,7 @@ func (o *FileEntry) SetFullPath(v string) { o.FullPath = &v } + // GetFilename returns the Filename field value if set, zero value otherwise. func (o *FileEntry) GetFilename() string { if o == nil || o.Filename == nil { @@ -122,6 +133,7 @@ func (o *FileEntry) SetFilename(v string) { o.Filename = &v } + // GetSize returns the Size field value if set, zero value otherwise. func (o *FileEntry) GetSize() int64 { if o == nil || o.Size == nil { @@ -150,6 +162,8 @@ func (o *FileEntry) SetSize(v int64) { o.Size = &v } + + // MarshalJSON serializes the struct using spec logic. func (o FileEntry) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -178,17 +192,17 @@ func (o FileEntry) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *FileEntry) UnmarshalJSON(bytes []byte) (err error) { all := struct { - IsDir *bool `json:"IsDir,omitempty"` + IsDir *bool `json:"IsDir,omitempty"` FullPath *string `json:"fullPath,omitempty"` Filename *string `json:"filename,omitempty"` - Size *int64 `json:"size,omitempty"` + Size *int64 `json:"size,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"IsDir", "fullPath", "filename", "size"}) + common.DeleteKeys(additionalProperties, &[]string{ "IsDir", "fullPath", "filename", "size", }) } else { return err } diff --git a/api/kbcloud/model_file_entry_list.go b/api/kbcloud/model_file_entry_list.go index ae50d93b..748a1860 100644 --- a/api/kbcloud/model_file_entry_list.go +++ b/api/kbcloud/model_file_entry_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// FileEntryList BackupEntryList is a list of entry + + +// FileEntryList BackupEntryList is a list of entry type FileEntryList struct { // Items is the list of backup entry Items []FileEntry `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFileEntryList instantiates a new FileEntryList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewFileEntryListWithDefaults() *FileEntryList { this := FileEntryList{} return &this } - // GetItems returns the Items field value. func (o *FileEntryList) GetItems() []FileEntry { if o == nil { @@ -62,6 +67,7 @@ func (o *FileEntryList) SetItems(v []FileEntry) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *FileEntryList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *FileEntryList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o FileEntryList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o FileEntryList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *FileEntryList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]FileEntry `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]FileEntry `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *FileEntryList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_float_option.go b/api/kbcloud/model_float_option.go index aa8eefbe..a8c0e96f 100644 --- a/api/kbcloud/model_float_option.go +++ b/api/kbcloud/model_float_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type FloatOption struct { - Min float64 `json:"min"` - Max float64 `json:"max"` + Min float64 `json:"min"` + Max float64 `json:"max"` Default float64 `json:"default"` - Step float64 `json:"step"` + Step float64 `json:"step"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewFloatOption instantiates a new FloatOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewFloatOptionWithDefaults() *FloatOption { this := FloatOption{} return &this } - // GetMin returns the Min field value. func (o *FloatOption) GetMin() float64 { if o == nil { @@ -64,6 +69,7 @@ func (o *FloatOption) SetMin(v float64) { o.Min = v } + // GetMax returns the Max field value. func (o *FloatOption) GetMax() float64 { if o == nil { @@ -87,6 +93,7 @@ func (o *FloatOption) SetMax(v float64) { o.Max = v } + // GetDefault returns the Default field value. func (o *FloatOption) GetDefault() float64 { if o == nil { @@ -110,6 +117,7 @@ func (o *FloatOption) SetDefault(v float64) { o.Default = v } + // GetStep returns the Step field value. func (o *FloatOption) GetStep() float64 { if o == nil { @@ -133,6 +141,8 @@ func (o *FloatOption) SetStep(v float64) { o.Step = v } + + // MarshalJSON serializes the struct using spec logic. func (o FloatOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,10 +163,10 @@ func (o FloatOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *FloatOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Min *float64 `json:"min"` - Max *float64 `json:"max"` + Min *float64 `json:"min"` + Max *float64 `json:"max"` Default *float64 `json:"default"` - Step *float64 `json:"step"` + Step *float64 `json:"step"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -175,7 +185,7 @@ func (o *FloatOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"min", "max", "default", "step"}) + common.DeleteKeys(additionalProperties, &[]string{ "min", "max", "default", "step", }) } else { return err } diff --git a/api/kbcloud/model_ha_history_response.go b/api/kbcloud/model_ha_history_response.go index d808f68a..c67c0757 100644 --- a/api/kbcloud/model_ha_history_response.go +++ b/api/kbcloud/model_ha_history_response.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// HaHistoryResponse hahistory is the payload to get ha history of a KubeBlocks cluster +// HaHistoryResponse hahistory is the payload to get ha history of a KubeBlocks cluster type HaHistoryResponse struct { - ComponentName *string `json:"componentName,omitempty"` - Records []HaHistoryResponseRecordsItem `json:"records,omitempty"` + ComponentName *string `json:"componentName,omitempty"` + Records []HaHistoryResponseRecordsItem `json:"records,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewHaHistoryResponse instantiates a new HaHistoryResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewHaHistoryResponseWithDefaults() *HaHistoryResponse { this := HaHistoryResponse{} return &this } - // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *HaHistoryResponse) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -60,6 +69,7 @@ func (o *HaHistoryResponse) SetComponentName(v string) { o.ComponentName = &v } + // GetRecords returns the Records field value if set, zero value otherwise. func (o *HaHistoryResponse) GetRecords() []HaHistoryResponseRecordsItem { if o == nil || o.Records == nil { @@ -88,6 +98,8 @@ func (o *HaHistoryResponse) SetRecords(v []HaHistoryResponseRecordsItem) { o.Records = v } + + // MarshalJSON serializes the struct using spec logic. func (o HaHistoryResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,15 +122,15 @@ func (o HaHistoryResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *HaHistoryResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ComponentName *string `json:"componentName,omitempty"` - Records []HaHistoryResponseRecordsItem `json:"records,omitempty"` + ComponentName *string `json:"componentName,omitempty"` + Records []HaHistoryResponseRecordsItem `json:"records,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"componentName", "records"}) + common.DeleteKeys(additionalProperties, &[]string{ "componentName", "records", }) } else { return err } diff --git a/api/kbcloud/model_ha_history_response_records_item.go b/api/kbcloud/model_ha_history_response_records_item.go index 4057edf1..290c8758 100644 --- a/api/kbcloud/model_ha_history_response_records_item.go +++ b/api/kbcloud/model_ha_history_response_records_item.go @@ -2,27 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type HaHistoryResponseRecordsItem struct { - StartAt int32 `json:"StartAt"` - EndAt *int32 `json:"EndAt,omitempty"` + StartAt int32 `json:"StartAt"` + EndAt *int32 `json:"EndAt,omitempty"` OldPrimary *string `json:"OldPrimary,omitempty"` NewPrimary *string `json:"NewPrimary,omitempty"` - Reason *string `json:"Reason,omitempty"` - UserId *string `json:"UserID,omitempty"` - UserName *string `json:"UserName,omitempty"` + Reason *string `json:"Reason,omitempty"` + UserId *string `json:"UserID,omitempty"` + UserName *string `json:"UserName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewHaHistoryResponseRecordsItem instantiates a new HaHistoryResponseRecordsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewHaHistoryResponseRecordsItemWithDefaults() *HaHistoryResponseRecordsItem this := HaHistoryResponseRecordsItem{} return &this } - // GetStartAt returns the StartAt field value. func (o *HaHistoryResponseRecordsItem) GetStartAt() int32 { if o == nil { @@ -64,6 +69,7 @@ func (o *HaHistoryResponseRecordsItem) SetStartAt(v int32) { o.StartAt = v } + // GetEndAt returns the EndAt field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetEndAt() int32 { if o == nil || o.EndAt == nil { @@ -92,6 +98,7 @@ func (o *HaHistoryResponseRecordsItem) SetEndAt(v int32) { o.EndAt = &v } + // GetOldPrimary returns the OldPrimary field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetOldPrimary() string { if o == nil || o.OldPrimary == nil { @@ -120,6 +127,7 @@ func (o *HaHistoryResponseRecordsItem) SetOldPrimary(v string) { o.OldPrimary = &v } + // GetNewPrimary returns the NewPrimary field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetNewPrimary() string { if o == nil || o.NewPrimary == nil { @@ -148,6 +156,7 @@ func (o *HaHistoryResponseRecordsItem) SetNewPrimary(v string) { o.NewPrimary = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetReason() string { if o == nil || o.Reason == nil { @@ -176,6 +185,7 @@ func (o *HaHistoryResponseRecordsItem) SetReason(v string) { o.Reason = &v } + // GetUserId returns the UserId field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetUserId() string { if o == nil || o.UserId == nil { @@ -204,6 +214,7 @@ func (o *HaHistoryResponseRecordsItem) SetUserId(v string) { o.UserId = &v } + // GetUserName returns the UserName field value if set, zero value otherwise. func (o *HaHistoryResponseRecordsItem) GetUserName() string { if o == nil || o.UserName == nil { @@ -232,6 +243,8 @@ func (o *HaHistoryResponseRecordsItem) SetUserName(v string) { o.UserName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o HaHistoryResponseRecordsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -267,13 +280,13 @@ func (o HaHistoryResponseRecordsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *HaHistoryResponseRecordsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - StartAt *int32 `json:"StartAt"` - EndAt *int32 `json:"EndAt,omitempty"` + StartAt *int32 `json:"StartAt"` + EndAt *int32 `json:"EndAt,omitempty"` OldPrimary *string `json:"OldPrimary,omitempty"` NewPrimary *string `json:"NewPrimary,omitempty"` - Reason *string `json:"Reason,omitempty"` - UserId *string `json:"UserID,omitempty"` - UserName *string `json:"UserName,omitempty"` + Reason *string `json:"Reason,omitempty"` + UserId *string `json:"UserID,omitempty"` + UserName *string `json:"UserName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -283,7 +296,7 @@ func (o *HaHistoryResponseRecordsItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"StartAt", "EndAt", "OldPrimary", "NewPrimary", "Reason", "UserID", "UserName"}) + common.DeleteKeys(additionalProperties, &[]string{ "StartAt", "EndAt", "OldPrimary", "NewPrimary", "Reason", "UserID", "UserName", }) } else { return err } diff --git a/api/kbcloud/model_init_options_item.go b/api/kbcloud/model_init_options_item.go index 888fbdb7..127251ef 100644 --- a/api/kbcloud/model_init_options_item.go +++ b/api/kbcloud/model_init_options_item.go @@ -2,23 +2,33 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type InitOptionsItem struct { // component type, refer to componentDef and support NamePrefix' Component *string `json:"component,omitempty"` // component type, refer to componentDef and support NamePrefix, Deprecated - ComponentDefRef *string `json:"componentDefRef,omitempty"` - InitParams map[string]string `json:"initParams,omitempty"` + ComponentDefRef *string `json:"componentDefRef,omitempty"` + InitParams map[string]string `json:"initParams,omitempty"` // config spec name SpecName *string `json:"specName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInitOptionsItem instantiates a new InitOptionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewInitOptionsItemWithDefaults() *InitOptionsItem { this := InitOptionsItem{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *InitOptionsItem) GetComponent() string { if o == nil || o.Component == nil { @@ -64,6 +73,7 @@ func (o *InitOptionsItem) SetComponent(v string) { o.Component = &v } + // GetComponentDefRef returns the ComponentDefRef field value if set, zero value otherwise. func (o *InitOptionsItem) GetComponentDefRef() string { if o == nil || o.ComponentDefRef == nil { @@ -92,6 +102,7 @@ func (o *InitOptionsItem) SetComponentDefRef(v string) { o.ComponentDefRef = &v } + // GetInitParams returns the InitParams field value if set, zero value otherwise. func (o *InitOptionsItem) GetInitParams() map[string]string { if o == nil || o.InitParams == nil { @@ -120,6 +131,7 @@ func (o *InitOptionsItem) SetInitParams(v map[string]string) { o.InitParams = v } + // GetSpecName returns the SpecName field value if set, zero value otherwise. func (o *InitOptionsItem) GetSpecName() string { if o == nil || o.SpecName == nil { @@ -148,6 +160,8 @@ func (o *InitOptionsItem) SetSpecName(v string) { o.SpecName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InitOptionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -176,17 +190,17 @@ func (o InitOptionsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InitOptionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - ComponentDefRef *string `json:"componentDefRef,omitempty"` - InitParams map[string]string `json:"initParams,omitempty"` - SpecName *string `json:"specName,omitempty"` + Component *string `json:"component,omitempty"` + ComponentDefRef *string `json:"componentDefRef,omitempty"` + InitParams map[string]string `json:"initParams,omitempty"` + SpecName *string `json:"specName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "componentDefRef", "initParams", "specName"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "componentDefRef", "initParams", "specName", }) } else { return err } diff --git a/api/kbcloud/model_inspection.go b/api/kbcloud/model_inspection.go index 63f6977a..98056896 100644 --- a/api/kbcloud/model_inspection.go +++ b/api/kbcloud/model_inspection.go @@ -2,38 +2,44 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Inspection inspection + + +// Inspection inspection type Inspection struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Creator *string `json:"creator,omitempty"` - ClusterId *string `json:"clusterID,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - ClusterEngine *string `json:"clusterEngine,omitempty"` - Result *string `json:"result,omitempty"` - Severity *string `json:"severity,omitempty"` - Status *string `json:"status,omitempty"` - IsAuto *bool `json:"isAuto,omitempty"` - ScriptId *int32 `json:"scriptID,omitempty"` - ScriptName *string `json:"scriptName,omitempty"` - ScriptCategory *string `json:"scriptCategory,omitempty"` - Reason *string `json:"reason,omitempty"` - Suggestion *string `json:"suggestion,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Creator *string `json:"creator,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + ClusterEngine *string `json:"clusterEngine,omitempty"` + Result *string `json:"result,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + IsAuto *bool `json:"isAuto,omitempty"` + ScriptId *int32 `json:"scriptID,omitempty"` + ScriptName *string `json:"scriptName,omitempty"` + ScriptCategory *string `json:"scriptCategory,omitempty"` + Reason *string `json:"reason,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInspection instantiates a new Inspection object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -50,7 +56,6 @@ func NewInspectionWithDefaults() *Inspection { this := Inspection{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Inspection) GetId() int32 { if o == nil || o.Id == nil { @@ -79,6 +84,7 @@ func (o *Inspection) SetId(v int32) { o.Id = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *Inspection) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -107,6 +113,7 @@ func (o *Inspection) SetOrgName(v string) { o.OrgName = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Inspection) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -135,6 +142,7 @@ func (o *Inspection) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Inspection) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -163,6 +171,7 @@ func (o *Inspection) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetCreator returns the Creator field value if set, zero value otherwise. func (o *Inspection) GetCreator() string { if o == nil || o.Creator == nil { @@ -191,6 +200,7 @@ func (o *Inspection) SetCreator(v string) { o.Creator = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *Inspection) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -219,6 +229,7 @@ func (o *Inspection) SetClusterId(v string) { o.ClusterId = &v } + // GetClusterName returns the ClusterName field value if set, zero value otherwise. func (o *Inspection) GetClusterName() string { if o == nil || o.ClusterName == nil { @@ -247,6 +258,7 @@ func (o *Inspection) SetClusterName(v string) { o.ClusterName = &v } + // GetClusterEngine returns the ClusterEngine field value if set, zero value otherwise. func (o *Inspection) GetClusterEngine() string { if o == nil || o.ClusterEngine == nil { @@ -275,6 +287,7 @@ func (o *Inspection) SetClusterEngine(v string) { o.ClusterEngine = &v } + // GetResult returns the Result field value if set, zero value otherwise. func (o *Inspection) GetResult() string { if o == nil || o.Result == nil { @@ -303,6 +316,7 @@ func (o *Inspection) SetResult(v string) { o.Result = &v } + // GetSeverity returns the Severity field value if set, zero value otherwise. func (o *Inspection) GetSeverity() string { if o == nil || o.Severity == nil { @@ -331,6 +345,7 @@ func (o *Inspection) SetSeverity(v string) { o.Severity = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Inspection) GetStatus() string { if o == nil || o.Status == nil { @@ -359,6 +374,7 @@ func (o *Inspection) SetStatus(v string) { o.Status = &v } + // GetIsAuto returns the IsAuto field value if set, zero value otherwise. func (o *Inspection) GetIsAuto() bool { if o == nil || o.IsAuto == nil { @@ -387,6 +403,7 @@ func (o *Inspection) SetIsAuto(v bool) { o.IsAuto = &v } + // GetScriptId returns the ScriptId field value if set, zero value otherwise. func (o *Inspection) GetScriptId() int32 { if o == nil || o.ScriptId == nil { @@ -415,6 +432,7 @@ func (o *Inspection) SetScriptId(v int32) { o.ScriptId = &v } + // GetScriptName returns the ScriptName field value if set, zero value otherwise. func (o *Inspection) GetScriptName() string { if o == nil || o.ScriptName == nil { @@ -443,6 +461,7 @@ func (o *Inspection) SetScriptName(v string) { o.ScriptName = &v } + // GetScriptCategory returns the ScriptCategory field value if set, zero value otherwise. func (o *Inspection) GetScriptCategory() string { if o == nil || o.ScriptCategory == nil { @@ -471,6 +490,7 @@ func (o *Inspection) SetScriptCategory(v string) { o.ScriptCategory = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *Inspection) GetReason() string { if o == nil || o.Reason == nil { @@ -499,6 +519,7 @@ func (o *Inspection) SetReason(v string) { o.Reason = &v } + // GetSuggestion returns the Suggestion field value if set, zero value otherwise. func (o *Inspection) GetSuggestion() string { if o == nil || o.Suggestion == nil { @@ -527,6 +548,8 @@ func (o *Inspection) SetSuggestion(v string) { o.Suggestion = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Inspection) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -602,30 +625,30 @@ func (o Inspection) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Inspection) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - OrgName *string `json:"orgName,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Creator *string `json:"creator,omitempty"` - ClusterId *string `json:"clusterID,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - ClusterEngine *string `json:"clusterEngine,omitempty"` - Result *string `json:"result,omitempty"` - Severity *string `json:"severity,omitempty"` - Status *string `json:"status,omitempty"` - IsAuto *bool `json:"isAuto,omitempty"` - ScriptId *int32 `json:"scriptID,omitempty"` - ScriptName *string `json:"scriptName,omitempty"` - ScriptCategory *string `json:"scriptCategory,omitempty"` - Reason *string `json:"reason,omitempty"` - Suggestion *string `json:"suggestion,omitempty"` + Id *int32 `json:"id,omitempty"` + OrgName *string `json:"orgName,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Creator *string `json:"creator,omitempty"` + ClusterId *string `json:"clusterID,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + ClusterEngine *string `json:"clusterEngine,omitempty"` + Result *string `json:"result,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + IsAuto *bool `json:"isAuto,omitempty"` + ScriptId *int32 `json:"scriptID,omitempty"` + ScriptName *string `json:"scriptName,omitempty"` + ScriptCategory *string `json:"scriptCategory,omitempty"` + Reason *string `json:"reason,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "orgName", "updatedAt", "createdAt", "creator", "clusterID", "clusterName", "clusterEngine", "result", "severity", "status", "isAuto", "scriptID", "scriptName", "scriptCategory", "reason", "suggestion"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "orgName", "updatedAt", "createdAt", "creator", "clusterID", "clusterName", "clusterEngine", "result", "severity", "status", "isAuto", "scriptID", "scriptName", "scriptCategory", "reason", "suggestion", }) } else { return err } diff --git a/api/kbcloud/model_inspection_script.go b/api/kbcloud/model_inspection_script.go index 444bd287..4c629adf 100644 --- a/api/kbcloud/model_inspection_script.go +++ b/api/kbcloud/model_inspection_script.go @@ -2,29 +2,39 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type InspectionScript struct { - Id *int32 `json:"id,omitempty"` - Engine *string `json:"engine,omitempty"` - Name *string `json:"name,omitempty"` - Category *string `json:"category,omitempty"` - Type *string `json:"type,omitempty"` - ScriptType *string `json:"scriptType,omitempty"` - Reason *string `json:"reason,omitempty"` - Suggestion *string `json:"suggestion,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - ScriptName *string `json:"scriptName,omitempty"` - Script *string `json:"script,omitempty"` + Id *int32 `json:"id,omitempty"` + Engine *string `json:"engine,omitempty"` + Name *string `json:"name,omitempty"` + Category *string `json:"category,omitempty"` + Type *string `json:"type,omitempty"` + ScriptType *string `json:"scriptType,omitempty"` + Reason *string `json:"reason,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ScriptName *string `json:"scriptName,omitempty"` + Script *string `json:"script,omitempty"` StatusCheckName *string `json:"statusCheckName,omitempty"` - StatusCheck *string `json:"statusCheck,omitempty"` + StatusCheck *string `json:"statusCheck,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInspectionScript instantiates a new InspectionScript object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +51,6 @@ func NewInspectionScriptWithDefaults() *InspectionScript { this := InspectionScript{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *InspectionScript) GetId() int32 { if o == nil || o.Id == nil { @@ -70,6 +79,7 @@ func (o *InspectionScript) SetId(v int32) { o.Id = &v } + // GetEngine returns the Engine field value if set, zero value otherwise. func (o *InspectionScript) GetEngine() string { if o == nil || o.Engine == nil { @@ -98,6 +108,7 @@ func (o *InspectionScript) SetEngine(v string) { o.Engine = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *InspectionScript) GetName() string { if o == nil || o.Name == nil { @@ -126,6 +137,7 @@ func (o *InspectionScript) SetName(v string) { o.Name = &v } + // GetCategory returns the Category field value if set, zero value otherwise. func (o *InspectionScript) GetCategory() string { if o == nil || o.Category == nil { @@ -154,6 +166,7 @@ func (o *InspectionScript) SetCategory(v string) { o.Category = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *InspectionScript) GetType() string { if o == nil || o.Type == nil { @@ -182,6 +195,7 @@ func (o *InspectionScript) SetType(v string) { o.Type = &v } + // GetScriptType returns the ScriptType field value if set, zero value otherwise. func (o *InspectionScript) GetScriptType() string { if o == nil || o.ScriptType == nil { @@ -210,6 +224,7 @@ func (o *InspectionScript) SetScriptType(v string) { o.ScriptType = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *InspectionScript) GetReason() string { if o == nil || o.Reason == nil { @@ -238,6 +253,7 @@ func (o *InspectionScript) SetReason(v string) { o.Reason = &v } + // GetSuggestion returns the Suggestion field value if set, zero value otherwise. func (o *InspectionScript) GetSuggestion() string { if o == nil || o.Suggestion == nil { @@ -266,6 +282,7 @@ func (o *InspectionScript) SetSuggestion(v string) { o.Suggestion = &v } + // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *InspectionScript) GetEnabled() bool { if o == nil || o.Enabled == nil { @@ -294,6 +311,7 @@ func (o *InspectionScript) SetEnabled(v bool) { o.Enabled = &v } + // GetScriptName returns the ScriptName field value if set, zero value otherwise. func (o *InspectionScript) GetScriptName() string { if o == nil || o.ScriptName == nil { @@ -322,6 +340,7 @@ func (o *InspectionScript) SetScriptName(v string) { o.ScriptName = &v } + // GetScript returns the Script field value if set, zero value otherwise. func (o *InspectionScript) GetScript() string { if o == nil || o.Script == nil { @@ -350,6 +369,7 @@ func (o *InspectionScript) SetScript(v string) { o.Script = &v } + // GetStatusCheckName returns the StatusCheckName field value if set, zero value otherwise. func (o *InspectionScript) GetStatusCheckName() string { if o == nil || o.StatusCheckName == nil { @@ -378,6 +398,7 @@ func (o *InspectionScript) SetStatusCheckName(v string) { o.StatusCheckName = &v } + // GetStatusCheck returns the StatusCheck field value if set, zero value otherwise. func (o *InspectionScript) GetStatusCheck() string { if o == nil || o.StatusCheck == nil { @@ -406,6 +427,8 @@ func (o *InspectionScript) SetStatusCheck(v string) { o.StatusCheck = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InspectionScript) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -461,26 +484,26 @@ func (o InspectionScript) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InspectionScript) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *int32 `json:"id,omitempty"` - Engine *string `json:"engine,omitempty"` - Name *string `json:"name,omitempty"` - Category *string `json:"category,omitempty"` - Type *string `json:"type,omitempty"` - ScriptType *string `json:"scriptType,omitempty"` - Reason *string `json:"reason,omitempty"` - Suggestion *string `json:"suggestion,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - ScriptName *string `json:"scriptName,omitempty"` - Script *string `json:"script,omitempty"` + Id *int32 `json:"id,omitempty"` + Engine *string `json:"engine,omitempty"` + Name *string `json:"name,omitempty"` + Category *string `json:"category,omitempty"` + Type *string `json:"type,omitempty"` + ScriptType *string `json:"scriptType,omitempty"` + Reason *string `json:"reason,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ScriptName *string `json:"scriptName,omitempty"` + Script *string `json:"script,omitempty"` StatusCheckName *string `json:"statusCheckName,omitempty"` - StatusCheck *string `json:"statusCheck,omitempty"` + StatusCheck *string `json:"statusCheck,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "engine", "name", "category", "type", "scriptType", "reason", "suggestion", "enabled", "scriptName", "script", "statusCheckName", "statusCheck"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "engine", "name", "category", "type", "scriptType", "reason", "suggestion", "enabled", "scriptName", "script", "statusCheckName", "statusCheck", }) } else { return err } diff --git a/api/kbcloud/model_instance.go b/api/kbcloud/model_instance.go index ba1207eb..c089cca7 100644 --- a/api/kbcloud/model_instance.go +++ b/api/kbcloud/model_instance.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Instance Instance is the information of KubeBlocks cluster instances + + +// Instance Instance is the information of KubeBlocks cluster instances type Instance struct { // Access mode for instance AccessMode string `json:"accessMode"` @@ -45,10 +50,11 @@ type Instance struct { // Available zone for instance Zone string `json:"zone"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstance instantiates a new Instance object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -79,7 +85,6 @@ func NewInstanceWithDefaults() *Instance { this := Instance{} return &this } - // GetAccessMode returns the AccessMode field value. func (o *Instance) GetAccessMode() string { if o == nil { @@ -103,6 +108,7 @@ func (o *Instance) SetAccessMode(v string) { o.AccessMode = v } + // GetCloud returns the Cloud field value. func (o *Instance) GetCloud() string { if o == nil { @@ -126,6 +132,7 @@ func (o *Instance) SetCloud(v string) { o.Cloud = v } + // GetCluster returns the Cluster field value. func (o *Instance) GetCluster() string { if o == nil { @@ -149,6 +156,7 @@ func (o *Instance) SetCluster(v string) { o.Cluster = v } + // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *Instance) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -177,6 +185,7 @@ func (o *Instance) SetComponentName(v string) { o.ComponentName = &v } + // GetComponentDef returns the ComponentDef field value if set, zero value otherwise. func (o *Instance) GetComponentDef() string { if o == nil || o.ComponentDef == nil { @@ -205,6 +214,7 @@ func (o *Instance) SetComponentDef(v string) { o.ComponentDef = &v } + // GetComponent returns the Component field value. func (o *Instance) GetComponent() string { if o == nil { @@ -228,6 +238,7 @@ func (o *Instance) SetComponent(v string) { o.Component = v } + // GetCpu returns the Cpu field value. func (o *Instance) GetCpu() string { if o == nil { @@ -251,6 +262,7 @@ func (o *Instance) SetCpu(v string) { o.Cpu = v } + // GetCreatedAt returns the CreatedAt field value. func (o *Instance) GetCreatedAt() string { if o == nil { @@ -274,6 +286,7 @@ func (o *Instance) SetCreatedAt(v string) { o.CreatedAt = v } + // GetMemory returns the Memory field value. func (o *Instance) GetMemory() string { if o == nil { @@ -297,6 +310,7 @@ func (o *Instance) SetMemory(v string) { o.Memory = v } + // GetName returns the Name field value. func (o *Instance) GetName() string { if o == nil { @@ -320,6 +334,7 @@ func (o *Instance) SetName(v string) { o.Name = v } + // GetNode returns the Node field value. func (o *Instance) GetNode() string { if o == nil { @@ -343,6 +358,7 @@ func (o *Instance) SetNode(v string) { o.Node = v } + // GetRegion returns the Region field value. func (o *Instance) GetRegion() string { if o == nil { @@ -366,6 +382,7 @@ func (o *Instance) SetRegion(v string) { o.Region = v } + // GetRole returns the Role field value. func (o *Instance) GetRole() string { if o == nil { @@ -389,6 +406,7 @@ func (o *Instance) SetRole(v string) { o.Role = v } + // GetStatus returns the Status field value. func (o *Instance) GetStatus() InstanceStatus { if o == nil { @@ -412,6 +430,7 @@ func (o *Instance) SetStatus(v InstanceStatus) { o.Status = v } + // GetStorage returns the Storage field value. func (o *Instance) GetStorage() []InstanceStorageItem { if o == nil { @@ -435,6 +454,7 @@ func (o *Instance) SetStorage(v []InstanceStorageItem) { o.Storage = v } + // GetZone returns the Zone field value. func (o *Instance) GetZone() string { if o == nil { @@ -458,6 +478,8 @@ func (o *Instance) SetZone(v string) { o.Zone = v } + + // MarshalJSON serializes the struct using spec logic. func (o Instance) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -494,22 +516,22 @@ func (o Instance) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Instance) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AccessMode *string `json:"accessMode"` - Cloud *string `json:"cloud"` - Cluster *string `json:"cluster"` - ComponentName *string `json:"componentName,omitempty"` - ComponentDef *string `json:"componentDef,omitempty"` - Component *string `json:"component"` - Cpu *string `json:"cpu"` - CreatedAt *string `json:"createdAt"` - Memory *string `json:"memory"` - Name *string `json:"name"` - Node *string `json:"node"` - Region *string `json:"region"` - Role *string `json:"role"` - Status *InstanceStatus `json:"status"` - Storage *[]InstanceStorageItem `json:"storage"` - Zone *string `json:"zone"` + AccessMode *string `json:"accessMode"` + Cloud *string `json:"cloud"` + Cluster *string `json:"cluster"` + ComponentName *string `json:"componentName,omitempty"` + ComponentDef *string `json:"componentDef,omitempty"` + Component *string `json:"component"` + Cpu *string `json:"cpu"` + CreatedAt *string `json:"createdAt"` + Memory *string `json:"memory"` + Name *string `json:"name"` + Node *string `json:"node"` + Region *string `json:"region"` + Role *string `json:"role"` + Status *InstanceStatus `json:"status"` + Storage *[]InstanceStorageItem `json:"storage"` + Zone *string `json:"zone"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -558,7 +580,7 @@ func (o *Instance) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accessMode", "cloud", "cluster", "componentName", "componentDef", "component", "cpu", "createdAt", "memory", "name", "node", "region", "role", "status", "storage", "zone"}) + common.DeleteKeys(additionalProperties, &[]string{ "accessMode", "cloud", "cluster", "componentName", "componentDef", "component", "cpu", "createdAt", "memory", "name", "node", "region", "role", "status", "storage", "zone", }) } else { return err } diff --git a/api/kbcloud/model_instance_list.go b/api/kbcloud/model_instance_list.go index 5b60c350..263bfaad 100644 --- a/api/kbcloud/model_instance_list.go +++ b/api/kbcloud/model_instance_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceList ClusterList is a list of KubeBlocks clusters + + +// InstanceList ClusterList is a list of KubeBlocks clusters type InstanceList struct { // Items is the list of KubeBlocks cluster objects in the list Items []Instance `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceList instantiates a new InstanceList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewInstanceListWithDefaults() *InstanceList { this := InstanceList{} return &this } - // GetItems returns the Items field value. func (o *InstanceList) GetItems() []Instance { if o == nil { @@ -60,6 +65,8 @@ func (o *InstanceList) SetItems(v []Instance) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *InstanceList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_instance_metrics.go b/api/kbcloud/model_instance_metrics.go index 6aef6f03..b2e38843 100644 --- a/api/kbcloud/model_instance_metrics.go +++ b/api/kbcloud/model_instance_metrics.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceMetrics instance metrics + + +// InstanceMetrics instance metrics type InstanceMetrics struct { // the name of the instance InstanceName string `json:"instanceName"` @@ -21,10 +26,11 @@ type InstanceMetrics struct { // disk with uint Gi. DiskUsage string `json:"diskUsage"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceMetrics instantiates a new InstanceMetrics object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewInstanceMetricsWithDefaults() *InstanceMetrics { this := InstanceMetrics{} return &this } - // GetInstanceName returns the InstanceName field value. func (o *InstanceMetrics) GetInstanceName() string { if o == nil { @@ -69,6 +74,7 @@ func (o *InstanceMetrics) SetInstanceName(v string) { o.InstanceName = v } + // GetCpuUsage returns the CpuUsage field value. func (o *InstanceMetrics) GetCpuUsage() string { if o == nil { @@ -92,6 +98,7 @@ func (o *InstanceMetrics) SetCpuUsage(v string) { o.CpuUsage = v } + // GetMemoryUsage returns the MemoryUsage field value. func (o *InstanceMetrics) GetMemoryUsage() string { if o == nil { @@ -115,6 +122,7 @@ func (o *InstanceMetrics) SetMemoryUsage(v string) { o.MemoryUsage = v } + // GetDiskUsage returns the DiskUsage field value. func (o *InstanceMetrics) GetDiskUsage() string { if o == nil { @@ -138,6 +146,8 @@ func (o *InstanceMetrics) SetDiskUsage(v string) { o.DiskUsage = v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceMetrics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -159,9 +169,9 @@ func (o InstanceMetrics) MarshalJSON() ([]byte, error) { func (o *InstanceMetrics) UnmarshalJSON(bytes []byte) (err error) { all := struct { InstanceName *string `json:"instanceName"` - CpuUsage *string `json:"cpuUsage"` - MemoryUsage *string `json:"memoryUsage"` - DiskUsage *string `json:"diskUsage"` + CpuUsage *string `json:"cpuUsage"` + MemoryUsage *string `json:"memoryUsage"` + DiskUsage *string `json:"diskUsage"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *InstanceMetrics) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"instanceName", "cpuUsage", "memoryUsage", "diskUsage"}) + common.DeleteKeys(additionalProperties, &[]string{ "instanceName", "cpuUsage", "memoryUsage", "diskUsage", }) } else { return err } diff --git a/api/kbcloud/model_instance_metrics_list.go b/api/kbcloud/model_instance_metrics_list.go index dcf92939..28f7a232 100644 --- a/api/kbcloud/model_instance_metrics_list.go +++ b/api/kbcloud/model_instance_metrics_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceMetricsList instance metrics list + + +// InstanceMetricsList instance metrics list type InstanceMetricsList struct { // instanceMetrics list Items []InstanceMetrics `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceMetricsList instantiates a new InstanceMetricsList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewInstanceMetricsListWithDefaults() *InstanceMetricsList { this := InstanceMetricsList{} return &this } - // GetItems returns the Items field value. func (o *InstanceMetricsList) GetItems() []InstanceMetrics { if o == nil { @@ -60,6 +65,8 @@ func (o *InstanceMetricsList) SetItems(v []InstanceMetrics) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceMetricsList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *InstanceMetricsList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_instance_status.go b/api/kbcloud/model_instance_status.go index 0c70496e..e924be75 100644 --- a/api/kbcloud/model_instance_status.go +++ b/api/kbcloud/model_instance_status.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceStatus Status for instance + + +// InstanceStatus Status for instance type InstanceStatus struct { // The current phase of the cluster Phase string `json:"phase"` @@ -19,10 +24,11 @@ type InstanceStatus struct { // A human-readable message indicating details about the cluster's current phase Message *string `json:"message,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceStatus instantiates a new InstanceStatus object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewInstanceStatusWithDefaults() *InstanceStatus { this := InstanceStatus{} return &this } - // GetPhase returns the Phase field value. func (o *InstanceStatus) GetPhase() string { if o == nil { @@ -64,6 +69,7 @@ func (o *InstanceStatus) SetPhase(v string) { o.Phase = v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *InstanceStatus) GetReason() string { if o == nil || o.Reason == nil { @@ -92,6 +98,7 @@ func (o *InstanceStatus) SetReason(v string) { o.Reason = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *InstanceStatus) GetMessage() string { if o == nil || o.Message == nil { @@ -120,6 +127,8 @@ func (o *InstanceStatus) SetMessage(v string) { o.Message = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o InstanceStatus) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InstanceStatus) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Phase *string `json:"phase"` - Reason *string `json:"reason,omitempty"` + Phase *string `json:"phase"` + Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *InstanceStatus) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"phase", "reason", "message"}) + common.DeleteKeys(additionalProperties, &[]string{ "phase", "reason", "message", }) } else { return err } diff --git a/api/kbcloud/model_instance_storage_item.go b/api/kbcloud/model_instance_storage_item.go index 997fc362..26e343a3 100644 --- a/api/kbcloud/model_instance_storage_item.go +++ b/api/kbcloud/model_instance_storage_item.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InstanceStorageItem Instance storage information + + +// InstanceStorageItem Instance storage information type InstanceStorageItem struct { // Specify the name of storage, which must be unique. Name string `json:"name"` @@ -19,10 +24,11 @@ type InstanceStorageItem struct { // The name of StorageClass in use StorageClass *string `json:"storageClass,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInstanceStorageItem instantiates a new InstanceStorageItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewInstanceStorageItemWithDefaults() *InstanceStorageItem { this := InstanceStorageItem{} return &this } - // GetName returns the Name field value. func (o *InstanceStorageItem) GetName() string { if o == nil { @@ -65,6 +70,7 @@ func (o *InstanceStorageItem) SetName(v string) { o.Name = v } + // GetSize returns the Size field value. func (o *InstanceStorageItem) GetSize() string { if o == nil { @@ -88,6 +94,7 @@ func (o *InstanceStorageItem) SetSize(v string) { o.Size = v } + // GetStorageClass returns the StorageClass field value if set, zero value otherwise. func (o *InstanceStorageItem) GetStorageClass() string { if o == nil || o.StorageClass == nil { @@ -116,6 +123,8 @@ func (o *InstanceStorageItem) SetStorageClass(v string) { o.StorageClass = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InstanceStorageItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -137,8 +146,8 @@ func (o InstanceStorageItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InstanceStorageItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Size *string `json:"size"` + Name *string `json:"name"` + Size *string `json:"size"` StorageClass *string `json:"storageClass,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -152,7 +161,7 @@ func (o *InstanceStorageItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "size", "storageClass"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "size", "storageClass", }) } else { return err } diff --git a/api/kbcloud/model_integer_option.go b/api/kbcloud/model_integer_option.go index 3f5ad7f0..ba6f5a93 100644 --- a/api/kbcloud/model_integer_option.go +++ b/api/kbcloud/model_integer_option.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type IntegerOption struct { - Min int32 `json:"min"` - Max int32 `json:"max"` + Min int32 `json:"min"` + Max int32 `json:"max"` Default int32 `json:"default"` - Step int32 `json:"step"` + Step int32 `json:"step"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewIntegerOption instantiates a new IntegerOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewIntegerOptionWithDefaults() *IntegerOption { this := IntegerOption{} return &this } - // GetMin returns the Min field value. func (o *IntegerOption) GetMin() int32 { if o == nil { @@ -64,6 +69,7 @@ func (o *IntegerOption) SetMin(v int32) { o.Min = v } + // GetMax returns the Max field value. func (o *IntegerOption) GetMax() int32 { if o == nil { @@ -87,6 +93,7 @@ func (o *IntegerOption) SetMax(v int32) { o.Max = v } + // GetDefault returns the Default field value. func (o *IntegerOption) GetDefault() int32 { if o == nil { @@ -110,6 +117,7 @@ func (o *IntegerOption) SetDefault(v int32) { o.Default = v } + // GetStep returns the Step field value. func (o *IntegerOption) GetStep() int32 { if o == nil { @@ -133,6 +141,8 @@ func (o *IntegerOption) SetStep(v int32) { o.Step = v } + + // MarshalJSON serializes the struct using spec logic. func (o IntegerOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -153,10 +163,10 @@ func (o IntegerOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *IntegerOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Min *int32 `json:"min"` - Max *int32 `json:"max"` + Min *int32 `json:"min"` + Max *int32 `json:"max"` Default *int32 `json:"default"` - Step *int32 `json:"step"` + Step *int32 `json:"step"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -175,7 +185,7 @@ func (o *IntegerOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"min", "max", "default", "step"}) + common.DeleteKeys(additionalProperties, &[]string{ "min", "max", "default", "step", }) } else { return err } diff --git a/api/kbcloud/model_invitation.go b/api/kbcloud/model_invitation.go index 946e5e1a..5b801467 100644 --- a/api/kbcloud/model_invitation.go +++ b/api/kbcloud/model_invitation.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Invitation Invitation info + + +// Invitation Invitation info type Invitation struct { // User has accepted or not Accepted bool `json:"accepted"` @@ -36,10 +40,11 @@ type Invitation struct { // the updated time of the invitation UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInvitation instantiates a new Invitation object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -64,7 +69,6 @@ func NewInvitationWithDefaults() *Invitation { this := Invitation{} return &this } - // GetAccepted returns the Accepted field value. func (o *Invitation) GetAccepted() bool { if o == nil { @@ -88,6 +92,7 @@ func (o *Invitation) SetAccepted(v bool) { o.Accepted = v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Invitation) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -116,6 +121,7 @@ func (o *Invitation) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetEmail returns the Email field value. func (o *Invitation) GetEmail() string { if o == nil { @@ -139,6 +145,7 @@ func (o *Invitation) SetEmail(v string) { o.Email = v } + // GetExpireTime returns the ExpireTime field value. func (o *Invitation) GetExpireTime() time.Time { if o == nil { @@ -162,6 +169,7 @@ func (o *Invitation) SetExpireTime(v time.Time) { o.ExpireTime = v } + // GetId returns the Id field value. func (o *Invitation) GetId() string { if o == nil { @@ -185,6 +193,7 @@ func (o *Invitation) SetId(v string) { o.Id = v } + // GetLastEmailTime returns the LastEmailTime field value. func (o *Invitation) GetLastEmailTime() time.Time { if o == nil { @@ -208,6 +217,7 @@ func (o *Invitation) SetLastEmailTime(v time.Time) { o.LastEmailTime = v } + // GetOrgName returns the OrgName field value. func (o *Invitation) GetOrgName() string { if o == nil { @@ -231,6 +241,7 @@ func (o *Invitation) SetOrgName(v string) { o.OrgName = v } + // GetRoleName returns the RoleName field value. func (o *Invitation) GetRoleName() string { if o == nil { @@ -254,6 +265,7 @@ func (o *Invitation) SetRoleName(v string) { o.RoleName = v } + // GetSender returns the Sender field value if set, zero value otherwise. func (o *Invitation) GetSender() InvitationSender { if o == nil || o.Sender == nil { @@ -282,6 +294,7 @@ func (o *Invitation) SetSender(v InvitationSender) { o.Sender = &v } + // GetToken returns the Token field value. func (o *Invitation) GetToken() string { if o == nil { @@ -305,6 +318,7 @@ func (o *Invitation) SetToken(v string) { o.Token = v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Invitation) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -333,6 +347,8 @@ func (o *Invitation) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Invitation) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -382,17 +398,17 @@ func (o Invitation) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Invitation) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Accepted *bool `json:"accepted"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Email *string `json:"email"` - ExpireTime *time.Time `json:"expireTime"` - Id *string `json:"id"` - LastEmailTime *time.Time `json:"lastEmailTime"` - OrgName *string `json:"orgName"` - RoleName *string `json:"roleName"` - Sender *InvitationSender `json:"sender,omitempty"` - Token *string `json:"token"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Accepted *bool `json:"accepted"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Email *string `json:"email"` + ExpireTime *time.Time `json:"expireTime"` + Id *string `json:"id"` + LastEmailTime *time.Time `json:"lastEmailTime"` + OrgName *string `json:"orgName"` + RoleName *string `json:"roleName"` + Sender *InvitationSender `json:"sender,omitempty"` + Token *string `json:"token"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -423,7 +439,7 @@ func (o *Invitation) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"accepted", "createdAt", "email", "expireTime", "id", "lastEmailTime", "orgName", "roleName", "sender", "token", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "accepted", "createdAt", "email", "expireTime", "id", "lastEmailTime", "orgName", "roleName", "sender", "token", "updatedAt", }) } else { return err } @@ -437,7 +453,7 @@ func (o *Invitation) UnmarshalJSON(bytes []byte) (err error) { o.LastEmailTime = *all.LastEmailTime o.OrgName = *all.OrgName o.RoleName = *all.RoleName - if all.Sender != nil && all.Sender.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Sender != nil && all.Sender.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Sender = all.Sender diff --git a/api/kbcloud/model_invitation_create.go b/api/kbcloud/model_invitation_create.go index f66d5116..48f42263 100644 --- a/api/kbcloud/model_invitation_create.go +++ b/api/kbcloud/model_invitation_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InvitationCreate Invitation create payload + + +// InvitationCreate Invitation create payload type InvitationCreate struct { // The email of the invitee Email string `json:"email"` @@ -19,10 +24,11 @@ type InvitationCreate struct { // The name of the role RoleName string `json:"roleName"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInvitationCreate instantiates a new InvitationCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewInvitationCreateWithDefaults() *InvitationCreate { this := InvitationCreate{} return &this } - // GetEmail returns the Email field value. func (o *InvitationCreate) GetEmail() string { if o == nil { @@ -66,6 +71,7 @@ func (o *InvitationCreate) SetEmail(v string) { o.Email = v } + // GetOrgName returns the OrgName field value. func (o *InvitationCreate) GetOrgName() string { if o == nil { @@ -89,6 +95,7 @@ func (o *InvitationCreate) SetOrgName(v string) { o.OrgName = v } + // GetRoleName returns the RoleName field value. func (o *InvitationCreate) GetRoleName() string { if o == nil { @@ -112,6 +119,8 @@ func (o *InvitationCreate) SetRoleName(v string) { o.RoleName = v } + + // MarshalJSON serializes the struct using spec logic. func (o InvitationCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -131,8 +140,8 @@ func (o InvitationCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InvitationCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Email *string `json:"email"` - OrgName *string `json:"orgName"` + Email *string `json:"email"` + OrgName *string `json:"orgName"` RoleName *string `json:"roleName"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -149,7 +158,7 @@ func (o *InvitationCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"email", "orgName", "roleName"}) + common.DeleteKeys(additionalProperties, &[]string{ "email", "orgName", "roleName", }) } else { return err } diff --git a/api/kbcloud/model_invitation_list.go b/api/kbcloud/model_invitation_list.go index 43e0d933..29621a23 100644 --- a/api/kbcloud/model_invitation_list.go +++ b/api/kbcloud/model_invitation_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// InvitationList InvitationList is a list of invitations + + +// InvitationList InvitationList is a list of invitations type InvitationList struct { // Items is the list of Invitation objects in the list Items []Invitation `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInvitationList instantiates a new InvitationList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewInvitationListWithDefaults() *InvitationList { this := InvitationList{} return &this } - // GetItems returns the Items field value. func (o *InvitationList) GetItems() []Invitation { if o == nil { @@ -62,6 +67,7 @@ func (o *InvitationList) SetItems(v []Invitation) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *InvitationList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *InvitationList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InvitationList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o InvitationList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *InvitationList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Invitation `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]Invitation `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *InvitationList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_invitation_sender.go b/api/kbcloud/model_invitation_sender.go index 112ce931..6e8eb57f 100644 --- a/api/kbcloud/model_invitation_sender.go +++ b/api/kbcloud/model_invitation_sender.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// InvitationSender InvitationSender is the User who send the Invitation + + +// InvitationSender InvitationSender is the User who send the Invitation type InvitationSender struct { // The email of the User Email *string `json:"email,omitempty"` @@ -15,10 +24,11 @@ type InvitationSender struct { // The name of the User Name *string `json:"name,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewInvitationSender instantiates a new InvitationSender object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewInvitationSenderWithDefaults() *InvitationSender { this := InvitationSender{} return &this } - // GetEmail returns the Email field value if set, zero value otherwise. func (o *InvitationSender) GetEmail() string { if o == nil || o.Email == nil { @@ -64,6 +73,7 @@ func (o *InvitationSender) SetEmail(v string) { o.Email = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *InvitationSender) GetId() string { if o == nil || o.Id == nil { @@ -92,6 +102,7 @@ func (o *InvitationSender) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *InvitationSender) GetName() string { if o == nil || o.Name == nil { @@ -120,6 +131,8 @@ func (o *InvitationSender) SetName(v string) { o.Name = &v } + + // MarshalJSON serializes the struct using spec logic. func (o InvitationSender) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -146,15 +159,15 @@ func (o InvitationSender) MarshalJSON() ([]byte, error) { func (o *InvitationSender) UnmarshalJSON(bytes []byte) (err error) { all := struct { Email *string `json:"email,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"email", "id", "name"}) + common.DeleteKeys(additionalProperties, &[]string{ "email", "id", "name", }) } else { return err } diff --git a/api/kbcloud/model_ip_whitelist.go b/api/kbcloud/model_ip_whitelist.go index d3ea2702..6260df6a 100644 --- a/api/kbcloud/model_ip_whitelist.go +++ b/api/kbcloud/model_ip_whitelist.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// IpWhitelist whitelist + + +// IpWhitelist whitelist type IpWhitelist struct { // ID of the whitelist Id string `json:"id"` @@ -30,10 +34,11 @@ type IpWhitelist struct { // Populated by the system. Read-only. Null for lists UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewIpWhitelist instantiates a new IpWhitelist object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -53,7 +58,6 @@ func NewIpWhitelistWithDefaults() *IpWhitelist { this := IpWhitelist{} return &this } - // GetId returns the Id field value. func (o *IpWhitelist) GetId() string { if o == nil { @@ -77,6 +81,7 @@ func (o *IpWhitelist) SetId(v string) { o.Id = v } + // GetName returns the Name field value. func (o *IpWhitelist) GetName() string { if o == nil { @@ -100,6 +105,7 @@ func (o *IpWhitelist) SetName(v string) { o.Name = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *IpWhitelist) GetDescription() string { if o == nil || o.Description == nil { @@ -128,6 +134,7 @@ func (o *IpWhitelist) SetDescription(v string) { o.Description = &v } + // GetAddresses returns the Addresses field value. func (o *IpWhitelist) GetAddresses() []string { if o == nil { @@ -151,6 +158,7 @@ func (o *IpWhitelist) SetAddresses(v []string) { o.Addresses = v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *IpWhitelist) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -179,6 +187,7 @@ func (o *IpWhitelist) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *IpWhitelist) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -207,6 +216,8 @@ func (o *IpWhitelist) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o IpWhitelist) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -243,12 +254,12 @@ func (o IpWhitelist) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *IpWhitelist) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Name *string `json:"name"` - Description *string `json:"description,omitempty"` - Addresses *[]string `json:"addresses"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Id *string `json:"id"` + Name *string `json:"name"` + Description *string `json:"description,omitempty"` + Addresses *[]string `json:"addresses"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -264,7 +275,7 @@ func (o *IpWhitelist) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "description", "addresses", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "description", "addresses", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/model_ip_whitelist_list.go b/api/kbcloud/model_ip_whitelist_list.go index 1c871462..115d2583 100644 --- a/api/kbcloud/model_ip_whitelist_list.go +++ b/api/kbcloud/model_ip_whitelist_list.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type IpWhitelistList struct { // Items is the list of whitelist objects in the Cluster Items []IpWhitelist `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewIpWhitelistList instantiates a new IpWhitelistList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewIpWhitelistListWithDefaults() *IpWhitelistList { this := IpWhitelistList{} return &this } - // GetItems returns the Items field value. func (o *IpWhitelistList) GetItems() []IpWhitelist { if o == nil { @@ -59,6 +64,8 @@ func (o *IpWhitelistList) SetItems(v []IpWhitelist) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o IpWhitelistList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *IpWhitelistList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_kubernetes_manifest_list.go b/api/kbcloud/model_kubernetes_manifest_list.go index 88bed7f1..7fb13a14 100644 --- a/api/kbcloud/model_kubernetes_manifest_list.go +++ b/api/kbcloud/model_kubernetes_manifest_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// KubernetesManifestList KubernetesManifestList is the list of Kubernetes objects in the list +// KubernetesManifestList KubernetesManifestList is the list of Kubernetes objects in the list type KubernetesManifestList struct { // Items is the list of Kubernetes objects in the list KubernetesManifests []map[string]interface{} `json:"kubernetesManifests,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewKubernetesManifestList instantiates a new KubernetesManifestList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewKubernetesManifestListWithDefaults() *KubernetesManifestList { this := KubernetesManifestList{} return &this } - // GetKubernetesManifests returns the KubernetesManifests field value if set, zero value otherwise. func (o *KubernetesManifestList) GetKubernetesManifests() []map[string]interface{} { if o == nil || o.KubernetesManifests == nil { @@ -60,6 +69,8 @@ func (o *KubernetesManifestList) SetKubernetesManifests(v []map[string]interface o.KubernetesManifests = v } + + // MarshalJSON serializes the struct using spec logic. func (o KubernetesManifestList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *KubernetesManifestList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"kubernetesManifests"}) + common.DeleteKeys(additionalProperties, &[]string{ "kubernetesManifests", }) } else { return err } diff --git a/api/kbcloud/model_license_option.go b/api/kbcloud/model_license_option.go index 3f716dfa..5a31cf76 100644 --- a/api/kbcloud/model_license_option.go +++ b/api/kbcloud/model_license_option.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type LicenseOption struct { - Component string `json:"component"` + Component string `json:"component"` OpsDefName string `json:"opsDefName"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLicenseOption instantiates a new LicenseOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewLicenseOptionWithDefaults() *LicenseOption { this := LicenseOption{} return &this } - // GetComponent returns the Component field value. func (o *LicenseOption) GetComponent() string { if o == nil { @@ -60,6 +65,7 @@ func (o *LicenseOption) SetComponent(v string) { o.Component = v } + // GetOpsDefName returns the OpsDefName field value. func (o *LicenseOption) GetOpsDefName() string { if o == nil { @@ -83,6 +89,8 @@ func (o *LicenseOption) SetOpsDefName(v string) { o.OpsDefName = v } + + // MarshalJSON serializes the struct using spec logic. func (o LicenseOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -101,7 +109,7 @@ func (o LicenseOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *LicenseOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` + Component *string `json:"component"` OpsDefName *string `json:"opsDefName"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -115,7 +123,7 @@ func (o *LicenseOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "opsDefName"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "opsDefName", }) } else { return err } diff --git a/api/kbcloud/model_load_balancer.go b/api/kbcloud/model_load_balancer.go index 1571ed1b..792ec7da 100644 --- a/api/kbcloud/model_load_balancer.go +++ b/api/kbcloud/model_load_balancer.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// LoadBalancer The load balancer info + + +// LoadBalancer The load balancer info type LoadBalancer struct { // Whether the loadbalancer is available in the environment. Available LoadBalancerAvailableType `json:"available"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // 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 @@ -36,7 +42,6 @@ func NewLoadBalancerWithDefaults() *LoadBalancer { this := LoadBalancer{} return &this } - // GetAvailable returns the Available field value. func (o *LoadBalancer) GetAvailable() LoadBalancerAvailableType { if o == nil { @@ -60,6 +65,8 @@ func (o *LoadBalancer) SetAvailable(v LoadBalancerAvailableType) { o.Available = v } + + // MarshalJSON serializes the struct using spec logic. func (o LoadBalancer) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *LoadBalancer) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"available"}) + common.DeleteKeys(additionalProperties, &[]string{ "available", }) } else { return err } diff --git a/api/kbcloud/model_load_balancer_available_type.go b/api/kbcloud/model_load_balancer_available_type.go new file mode 100644 index 00000000..cace5a20 --- /dev/null +++ b/api/kbcloud/model_load_balancer_available_type.go @@ -0,0 +1,75 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at ApeCloud (https://www.apecloud.com/). +// Copyright 2022-Present ApeCloud Co., Ltd + + +package kbcloud + +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + + +// LoadBalancerAvailableType Whether the loadbalancer is available in the environment. +type LoadBalancerAvailableType string + +// List of LoadBalancerAvailableType. +const ( + LoadBalancerAvailableTypeAvailable LoadBalancerAvailableType = "Available" + LoadBalancerAvailableTypeUnavailable LoadBalancerAvailableType = "Unavailable" + LoadBalancerAvailableTypeChecking LoadBalancerAvailableType = "Checking" + LoadBalancerAvailableTypeUnknown LoadBalancerAvailableType = "Unknown" +) + +var allowedLoadBalancerAvailableTypeEnumValues = []LoadBalancerAvailableType{ + LoadBalancerAvailableTypeAvailable, + LoadBalancerAvailableTypeUnavailable, + LoadBalancerAvailableTypeChecking, + LoadBalancerAvailableTypeUnknown, +} + +// GetAllowedValues returns the list of possible values. +func (v *LoadBalancerAvailableType) GetAllowedValues() []LoadBalancerAvailableType { + return allowedLoadBalancerAvailableTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LoadBalancerAvailableType) UnmarshalJSON(src []byte) error { + var value string + err := common.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LoadBalancerAvailableType(value) + return nil +} + +// NewLoadBalancerAvailableTypeFromValue returns a pointer to a valid LoadBalancerAvailableType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLoadBalancerAvailableTypeFromValue(v string) (*LoadBalancerAvailableType, error) { + ev := LoadBalancerAvailableType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerAvailableType: valid values are %v", v, allowedLoadBalancerAvailableTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LoadBalancerAvailableType) IsValid() bool { + for _, existing := range allowedLoadBalancerAvailableTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancerAvailableType value. +func (v LoadBalancerAvailableType) Ptr() *LoadBalancerAvailableType { + return &v +} diff --git a/api/kbcloud/model_load_balancer_status.go b/api/kbcloud/model_load_balancer_status.go deleted file mode 100644 index 202acaf9..00000000 --- a/api/kbcloud/model_load_balancer_status.go +++ /dev/null @@ -1,70 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at ApeCloud (https://www.apecloud.com/). -// Copyright 2022-Present ApeCloud Co., Ltd - -package kbcloud - -import ( - "fmt" - - "github.com/apecloud/kb-cloud-client-go/api/common" -) - -// LoadBalancerStatus Whether the loadbalancer is available in the environment. -type LoadBalancerStatus string - -// List of LoadBalancerStatus. -const ( - LoadBalancerStatusAvailable LoadBalancerStatus = "Available" - LoadBalancerStatusUnavailable LoadBalancerStatus = "Unavailable" - LoadBalancerStatusChecking LoadBalancerStatus = "Checking" - LoadBalancerStatusUnknown LoadBalancerStatus = "Unknown" -) - -var allowedLoadBalancerStatusEnumValues = []LoadBalancerStatus{ - LoadBalancerStatusAvailable, - LoadBalancerStatusUnavailable, - LoadBalancerStatusChecking, - LoadBalancerStatusUnknown, -} - -// GetAllowedValues returns the list of possible values. -func (v *LoadBalancerStatus) GetAllowedValues() []LoadBalancerStatus { - return allowedLoadBalancerStatusEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *LoadBalancerStatus) UnmarshalJSON(src []byte) error { - var value string - err := common.Unmarshal(src, &value) - if err != nil { - return err - } - *v = LoadBalancerStatus(value) - return nil -} - -// NewLoadBalancerStatusFromValue returns a pointer to a valid LoadBalancerStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewLoadBalancerStatusFromValue(v string) (*LoadBalancerStatus, error) { - ev := LoadBalancerStatus(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for LoadBalancerStatus: valid values are %v", v, allowedLoadBalancerStatusEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v LoadBalancerStatus) IsValid() bool { - for _, existing := range allowedLoadBalancerStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to LoadBalancerStatus value. -func (v LoadBalancerStatus) Ptr() *LoadBalancerStatus { - return &v -} diff --git a/api/kbcloud/model_localized_description.go b/api/kbcloud/model_localized_description.go index ca4d45e0..80bfaa87 100644 --- a/api/kbcloud/model_localized_description.go +++ b/api/kbcloud/model_localized_description.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type LocalizedDescription struct { ZhCn string `json:"zh-CN"` EnUs string `json:"en-US"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLocalizedDescription instantiates a new LocalizedDescription object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewLocalizedDescriptionWithDefaults() *LocalizedDescription { this := LocalizedDescription{} return &this } - // GetZhCn returns the ZhCn field value. func (o *LocalizedDescription) GetZhCn() string { if o == nil { @@ -60,6 +65,7 @@ func (o *LocalizedDescription) SetZhCn(v string) { o.ZhCn = v } + // GetEnUs returns the EnUs field value. func (o *LocalizedDescription) GetEnUs() string { if o == nil { @@ -83,6 +89,8 @@ func (o *LocalizedDescription) SetEnUs(v string) { o.EnUs = v } + + // MarshalJSON serializes the struct using spec logic. func (o LocalizedDescription) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -115,7 +123,7 @@ func (o *LocalizedDescription) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"zh-CN", "en-US"}) + common.DeleteKeys(additionalProperties, &[]string{ "zh-CN", "en-US", }) } else { return err } diff --git a/api/kbcloud/model_log_disk.go b/api/kbcloud/model_log_disk.go index d100afba..97f13e0c 100644 --- a/api/kbcloud/model_log_disk.go +++ b/api/kbcloud/model_log_disk.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type LogDisk struct { LogDiskCapacity *string `json:"log_disk_capacity,omitempty"` LogDiskAssigned *string `json:"log_disk_assigned,omitempty"` - LogDiskInUse *string `json:"log_disk_in_use,omitempty"` + LogDiskInUse *string `json:"log_disk_in_use,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLogDisk instantiates a new LogDisk object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewLogDiskWithDefaults() *LogDisk { this := LogDisk{} return &this } - // GetLogDiskCapacity returns the LogDiskCapacity field value if set, zero value otherwise. func (o *LogDisk) GetLogDiskCapacity() string { if o == nil || o.LogDiskCapacity == nil { @@ -60,6 +69,7 @@ func (o *LogDisk) SetLogDiskCapacity(v string) { o.LogDiskCapacity = &v } + // GetLogDiskAssigned returns the LogDiskAssigned field value if set, zero value otherwise. func (o *LogDisk) GetLogDiskAssigned() string { if o == nil || o.LogDiskAssigned == nil { @@ -88,6 +98,7 @@ func (o *LogDisk) SetLogDiskAssigned(v string) { o.LogDiskAssigned = &v } + // GetLogDiskInUse returns the LogDiskInUse field value if set, zero value otherwise. func (o *LogDisk) GetLogDiskInUse() string { if o == nil || o.LogDiskInUse == nil { @@ -116,6 +127,8 @@ func (o *LogDisk) SetLogDiskInUse(v string) { o.LogDiskInUse = &v } + + // MarshalJSON serializes the struct using spec logic. func (o LogDisk) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,14 +156,14 @@ func (o *LogDisk) UnmarshalJSON(bytes []byte) (err error) { all := struct { LogDiskCapacity *string `json:"log_disk_capacity,omitempty"` LogDiskAssigned *string `json:"log_disk_assigned,omitempty"` - LogDiskInUse *string `json:"log_disk_in_use,omitempty"` + LogDiskInUse *string `json:"log_disk_in_use,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"log_disk_capacity", "log_disk_assigned", "log_disk_in_use"}) + common.DeleteKeys(additionalProperties, &[]string{ "log_disk_capacity", "log_disk_assigned", "log_disk_in_use", }) } else { return err } diff --git a/api/kbcloud/model_log_option.go b/api/kbcloud/model_log_option.go index b8f85978..e2402382 100644 --- a/api/kbcloud/model_log_option.go +++ b/api/kbcloud/model_log_option.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type LogOption struct { Component string `json:"component"` - Error bool `json:"error"` - Slow bool `json:"slow"` - Audit bool `json:"audit"` - Running bool `json:"running"` + Error bool `json:"error"` + Slow bool `json:"slow"` + Audit bool `json:"audit"` + Running bool `json:"running"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewLogOption instantiates a new LogOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewLogOptionWithDefaults() *LogOption { this := LogOption{} return &this } - // GetComponent returns the Component field value. func (o *LogOption) GetComponent() string { if o == nil { @@ -66,6 +71,7 @@ func (o *LogOption) SetComponent(v string) { o.Component = v } + // GetError returns the Error field value. func (o *LogOption) GetError() bool { if o == nil { @@ -89,6 +95,7 @@ func (o *LogOption) SetError(v bool) { o.Error = v } + // GetSlow returns the Slow field value. func (o *LogOption) GetSlow() bool { if o == nil { @@ -112,6 +119,7 @@ func (o *LogOption) SetSlow(v bool) { o.Slow = v } + // GetAudit returns the Audit field value. func (o *LogOption) GetAudit() bool { if o == nil { @@ -135,6 +143,7 @@ func (o *LogOption) SetAudit(v bool) { o.Audit = v } + // GetRunning returns the Running field value. func (o *LogOption) GetRunning() bool { if o == nil { @@ -158,6 +167,8 @@ func (o *LogOption) SetRunning(v bool) { o.Running = v } + + // MarshalJSON serializes the struct using spec logic. func (o LogOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -180,10 +191,10 @@ func (o LogOption) MarshalJSON() ([]byte, error) { func (o *LogOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { Component *string `json:"component"` - Error *bool `json:"error"` - Slow *bool `json:"slow"` - Audit *bool `json:"audit"` - Running *bool `json:"running"` + Error *bool `json:"error"` + Slow *bool `json:"slow"` + Audit *bool `json:"audit"` + Running *bool `json:"running"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -205,7 +216,7 @@ func (o *LogOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "error", "slow", "audit", "running"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "error", "slow", "audit", "running", }) } else { return err } diff --git a/api/kbcloud/model_manifest_type.go b/api/kbcloud/model_manifest_type.go index b606657d..d1ff7bfa 100644 --- a/api/kbcloud/model_manifest_type.go +++ b/api/kbcloud/model_manifest_type.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ManifestType string // List of ManifestType. const ( - ManifestTypeService ManifestType = "service" - ManifestTypeConfigmap ManifestType = "configmap" - ManifestTypeSecret ManifestType = "secret" - ManifestTypeEvent ManifestType = "event" - ManifestTypeOpsrequest ManifestType = "opsrequest" + ManifestTypeService ManifestType = "service" + ManifestTypeConfigmap ManifestType = "configmap" + ManifestTypeSecret ManifestType = "secret" + ManifestTypeEvent ManifestType = "event" + ManifestTypeOpsrequest ManifestType = "opsrequest" ManifestTypeConfigconstraint ManifestType = "configconstraint" ) diff --git a/api/kbcloud/model_memory.go b/api/kbcloud/model_memory.go index 4b48c336..73b0da04 100644 --- a/api/kbcloud/model_memory.go +++ b/api/kbcloud/model_memory.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Memory struct { MemCapacity *string `json:"mem_capacity,omitempty"` MemoryLimit *string `json:"memory_limit,omitempty"` MemAssigned *string `json:"mem_assigned,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMemory instantiates a new Memory object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewMemoryWithDefaults() *Memory { this := Memory{} return &this } - // GetMemCapacity returns the MemCapacity field value if set, zero value otherwise. func (o *Memory) GetMemCapacity() string { if o == nil || o.MemCapacity == nil { @@ -60,6 +69,7 @@ func (o *Memory) SetMemCapacity(v string) { o.MemCapacity = &v } + // GetMemoryLimit returns the MemoryLimit field value if set, zero value otherwise. func (o *Memory) GetMemoryLimit() string { if o == nil || o.MemoryLimit == nil { @@ -88,6 +98,7 @@ func (o *Memory) SetMemoryLimit(v string) { o.MemoryLimit = &v } + // GetMemAssigned returns the MemAssigned field value if set, zero value otherwise. func (o *Memory) GetMemAssigned() string { if o == nil || o.MemAssigned == nil { @@ -116,6 +127,8 @@ func (o *Memory) SetMemAssigned(v string) { o.MemAssigned = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Memory) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -150,7 +163,7 @@ func (o *Memory) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"mem_capacity", "memory_limit", "mem_assigned"}) + common.DeleteKeys(additionalProperties, &[]string{ "mem_capacity", "memory_limit", "mem_assigned", }) } else { return err } diff --git a/api/kbcloud/model_metrics_option.go b/api/kbcloud/model_metrics_option.go index 599c8a76..21edfc8e 100644 --- a/api/kbcloud/model_metrics_option.go +++ b/api/kbcloud/model_metrics_option.go @@ -2,17 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type MetricsOption struct { ReplicationLag *MetricsOptionReplicationLag `json:"replicationLag,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetricsOption instantiates a new MetricsOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -29,7 +39,6 @@ func NewMetricsOptionWithDefaults() *MetricsOption { this := MetricsOption{} return &this } - // GetReplicationLag returns the ReplicationLag field value if set, zero value otherwise. func (o *MetricsOption) GetReplicationLag() MetricsOptionReplicationLag { if o == nil || o.ReplicationLag == nil { @@ -58,6 +67,8 @@ func (o *MetricsOption) SetReplicationLag(v MetricsOptionReplicationLag) { o.ReplicationLag = &v } + + // MarshalJSON serializes the struct using spec logic. func (o MetricsOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -84,13 +95,13 @@ func (o *MetricsOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"replicationLag"}) + common.DeleteKeys(additionalProperties, &[]string{ "replicationLag", }) } else { return err } hasInvalidField := false - if all.ReplicationLag != nil && all.ReplicationLag.UnparsedObject != nil && o.UnparsedObject == nil { + if all.ReplicationLag != nil && all.ReplicationLag.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.ReplicationLag = all.ReplicationLag diff --git a/api/kbcloud/model_metrics_option_replication_lag.go b/api/kbcloud/model_metrics_option_replication_lag.go index c94c6cdc..9af88ec2 100644 --- a/api/kbcloud/model_metrics_option_replication_lag.go +++ b/api/kbcloud/model_metrics_option_replication_lag.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type MetricsOptionReplicationLag struct { QueryPattern *string `json:"queryPattern,omitempty"` // Specifies the type of metrics query to be performed. @@ -13,10 +22,11 @@ type MetricsOptionReplicationLag struct { // QueryType *EngineOptionsMetricsQueryType `json:"queryType,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewMetricsOptionReplicationLag instantiates a new MetricsOptionReplicationLag object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewMetricsOptionReplicationLagWithDefaults() *MetricsOptionReplicationLag { this := MetricsOptionReplicationLag{} return &this } - // GetQueryPattern returns the QueryPattern field value if set, zero value otherwise. func (o *MetricsOptionReplicationLag) GetQueryPattern() string { if o == nil || o.QueryPattern == nil { @@ -62,6 +71,7 @@ func (o *MetricsOptionReplicationLag) SetQueryPattern(v string) { o.QueryPattern = &v } + // GetQueryType returns the QueryType field value if set, zero value otherwise. func (o *MetricsOptionReplicationLag) GetQueryType() EngineOptionsMetricsQueryType { if o == nil || o.QueryType == nil { @@ -90,6 +100,8 @@ func (o *MetricsOptionReplicationLag) SetQueryType(v EngineOptionsMetricsQueryTy o.QueryType = &v } + + // MarshalJSON serializes the struct using spec logic. func (o MetricsOptionReplicationLag) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,22 +124,22 @@ func (o MetricsOptionReplicationLag) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *MetricsOptionReplicationLag) UnmarshalJSON(bytes []byte) (err error) { all := struct { - QueryPattern *string `json:"queryPattern,omitempty"` - QueryType *EngineOptionsMetricsQueryType `json:"queryType,omitempty"` + QueryPattern *string `json:"queryPattern,omitempty"` + QueryType *EngineOptionsMetricsQueryType `json:"queryType,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"queryPattern", "queryType"}) + common.DeleteKeys(additionalProperties, &[]string{ "queryPattern", "queryType", }) } else { return err } hasInvalidField := false o.QueryPattern = all.QueryPattern - if all.QueryType != nil && !all.QueryType.IsValid() { + if all.QueryType != nil &&!all.QueryType.IsValid() { hasInvalidField = true } else { o.QueryType = all.QueryType diff --git a/api/kbcloud/model_metrics_query_type.go b/api/kbcloud/model_metrics_query_type.go index 63b67a89..c1a2271e 100644 --- a/api/kbcloud/model_metrics_query_type.go +++ b/api/kbcloud/model_metrics_query_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type MetricsQueryType string // List of MetricsQueryType. const ( MetricsQueryTypeInstant MetricsQueryType = "instant" - MetricsQueryTypeRange MetricsQueryType = "range" + MetricsQueryTypeRange MetricsQueryType = "range" ) var allowedMetricsQueryTypeEnumValues = []MetricsQueryType{ diff --git a/api/kbcloud/model_mode_component.go b/api/kbcloud/model_mode_component.go index c1c9a704..92591ae8 100644 --- a/api/kbcloud/model_mode_component.go +++ b/api/kbcloud/model_mode_component.go @@ -2,28 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ModeComponent struct { - Component string `json:"component"` - Shards *IntegerOption `json:"shards,omitempty"` - Replicas IntegerOption `json:"replicas"` - Cpu FloatOption `json:"cpu"` - Memory FloatOption `json:"memory"` - HideEnpoints bool `json:"hideEnpoints"` - HideOnCreate bool `json:"hideOnCreate"` - Storages []StorageOption `json:"storages"` + Component string `json:"component"` + Shards *IntegerOption `json:"shards,omitempty"` + Replicas IntegerOption `json:"replicas"` + Cpu FloatOption `json:"cpu"` + Memory FloatOption `json:"memory"` + HideEnpoints bool `json:"hideEnpoints"` + HideOnCreate bool `json:"hideOnCreate"` + Storages []StorageOption `json:"storages"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewModeComponent instantiates a new ModeComponent object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +53,6 @@ func NewModeComponentWithDefaults() *ModeComponent { this := ModeComponent{} return &this } - // GetComponent returns the Component field value. func (o *ModeComponent) GetComponent() string { if o == nil { @@ -71,6 +76,7 @@ func (o *ModeComponent) SetComponent(v string) { o.Component = v } + // GetShards returns the Shards field value if set, zero value otherwise. func (o *ModeComponent) GetShards() IntegerOption { if o == nil || o.Shards == nil { @@ -99,6 +105,7 @@ func (o *ModeComponent) SetShards(v IntegerOption) { o.Shards = &v } + // GetReplicas returns the Replicas field value. func (o *ModeComponent) GetReplicas() IntegerOption { if o == nil { @@ -122,6 +129,7 @@ func (o *ModeComponent) SetReplicas(v IntegerOption) { o.Replicas = v } + // GetCpu returns the Cpu field value. func (o *ModeComponent) GetCpu() FloatOption { if o == nil { @@ -145,6 +153,7 @@ func (o *ModeComponent) SetCpu(v FloatOption) { o.Cpu = v } + // GetMemory returns the Memory field value. func (o *ModeComponent) GetMemory() FloatOption { if o == nil { @@ -168,6 +177,7 @@ func (o *ModeComponent) SetMemory(v FloatOption) { o.Memory = v } + // GetHideEnpoints returns the HideEnpoints field value. func (o *ModeComponent) GetHideEnpoints() bool { if o == nil { @@ -191,6 +201,7 @@ func (o *ModeComponent) SetHideEnpoints(v bool) { o.HideEnpoints = v } + // GetHideOnCreate returns the HideOnCreate field value. func (o *ModeComponent) GetHideOnCreate() bool { if o == nil { @@ -214,6 +225,7 @@ func (o *ModeComponent) SetHideOnCreate(v bool) { o.HideOnCreate = v } + // GetStorages returns the Storages field value. func (o *ModeComponent) GetStorages() []StorageOption { if o == nil { @@ -237,6 +249,8 @@ func (o *ModeComponent) SetStorages(v []StorageOption) { o.Storages = v } + + // MarshalJSON serializes the struct using spec logic. func (o ModeComponent) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -263,14 +277,14 @@ func (o ModeComponent) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ModeComponent) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` - Shards *IntegerOption `json:"shards,omitempty"` - Replicas *IntegerOption `json:"replicas"` - Cpu *FloatOption `json:"cpu"` - Memory *FloatOption `json:"memory"` - HideEnpoints *bool `json:"hideEnpoints"` - HideOnCreate *bool `json:"hideOnCreate"` - Storages *[]StorageOption `json:"storages"` + Component *string `json:"component"` + Shards *IntegerOption `json:"shards,omitempty"` + Replicas *IntegerOption `json:"replicas"` + Cpu *FloatOption `json:"cpu"` + Memory *FloatOption `json:"memory"` + HideEnpoints *bool `json:"hideEnpoints"` + HideOnCreate *bool `json:"hideOnCreate"` + Storages *[]StorageOption `json:"storages"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -298,14 +312,14 @@ func (o *ModeComponent) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "shards", "replicas", "cpu", "memory", "hideEnpoints", "hideOnCreate", "storages"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "shards", "replicas", "cpu", "memory", "hideEnpoints", "hideOnCreate", "storages", }) } else { return err } hasInvalidField := false o.Component = *all.Component - if all.Shards != nil && all.Shards.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Shards != nil && all.Shards.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Shards = all.Shards diff --git a/api/kbcloud/model_mode_option.go b/api/kbcloud/model_mode_option.go index 0a9513f4..7e3c1796 100644 --- a/api/kbcloud/model_mode_option.go +++ b/api/kbcloud/model_mode_option.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ModeOption struct { - Name string `json:"name"` - Title LocalizedDescription `json:"title"` - Description LocalizedDescription `json:"description"` - Components []ModeComponent `json:"components"` - Proxy *ModeOptionProxy `json:"proxy,omitempty"` - Extra map[string]interface{} `json:"extra,omitempty"` + Name string `json:"name"` + Title LocalizedDescription `json:"title"` + Description LocalizedDescription `json:"description"` + Components []ModeComponent `json:"components"` + Proxy *ModeOptionProxy `json:"proxy,omitempty"` + Extra map[string]interface{} `json:"extra,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewModeOption instantiates a new ModeOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewModeOptionWithDefaults() *ModeOption { this := ModeOption{} return &this } - // GetName returns the Name field value. func (o *ModeOption) GetName() string { if o == nil { @@ -66,6 +71,7 @@ func (o *ModeOption) SetName(v string) { o.Name = v } + // GetTitle returns the Title field value. func (o *ModeOption) GetTitle() LocalizedDescription { if o == nil { @@ -89,6 +95,7 @@ func (o *ModeOption) SetTitle(v LocalizedDescription) { o.Title = v } + // GetDescription returns the Description field value. func (o *ModeOption) GetDescription() LocalizedDescription { if o == nil { @@ -112,6 +119,7 @@ func (o *ModeOption) SetDescription(v LocalizedDescription) { o.Description = v } + // GetComponents returns the Components field value. func (o *ModeOption) GetComponents() []ModeComponent { if o == nil { @@ -135,6 +143,7 @@ func (o *ModeOption) SetComponents(v []ModeComponent) { o.Components = v } + // GetProxy returns the Proxy field value if set, zero value otherwise. func (o *ModeOption) GetProxy() ModeOptionProxy { if o == nil || o.Proxy == nil { @@ -163,6 +172,7 @@ func (o *ModeOption) SetProxy(v ModeOptionProxy) { o.Proxy = &v } + // GetExtra returns the Extra field value if set, zero value otherwise. func (o *ModeOption) GetExtra() map[string]interface{} { if o == nil || o.Extra == nil { @@ -191,6 +201,8 @@ func (o *ModeOption) SetExtra(v map[string]interface{}) { o.Extra = v } + + // MarshalJSON serializes the struct using spec logic. func (o ModeOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -217,12 +229,12 @@ func (o ModeOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ModeOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Title *LocalizedDescription `json:"title"` - Description *LocalizedDescription `json:"description"` - Components *[]ModeComponent `json:"components"` - Proxy *ModeOptionProxy `json:"proxy,omitempty"` - Extra map[string]interface{} `json:"extra,omitempty"` + Name *string `json:"name"` + Title *LocalizedDescription `json:"title"` + Description *LocalizedDescription `json:"description"` + Components *[]ModeComponent `json:"components"` + Proxy *ModeOptionProxy `json:"proxy,omitempty"` + Extra map[string]interface{} `json:"extra,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -241,7 +253,7 @@ func (o *ModeOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "title", "description", "components", "proxy", "extra"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "title", "description", "components", "proxy", "extra", }) } else { return err } @@ -257,7 +269,7 @@ func (o *ModeOption) UnmarshalJSON(bytes []byte) (err error) { } o.Description = *all.Description o.Components = *all.Components - if all.Proxy != nil && all.Proxy.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Proxy != nil && all.Proxy.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Proxy = all.Proxy diff --git a/api/kbcloud/model_mode_option_proxy.go b/api/kbcloud/model_mode_option_proxy.go index 47f6425f..d09b4f28 100644 --- a/api/kbcloud/model_mode_option_proxy.go +++ b/api/kbcloud/model_mode_option_proxy.go @@ -2,17 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ModeOptionProxy struct { Enabled *bool `json:"enabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewModeOptionProxy instantiates a new ModeOptionProxy object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -29,7 +39,6 @@ func NewModeOptionProxyWithDefaults() *ModeOptionProxy { this := ModeOptionProxy{} return &this } - // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *ModeOptionProxy) GetEnabled() bool { if o == nil || o.Enabled == nil { @@ -58,6 +67,8 @@ func (o *ModeOptionProxy) SetEnabled(v bool) { o.Enabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ModeOptionProxy) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -84,7 +95,7 @@ func (o *ModeOptionProxy) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "enabled", }) } else { return err } diff --git a/api/kbcloud/model_network_config.go b/api/kbcloud/model_network_config.go index d316e81e..ad1a4a2b 100644 --- a/api/kbcloud/model_network_config.go +++ b/api/kbcloud/model_network_config.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// NetworkConfig Configuration of networking for this environment + + +// NetworkConfig Configuration of networking for this environment type NetworkConfig struct { // Enable node port service for this environment NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` @@ -15,10 +24,11 @@ type NetworkConfig struct { // Enable the Internet load balancer service for this environment InternetLbEnabled *bool `json:"internetLBEnabled,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNetworkConfig instantiates a new NetworkConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +57,6 @@ func NewNetworkConfigWithDefaults() *NetworkConfig { this.InternetLbEnabled = &internetLbEnabled return &this } - // GetNodePortEnabled returns the NodePortEnabled field value if set, zero value otherwise. func (o *NetworkConfig) GetNodePortEnabled() bool { if o == nil || o.NodePortEnabled == nil { @@ -76,6 +85,7 @@ func (o *NetworkConfig) SetNodePortEnabled(v bool) { o.NodePortEnabled = &v } + // GetLbEnabled returns the LbEnabled field value if set, zero value otherwise. func (o *NetworkConfig) GetLbEnabled() bool { if o == nil || o.LbEnabled == nil { @@ -104,6 +114,7 @@ func (o *NetworkConfig) SetLbEnabled(v bool) { o.LbEnabled = &v } + // GetInternetLbEnabled returns the InternetLbEnabled field value if set, zero value otherwise. func (o *NetworkConfig) GetInternetLbEnabled() bool { if o == nil || o.InternetLbEnabled == nil { @@ -132,6 +143,8 @@ func (o *NetworkConfig) SetInternetLbEnabled(v bool) { o.InternetLbEnabled = &v } + + // MarshalJSON serializes the struct using spec logic. func (o NetworkConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -157,8 +170,8 @@ func (o NetworkConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NetworkConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` - LbEnabled *bool `json:"lbEnabled,omitempty"` + NodePortEnabled *bool `json:"nodePortEnabled,omitempty"` + LbEnabled *bool `json:"lbEnabled,omitempty"` InternetLbEnabled *bool `json:"internetLBEnabled,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -166,7 +179,7 @@ func (o *NetworkConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"nodePortEnabled", "lbEnabled", "internetLBEnabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "nodePortEnabled", "lbEnabled", "internetLBEnabled", }) } else { return err } diff --git a/api/kbcloud/model_node_group.go b/api/kbcloud/model_node_group.go index fbbe5d61..ba93934f 100644 --- a/api/kbcloud/model_node_group.go +++ b/api/kbcloud/model_node_group.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// NodeGroup NodeGroup creation info + + +// NodeGroup NodeGroup creation info type NodeGroup struct { // The full, unique name of this Object, name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc' Name string `json:"name"` @@ -19,10 +24,11 @@ type NodeGroup struct { // the nodes of the node group Nodes []string `json:"nodes"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewNodeGroup instantiates a new NodeGroup object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewNodeGroupWithDefaults() *NodeGroup { this := NodeGroup{} return &this } - // GetName returns the Name field value. func (o *NodeGroup) GetName() string { if o == nil { @@ -65,6 +70,7 @@ func (o *NodeGroup) SetName(v string) { o.Name = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *NodeGroup) GetDescription() string { if o == nil || o.Description == nil { @@ -93,6 +99,7 @@ func (o *NodeGroup) SetDescription(v string) { o.Description = &v } + // GetNodes returns the Nodes field value. func (o *NodeGroup) GetNodes() []string { if o == nil { @@ -116,6 +123,8 @@ func (o *NodeGroup) SetNodes(v []string) { o.Nodes = v } + + // MarshalJSON serializes the struct using spec logic. func (o NodeGroup) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -137,9 +146,9 @@ func (o NodeGroup) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NodeGroup) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Description *string `json:"description,omitempty"` - Nodes *[]string `json:"nodes"` + Name *string `json:"name"` + Description *string `json:"description,omitempty"` + Nodes *[]string `json:"nodes"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -152,7 +161,7 @@ func (o *NodeGroup) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "description", "nodes"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "description", "nodes", }) } else { return err } diff --git a/api/kbcloud/model_ob_parameter.go b/api/kbcloud/model_ob_parameter.go index 5c1034e8..78de4db0 100644 --- a/api/kbcloud/model_ob_parameter.go +++ b/api/kbcloud/model_ob_parameter.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ObParameter struct { // The name of the parameter Name string `json:"name"` @@ -34,10 +39,11 @@ type ObParameter struct { // Whether the parameter is read-only ReadOnly bool `json:"readOnly"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewObParameter instantiates a new ObParameter object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -62,7 +68,6 @@ func NewObParameterWithDefaults() *ObParameter { this := ObParameter{} return &this } - // GetName returns the Name field value. func (o *ObParameter) GetName() string { if o == nil { @@ -86,6 +91,7 @@ func (o *ObParameter) SetName(v string) { o.Name = v } + // GetValue returns the Value field value. func (o *ObParameter) GetValue() string { if o == nil { @@ -109,6 +115,7 @@ func (o *ObParameter) SetValue(v string) { o.Value = v } + // GetDataType returns the DataType field value. func (o *ObParameter) GetDataType() string { if o == nil { @@ -132,6 +139,7 @@ func (o *ObParameter) SetDataType(v string) { o.DataType = v } + // GetDescription returns the Description field value. func (o *ObParameter) GetDescription() string { if o == nil { @@ -155,6 +163,7 @@ func (o *ObParameter) SetDescription(v string) { o.Description = v } + // GetEnum returns the Enum field value. func (o *ObParameter) GetEnum() []map[string]interface{} { if o == nil { @@ -178,6 +187,7 @@ func (o *ObParameter) SetEnum(v []map[string]interface{}) { o.Enum = v } + // GetMaximum returns the Maximum field value. func (o *ObParameter) GetMaximum() float64 { if o == nil { @@ -201,6 +211,7 @@ func (o *ObParameter) SetMaximum(v float64) { o.Maximum = v } + // GetMinimum returns the Minimum field value. func (o *ObParameter) GetMinimum() float64 { if o == nil { @@ -224,6 +235,7 @@ func (o *ObParameter) SetMinimum(v float64) { o.Minimum = v } + // GetImmutable returns the Immutable field value if set, zero value otherwise. func (o *ObParameter) GetImmutable() bool { if o == nil || o.Immutable == nil { @@ -252,6 +264,7 @@ func (o *ObParameter) SetImmutable(v bool) { o.Immutable = &v } + // GetIsVariable returns the IsVariable field value if set, zero value otherwise. func (o *ObParameter) GetIsVariable() bool { if o == nil || o.IsVariable == nil { @@ -280,6 +293,7 @@ func (o *ObParameter) SetIsVariable(v bool) { o.IsVariable = &v } + // GetEditLevel returns the EditLevel field value if set, zero value otherwise. func (o *ObParameter) GetEditLevel() string { if o == nil || o.EditLevel == nil { @@ -308,6 +322,7 @@ func (o *ObParameter) SetEditLevel(v string) { o.EditLevel = &v } + // GetReadOnly returns the ReadOnly field value. func (o *ObParameter) GetReadOnly() bool { if o == nil { @@ -331,6 +346,8 @@ func (o *ObParameter) SetReadOnly(v bool) { o.ReadOnly = v } + + // MarshalJSON serializes the struct using spec logic. func (o ObParameter) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -364,17 +381,17 @@ func (o ObParameter) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ObParameter) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Value *string `json:"value"` - DataType *string `json:"dataType"` - Description *string `json:"description"` - Enum *[]map[string]interface{} `json:"enum"` - Maximum *float64 `json:"maximum"` - Minimum *float64 `json:"minimum"` - Immutable *bool `json:"immutable,omitempty"` - IsVariable *bool `json:"isVariable,omitempty"` - EditLevel *string `json:"editLevel,omitempty"` - ReadOnly *bool `json:"readOnly"` + Name *string `json:"name"` + Value *string `json:"value"` + DataType *string `json:"dataType"` + Description *string `json:"description"` + Enum *[]map[string]interface{} `json:"enum"` + Maximum *float64 `json:"maximum"` + Minimum *float64 `json:"minimum"` + Immutable *bool `json:"immutable,omitempty"` + IsVariable *bool `json:"isVariable,omitempty"` + EditLevel *string `json:"editLevel,omitempty"` + ReadOnly *bool `json:"readOnly"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -405,7 +422,7 @@ func (o *ObParameter) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "value", "dataType", "description", "enum", "maximum", "minimum", "immutable", "isVariable", "editLevel", "readOnly"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "value", "dataType", "description", "enum", "maximum", "minimum", "immutable", "isVariable", "editLevel", "readOnly", }) } else { return err } diff --git a/api/kbcloud/model_ob_session.go b/api/kbcloud/model_ob_session.go index e29942b6..ccf8d6e6 100644 --- a/api/kbcloud/model_ob_session.go +++ b/api/kbcloud/model_ob_session.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ObSession struct { // session id Id *string `json:"id,omitempty"` @@ -30,10 +39,11 @@ type ObSession struct { // port Port *string `json:"port,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewObSession instantiates a new ObSession object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -50,7 +60,6 @@ func NewObSessionWithDefaults() *ObSession { this := ObSession{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *ObSession) GetId() string { if o == nil || o.Id == nil { @@ -79,6 +88,7 @@ func (o *ObSession) SetId(v string) { o.Id = &v } + // GetUser returns the User field value if set, zero value otherwise. func (o *ObSession) GetUser() string { if o == nil || o.User == nil { @@ -107,6 +117,7 @@ func (o *ObSession) SetUser(v string) { o.User = &v } + // GetTenant returns the Tenant field value if set, zero value otherwise. func (o *ObSession) GetTenant() string { if o == nil || o.Tenant == nil { @@ -135,6 +146,7 @@ func (o *ObSession) SetTenant(v string) { o.Tenant = &v } + // GetHost returns the Host field value if set, zero value otherwise. func (o *ObSession) GetHost() string { if o == nil || o.Host == nil { @@ -163,6 +175,7 @@ func (o *ObSession) SetHost(v string) { o.Host = &v } + // GetDb returns the Db field value if set, zero value otherwise. func (o *ObSession) GetDb() string { if o == nil || o.Db == nil { @@ -191,6 +204,7 @@ func (o *ObSession) SetDb(v string) { o.Db = &v } + // GetCommand returns the Command field value if set, zero value otherwise. func (o *ObSession) GetCommand() string { if o == nil || o.Command == nil { @@ -219,6 +233,7 @@ func (o *ObSession) SetCommand(v string) { o.Command = &v } + // GetTime returns the Time field value if set, zero value otherwise. func (o *ObSession) GetTime() string { if o == nil || o.Time == nil { @@ -247,6 +262,7 @@ func (o *ObSession) SetTime(v string) { o.Time = &v } + // GetState returns the State field value if set, zero value otherwise. func (o *ObSession) GetState() string { if o == nil || o.State == nil { @@ -275,6 +291,7 @@ func (o *ObSession) SetState(v string) { o.State = &v } + // GetInfo returns the Info field value if set, zero value otherwise. func (o *ObSession) GetInfo() string { if o == nil || o.Info == nil { @@ -303,6 +320,7 @@ func (o *ObSession) SetInfo(v string) { o.Info = &v } + // GetIp returns the Ip field value if set, zero value otherwise. func (o *ObSession) GetIp() string { if o == nil || o.Ip == nil { @@ -331,6 +349,7 @@ func (o *ObSession) SetIp(v string) { o.Ip = &v } + // GetPort returns the Port field value if set, zero value otherwise. func (o *ObSession) GetPort() string { if o == nil || o.Port == nil { @@ -359,6 +378,8 @@ func (o *ObSession) SetPort(v string) { o.Port = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ObSession) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -408,24 +429,24 @@ func (o ObSession) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ObSession) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - User *string `json:"user,omitempty"` - Tenant *string `json:"tenant,omitempty"` - Host *string `json:"host,omitempty"` - Db *string `json:"db,omitempty"` + Id *string `json:"id,omitempty"` + User *string `json:"user,omitempty"` + Tenant *string `json:"tenant,omitempty"` + Host *string `json:"host,omitempty"` + Db *string `json:"db,omitempty"` Command *string `json:"command,omitempty"` - Time *string `json:"time,omitempty"` - State *string `json:"state,omitempty"` - Info *string `json:"info,omitempty"` - Ip *string `json:"ip,omitempty"` - Port *string `json:"port,omitempty"` + Time *string `json:"time,omitempty"` + State *string `json:"state,omitempty"` + Info *string `json:"info,omitempty"` + Ip *string `json:"ip,omitempty"` + Port *string `json:"port,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "user", "tenant", "host", "db", "command", "time", "state", "info", "ip", "port"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "user", "tenant", "host", "db", "command", "time", "state", "info", "ip", "port", }) } else { return err } diff --git a/api/kbcloud/model_object.go b/api/kbcloud/model_object.go index a052fa93..a4fe5d01 100644 --- a/api/kbcloud/model_object.go +++ b/api/kbcloud/model_object.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Object struct { // Type is the type of db object, like 'Table', 'Views', 'Functions' Type *string `json:"type,omitempty"` // Count is the number of each object Count *int64 `json:"count,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewObject instantiates a new Object object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewObjectWithDefaults() *Object { this := Object{} return &this } - // GetType returns the Type field value if set, zero value otherwise. func (o *Object) GetType() string { if o == nil || o.Type == nil { @@ -61,6 +70,7 @@ func (o *Object) SetType(v string) { o.Type = &v } + // GetCount returns the Count field value if set, zero value otherwise. func (o *Object) GetCount() int64 { if o == nil || o.Count == nil { @@ -89,6 +99,8 @@ func (o *Object) SetCount(v int64) { o.Count = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Object) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,15 +123,15 @@ func (o Object) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Object) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Type *string `json:"type,omitempty"` - Count *int64 `json:"count,omitempty"` + Type *string `json:"type,omitempty"` + Count *int64 `json:"count,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"type", "count"}) + common.DeleteKeys(additionalProperties, &[]string{ "type", "count", }) } else { return err } diff --git a/api/kbcloud/model_object_response.go b/api/kbcloud/model_object_response.go index 74c766ed..c389c3d4 100644 --- a/api/kbcloud/model_object_response.go +++ b/api/kbcloud/model_object_response.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ObjectResponse struct { // The data of the Object Data map[string]interface{} `json:"data,omitempty"` // The type of the Object Type *string `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewObjectResponse instantiates a new ObjectResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewObjectResponseWithDefaults() *ObjectResponse { this := ObjectResponse{} return &this } - // GetData returns the Data field value if set, zero value otherwise. func (o *ObjectResponse) GetData() map[string]interface{} { if o == nil || o.Data == nil { @@ -61,6 +70,7 @@ func (o *ObjectResponse) SetData(v map[string]interface{}) { o.Data = v } + // GetType returns the Type field value if set, zero value otherwise. func (o *ObjectResponse) GetType() string { if o == nil || o.Type == nil { @@ -89,6 +99,8 @@ func (o *ObjectResponse) SetType(v string) { o.Type = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ObjectResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,14 +124,14 @@ func (o ObjectResponse) MarshalJSON() ([]byte, error) { func (o *ObjectResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { Data map[string]interface{} `json:"data,omitempty"` - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"data", "type"}) + common.DeleteKeys(additionalProperties, &[]string{ "data", "type", }) } else { return err } diff --git a/api/kbcloud/model_ops_expose.go b/api/kbcloud/model_ops_expose.go index 8d590a12..dd603357 100644 --- a/api/kbcloud/model_ops_expose.go +++ b/api/kbcloud/model_ops_expose.go @@ -2,28 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsExpose OpsExpose is the payload to expose a KubeBlocks cluster + + +// OpsExpose OpsExpose is the payload to expose a KubeBlocks cluster type OpsExpose struct { Component *string `json:"component,omitempty"` - Enable bool `json:"enable"` + Enable bool `json:"enable"` // Specifies the type of exposure for the KubeBlocks cluster. Type OpsExposeType `json:"type"` // Specifies the type of service for the KubeBlocks cluster. - VpcServiceType *OpsExposeVPCServiceType `json:"vpcServiceType,omitempty"` - PortsMapping []OpsExposePortsMappingItem `json:"portsMapping,omitempty"` + VpcServiceType *OpsExposeVPCServiceType `json:"vpcServiceType,omitempty"` + PortsMapping []OpsExposePortsMappingItem `json:"portsMapping,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsExpose instantiates a new OpsExpose object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +52,6 @@ func NewOpsExposeWithDefaults() *OpsExpose { this.VpcServiceType = &vpcServiceType return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsExpose) GetComponent() string { if o == nil || o.Component == nil { @@ -75,6 +80,7 @@ func (o *OpsExpose) SetComponent(v string) { o.Component = &v } + // GetEnable returns the Enable field value. func (o *OpsExpose) GetEnable() bool { if o == nil { @@ -98,6 +104,7 @@ func (o *OpsExpose) SetEnable(v bool) { o.Enable = v } + // GetType returns the Type field value. func (o *OpsExpose) GetType() OpsExposeType { if o == nil { @@ -121,6 +128,7 @@ func (o *OpsExpose) SetType(v OpsExposeType) { o.Type = v } + // GetVpcServiceType returns the VpcServiceType field value if set, zero value otherwise. func (o *OpsExpose) GetVpcServiceType() OpsExposeVPCServiceType { if o == nil || o.VpcServiceType == nil { @@ -149,6 +157,7 @@ func (o *OpsExpose) SetVpcServiceType(v OpsExposeVPCServiceType) { o.VpcServiceType = &v } + // GetPortsMapping returns the PortsMapping field value if set, zero value otherwise. func (o *OpsExpose) GetPortsMapping() []OpsExposePortsMappingItem { if o == nil || o.PortsMapping == nil { @@ -177,6 +186,8 @@ func (o *OpsExpose) SetPortsMapping(v []OpsExposePortsMappingItem) { o.PortsMapping = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsExpose) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -204,11 +215,11 @@ func (o OpsExpose) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsExpose) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - Enable *bool `json:"enable"` - Type *OpsExposeType `json:"type"` - VpcServiceType *OpsExposeVPCServiceType `json:"vpcServiceType,omitempty"` - PortsMapping []OpsExposePortsMappingItem `json:"portsMapping,omitempty"` + Component *string `json:"component,omitempty"` + Enable *bool `json:"enable"` + Type *OpsExposeType `json:"type"` + VpcServiceType *OpsExposeVPCServiceType `json:"vpcServiceType,omitempty"` + PortsMapping []OpsExposePortsMappingItem `json:"portsMapping,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -221,7 +232,7 @@ func (o *OpsExpose) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "enable", "type", "vpcServiceType", "portsMapping"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "enable", "type", "vpcServiceType", "portsMapping", }) } else { return err } @@ -234,7 +245,7 @@ func (o *OpsExpose) UnmarshalJSON(bytes []byte) (err error) { } else { o.Type = *all.Type } - if all.VpcServiceType != nil && !all.VpcServiceType.IsValid() { + if all.VpcServiceType != nil &&!all.VpcServiceType.IsValid() { hasInvalidField = true } else { o.VpcServiceType = all.VpcServiceType diff --git a/api/kbcloud/model_ops_expose_ports_mapping_item.go b/api/kbcloud/model_ops_expose_ports_mapping_item.go index 5c74c9f3..172f35f1 100644 --- a/api/kbcloud/model_ops_expose_ports_mapping_item.go +++ b/api/kbcloud/model_ops_expose_ports_mapping_item.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type OpsExposePortsMappingItem struct { Old *int32 `json:"old,omitempty"` New *int32 `json:"new,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsExposePortsMappingItem instantiates a new OpsExposePortsMappingItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewOpsExposePortsMappingItemWithDefaults() *OpsExposePortsMappingItem { this := OpsExposePortsMappingItem{} return &this } - // GetOld returns the Old field value if set, zero value otherwise. func (o *OpsExposePortsMappingItem) GetOld() int32 { if o == nil || o.Old == nil { @@ -59,6 +68,7 @@ func (o *OpsExposePortsMappingItem) SetOld(v int32) { o.Old = &v } + // GetNew returns the New field value if set, zero value otherwise. func (o *OpsExposePortsMappingItem) GetNew() int32 { if o == nil || o.New == nil { @@ -87,6 +97,8 @@ func (o *OpsExposePortsMappingItem) SetNew(v int32) { o.New = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsExposePortsMappingItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -117,7 +129,7 @@ func (o *OpsExposePortsMappingItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"old", "new"}) + common.DeleteKeys(additionalProperties, &[]string{ "old", "new", }) } else { return err } diff --git a/api/kbcloud/model_ops_expose_type.go b/api/kbcloud/model_ops_expose_type.go index 408835af..85c92536 100644 --- a/api/kbcloud/model_ops_expose_type.go +++ b/api/kbcloud/model_ops_expose_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // OpsExposeType Specifies the type of exposure for the KubeBlocks cluster. type OpsExposeType string // List of OpsExposeType. const ( - OpsExposeTypeVpc OpsExposeType = "vpc" + OpsExposeTypeVpc OpsExposeType = "vpc" OpsExposeTypeInternet OpsExposeType = "internet" ) diff --git a/api/kbcloud/model_ops_expose_vpc_service_type.go b/api/kbcloud/model_ops_expose_vpc_service_type.go index 4054441e..ca6e1360 100644 --- a/api/kbcloud/model_ops_expose_vpc_service_type.go +++ b/api/kbcloud/model_ops_expose_vpc_service_type.go @@ -2,21 +2,26 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // OpsExposeVPCServiceType Specifies the type of service for the KubeBlocks cluster. type OpsExposeVPCServiceType string // List of OpsExposeVPCServiceType. const ( OpsExposeVPCServiceTypeLoadBalancer OpsExposeVPCServiceType = "LoadBalancer" - OpsExposeVPCServiceTypeNodePort OpsExposeVPCServiceType = "NodePort" + OpsExposeVPCServiceTypeNodePort OpsExposeVPCServiceType = "NodePort" ) var allowedOpsExposeVPCServiceTypeEnumValues = []OpsExposeVPCServiceType{ diff --git a/api/kbcloud/model_ops_h_scale.go b/api/kbcloud/model_ops_h_scale.go index c6f20c48..831444d9 100644 --- a/api/kbcloud/model_ops_h_scale.go +++ b/api/kbcloud/model_ops_h_scale.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsHScale OpsHScale is the payload to horizontally scale a KubeBlocks cluster + + +// OpsHScale OpsHScale is the payload to horizontally scale a KubeBlocks cluster type OpsHScale struct { // component type Component *string `json:"component,omitempty"` // number of replicas Replicas int32 `json:"replicas"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsHScale instantiates a new OpsHScale object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOpsHScaleWithDefaults() *OpsHScale { this := OpsHScale{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsHScale) GetComponent() string { if o == nil || o.Component == nil { @@ -67,6 +72,7 @@ func (o *OpsHScale) SetComponent(v string) { o.Component = &v } + // GetReplicas returns the Replicas field value. func (o *OpsHScale) GetReplicas() int32 { if o == nil { @@ -90,6 +96,8 @@ func (o *OpsHScale) SetReplicas(v int32) { o.Replicas = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsHScale) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +119,7 @@ func (o OpsHScale) MarshalJSON() ([]byte, error) { func (o *OpsHScale) UnmarshalJSON(bytes []byte) (err error) { all := struct { Component *string `json:"component,omitempty"` - Replicas *int32 `json:"replicas"` + Replicas *int32 `json:"replicas"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,7 +129,7 @@ func (o *OpsHScale) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "replicas"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "replicas", }) } else { return err } diff --git a/api/kbcloud/model_ops_license.go b/api/kbcloud/model_ops_license.go index 1050802a..5912e2cb 100644 --- a/api/kbcloud/model_ops_license.go +++ b/api/kbcloud/model_ops_license.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsLicense OpsLicense is the payload to update a KubeBlocks cluster license + + +// OpsLicense OpsLicense is the payload to update a KubeBlocks cluster license type OpsLicense struct { // component type Component string `json:"component"` // license ID LicenseId string `json:"licenseId"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsLicense instantiates a new OpsLicense object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewOpsLicenseWithDefaults() *OpsLicense { this := OpsLicense{} return &this } - // GetComponent returns the Component field value. func (o *OpsLicense) GetComponent() string { if o == nil { @@ -63,6 +68,7 @@ func (o *OpsLicense) SetComponent(v string) { o.Component = v } + // GetLicenseId returns the LicenseId field value. func (o *OpsLicense) GetLicenseId() string { if o == nil { @@ -86,6 +92,8 @@ func (o *OpsLicense) SetLicenseId(v string) { o.LicenseId = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsLicense) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -118,7 +126,7 @@ func (o *OpsLicense) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "licenseId"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "licenseId", }) } else { return err } diff --git a/api/kbcloud/model_ops_promote.go b/api/kbcloud/model_ops_promote.go index 74b8f0bd..d08970de 100644 --- a/api/kbcloud/model_ops_promote.go +++ b/api/kbcloud/model_ops_promote.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OpsPromote OpsPromote is the payload to promote a KubeBlocks cluster +// OpsPromote OpsPromote is the payload to promote a KubeBlocks cluster type OpsPromote struct { ComponentName *string `json:"componentName,omitempty"` - InstanceName *string `json:"instanceName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsPromote instantiates a new OpsPromote object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewOpsPromoteWithDefaults() *OpsPromote { this := OpsPromote{} return &this } - // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *OpsPromote) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -60,6 +69,7 @@ func (o *OpsPromote) SetComponentName(v string) { o.ComponentName = &v } + // GetInstanceName returns the InstanceName field value if set, zero value otherwise. func (o *OpsPromote) GetInstanceName() string { if o == nil || o.InstanceName == nil { @@ -88,6 +98,8 @@ func (o *OpsPromote) SetInstanceName(v string) { o.InstanceName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsPromote) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,14 +123,14 @@ func (o OpsPromote) MarshalJSON() ([]byte, error) { func (o *OpsPromote) UnmarshalJSON(bytes []byte) (err error) { all := struct { ComponentName *string `json:"componentName,omitempty"` - InstanceName *string `json:"instanceName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"componentName", "instanceName"}) + common.DeleteKeys(additionalProperties, &[]string{ "componentName", "instanceName", }) } else { return err } diff --git a/api/kbcloud/model_ops_rebuild_instance.go b/api/kbcloud/model_ops_rebuild_instance.go index 734e08bb..b3dd7ea3 100644 --- a/api/kbcloud/model_ops_rebuild_instance.go +++ b/api/kbcloud/model_ops_rebuild_instance.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OpsRebuildInstance rebuild the instances of the cluster. +// OpsRebuildInstance rebuild the instances of the cluster. type OpsRebuildInstance struct { // will ignore role check during rebuilding instance. - IgnoreRoleCheck *bool `json:"ignoreRoleCheck,omitempty"` - Requests []OpsRebuildInstanceRequestsItem `json:"requests,omitempty"` + IgnoreRoleCheck *bool `json:"ignoreRoleCheck,omitempty"` + Requests []OpsRebuildInstanceRequestsItem `json:"requests,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRebuildInstance instantiates a new OpsRebuildInstance object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewOpsRebuildInstanceWithDefaults() *OpsRebuildInstance { this := OpsRebuildInstance{} return &this } - // GetIgnoreRoleCheck returns the IgnoreRoleCheck field value if set, zero value otherwise. func (o *OpsRebuildInstance) GetIgnoreRoleCheck() bool { if o == nil || o.IgnoreRoleCheck == nil { @@ -61,6 +70,7 @@ func (o *OpsRebuildInstance) SetIgnoreRoleCheck(v bool) { o.IgnoreRoleCheck = &v } + // GetRequests returns the Requests field value if set, zero value otherwise. func (o *OpsRebuildInstance) GetRequests() []OpsRebuildInstanceRequestsItem { if o == nil || o.Requests == nil { @@ -89,6 +99,8 @@ func (o *OpsRebuildInstance) SetRequests(v []OpsRebuildInstanceRequestsItem) { o.Requests = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRebuildInstance) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,15 +123,15 @@ func (o OpsRebuildInstance) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsRebuildInstance) UnmarshalJSON(bytes []byte) (err error) { all := struct { - IgnoreRoleCheck *bool `json:"ignoreRoleCheck,omitempty"` - Requests []OpsRebuildInstanceRequestsItem `json:"requests,omitempty"` + IgnoreRoleCheck *bool `json:"ignoreRoleCheck,omitempty"` + Requests []OpsRebuildInstanceRequestsItem `json:"requests,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"ignoreRoleCheck", "requests"}) + common.DeleteKeys(additionalProperties, &[]string{ "ignoreRoleCheck", "requests", }) } else { return err } diff --git a/api/kbcloud/model_ops_rebuild_instance_instance_param.go b/api/kbcloud/model_ops_rebuild_instance_instance_param.go index 8ccb2c8d..c8bd0b9f 100644 --- a/api/kbcloud/model_ops_rebuild_instance_instance_param.go +++ b/api/kbcloud/model_ops_rebuild_instance_instance_param.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsRebuildInstanceInstanceParam instance params for RebuildInstance ops + + +// OpsRebuildInstanceInstanceParam instance params for RebuildInstance ops type OpsRebuildInstanceInstanceParam struct { // Pod name of the instance Name string `json:"name"` // The instance will rebuild on the specified node. If not set, it will rebuild on a random node. TargetNodeName *string `json:"targetNodeName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRebuildInstanceInstanceParam instantiates a new OpsRebuildInstanceInstanceParam object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOpsRebuildInstanceInstanceParamWithDefaults() *OpsRebuildInstanceInstanc this := OpsRebuildInstanceInstanceParam{} return &this } - // GetName returns the Name field value. func (o *OpsRebuildInstanceInstanceParam) GetName() string { if o == nil { @@ -62,6 +67,7 @@ func (o *OpsRebuildInstanceInstanceParam) SetName(v string) { o.Name = v } + // GetTargetNodeName returns the TargetNodeName field value if set, zero value otherwise. func (o *OpsRebuildInstanceInstanceParam) GetTargetNodeName() string { if o == nil || o.TargetNodeName == nil { @@ -90,6 +96,8 @@ func (o *OpsRebuildInstanceInstanceParam) SetTargetNodeName(v string) { o.TargetNodeName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRebuildInstanceInstanceParam) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o OpsRebuildInstanceInstanceParam) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsRebuildInstanceInstanceParam) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` TargetNodeName *string `json:"targetNodeName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,7 +129,7 @@ func (o *OpsRebuildInstanceInstanceParam) UnmarshalJSON(bytes []byte) (err error } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "targetNodeName"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "targetNodeName", }) } else { return err } diff --git a/api/kbcloud/model_ops_rebuild_instance_requests_item.go b/api/kbcloud/model_ops_rebuild_instance_requests_item.go index 59ec07cc..63d6339a 100644 --- a/api/kbcloud/model_ops_rebuild_instance_requests_item.go +++ b/api/kbcloud/model_ops_rebuild_instance_requests_item.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type OpsRebuildInstanceRequestsItem struct { - BackupName *string `json:"backupName,omitempty"` - Instances []OpsRebuildInstanceInstanceParam `json:"instances"` + BackupName *string `json:"backupName,omitempty"` + Instances []OpsRebuildInstanceInstanceParam `json:"instances"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRebuildInstanceRequestsItem instantiates a new OpsRebuildInstanceRequestsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewOpsRebuildInstanceRequestsItemWithDefaults() *OpsRebuildInstanceRequests this := OpsRebuildInstanceRequestsItem{} return &this } - // GetBackupName returns the BackupName field value if set, zero value otherwise. func (o *OpsRebuildInstanceRequestsItem) GetBackupName() string { if o == nil || o.BackupName == nil { @@ -64,6 +69,7 @@ func (o *OpsRebuildInstanceRequestsItem) SetBackupName(v string) { o.BackupName = &v } + // GetInstances returns the Instances field value. func (o *OpsRebuildInstanceRequestsItem) GetInstances() []OpsRebuildInstanceInstanceParam { if o == nil { @@ -87,6 +93,8 @@ func (o *OpsRebuildInstanceRequestsItem) SetInstances(v []OpsRebuildInstanceInst o.Instances = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRebuildInstanceRequestsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -107,8 +115,8 @@ func (o OpsRebuildInstanceRequestsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsRebuildInstanceRequestsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - BackupName *string `json:"backupName,omitempty"` - Instances *[]OpsRebuildInstanceInstanceParam `json:"instances"` + BackupName *string `json:"backupName,omitempty"` + Instances *[]OpsRebuildInstanceInstanceParam `json:"instances"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *OpsRebuildInstanceRequestsItem) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"backupName", "instances"}) + common.DeleteKeys(additionalProperties, &[]string{ "backupName", "instances", }) } else { return err } diff --git a/api/kbcloud/model_ops_request_name.go b/api/kbcloud/model_ops_request_name.go index 5b9da738..5923f5d2 100644 --- a/api/kbcloud/model_ops_request_name.go +++ b/api/kbcloud/model_ops_request_name.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsRequestName OpsRequestName is the name of a KubeBlocks OpsRequest + + +// OpsRequestName OpsRequestName is the name of a KubeBlocks OpsRequest type OpsRequestName struct { - OpsRequestName string `json:"opsRequestName"` + OpsRequestName string `json:"opsRequestName"` DependentOpsName *string `json:"dependentOpsName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRequestName instantiates a new OpsRequestName object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewOpsRequestNameWithDefaults() *OpsRequestName { this := OpsRequestName{} return &this } - // GetOpsRequestName returns the OpsRequestName field value. func (o *OpsRequestName) GetOpsRequestName() string { if o == nil { @@ -60,6 +65,7 @@ func (o *OpsRequestName) SetOpsRequestName(v string) { o.OpsRequestName = v } + // GetDependentOpsName returns the DependentOpsName field value if set, zero value otherwise. func (o *OpsRequestName) GetDependentOpsName() string { if o == nil || o.DependentOpsName == nil { @@ -88,6 +94,8 @@ func (o *OpsRequestName) SetDependentOpsName(v string) { o.DependentOpsName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRequestName) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -108,7 +116,7 @@ func (o OpsRequestName) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsRequestName) UnmarshalJSON(bytes []byte) (err error) { all := struct { - OpsRequestName *string `json:"opsRequestName"` + OpsRequestName *string `json:"opsRequestName"` DependentOpsName *string `json:"dependentOpsName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +127,7 @@ func (o *OpsRequestName) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"opsRequestName", "dependentOpsName"}) + common.DeleteKeys(additionalProperties, &[]string{ "opsRequestName", "dependentOpsName", }) } else { return err } diff --git a/api/kbcloud/model_ops_restart.go b/api/kbcloud/model_ops_restart.go index efac4d32..7db8832d 100644 --- a/api/kbcloud/model_ops_restart.go +++ b/api/kbcloud/model_ops_restart.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OpsRestart OpsRestart is the payload to restart a KubeBlocks cluster +// OpsRestart OpsRestart is the payload to restart a KubeBlocks cluster type OpsRestart struct { // component type Component *string `json:"component,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsRestart instantiates a new OpsRestart object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewOpsRestartWithDefaults() *OpsRestart { this := OpsRestart{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsRestart) GetComponent() string { if o == nil || o.Component == nil { @@ -60,6 +69,8 @@ func (o *OpsRestart) SetComponent(v string) { o.Component = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsRestart) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *OpsRestart) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", }) } else { return err } diff --git a/api/kbcloud/model_ops_type.go b/api/kbcloud/model_ops_type.go index 2645e3d0..bf9519e4 100644 --- a/api/kbcloud/model_ops_type.go +++ b/api/kbcloud/model_ops_type.go @@ -2,29 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type OpsType string // List of OpsType. const ( - OpsTypeVerticalScaling OpsType = "VerticalScaling" + OpsTypeVerticalScaling OpsType = "VerticalScaling" OpsTypeHorizontalScaling OpsType = "HorizontalScaling" - OpsTypeVolumeExpansion OpsType = "VolumeExpansion" - OpsTypeUpgrade OpsType = "Upgrade" - OpsTypeReconfiguring OpsType = "Reconfiguring" - OpsTypeSwitchover OpsType = "Switchover" - OpsTypeRestart OpsType = "Restart" - OpsTypeStop OpsType = "Stop" - OpsTypeStart OpsType = "Start" - OpsTypeExpose OpsType = "Expose" - OpsTypeDataScript OpsType = "DataScript" + OpsTypeVolumeExpansion OpsType = "VolumeExpansion" + OpsTypeUpgrade OpsType = "Upgrade" + OpsTypeReconfiguring OpsType = "Reconfiguring" + OpsTypeSwitchover OpsType = "Switchover" + OpsTypeRestart OpsType = "Restart" + OpsTypeStop OpsType = "Stop" + OpsTypeStart OpsType = "Start" + OpsTypeExpose OpsType = "Expose" + OpsTypeDataScript OpsType = "DataScript" ) var allowedOpsTypeEnumValues = []OpsType{ diff --git a/api/kbcloud/model_ops_upgrade.go b/api/kbcloud/model_ops_upgrade.go index 3ffe8a1b..e96eab8b 100644 --- a/api/kbcloud/model_ops_upgrade.go +++ b/api/kbcloud/model_ops_upgrade.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsUpgrade OpsUpgrade is the payload to upgrade a KubeBlocks cluster + + +// OpsUpgrade OpsUpgrade is the payload to upgrade a KubeBlocks cluster type OpsUpgrade struct { - Version string `json:"version"` + Version string `json:"version"` Component *string `json:"component,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsUpgrade instantiates a new OpsUpgrade object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewOpsUpgradeWithDefaults() *OpsUpgrade { this := OpsUpgrade{} return &this } - // GetVersion returns the Version field value. func (o *OpsUpgrade) GetVersion() string { if o == nil { @@ -60,6 +65,7 @@ func (o *OpsUpgrade) SetVersion(v string) { o.Version = v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsUpgrade) GetComponent() string { if o == nil || o.Component == nil { @@ -88,6 +94,8 @@ func (o *OpsUpgrade) SetComponent(v string) { o.Component = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsUpgrade) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -108,7 +116,7 @@ func (o OpsUpgrade) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsUpgrade) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Version *string `json:"version"` + Version *string `json:"version"` Component *string `json:"component,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -119,7 +127,7 @@ func (o *OpsUpgrade) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"version", "component"}) + common.DeleteKeys(additionalProperties, &[]string{ "version", "component", }) } else { return err } diff --git a/api/kbcloud/model_ops_v_scale.go b/api/kbcloud/model_ops_v_scale.go index 02552e39..1492e61c 100644 --- a/api/kbcloud/model_ops_v_scale.go +++ b/api/kbcloud/model_ops_v_scale.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// OpsVScale OpsVScale is the payload to vertically scale a KubeBlocks cluster + + +// OpsVScale OpsVScale is the payload to vertically scale a KubeBlocks cluster type OpsVScale struct { // component type Component *string `json:"component,omitempty"` @@ -17,10 +26,11 @@ type OpsVScale struct { // class code of the cluster ClassCode *string `json:"classCode,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsVScale instantiates a new OpsVScale object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewOpsVScaleWithDefaults() *OpsVScale { this := OpsVScale{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsVScale) GetComponent() string { if o == nil || o.Component == nil { @@ -66,6 +75,7 @@ func (o *OpsVScale) SetComponent(v string) { o.Component = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *OpsVScale) GetCpu() string { if o == nil || o.Cpu == nil { @@ -94,6 +104,7 @@ func (o *OpsVScale) SetCpu(v string) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *OpsVScale) GetMemory() string { if o == nil || o.Memory == nil { @@ -122,6 +133,7 @@ func (o *OpsVScale) SetMemory(v string) { o.Memory = &v } + // GetClassCode returns the ClassCode field value if set, zero value otherwise. func (o *OpsVScale) GetClassCode() string { if o == nil || o.ClassCode == nil { @@ -150,6 +162,8 @@ func (o *OpsVScale) SetClassCode(v string) { o.ClassCode = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsVScale) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -179,8 +193,8 @@ func (o OpsVScale) MarshalJSON() ([]byte, error) { func (o *OpsVScale) UnmarshalJSON(bytes []byte) (err error) { all := struct { Component *string `json:"component,omitempty"` - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` + Cpu *string `json:"cpu,omitempty"` + Memory *string `json:"memory,omitempty"` ClassCode *string `json:"classCode,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -188,7 +202,7 @@ func (o *OpsVScale) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "cpu", "memory", "classCode"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "cpu", "memory", "classCode", }) } else { return err } diff --git a/api/kbcloud/model_ops_volume_expand.go b/api/kbcloud/model_ops_volume_expand.go index 0ae248d7..f71d6a39 100644 --- a/api/kbcloud/model_ops_volume_expand.go +++ b/api/kbcloud/model_ops_volume_expand.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OpsVolumeExpand OpsVolumeExpand is the payload to expand volume for a KubeBlocks cluster + + +// OpsVolumeExpand OpsVolumeExpand is the payload to expand volume for a KubeBlocks cluster type OpsVolumeExpand struct { - Component *string `json:"component,omitempty"` - Volumes []OpsVolumeExpandVolumesItem `json:"volumes"` + Component *string `json:"component,omitempty"` + Volumes []OpsVolumeExpandVolumesItem `json:"volumes"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsVolumeExpand instantiates a new OpsVolumeExpand object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewOpsVolumeExpandWithDefaults() *OpsVolumeExpand { this := OpsVolumeExpand{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *OpsVolumeExpand) GetComponent() string { if o == nil || o.Component == nil { @@ -65,6 +70,7 @@ func (o *OpsVolumeExpand) SetComponent(v string) { o.Component = &v } + // GetVolumes returns the Volumes field value. func (o *OpsVolumeExpand) GetVolumes() []OpsVolumeExpandVolumesItem { if o == nil { @@ -88,6 +94,8 @@ func (o *OpsVolumeExpand) SetVolumes(v []OpsVolumeExpandVolumesItem) { o.Volumes = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsVolumeExpand) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -108,8 +116,8 @@ func (o OpsVolumeExpand) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsVolumeExpand) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - Volumes *[]OpsVolumeExpandVolumesItem `json:"volumes"` + Component *string `json:"component,omitempty"` + Volumes *[]OpsVolumeExpandVolumesItem `json:"volumes"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -119,7 +127,7 @@ func (o *OpsVolumeExpand) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "volumes"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "volumes", }) } else { return err } diff --git a/api/kbcloud/model_ops_volume_expand_volumes_item.go b/api/kbcloud/model_ops_volume_expand_volumes_item.go index 2c52f591..dcff2e58 100644 --- a/api/kbcloud/model_ops_volume_expand_volumes_item.go +++ b/api/kbcloud/model_ops_volume_expand_volumes_item.go @@ -2,24 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type OpsVolumeExpandVolumesItem struct { // volume name Name string `json:"name"` // Storage size, the unit is Gi. Storage string `json:"storage"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOpsVolumeExpandVolumesItem instantiates a new OpsVolumeExpandVolumesItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOpsVolumeExpandVolumesItemWithDefaults() *OpsVolumeExpandVolumesItem { this := OpsVolumeExpandVolumesItem{} return &this } - // GetName returns the Name field value. func (o *OpsVolumeExpandVolumesItem) GetName() string { if o == nil { @@ -62,6 +67,7 @@ func (o *OpsVolumeExpandVolumesItem) SetName(v string) { o.Name = v } + // GetStorage returns the Storage field value. func (o *OpsVolumeExpandVolumesItem) GetStorage() string { if o == nil { @@ -85,6 +91,8 @@ func (o *OpsVolumeExpandVolumesItem) SetStorage(v string) { o.Storage = v } + + // MarshalJSON serializes the struct using spec logic. func (o OpsVolumeExpandVolumesItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -103,7 +111,7 @@ func (o OpsVolumeExpandVolumesItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OpsVolumeExpandVolumesItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` + Name *string `json:"name"` Storage *string `json:"storage"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -117,7 +125,7 @@ func (o *OpsVolumeExpandVolumesItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "storage"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "storage", }) } else { return err } diff --git a/api/kbcloud/model_org.go b/api/kbcloud/model_org.go index 1478e0bc..7d4bd5c3 100644 --- a/api/kbcloud/model_org.go +++ b/api/kbcloud/model_org.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Org Org info + + +// Org Org info type Org struct { // CreatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. // @@ -32,10 +36,11 @@ type Org struct { // return true if the organization is enabled Enabled bool `json:"enabled"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrg instantiates a new Org object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +61,6 @@ func NewOrgWithDefaults() *Org { this := Org{} return &this } - // GetCreatedAt returns the CreatedAt field value. func (o *Org) GetCreatedAt() time.Time { if o == nil { @@ -80,6 +84,7 @@ func (o *Org) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Org) GetDescription() string { if o == nil || o.Description == nil { @@ -108,6 +113,7 @@ func (o *Org) SetDescription(v string) { o.Description = &v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *Org) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -136,6 +142,7 @@ func (o *Org) SetDisplayName(v string) { o.DisplayName = &v } + // GetId returns the Id field value if set, zero value otherwise. func (o *Org) GetId() string { if o == nil || o.Id == nil { @@ -164,6 +171,7 @@ func (o *Org) SetId(v string) { o.Id = &v } + // GetName returns the Name field value. func (o *Org) GetName() string { if o == nil { @@ -187,6 +195,7 @@ func (o *Org) SetName(v string) { o.Name = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Org) GetUpdatedAt() time.Time { if o == nil { @@ -210,6 +219,7 @@ func (o *Org) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetEnabled returns the Enabled field value. func (o *Org) GetEnabled() bool { if o == nil { @@ -233,6 +243,8 @@ func (o *Org) SetEnabled(v bool) { o.Enabled = v } + + // MarshalJSON serializes the struct using spec logic. func (o Org) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -270,13 +282,13 @@ func (o Org) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Org) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CreatedAt *time.Time `json:"createdAt"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name"` - UpdatedAt *time.Time `json:"updatedAt"` - Enabled *bool `json:"enabled"` + CreatedAt *time.Time `json:"createdAt"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name"` + UpdatedAt *time.Time `json:"updatedAt"` + Enabled *bool `json:"enabled"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -295,7 +307,7 @@ func (o *Org) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"createdAt", "description", "displayName", "id", "name", "updatedAt", "enabled"}) + common.DeleteKeys(additionalProperties, &[]string{ "createdAt", "description", "displayName", "id", "name", "updatedAt", "enabled", }) } else { return err } diff --git a/api/kbcloud/model_org_create.go b/api/kbcloud/model_org_create.go index b2fba121..db1d40bf 100644 --- a/api/kbcloud/model_org_create.go +++ b/api/kbcloud/model_org_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgCreate OrgCreate is the payload for organization creation + + +// OrgCreate OrgCreate is the payload for organization creation type OrgCreate struct { // The description of the organization Description *string `json:"description,omitempty"` @@ -19,10 +24,11 @@ type OrgCreate struct { // The full, unique name of this Object in the format organizations/{name}, set during creation. name must be a valid RFC 1123 compliant DNS label Name string `json:"name"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgCreate instantiates a new OrgCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewOrgCreateWithDefaults() *OrgCreate { this := OrgCreate{} return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *OrgCreate) GetDescription() string { if o == nil || o.Description == nil { @@ -69,6 +74,7 @@ func (o *OrgCreate) SetDescription(v string) { o.Description = &v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *OrgCreate) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -97,6 +103,7 @@ func (o *OrgCreate) SetDisplayName(v string) { o.DisplayName = &v } + // GetName returns the Name field value. func (o *OrgCreate) GetName() string { if o == nil { @@ -120,6 +127,8 @@ func (o *OrgCreate) SetName(v string) { o.Name = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -145,7 +154,7 @@ func (o *OrgCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - Name *string `json:"name"` + Name *string `json:"name"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -155,7 +164,7 @@ func (o *OrgCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "displayName", "name"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "displayName", "name", }) } else { return err } diff --git a/api/kbcloud/model_org_list.go b/api/kbcloud/model_org_list.go index 30cb662d..15fb5b88 100644 --- a/api/kbcloud/model_org_list.go +++ b/api/kbcloud/model_org_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgList OrgList is a list of Orgs + + +// OrgList OrgList is a list of Orgs type OrgList struct { // Items is the list of Org objects in the list Items []Org `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgList instantiates a new OrgList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOrgListWithDefaults() *OrgList { this := OrgList{} return &this } - // GetItems returns the Items field value. func (o *OrgList) GetItems() []Org { if o == nil { @@ -62,6 +67,7 @@ func (o *OrgList) SetItems(v []Org) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *OrgList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *OrgList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,7 +118,7 @@ func (o OrgList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]Org `json:"items"` + Items *[]Org `json:"items"` PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -121,14 +129,14 @@ func (o *OrgList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_org_member.go b/api/kbcloud/model_org_member.go index 8e82a8fe..951b7898 100644 --- a/api/kbcloud/model_org_member.go +++ b/api/kbcloud/model_org_member.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgMember Org Member info + + +// OrgMember Org Member info type OrgMember struct { // The display name of User. Read-Only DisplayName *string `json:"displayName,omitempty"` @@ -23,10 +28,11 @@ type OrgMember struct { // Return true if the member is freezed in the organization Freezed bool `json:"freezed"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgMember instantiates a new OrgMember object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -47,7 +53,6 @@ func NewOrgMemberWithDefaults() *OrgMember { this := OrgMember{} return &this } - // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *OrgMember) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -76,6 +81,7 @@ func (o *OrgMember) SetDisplayName(v string) { o.DisplayName = &v } + // GetEmail returns the Email field value. func (o *OrgMember) GetEmail() string { if o == nil { @@ -99,6 +105,7 @@ func (o *OrgMember) SetEmail(v string) { o.Email = v } + // GetRole returns the Role field value. func (o *OrgMember) GetRole() OrgMemberRole { if o == nil { @@ -122,6 +129,7 @@ func (o *OrgMember) SetRole(v OrgMemberRole) { o.Role = v } + // GetUserId returns the UserId field value. func (o *OrgMember) GetUserId() string { if o == nil { @@ -145,6 +153,7 @@ func (o *OrgMember) SetUserId(v string) { o.UserId = v } + // GetFreezed returns the Freezed field value. func (o *OrgMember) GetFreezed() bool { if o == nil { @@ -168,6 +177,8 @@ func (o *OrgMember) SetFreezed(v bool) { o.Freezed = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgMember) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -191,11 +202,11 @@ func (o OrgMember) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgMember) UnmarshalJSON(bytes []byte) (err error) { all := struct { - DisplayName *string `json:"displayName,omitempty"` - Email *string `json:"email"` - Role *OrgMemberRole `json:"role"` - UserId *string `json:"userId"` - Freezed *bool `json:"freezed"` + DisplayName *string `json:"displayName,omitempty"` + Email *string `json:"email"` + Role *OrgMemberRole `json:"role"` + UserId *string `json:"userId"` + Freezed *bool `json:"freezed"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -214,7 +225,7 @@ func (o *OrgMember) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"displayName", "email", "role", "userId", "freezed"}) + common.DeleteKeys(additionalProperties, &[]string{ "displayName", "email", "role", "userId", "freezed", }) } else { return err } diff --git a/api/kbcloud/model_org_member_add.go b/api/kbcloud/model_org_member_add.go index a944519d..6f4c749d 100644 --- a/api/kbcloud/model_org_member_add.go +++ b/api/kbcloud/model_org_member_add.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgMemberAdd MemberAdd is the payload for adding organization member + + +// OrgMemberAdd MemberAdd is the payload for adding organization member type OrgMemberAdd struct { // The name of the role in the organization Role string `json:"role"` // The ID of the user UserId string `json:"userId"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgMemberAdd instantiates a new OrgMemberAdd object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewOrgMemberAddWithDefaults() *OrgMemberAdd { this := OrgMemberAdd{} return &this } - // GetRole returns the Role field value. func (o *OrgMemberAdd) GetRole() string { if o == nil { @@ -63,6 +68,7 @@ func (o *OrgMemberAdd) SetRole(v string) { o.Role = v } + // GetUserId returns the UserId field value. func (o *OrgMemberAdd) GetUserId() string { if o == nil { @@ -86,6 +92,8 @@ func (o *OrgMemberAdd) SetUserId(v string) { o.UserId = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgMemberAdd) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,7 +112,7 @@ func (o OrgMemberAdd) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgMemberAdd) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Role *string `json:"role"` + Role *string `json:"role"` UserId *string `json:"userId"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,7 +126,7 @@ func (o *OrgMemberAdd) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"role", "userId"}) + common.DeleteKeys(additionalProperties, &[]string{ "role", "userId", }) } else { return err } diff --git a/api/kbcloud/model_org_member_list.go b/api/kbcloud/model_org_member_list.go index b7872f9c..1404088f 100644 --- a/api/kbcloud/model_org_member_list.go +++ b/api/kbcloud/model_org_member_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgMemberList OrgMemberList is org member list + + +// OrgMemberList OrgMemberList is org member list type OrgMemberList struct { // Items is the list of OrgMember objects in the list Items []OrgMember `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgMemberList instantiates a new OrgMemberList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewOrgMemberListWithDefaults() *OrgMemberList { this := OrgMemberList{} return &this } - // GetItems returns the Items field value. func (o *OrgMemberList) GetItems() []OrgMember { if o == nil { @@ -62,6 +67,7 @@ func (o *OrgMemberList) SetItems(v []OrgMember) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *OrgMemberList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *OrgMemberList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgMemberList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o OrgMemberList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgMemberList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]OrgMember `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]OrgMember `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *OrgMemberList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_org_member_role.go b/api/kbcloud/model_org_member_role.go index cefa0d5f..b1553228 100644 --- a/api/kbcloud/model_org_member_role.go +++ b/api/kbcloud/model_org_member_role.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // OrgMemberRole The role of the User in the Org. Required type OrgMemberRole string // List of OrgMemberRole. const ( - OrgMemberRoleAdmin OrgMemberRole = "admin" + OrgMemberRoleAdmin OrgMemberRole = "admin" OrgMemberRoleDeveloper OrgMemberRole = "developer" ) diff --git a/api/kbcloud/model_org_member_update.go b/api/kbcloud/model_org_member_update.go index c241c479..c497c4d0 100644 --- a/api/kbcloud/model_org_member_update.go +++ b/api/kbcloud/model_org_member_update.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// OrgMemberUpdate Org Member update + + +// OrgMemberUpdate Org Member update type OrgMemberUpdate struct { // The role of the User in the Org. Required Role string `json:"role"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgMemberUpdate instantiates a new OrgMemberUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewOrgMemberUpdateWithDefaults() *OrgMemberUpdate { this := OrgMemberUpdate{} return &this } - // GetRole returns the Role field value. func (o *OrgMemberUpdate) GetRole() string { if o == nil { @@ -60,6 +65,8 @@ func (o *OrgMemberUpdate) SetRole(v string) { o.Role = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgMemberUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *OrgMemberUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"role"}) + common.DeleteKeys(additionalProperties, &[]string{ "role", }) } else { return err } diff --git a/api/kbcloud/model_org_tags_list.go b/api/kbcloud/model_org_tags_list.go index 1ec29da8..5ac7fcd7 100644 --- a/api/kbcloud/model_org_tags_list.go +++ b/api/kbcloud/model_org_tags_list.go @@ -2,21 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type OrgTagsList struct { Items []Tag `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgTagsList instantiates a new OrgTagsList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +40,6 @@ func NewOrgTagsListWithDefaults() *OrgTagsList { this := OrgTagsList{} return &this } - // GetItems returns the Items field value. func (o *OrgTagsList) GetItems() []Tag { if o == nil { @@ -58,6 +63,8 @@ func (o *OrgTagsList) SetItems(v []Tag) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgTagsList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +92,7 @@ func (o *OrgTagsList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_org_update.go b/api/kbcloud/model_org_update.go index 40bae72f..2e6e0840 100644 --- a/api/kbcloud/model_org_update.go +++ b/api/kbcloud/model_org_update.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// OrgUpdate Organization update +// OrgUpdate Organization update type OrgUpdate struct { // The description of the organization Description *string `json:"description,omitempty"` // The display name of the organization DisplayName *string `json:"displayName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOrgUpdate instantiates a new OrgUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewOrgUpdateWithDefaults() *OrgUpdate { this := OrgUpdate{} return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *OrgUpdate) GetDescription() string { if o == nil || o.Description == nil { @@ -62,6 +71,7 @@ func (o *OrgUpdate) SetDescription(v string) { o.Description = &v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *OrgUpdate) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -90,6 +100,8 @@ func (o *OrgUpdate) SetDisplayName(v string) { o.DisplayName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o OrgUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -120,7 +132,7 @@ func (o *OrgUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "displayName"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "displayName", }) } else { return err } diff --git a/api/kbcloud/model_owner.go b/api/kbcloud/model_owner.go index 21ee8123..51fb3639 100644 --- a/api/kbcloud/model_owner.go +++ b/api/kbcloud/model_owner.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// Owner Owner related to the Event + + +// Owner Owner related to the Event type Owner struct { // APIVersion is the API version of the owner. ApiVersion *string `json:"apiVersion,omitempty"` @@ -17,10 +26,11 @@ type Owner struct { // UID is the unique identifier of the owner. Uid *string `json:"uid,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewOwner instantiates a new Owner object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewOwnerWithDefaults() *Owner { this := Owner{} return &this } - // GetApiVersion returns the ApiVersion field value if set, zero value otherwise. func (o *Owner) GetApiVersion() string { if o == nil || o.ApiVersion == nil { @@ -66,6 +75,7 @@ func (o *Owner) SetApiVersion(v string) { o.ApiVersion = &v } + // GetKind returns the Kind field value if set, zero value otherwise. func (o *Owner) GetKind() string { if o == nil || o.Kind == nil { @@ -94,6 +104,7 @@ func (o *Owner) SetKind(v string) { o.Kind = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Owner) GetName() string { if o == nil || o.Name == nil { @@ -122,6 +133,7 @@ func (o *Owner) SetName(v string) { o.Name = &v } + // GetUid returns the Uid field value if set, zero value otherwise. func (o *Owner) GetUid() string { if o == nil || o.Uid == nil { @@ -150,6 +162,8 @@ func (o *Owner) SetUid(v string) { o.Uid = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Owner) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -179,16 +193,16 @@ func (o Owner) MarshalJSON() ([]byte, error) { func (o *Owner) UnmarshalJSON(bytes []byte) (err error) { all := struct { ApiVersion *string `json:"apiVersion,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - Uid *string `json:"uid,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Uid *string `json:"uid,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"apiVersion", "kind", "name", "uid"}) + common.DeleteKeys(additionalProperties, &[]string{ "apiVersion", "kind", "name", "uid", }) } else { return err } diff --git a/api/kbcloud/model_page_result.go b/api/kbcloud/model_page_result.go index e4d0a4b3..6942a6d9 100644 --- a/api/kbcloud/model_page_result.go +++ b/api/kbcloud/model_page_result.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// PageResult PageResult info + +// PageResult PageResult info type PageResult struct { // a link to the first page of results. This link is optional for collections that cannot be indexed directly to a given page First *string `json:"first,omitempty"` @@ -19,10 +28,11 @@ type PageResult struct { // the total count of items in the list irrespective of pagination TotalSize *int64 `json:"totalSize,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPageResult instantiates a new PageResult object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewPageResultWithDefaults() *PageResult { this := PageResult{} return &this } - // GetFirst returns the First field value if set, zero value otherwise. func (o *PageResult) GetFirst() string { if o == nil || o.First == nil { @@ -68,6 +77,7 @@ func (o *PageResult) SetFirst(v string) { o.First = &v } + // GetLast returns the Last field value if set, zero value otherwise. func (o *PageResult) GetLast() string { if o == nil || o.Last == nil { @@ -96,6 +106,7 @@ func (o *PageResult) SetLast(v string) { o.Last = &v } + // GetNext returns the Next field value if set, zero value otherwise. func (o *PageResult) GetNext() string { if o == nil || o.Next == nil { @@ -124,6 +135,7 @@ func (o *PageResult) SetNext(v string) { o.Next = &v } + // GetPrev returns the Prev field value if set, zero value otherwise. func (o *PageResult) GetPrev() string { if o == nil || o.Prev == nil { @@ -152,6 +164,7 @@ func (o *PageResult) SetPrev(v string) { o.Prev = &v } + // GetTotalSize returns the TotalSize field value if set, zero value otherwise. func (o *PageResult) GetTotalSize() int64 { if o == nil || o.TotalSize == nil { @@ -180,6 +193,8 @@ func (o *PageResult) SetTotalSize(v int64) { o.TotalSize = &v } + + // MarshalJSON serializes the struct using spec logic. func (o PageResult) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,18 +226,18 @@ func (o PageResult) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PageResult) UnmarshalJSON(bytes []byte) (err error) { all := struct { - First *string `json:"first,omitempty"` - Last *string `json:"last,omitempty"` - Next *string `json:"next,omitempty"` - Prev *string `json:"prev,omitempty"` - TotalSize *int64 `json:"totalSize,omitempty"` + First *string `json:"first,omitempty"` + Last *string `json:"last,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` + TotalSize *int64 `json:"totalSize,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"first", "last", "next", "prev", "totalSize"}) + common.DeleteKeys(additionalProperties, &[]string{ "first", "last", "next", "prev", "totalSize", }) } else { return err } diff --git a/api/kbcloud/model_pagination.go b/api/kbcloud/model_pagination.go index 29a200c2..3cc47eb9 100644 --- a/api/kbcloud/model_pagination.go +++ b/api/kbcloud/model_pagination.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Pagination struct { - RowsCount *int32 `json:"rows_count,omitempty"` - Page *int32 `json:"page,omitempty"` + RowsCount *int32 `json:"rows_count,omitempty"` + Page *int32 `json:"page,omitempty"` PagesCount *int32 `json:"pages_count,omitempty"` - PerPage *int32 `json:"per_page,omitempty"` + PerPage *int32 `json:"per_page,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPagination instantiates a new Pagination object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewPaginationWithDefaults() *Pagination { this := Pagination{} return &this } - // GetRowsCount returns the RowsCount field value if set, zero value otherwise. func (o *Pagination) GetRowsCount() int32 { if o == nil || o.RowsCount == nil { @@ -61,6 +70,7 @@ func (o *Pagination) SetRowsCount(v int32) { o.RowsCount = &v } + // GetPage returns the Page field value if set, zero value otherwise. func (o *Pagination) GetPage() int32 { if o == nil || o.Page == nil { @@ -89,6 +99,7 @@ func (o *Pagination) SetPage(v int32) { o.Page = &v } + // GetPagesCount returns the PagesCount field value if set, zero value otherwise. func (o *Pagination) GetPagesCount() int32 { if o == nil || o.PagesCount == nil { @@ -117,6 +128,7 @@ func (o *Pagination) SetPagesCount(v int32) { o.PagesCount = &v } + // GetPerPage returns the PerPage field value if set, zero value otherwise. func (o *Pagination) GetPerPage() int32 { if o == nil || o.PerPage == nil { @@ -145,6 +157,8 @@ func (o *Pagination) SetPerPage(v int32) { o.PerPage = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Pagination) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -173,17 +187,17 @@ func (o Pagination) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Pagination) UnmarshalJSON(bytes []byte) (err error) { all := struct { - RowsCount *int32 `json:"rows_count,omitempty"` - Page *int32 `json:"page,omitempty"` + RowsCount *int32 `json:"rows_count,omitempty"` + Page *int32 `json:"page,omitempty"` PagesCount *int32 `json:"pages_count,omitempty"` - PerPage *int32 `json:"per_page,omitempty"` + PerPage *int32 `json:"per_page,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"rows_count", "page", "pages_count", "per_page"}) + common.DeleteKeys(additionalProperties, &[]string{ "rows_count", "page", "pages_count", "per_page", }) } else { return err } diff --git a/api/kbcloud/model_param_tpl_appl_to_cluster_list.go b/api/kbcloud/model_param_tpl_appl_to_cluster_list.go index 9db50385..90475b91 100644 --- a/api/kbcloud/model_param_tpl_appl_to_cluster_list.go +++ b/api/kbcloud/model_param_tpl_appl_to_cluster_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplApplToClusterList paramTplAPPLToClusterList is a list of parameter templates applicable to the cluster + + +// ParamTplApplToClusterList paramTplAPPLToClusterList is a list of parameter templates applicable to the cluster type ParamTplApplToClusterList struct { // Items is the list of parameter templates applicable to the cluster objects in the list Items []ParamTplApplToClusterListItem `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplApplToClusterList instantiates a new ParamTplApplToClusterList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewParamTplApplToClusterListWithDefaults() *ParamTplApplToClusterList { this := ParamTplApplToClusterList{} return &this } - // GetItems returns the Items field value. func (o *ParamTplApplToClusterList) GetItems() []ParamTplApplToClusterListItem { if o == nil { @@ -62,6 +67,7 @@ func (o *ParamTplApplToClusterList) SetItems(v []ParamTplApplToClusterListItem) o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *ParamTplApplToClusterList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *ParamTplApplToClusterList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplApplToClusterList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o ParamTplApplToClusterList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplApplToClusterList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]ParamTplApplToClusterListItem `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]ParamTplApplToClusterListItem `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *ParamTplApplToClusterList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_param_tpl_appl_to_cluster_list_item.go b/api/kbcloud/model_param_tpl_appl_to_cluster_list_item.go index 9050dafb..32a95021 100644 --- a/api/kbcloud/model_param_tpl_appl_to_cluster_list_item.go +++ b/api/kbcloud/model_param_tpl_appl_to_cluster_list_item.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplApplToClusterListItem parameter template applicable to the cluster information + + +// ParamTplApplToClusterListItem parameter template applicable to the cluster information type ParamTplApplToClusterListItem struct { // The number of parameters in the parameter template Count int32 `json:"count"` @@ -21,10 +26,11 @@ type ParamTplApplToClusterListItem struct { // the template partition Partition string `json:"partition"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplApplToClusterListItem instantiates a new ParamTplApplToClusterListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -45,7 +51,6 @@ func NewParamTplApplToClusterListItemWithDefaults() *ParamTplApplToClusterListIt this := ParamTplApplToClusterListItem{} return &this } - // GetCount returns the Count field value. func (o *ParamTplApplToClusterListItem) GetCount() int32 { if o == nil { @@ -69,6 +74,7 @@ func (o *ParamTplApplToClusterListItem) SetCount(v int32) { o.Count = v } + // GetName returns the Name field value. func (o *ParamTplApplToClusterListItem) GetName() string { if o == nil { @@ -92,6 +98,7 @@ func (o *ParamTplApplToClusterListItem) SetName(v string) { o.Name = v } + // GetNeedRestart returns the NeedRestart field value. func (o *ParamTplApplToClusterListItem) GetNeedRestart() bool { if o == nil { @@ -115,6 +122,7 @@ func (o *ParamTplApplToClusterListItem) SetNeedRestart(v bool) { o.NeedRestart = v } + // GetPartition returns the Partition field value. func (o *ParamTplApplToClusterListItem) GetPartition() string { if o == nil { @@ -138,6 +146,8 @@ func (o *ParamTplApplToClusterListItem) SetPartition(v string) { o.Partition = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplApplToClusterListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -158,10 +168,10 @@ func (o ParamTplApplToClusterListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplApplToClusterListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Count *int32 `json:"count"` - Name *string `json:"name"` - NeedRestart *bool `json:"needRestart"` - Partition *string `json:"partition"` + Count *int32 `json:"count"` + Name *string `json:"name"` + NeedRestart *bool `json:"needRestart"` + Partition *string `json:"partition"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -180,7 +190,7 @@ func (o *ParamTplApplToClusterListItem) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"count", "name", "needRestart", "partition"}) + common.DeleteKeys(additionalProperties, &[]string{ "count", "name", "needRestart", "partition", }) } else { return err } diff --git a/api/kbcloud/model_param_tpl_create.go b/api/kbcloud/model_param_tpl_create.go index 6a39cb62..02243678 100644 --- a/api/kbcloud/model_param_tpl_create.go +++ b/api/kbcloud/model_param_tpl_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplCreate parameter template create + + +// ParamTplCreate parameter template create type ParamTplCreate struct { // Description of parameter template Description string `json:"description"` @@ -23,10 +28,11 @@ type ParamTplCreate struct { // Determines whether the user can see this parameter template IsPrivate *bool `json:"isPrivate,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplCreate instantiates a new ParamTplCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +52,6 @@ func NewParamTplCreateWithDefaults() *ParamTplCreate { this := ParamTplCreate{} return &this } - // GetDescription returns the Description field value. func (o *ParamTplCreate) GetDescription() string { if o == nil { @@ -70,6 +75,7 @@ func (o *ParamTplCreate) SetDescription(v string) { o.Description = v } + // GetFamily returns the Family field value. func (o *ParamTplCreate) GetFamily() string { if o == nil { @@ -93,6 +99,7 @@ func (o *ParamTplCreate) SetFamily(v string) { o.Family = v } + // GetName returns the Name field value. func (o *ParamTplCreate) GetName() string { if o == nil { @@ -116,6 +123,7 @@ func (o *ParamTplCreate) SetName(v string) { o.Name = v } + // GetCustomName returns the CustomName field value if set, zero value otherwise. func (o *ParamTplCreate) GetCustomName() string { if o == nil || o.CustomName == nil { @@ -144,6 +152,7 @@ func (o *ParamTplCreate) SetCustomName(v string) { o.CustomName = &v } + // GetIsPrivate returns the IsPrivate field value if set, zero value otherwise. func (o *ParamTplCreate) GetIsPrivate() bool { if o == nil || o.IsPrivate == nil { @@ -172,6 +181,8 @@ func (o *ParamTplCreate) SetIsPrivate(v bool) { o.IsPrivate = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -198,10 +209,10 @@ func (o ParamTplCreate) MarshalJSON() ([]byte, error) { func (o *ParamTplCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { Description *string `json:"description"` - Family *string `json:"family"` - Name *string `json:"name"` - CustomName *string `json:"customName,omitempty"` - IsPrivate *bool `json:"isPrivate,omitempty"` + Family *string `json:"family"` + Name *string `json:"name"` + CustomName *string `json:"customName,omitempty"` + IsPrivate *bool `json:"isPrivate,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -217,7 +228,7 @@ func (o *ParamTplCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "family", "name", "customName", "isPrivate"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "family", "name", "customName", "isPrivate", }) } else { return err } diff --git a/api/kbcloud/model_param_tpl_create_from_cluster.go b/api/kbcloud/model_param_tpl_create_from_cluster.go index d06f516b..34a9ac47 100644 --- a/api/kbcloud/model_param_tpl_create_from_cluster.go +++ b/api/kbcloud/model_param_tpl_create_from_cluster.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplCreateFromCluster parameter template create + + +// ParamTplCreateFromCluster parameter template create type ParamTplCreateFromCluster struct { // Description of parameter template Description string `json:"description"` @@ -21,10 +26,11 @@ type ParamTplCreateFromCluster struct { // database engine Version EngineVersion *string `json:"engineVersion,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplCreateFromCluster instantiates a new ParamTplCreateFromCluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +49,6 @@ func NewParamTplCreateFromClusterWithDefaults() *ParamTplCreateFromCluster { this := ParamTplCreateFromCluster{} return &this } - // GetDescription returns the Description field value. func (o *ParamTplCreateFromCluster) GetDescription() string { if o == nil { @@ -67,6 +72,7 @@ func (o *ParamTplCreateFromCluster) SetDescription(v string) { o.Description = v } + // GetName returns the Name field value. func (o *ParamTplCreateFromCluster) GetName() string { if o == nil { @@ -90,6 +96,7 @@ func (o *ParamTplCreateFromCluster) SetName(v string) { o.Name = v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ParamTplCreateFromCluster) GetComponent() string { if o == nil || o.Component == nil { @@ -118,6 +125,7 @@ func (o *ParamTplCreateFromCluster) SetComponent(v string) { o.Component = &v } + // GetEngineVersion returns the EngineVersion field value if set, zero value otherwise. func (o *ParamTplCreateFromCluster) GetEngineVersion() string { if o == nil || o.EngineVersion == nil { @@ -146,6 +154,8 @@ func (o *ParamTplCreateFromCluster) SetEngineVersion(v string) { o.EngineVersion = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplCreateFromCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -170,9 +180,9 @@ func (o ParamTplCreateFromCluster) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplCreateFromCluster) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Description *string `json:"description"` - Name *string `json:"name"` - Component *string `json:"component,omitempty"` + Description *string `json:"description"` + Name *string `json:"name"` + Component *string `json:"component,omitempty"` EngineVersion *string `json:"engineVersion,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -186,7 +196,7 @@ func (o *ParamTplCreateFromCluster) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description", "name", "component", "engineVersion"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", "name", "component", "engineVersion", }) } else { return err } diff --git a/api/kbcloud/model_param_tpl_get.go b/api/kbcloud/model_param_tpl_get.go index 41a9ade2..8a651cec 100644 --- a/api/kbcloud/model_param_tpl_get.go +++ b/api/kbcloud/model_param_tpl_get.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ParamTplGet paramTplGet is the response of get parameter template request +// ParamTplGet paramTplGet is the response of get parameter template request type ParamTplGet struct { Items []ParamTplGetItem `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplGet instantiates a new ParamTplGet object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewParamTplGetWithDefaults() *ParamTplGet { this := ParamTplGet{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ParamTplGet) GetItems() []ParamTplGetItem { if o == nil || o.Items == nil { @@ -59,6 +68,8 @@ func (o *ParamTplGet) SetItems(v []ParamTplGetItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplGet) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *ParamTplGet) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_param_tpl_get_item.go b/api/kbcloud/model_param_tpl_get_item.go index 249dcfc5..15ad9f0b 100644 --- a/api/kbcloud/model_param_tpl_get_item.go +++ b/api/kbcloud/model_param_tpl_get_item.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplGetItem paramTplGetItem is a list of get parameter template and parameterSpec + + +// ParamTplGetItem paramTplGetItem is a list of get parameter template and parameterSpec type ParamTplGetItem struct { // The name of the configuration spec SpecName string `json:"specName"` @@ -19,10 +24,11 @@ type ParamTplGetItem struct { // With the list of parameterSpecs and the configuration file name ParameterSpec ParameterSpecListItem `json:"parameterSpec"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplGetItem instantiates a new ParamTplGetItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +48,6 @@ func NewParamTplGetItemWithDefaults() *ParamTplGetItem { this := ParamTplGetItem{} return &this } - // GetSpecName returns the SpecName field value. func (o *ParamTplGetItem) GetSpecName() string { if o == nil { @@ -66,6 +71,7 @@ func (o *ParamTplGetItem) SetSpecName(v string) { o.SpecName = v } + // GetConfig returns the Config field value. func (o *ParamTplGetItem) GetConfig() ConfigurationWithRegex { if o == nil { @@ -89,6 +95,7 @@ func (o *ParamTplGetItem) SetConfig(v ConfigurationWithRegex) { o.Config = v } + // GetParameterSpec returns the ParameterSpec field value. func (o *ParamTplGetItem) GetParameterSpec() ParameterSpecListItem { if o == nil { @@ -112,6 +119,8 @@ func (o *ParamTplGetItem) SetParameterSpec(v ParameterSpecListItem) { o.ParameterSpec = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplGetItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -131,9 +140,9 @@ func (o ParamTplGetItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplGetItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - SpecName *string `json:"specName"` - Config *ConfigurationWithRegex `json:"config"` - ParameterSpec *ParameterSpecListItem `json:"parameterSpec"` + SpecName *string `json:"specName"` + Config *ConfigurationWithRegex `json:"config"` + ParameterSpec *ParameterSpecListItem `json:"parameterSpec"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -149,7 +158,7 @@ func (o *ParamTplGetItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"specName", "config", "parameterSpec"}) + common.DeleteKeys(additionalProperties, &[]string{ "specName", "config", "parameterSpec", }) } else { return err } diff --git a/api/kbcloud/model_param_tpl_list.go b/api/kbcloud/model_param_tpl_list.go index 7cbde730..a1f7d81b 100644 --- a/api/kbcloud/model_param_tpl_list.go +++ b/api/kbcloud/model_param_tpl_list.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplList paramTplList is a list of parameter templates + + +// ParamTplList paramTplList is a list of parameter templates type ParamTplList struct { // Items is the list of parameter templates objects in the list Items []ParamTplListItem `json:"items"` // PageResult info PageResult *PageResult `json:"pageResult,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplList instantiates a new ParamTplList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewParamTplListWithDefaults() *ParamTplList { this := ParamTplList{} return &this } - // GetItems returns the Items field value. func (o *ParamTplList) GetItems() []ParamTplListItem { if o == nil { @@ -62,6 +67,7 @@ func (o *ParamTplList) SetItems(v []ParamTplListItem) { o.Items = v } + // GetPageResult returns the PageResult field value if set, zero value otherwise. func (o *ParamTplList) GetPageResult() PageResult { if o == nil || o.PageResult == nil { @@ -90,6 +96,8 @@ func (o *ParamTplList) SetPageResult(v PageResult) { o.PageResult = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -110,8 +118,8 @@ func (o ParamTplList) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplList) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items *[]ParamTplListItem `json:"items"` - PageResult *PageResult `json:"pageResult,omitempty"` + Items *[]ParamTplListItem `json:"items"` + PageResult *PageResult `json:"pageResult,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,14 +129,14 @@ func (o *ParamTplList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "pageResult"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "pageResult", }) } else { return err } hasInvalidField := false o.Items = *all.Items - if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { + if all.PageResult != nil && all.PageResult.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.PageResult = all.PageResult diff --git a/api/kbcloud/model_param_tpl_list_item.go b/api/kbcloud/model_param_tpl_list_item.go index 2d9cc509..a3fb7081 100644 --- a/api/kbcloud/model_param_tpl_list_item.go +++ b/api/kbcloud/model_param_tpl_list_item.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParamTplListItem parameter template information + + +// ParamTplListItem parameter template information type ParamTplListItem struct { // Name of the organization OrgName *string `json:"orgName,omitempty"` @@ -32,10 +36,11 @@ type ParamTplListItem struct { // Populated by the system. Read-only. Null for lists UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplListItem instantiates a new ParamTplListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +61,6 @@ func NewParamTplListItemWithDefaults() *ParamTplListItem { this := ParamTplListItem{} return &this } - // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *ParamTplListItem) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -85,6 +89,7 @@ func (o *ParamTplListItem) SetOrgName(v string) { o.OrgName = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *ParamTplListItem) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -113,6 +118,7 @@ func (o *ParamTplListItem) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetDescription returns the Description field value. func (o *ParamTplListItem) GetDescription() string { if o == nil { @@ -136,6 +142,7 @@ func (o *ParamTplListItem) SetDescription(v string) { o.Description = v } + // GetFamily returns the Family field value. func (o *ParamTplListItem) GetFamily() string { if o == nil { @@ -159,6 +166,7 @@ func (o *ParamTplListItem) SetFamily(v string) { o.Family = v } + // GetName returns the Name field value. func (o *ParamTplListItem) GetName() string { if o == nil { @@ -182,6 +190,7 @@ func (o *ParamTplListItem) SetName(v string) { o.Name = v } + // GetPartition returns the Partition field value. func (o *ParamTplListItem) GetPartition() string { if o == nil { @@ -205,6 +214,7 @@ func (o *ParamTplListItem) SetPartition(v string) { o.Partition = v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *ParamTplListItem) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -233,6 +243,8 @@ func (o *ParamTplListItem) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -270,13 +282,13 @@ func (o ParamTplListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - OrgName *string `json:"orgName,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Description *string `json:"description"` - Family *string `json:"family"` - Name *string `json:"name"` - Partition *string `json:"partition"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + OrgName *string `json:"orgName,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Description *string `json:"description"` + Family *string `json:"family"` + Name *string `json:"name"` + Partition *string `json:"partition"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -295,7 +307,7 @@ func (o *ParamTplListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"orgName", "createdAt", "description", "family", "name", "partition", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "orgName", "createdAt", "description", "family", "name", "partition", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/model_param_tpl_partition.go b/api/kbcloud/model_param_tpl_partition.go index 84561e16..91d73d00 100644 --- a/api/kbcloud/model_param_tpl_partition.go +++ b/api/kbcloud/model_param_tpl_partition.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ParamTplPartition string // List of ParamTplPartition. const ( ParamTplPartitionDefault ParamTplPartition = "default" - ParamTplPartitionCustom ParamTplPartition = "custom" + ParamTplPartitionCustom ParamTplPartition = "custom" ) var allowedParamTplPartitionEnumValues = []ParamTplPartition{ diff --git a/api/kbcloud/model_param_tpl_update.go b/api/kbcloud/model_param_tpl_update.go index 8866db69..736e1203 100644 --- a/api/kbcloud/model_param_tpl_update.go +++ b/api/kbcloud/model_param_tpl_update.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// ParamTplUpdate paramTplUpdate is the payload to update a parameter template + + +// ParamTplUpdate paramTplUpdate is the payload to update a parameter template type ParamTplUpdate struct { // Specify parameters belongs to which spec SpecName *string `json:"specName,omitempty"` @@ -15,10 +24,11 @@ type ParamTplUpdate struct { // Specify parameters list to be updated Parameters map[string]string `json:"parameters,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplUpdate instantiates a new ParamTplUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewParamTplUpdateWithDefaults() *ParamTplUpdate { this := ParamTplUpdate{} return &this } - // GetSpecName returns the SpecName field value if set, zero value otherwise. func (o *ParamTplUpdate) GetSpecName() string { if o == nil || o.SpecName == nil { @@ -64,6 +73,7 @@ func (o *ParamTplUpdate) SetSpecName(v string) { o.SpecName = &v } + // GetConfigFile returns the ConfigFile field value if set, zero value otherwise. func (o *ParamTplUpdate) GetConfigFile() string { if o == nil || o.ConfigFile == nil { @@ -92,6 +102,7 @@ func (o *ParamTplUpdate) SetConfigFile(v string) { o.ConfigFile = &v } + // GetParameters returns the Parameters field value if set, zero value otherwise. func (o *ParamTplUpdate) GetParameters() map[string]string { if o == nil || o.Parameters == nil { @@ -120,6 +131,8 @@ func (o *ParamTplUpdate) SetParameters(v map[string]string) { o.Parameters = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -145,8 +158,8 @@ func (o ParamTplUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - SpecName *string `json:"specName,omitempty"` - ConfigFile *string `json:"configFile,omitempty"` + SpecName *string `json:"specName,omitempty"` + ConfigFile *string `json:"configFile,omitempty"` Parameters map[string]string `json:"parameters,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -154,7 +167,7 @@ func (o *ParamTplUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"specName", "configFile", "parameters"}) + common.DeleteKeys(additionalProperties, &[]string{ "specName", "configFile", "parameters", }) } else { return err } diff --git a/api/kbcloud/model_param_tpls_item.go b/api/kbcloud/model_param_tpls_item.go index 983ee7f2..eb2dbd5d 100644 --- a/api/kbcloud/model_param_tpls_item.go +++ b/api/kbcloud/model_param_tpls_item.go @@ -2,24 +2,34 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// ParamTplsItem the item of the parameter template + + +// ParamTplsItem the item of the parameter template type ParamTplsItem struct { // component type, refer to componentDef and support NamePrefix, Deprecated. ComponentDefRef *string `json:"componentDefRef,omitempty"` // component type, refer to componentDef and support NamePrefix Component *string `json:"component,omitempty"` // name of assigned parameter template - ParamTplName *string `json:"paramTplName,omitempty"` + ParamTplName *string `json:"paramTplName,omitempty"` ParamTplPartition *ParamTplPartition `json:"paramTplPartition,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParamTplsItem instantiates a new ParamTplsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +46,6 @@ func NewParamTplsItemWithDefaults() *ParamTplsItem { this := ParamTplsItem{} return &this } - // GetComponentDefRef returns the ComponentDefRef field value if set, zero value otherwise. func (o *ParamTplsItem) GetComponentDefRef() string { if o == nil || o.ComponentDefRef == nil { @@ -65,6 +74,7 @@ func (o *ParamTplsItem) SetComponentDefRef(v string) { o.ComponentDefRef = &v } + // GetComponent returns the Component field value if set, zero value otherwise. func (o *ParamTplsItem) GetComponent() string { if o == nil || o.Component == nil { @@ -93,6 +103,7 @@ func (o *ParamTplsItem) SetComponent(v string) { o.Component = &v } + // GetParamTplName returns the ParamTplName field value if set, zero value otherwise. func (o *ParamTplsItem) GetParamTplName() string { if o == nil || o.ParamTplName == nil { @@ -121,6 +132,7 @@ func (o *ParamTplsItem) SetParamTplName(v string) { o.ParamTplName = &v } + // GetParamTplPartition returns the ParamTplPartition field value if set, zero value otherwise. func (o *ParamTplsItem) GetParamTplPartition() ParamTplPartition { if o == nil || o.ParamTplPartition == nil { @@ -149,6 +161,8 @@ func (o *ParamTplsItem) SetParamTplPartition(v ParamTplPartition) { o.ParamTplPartition = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParamTplsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -177,9 +191,9 @@ func (o ParamTplsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParamTplsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ComponentDefRef *string `json:"componentDefRef,omitempty"` - Component *string `json:"component,omitempty"` - ParamTplName *string `json:"paramTplName,omitempty"` + ComponentDefRef *string `json:"componentDefRef,omitempty"` + Component *string `json:"component,omitempty"` + ParamTplName *string `json:"paramTplName,omitempty"` ParamTplPartition *ParamTplPartition `json:"paramTplPartition,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -187,7 +201,7 @@ func (o *ParamTplsItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"componentDefRef", "component", "paramTplName", "paramTplPartition"}) + common.DeleteKeys(additionalProperties, &[]string{ "componentDefRef", "component", "paramTplName", "paramTplPartition", }) } else { return err } @@ -196,7 +210,7 @@ func (o *ParamTplsItem) UnmarshalJSON(bytes []byte) (err error) { o.ComponentDefRef = all.ComponentDefRef o.Component = all.Component o.ParamTplName = all.ParamTplName - if all.ParamTplPartition != nil && !all.ParamTplPartition.IsValid() { + if all.ParamTplPartition != nil &&!all.ParamTplPartition.IsValid() { hasInvalidField = true } else { o.ParamTplPartition = all.ParamTplPartition diff --git a/api/kbcloud/model_parameter_config.go b/api/kbcloud/model_parameter_config.go index ed460777..5fe4a8eb 100644 --- a/api/kbcloud/model_parameter_config.go +++ b/api/kbcloud/model_parameter_config.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ParameterConfig struct { - ConfigName string `json:"configName"` - SpecName string `json:"specName"` - Constraint string `json:"constraint"` - Regex string `json:"regex"` - ConfigTplName string `json:"configTplName"` - InitOptions map[string]interface{} `json:"initOptions,omitempty"` + ConfigName string `json:"configName"` + SpecName string `json:"specName"` + Constraint string `json:"constraint"` + Regex string `json:"regex"` + ConfigTplName string `json:"configTplName"` + InitOptions map[string]interface{} `json:"initOptions,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterConfig instantiates a new ParameterConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +49,6 @@ func NewParameterConfigWithDefaults() *ParameterConfig { this := ParameterConfig{} return &this } - // GetConfigName returns the ConfigName field value. func (o *ParameterConfig) GetConfigName() string { if o == nil { @@ -67,6 +72,7 @@ func (o *ParameterConfig) SetConfigName(v string) { o.ConfigName = v } + // GetSpecName returns the SpecName field value. func (o *ParameterConfig) GetSpecName() string { if o == nil { @@ -90,6 +96,7 @@ func (o *ParameterConfig) SetSpecName(v string) { o.SpecName = v } + // GetConstraint returns the Constraint field value. func (o *ParameterConfig) GetConstraint() string { if o == nil { @@ -113,6 +120,7 @@ func (o *ParameterConfig) SetConstraint(v string) { o.Constraint = v } + // GetRegex returns the Regex field value. func (o *ParameterConfig) GetRegex() string { if o == nil { @@ -136,6 +144,7 @@ func (o *ParameterConfig) SetRegex(v string) { o.Regex = v } + // GetConfigTplName returns the ConfigTplName field value. func (o *ParameterConfig) GetConfigTplName() string { if o == nil { @@ -159,6 +168,7 @@ func (o *ParameterConfig) SetConfigTplName(v string) { o.ConfigTplName = v } + // GetInitOptions returns the InitOptions field value if set, zero value otherwise. func (o *ParameterConfig) GetInitOptions() map[string]interface{} { if o == nil || o.InitOptions == nil { @@ -187,6 +197,8 @@ func (o *ParameterConfig) SetInitOptions(v map[string]interface{}) { o.InitOptions = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,12 +223,12 @@ func (o ParameterConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ConfigName *string `json:"configName"` - SpecName *string `json:"specName"` - Constraint *string `json:"constraint"` - Regex *string `json:"regex"` - ConfigTplName *string `json:"configTplName"` - InitOptions map[string]interface{} `json:"initOptions,omitempty"` + ConfigName *string `json:"configName"` + SpecName *string `json:"specName"` + Constraint *string `json:"constraint"` + Regex *string `json:"regex"` + ConfigTplName *string `json:"configTplName"` + InitOptions map[string]interface{} `json:"initOptions,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -238,7 +250,7 @@ func (o *ParameterConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"configName", "specName", "constraint", "regex", "configTplName", "initOptions"}) + common.DeleteKeys(additionalProperties, &[]string{ "configName", "specName", "constraint", "regex", "configTplName", "initOptions", }) } else { return err } diff --git a/api/kbcloud/model_parameter_history.go b/api/kbcloud/model_parameter_history.go index 17d101dd..fa73e36e 100644 --- a/api/kbcloud/model_parameter_history.go +++ b/api/kbcloud/model_parameter_history.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParameterHistory The history of a parameter + + +// ParameterHistory The history of a parameter type ParameterHistory struct { // The name of the parameter ParameterName string `json:"parameterName"` @@ -22,10 +26,11 @@ type ParameterHistory struct { // The date and time the parameter was last updated UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterHistory instantiates a new ParameterHistory object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -46,7 +51,6 @@ func NewParameterHistoryWithDefaults() *ParameterHistory { this := ParameterHistory{} return &this } - // GetParameterName returns the ParameterName field value. func (o *ParameterHistory) GetParameterName() string { if o == nil { @@ -70,6 +74,7 @@ func (o *ParameterHistory) SetParameterName(v string) { o.ParameterName = v } + // GetOldValue returns the OldValue field value. func (o *ParameterHistory) GetOldValue() string { if o == nil { @@ -93,6 +98,7 @@ func (o *ParameterHistory) SetOldValue(v string) { o.OldValue = v } + // GetNewValue returns the NewValue field value. func (o *ParameterHistory) GetNewValue() string { if o == nil { @@ -116,6 +122,7 @@ func (o *ParameterHistory) SetNewValue(v string) { o.NewValue = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *ParameterHistory) GetUpdatedAt() time.Time { if o == nil { @@ -139,6 +146,8 @@ func (o *ParameterHistory) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterHistory) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -163,10 +172,10 @@ func (o ParameterHistory) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterHistory) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ParameterName *string `json:"parameterName"` - OldValue *string `json:"oldValue"` - NewValue *string `json:"newValue"` - UpdatedAt *time.Time `json:"updatedAt"` + ParameterName *string `json:"parameterName"` + OldValue *string `json:"oldValue"` + NewValue *string `json:"newValue"` + UpdatedAt *time.Time `json:"updatedAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -185,7 +194,7 @@ func (o *ParameterHistory) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"parameterName", "oldValue", "newValue", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "parameterName", "oldValue", "newValue", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/model_parameter_history_list.go b/api/kbcloud/model_parameter_history_list.go index 53a400f1..a29e2d85 100644 --- a/api/kbcloud/model_parameter_history_list.go +++ b/api/kbcloud/model_parameter_history_list.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ParameterHistoryList A list of parameter history +// ParameterHistoryList A list of parameter history type ParameterHistoryList struct { Items []ParameterHistory `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterHistoryList instantiates a new ParameterHistoryList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewParameterHistoryListWithDefaults() *ParameterHistoryList { this := ParameterHistoryList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ParameterHistoryList) GetItems() []ParameterHistory { if o == nil || o.Items == nil { @@ -59,6 +68,8 @@ func (o *ParameterHistoryList) SetItems(v []ParameterHistory) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterHistoryList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *ParameterHistoryList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_parameter_option.go b/api/kbcloud/model_parameter_option.go index 35b9a0bf..858b4b37 100644 --- a/api/kbcloud/model_parameter_option.go +++ b/api/kbcloud/model_parameter_option.go @@ -2,32 +2,38 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type ParameterOption struct { - Component string `json:"component"` - Configs []ParameterConfig `json:"configs"` + Component string `json:"component"` + Configs []ParameterConfig `json:"configs"` // deprecated - Versions []string `json:"versions"` - ExportTpl bool `json:"exportTpl"` + Versions []string `json:"versions"` + ExportTpl bool `json:"exportTpl"` // a alias with major version. Family string `json:"family"` // match the major version - MajorVersion *string `json:"majorVersion,omitempty"` - DefaultTplName string `json:"defaultTplName"` + MajorVersion *string `json:"majorVersion,omitempty"` + DefaultTplName string `json:"defaultTplName"` DefaultTplDescription LocalizedDescription `json:"defaultTplDescription"` - DisableHa *bool `json:"disableHA,omitempty"` + DisableHa *bool `json:"disableHA,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterOption instantiates a new ParameterOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +61,6 @@ func NewParameterOptionWithDefaults() *ParameterOption { this.DisableHa = &disableHa return &this } - // GetComponent returns the Component field value. func (o *ParameterOption) GetComponent() string { if o == nil { @@ -79,6 +84,7 @@ func (o *ParameterOption) SetComponent(v string) { o.Component = v } + // GetConfigs returns the Configs field value. func (o *ParameterOption) GetConfigs() []ParameterConfig { if o == nil { @@ -102,6 +108,7 @@ func (o *ParameterOption) SetConfigs(v []ParameterConfig) { o.Configs = v } + // GetVersions returns the Versions field value. func (o *ParameterOption) GetVersions() []string { if o == nil { @@ -125,6 +132,7 @@ func (o *ParameterOption) SetVersions(v []string) { o.Versions = v } + // GetExportTpl returns the ExportTpl field value. func (o *ParameterOption) GetExportTpl() bool { if o == nil { @@ -148,6 +156,7 @@ func (o *ParameterOption) SetExportTpl(v bool) { o.ExportTpl = v } + // GetFamily returns the Family field value. func (o *ParameterOption) GetFamily() string { if o == nil { @@ -171,6 +180,7 @@ func (o *ParameterOption) SetFamily(v string) { o.Family = v } + // GetMajorVersion returns the MajorVersion field value if set, zero value otherwise. func (o *ParameterOption) GetMajorVersion() string { if o == nil || o.MajorVersion == nil { @@ -199,6 +209,7 @@ func (o *ParameterOption) SetMajorVersion(v string) { o.MajorVersion = &v } + // GetDefaultTplName returns the DefaultTplName field value. func (o *ParameterOption) GetDefaultTplName() string { if o == nil { @@ -222,6 +233,7 @@ func (o *ParameterOption) SetDefaultTplName(v string) { o.DefaultTplName = v } + // GetDefaultTplDescription returns the DefaultTplDescription field value. func (o *ParameterOption) GetDefaultTplDescription() LocalizedDescription { if o == nil { @@ -245,6 +257,7 @@ func (o *ParameterOption) SetDefaultTplDescription(v LocalizedDescription) { o.DefaultTplDescription = v } + // GetDisableHa returns the DisableHa field value if set, zero value otherwise. func (o *ParameterOption) GetDisableHa() bool { if o == nil || o.DisableHa == nil { @@ -273,6 +286,8 @@ func (o *ParameterOption) SetDisableHa(v bool) { o.DisableHa = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -302,15 +317,15 @@ func (o ParameterOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component"` - Configs *[]ParameterConfig `json:"configs"` - Versions *[]string `json:"versions"` - ExportTpl *bool `json:"exportTpl"` - Family *string `json:"family"` - MajorVersion *string `json:"majorVersion,omitempty"` - DefaultTplName *string `json:"defaultTplName"` + Component *string `json:"component"` + Configs *[]ParameterConfig `json:"configs"` + Versions *[]string `json:"versions"` + ExportTpl *bool `json:"exportTpl"` + Family *string `json:"family"` + MajorVersion *string `json:"majorVersion,omitempty"` + DefaultTplName *string `json:"defaultTplName"` DefaultTplDescription *LocalizedDescription `json:"defaultTplDescription"` - DisableHa *bool `json:"disableHA,omitempty"` + DisableHa *bool `json:"disableHA,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -338,7 +353,7 @@ func (o *ParameterOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "configs", "versions", "exportTpl", "family", "majorVersion", "defaultTplName", "defaultTplDescription", "disableHA"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "configs", "versions", "exportTpl", "family", "majorVersion", "defaultTplName", "defaultTplDescription", "disableHA", }) } else { return err } diff --git a/api/kbcloud/model_parameter_spec.go b/api/kbcloud/model_parameter_spec.go index 9bb4074f..f99088ac 100644 --- a/api/kbcloud/model_parameter_spec.go +++ b/api/kbcloud/model_parameter_spec.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ParameterSpec Cluster parameter specification + + +// ParameterSpec Cluster parameter specification type ParameterSpec struct { // The name of the parameter Name string `json:"name"` @@ -31,10 +36,11 @@ type ParameterSpec struct { // The value options of the parameter Enum []map[string]interface{} `json:"enum"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterSpec instantiates a new ParameterSpec object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -60,7 +66,6 @@ func NewParameterSpecWithDefaults() *ParameterSpec { this := ParameterSpec{} return &this } - // GetName returns the Name field value. func (o *ParameterSpec) GetName() string { if o == nil { @@ -84,6 +89,7 @@ func (o *ParameterSpec) SetName(v string) { o.Name = v } + // GetDescription returns the Description field value. func (o *ParameterSpec) GetDescription() string { if o == nil { @@ -107,6 +113,7 @@ func (o *ParameterSpec) SetDescription(v string) { o.Description = v } + // GetType returns the Type field value. func (o *ParameterSpec) GetType() string { if o == nil { @@ -130,6 +137,7 @@ func (o *ParameterSpec) SetType(v string) { o.Type = v } + // GetDefault returns the Default field value. func (o *ParameterSpec) GetDefault() map[string]interface{} { if o == nil { @@ -153,6 +161,7 @@ func (o *ParameterSpec) SetDefault(v map[string]interface{}) { o.Default = v } + // GetNeedRestart returns the NeedRestart field value. func (o *ParameterSpec) GetNeedRestart() bool { if o == nil { @@ -176,6 +185,7 @@ func (o *ParameterSpec) SetNeedRestart(v bool) { o.NeedRestart = v } + // GetImmutable returns the Immutable field value. func (o *ParameterSpec) GetImmutable() bool { if o == nil { @@ -199,6 +209,7 @@ func (o *ParameterSpec) SetImmutable(v bool) { o.Immutable = v } + // GetMaximum returns the Maximum field value. func (o *ParameterSpec) GetMaximum() float64 { if o == nil { @@ -222,6 +233,7 @@ func (o *ParameterSpec) SetMaximum(v float64) { o.Maximum = v } + // GetMinimum returns the Minimum field value. func (o *ParameterSpec) GetMinimum() float64 { if o == nil { @@ -245,6 +257,7 @@ func (o *ParameterSpec) SetMinimum(v float64) { o.Minimum = v } + // GetEnum returns the Enum field value. func (o *ParameterSpec) GetEnum() []map[string]interface{} { if o == nil { @@ -268,6 +281,8 @@ func (o *ParameterSpec) SetEnum(v []map[string]interface{}) { o.Enum = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterSpec) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -293,15 +308,15 @@ func (o ParameterSpec) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterSpec) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - Description *string `json:"description"` - Type *string `json:"type"` - Default *map[string]interface{} `json:"default"` - NeedRestart *bool `json:"needRestart"` - Immutable *bool `json:"immutable"` - Maximum *float64 `json:"maximum"` - Minimum *float64 `json:"minimum"` - Enum *[]map[string]interface{} `json:"enum"` + Name *string `json:"name"` + Description *string `json:"description"` + Type *string `json:"type"` + Default *map[string]interface{} `json:"default"` + NeedRestart *bool `json:"needRestart"` + Immutable *bool `json:"immutable"` + Maximum *float64 `json:"maximum"` + Minimum *float64 `json:"minimum"` + Enum *[]map[string]interface{} `json:"enum"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -335,7 +350,7 @@ func (o *ParameterSpec) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "description", "type", "default", "needRestart", "immutable", "maximum", "minimum", "enum"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "description", "type", "default", "needRestart", "immutable", "maximum", "minimum", "enum", }) } else { return err } diff --git a/api/kbcloud/model_parameter_spec_list.go b/api/kbcloud/model_parameter_spec_list.go index 6257d3df..168e6f13 100644 --- a/api/kbcloud/model_parameter_spec_list.go +++ b/api/kbcloud/model_parameter_spec_list.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ParameterSpecList A list of cluster parameterSpecs +// ParameterSpecList A list of cluster parameterSpecs type ParameterSpecList struct { Items []ParameterSpecListItem `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterSpecList instantiates a new ParameterSpecList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewParameterSpecListWithDefaults() *ParameterSpecList { this := ParameterSpecList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ParameterSpecList) GetItems() []ParameterSpecListItem { if o == nil || o.Items == nil { @@ -59,6 +68,8 @@ func (o *ParameterSpecList) SetItems(v []ParameterSpecListItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterSpecList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *ParameterSpecList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_parameter_spec_list_item.go b/api/kbcloud/model_parameter_spec_list_item.go index aaa1713d..68434cfe 100644 --- a/api/kbcloud/model_parameter_spec_list_item.go +++ b/api/kbcloud/model_parameter_spec_list_item.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ParameterSpecListItem With the list of parameterSpecs and the configuration file name +// ParameterSpecListItem With the list of parameterSpecs and the configuration file name type ParameterSpecListItem struct { Specs []ParameterSpec `json:"specs,omitempty"` // The name of the configuration file FileName *string `json:"fileName,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewParameterSpecListItem instantiates a new ParameterSpecListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewParameterSpecListItemWithDefaults() *ParameterSpecListItem { this := ParameterSpecListItem{} return &this } - // GetSpecs returns the Specs field value if set, zero value otherwise. func (o *ParameterSpecListItem) GetSpecs() []ParameterSpec { if o == nil || o.Specs == nil { @@ -61,6 +70,7 @@ func (o *ParameterSpecListItem) SetSpecs(v []ParameterSpec) { o.Specs = v } + // GetFileName returns the FileName field value if set, zero value otherwise. func (o *ParameterSpecListItem) GetFileName() string { if o == nil || o.FileName == nil { @@ -89,6 +99,8 @@ func (o *ParameterSpecListItem) SetFileName(v string) { o.FileName = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ParameterSpecListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,15 +123,15 @@ func (o ParameterSpecListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ParameterSpecListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Specs []ParameterSpec `json:"specs,omitempty"` - FileName *string `json:"fileName,omitempty"` + Specs []ParameterSpec `json:"specs,omitempty"` + FileName *string `json:"fileName,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"specs", "fileName"}) + common.DeleteKeys(additionalProperties, &[]string{ "specs", "fileName", }) } else { return err } diff --git a/api/kbcloud/model_permission.go b/api/kbcloud/model_permission.go index 26d9b630..82200f8d 100644 --- a/api/kbcloud/model_permission.go +++ b/api/kbcloud/model_permission.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// Permission Permission information + + +// Permission Permission information type Permission struct { // The name of the permission Name *string `json:"name,omitempty"` @@ -15,10 +24,11 @@ type Permission struct { // The description of the permission Description *string `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPermission instantiates a new Permission object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +45,6 @@ func NewPermissionWithDefaults() *Permission { this := Permission{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *Permission) GetName() string { if o == nil || o.Name == nil { @@ -64,6 +73,7 @@ func (o *Permission) SetName(v string) { o.Name = &v } + // GetGroup returns the Group field value if set, zero value otherwise. func (o *Permission) GetGroup() string { if o == nil || o.Group == nil { @@ -92,6 +102,7 @@ func (o *Permission) SetGroup(v string) { o.Group = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Permission) GetDescription() string { if o == nil || o.Description == nil { @@ -120,6 +131,8 @@ func (o *Permission) SetDescription(v string) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Permission) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -145,8 +158,8 @@ func (o Permission) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Permission) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Group *string `json:"group,omitempty"` + Name *string `json:"name,omitempty"` + Group *string `json:"group,omitempty"` Description *string `json:"description,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -154,7 +167,7 @@ func (o *Permission) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "group", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "group", "description", }) } else { return err } diff --git a/api/kbcloud/model_permission_list.go b/api/kbcloud/model_permission_list.go index 13cf5cca..7ee8c463 100644 --- a/api/kbcloud/model_permission_list.go +++ b/api/kbcloud/model_permission_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PermissionList PermissionList is a list of Permissions + + +// PermissionList PermissionList is a list of Permissions type PermissionList struct { // Items is the list of Permission objects in the list Items []Permission `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPermissionList instantiates a new PermissionList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewPermissionListWithDefaults() *PermissionList { this := PermissionList{} return &this } - // GetItems returns the Items field value. func (o *PermissionList) GetItems() []Permission { if o == nil { @@ -60,6 +65,8 @@ func (o *PermissionList) SetItems(v []Permission) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o PermissionList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *PermissionList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_pgbench.go b/api/kbcloud/model_pgbench.go index 50ab5ba9..72a71551 100644 --- a/api/kbcloud/model_pgbench.go +++ b/api/kbcloud/model_pgbench.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Pgbench pgbench is the pgbench benchmark object + + +// Pgbench pgbench is the pgbench benchmark object type Pgbench struct { // Step of pgbench Step *PgbenchStep `json:"step,omitempty"` @@ -47,10 +52,11 @@ type Pgbench struct { // Extra arguments for pgbench ExtraArgs *string `json:"extraArgs,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPgbench instantiates a new Pgbench object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -96,7 +102,6 @@ func NewPgbenchWithDefaults() *Pgbench { this.SelectOnly = &selectOnly return &this } - // GetStep returns the Step field value if set, zero value otherwise. func (o *Pgbench) GetStep() PgbenchStep { if o == nil || o.Step == nil { @@ -125,6 +130,7 @@ func (o *Pgbench) SetStep(v PgbenchStep) { o.Step = &v } + // GetLimitCpu returns the LimitCpu field value if set, zero value otherwise. func (o *Pgbench) GetLimitCpu() string { if o == nil || o.LimitCpu == nil { @@ -153,6 +159,7 @@ func (o *Pgbench) SetLimitCpu(v string) { o.LimitCpu = &v } + // GetLimitMemory returns the LimitMemory field value if set, zero value otherwise. func (o *Pgbench) GetLimitMemory() string { if o == nil || o.LimitMemory == nil { @@ -181,6 +188,7 @@ func (o *Pgbench) SetLimitMemory(v string) { o.LimitMemory = &v } + // GetRequestCpu returns the RequestCpu field value if set, zero value otherwise. func (o *Pgbench) GetRequestCpu() string { if o == nil || o.RequestCpu == nil { @@ -209,6 +217,7 @@ func (o *Pgbench) SetRequestCpu(v string) { o.RequestCpu = &v } + // GetRequestMemory returns the RequestMemory field value if set, zero value otherwise. func (o *Pgbench) GetRequestMemory() string { if o == nil || o.RequestMemory == nil { @@ -237,6 +246,7 @@ func (o *Pgbench) SetRequestMemory(v string) { o.RequestMemory = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Pgbench) GetName() string { if o == nil || o.Name == nil { @@ -265,6 +275,7 @@ func (o *Pgbench) SetName(v string) { o.Name = &v } + // GetCluster returns the Cluster field value. func (o *Pgbench) GetCluster() string { if o == nil { @@ -288,6 +299,7 @@ func (o *Pgbench) SetCluster(v string) { o.Cluster = v } + // GetDatabase returns the Database field value. func (o *Pgbench) GetDatabase() string { if o == nil { @@ -311,6 +323,7 @@ func (o *Pgbench) SetDatabase(v string) { o.Database = v } + // GetUsername returns the Username field value. func (o *Pgbench) GetUsername() string { if o == nil { @@ -334,6 +347,7 @@ func (o *Pgbench) SetUsername(v string) { o.Username = v } + // GetPassword returns the Password field value. func (o *Pgbench) GetPassword() string { if o == nil { @@ -357,6 +371,7 @@ func (o *Pgbench) SetPassword(v string) { o.Password = v } + // GetAddress returns the Address field value. func (o *Pgbench) GetAddress() string { if o == nil { @@ -380,6 +395,7 @@ func (o *Pgbench) SetAddress(v string) { o.Address = v } + // GetScale returns the Scale field value if set, zero value otherwise. func (o *Pgbench) GetScale() int32 { if o == nil || o.Scale == nil { @@ -408,6 +424,7 @@ func (o *Pgbench) SetScale(v int32) { o.Scale = &v } + // GetClients returns the Clients field value if set, zero value otherwise. func (o *Pgbench) GetClients() int32 { if o == nil || o.Clients == nil { @@ -436,6 +453,7 @@ func (o *Pgbench) SetClients(v int32) { o.Clients = &v } + // GetThreads returns the Threads field value if set, zero value otherwise. func (o *Pgbench) GetThreads() int32 { if o == nil || o.Threads == nil { @@ -464,6 +482,7 @@ func (o *Pgbench) SetThreads(v int32) { o.Threads = &v } + // GetDuration returns the Duration field value if set, zero value otherwise. func (o *Pgbench) GetDuration() int32 { if o == nil || o.Duration == nil { @@ -492,6 +511,7 @@ func (o *Pgbench) SetDuration(v int32) { o.Duration = &v } + // GetSelectOnly returns the SelectOnly field value if set, zero value otherwise. func (o *Pgbench) GetSelectOnly() bool { if o == nil || o.SelectOnly == nil { @@ -520,6 +540,7 @@ func (o *Pgbench) SetSelectOnly(v bool) { o.SelectOnly = &v } + // GetExtraArgs returns the ExtraArgs field value if set, zero value otherwise. func (o *Pgbench) GetExtraArgs() string { if o == nil || o.ExtraArgs == nil { @@ -548,6 +569,8 @@ func (o *Pgbench) SetExtraArgs(v string) { o.ExtraArgs = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Pgbench) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -605,23 +628,23 @@ func (o Pgbench) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Pgbench) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Step *PgbenchStep `json:"step,omitempty"` - LimitCpu *string `json:"limitCpu,omitempty"` - LimitMemory *string `json:"limitMemory,omitempty"` - RequestCpu *string `json:"requestCpu,omitempty"` - RequestMemory *string `json:"requestMemory,omitempty"` - Name *string `json:"name,omitempty"` - Cluster *string `json:"cluster"` - Database *string `json:"database"` - Username *string `json:"username"` - Password *string `json:"password"` - Address *string `json:"address"` - Scale *int32 `json:"scale,omitempty"` - Clients *int32 `json:"clients,omitempty"` - Threads *int32 `json:"threads,omitempty"` - Duration *int32 `json:"duration,omitempty"` - SelectOnly *bool `json:"selectOnly,omitempty"` - ExtraArgs *string `json:"extraArgs,omitempty"` + Step *PgbenchStep `json:"step,omitempty"` + LimitCpu *string `json:"limitCpu,omitempty"` + LimitMemory *string `json:"limitMemory,omitempty"` + RequestCpu *string `json:"requestCpu,omitempty"` + RequestMemory *string `json:"requestMemory,omitempty"` + Name *string `json:"name,omitempty"` + Cluster *string `json:"cluster"` + Database *string `json:"database"` + Username *string `json:"username"` + Password *string `json:"password"` + Address *string `json:"address"` + Scale *int32 `json:"scale,omitempty"` + Clients *int32 `json:"clients,omitempty"` + Threads *int32 `json:"threads,omitempty"` + Duration *int32 `json:"duration,omitempty"` + SelectOnly *bool `json:"selectOnly,omitempty"` + ExtraArgs *string `json:"extraArgs,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -643,13 +666,13 @@ func (o *Pgbench) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"step", "limitCpu", "limitMemory", "requestCpu", "requestMemory", "name", "cluster", "database", "username", "password", "address", "scale", "clients", "threads", "duration", "selectOnly", "extraArgs"}) + common.DeleteKeys(additionalProperties, &[]string{ "step", "limitCpu", "limitMemory", "requestCpu", "requestMemory", "name", "cluster", "database", "username", "password", "address", "scale", "clients", "threads", "duration", "selectOnly", "extraArgs", }) } else { return err } hasInvalidField := false - if all.Step != nil && !all.Step.IsValid() { + if all.Step != nil &&!all.Step.IsValid() { hasInvalidField = true } else { o.Step = all.Step diff --git a/api/kbcloud/model_pgbench_step.go b/api/kbcloud/model_pgbench_step.go index 53fd8292..29fc0570 100644 --- a/api/kbcloud/model_pgbench_step.go +++ b/api/kbcloud/model_pgbench_step.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // PgbenchStep Step of pgbench type PgbenchStep string // List of PgbenchStep. const ( PgbenchStepPrepare PgbenchStep = "prepare" - PgbenchStepRun PgbenchStep = "run" + PgbenchStepRun PgbenchStep = "run" PgbenchStepCleanup PgbenchStep = "cleanup" - PgbenchStepAll PgbenchStep = "all" + PgbenchStepAll PgbenchStep = "all" ) var allowedPgbenchStepEnumValues = []PgbenchStep{ diff --git a/api/kbcloud/model_privilege_list_item.go b/api/kbcloud/model_privilege_list_item.go index f02ff92f..ef7a18ca 100644 --- a/api/kbcloud/model_privilege_list_item.go +++ b/api/kbcloud/model_privilege_list_item.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// PrivilegeListItem Database and its assigned privileges. + + +// PrivilegeListItem Database and its assigned privileges. type PrivilegeListItem struct { // The name of the database. DatabaseName *string `json:"databaseName,omitempty"` // The type of privilege. Privileges string `json:"privileges"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewPrivilegeListItem instantiates a new PrivilegeListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +44,6 @@ func NewPrivilegeListItemWithDefaults() *PrivilegeListItem { this := PrivilegeListItem{} return &this } - // GetDatabaseName returns the DatabaseName field value if set, zero value otherwise. func (o *PrivilegeListItem) GetDatabaseName() string { if o == nil || o.DatabaseName == nil { @@ -67,6 +72,7 @@ func (o *PrivilegeListItem) SetDatabaseName(v string) { o.DatabaseName = &v } + // GetPrivileges returns the Privileges field value. func (o *PrivilegeListItem) GetPrivileges() string { if o == nil { @@ -90,6 +96,8 @@ func (o *PrivilegeListItem) SetPrivileges(v string) { o.Privileges = v } + + // MarshalJSON serializes the struct using spec logic. func (o PrivilegeListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,7 +119,7 @@ func (o PrivilegeListItem) MarshalJSON() ([]byte, error) { func (o *PrivilegeListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { DatabaseName *string `json:"databaseName,omitempty"` - Privileges *string `json:"privileges"` + Privileges *string `json:"privileges"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -121,7 +129,7 @@ func (o *PrivilegeListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"databaseName", "privileges"}) + common.DeleteKeys(additionalProperties, &[]string{ "databaseName", "privileges", }) } else { return err } diff --git a/api/kbcloud/model_provider.go b/api/kbcloud/model_provider.go index 66242f20..178332af 100644 --- a/api/kbcloud/model_provider.go +++ b/api/kbcloud/model_provider.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Provider The cloud provider that the environment is running on. + + +// Provider The cloud provider that the environment is running on. type Provider struct { // The name of the cloud provider. Name string `json:"name"` @@ -36,10 +40,11 @@ type Provider struct { // The time when the cloud provider was last updated. UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewProvider instantiates a new Provider object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -67,7 +72,6 @@ func NewProviderWithDefaults() *Provider { this := Provider{} return &this } - // GetName returns the Name field value. func (o *Provider) GetName() string { if o == nil { @@ -91,6 +95,7 @@ func (o *Provider) SetName(v string) { o.Name = v } + // GetNameCn returns the NameCn field value. func (o *Provider) GetNameCn() string { if o == nil { @@ -114,6 +119,7 @@ func (o *Provider) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *Provider) GetNameEn() string { if o == nil { @@ -137,6 +143,7 @@ func (o *Provider) SetNameEn(v string) { o.NameEn = v } + // GetLogo returns the Logo field value. func (o *Provider) GetLogo() string { if o == nil { @@ -160,6 +167,7 @@ func (o *Provider) SetLogo(v string) { o.Logo = v } + // GetEnabled returns the Enabled field value. func (o *Provider) GetEnabled() bool { if o == nil { @@ -183,6 +191,7 @@ func (o *Provider) SetEnabled(v bool) { o.Enabled = v } + // GetSupportArn returns the SupportArn field value. func (o *Provider) GetSupportArn() bool { if o == nil { @@ -206,6 +215,7 @@ func (o *Provider) SetSupportArn(v bool) { o.SupportArn = v } + // GetEnvironmentCount returns the EnvironmentCount field value. func (o *Provider) GetEnvironmentCount() int32 { if o == nil { @@ -229,6 +239,7 @@ func (o *Provider) SetEnvironmentCount(v int32) { o.EnvironmentCount = v } + // GetRegionCount returns the RegionCount field value. func (o *Provider) GetRegionCount() int32 { if o == nil { @@ -252,6 +263,7 @@ func (o *Provider) SetRegionCount(v int32) { o.RegionCount = v } + // GetZoneCount returns the ZoneCount field value. func (o *Provider) GetZoneCount() int32 { if o == nil { @@ -275,6 +287,7 @@ func (o *Provider) SetZoneCount(v int32) { o.ZoneCount = v } + // GetCreatedAt returns the CreatedAt field value. func (o *Provider) GetCreatedAt() time.Time { if o == nil { @@ -298,6 +311,7 @@ func (o *Provider) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Provider) GetUpdatedAt() time.Time { if o == nil { @@ -321,6 +335,8 @@ func (o *Provider) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o Provider) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -356,17 +372,17 @@ func (o Provider) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Provider) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Logo *string `json:"logo"` - Enabled *bool `json:"enabled"` - SupportArn *bool `json:"supportARN"` - EnvironmentCount *int32 `json:"environmentCount"` - RegionCount *int32 `json:"regionCount"` - ZoneCount *int32 `json:"zoneCount"` - CreatedAt *time.Time `json:"createdAt"` - UpdatedAt *time.Time `json:"updatedAt"` + Name *string `json:"name"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Logo *string `json:"logo"` + Enabled *bool `json:"enabled"` + SupportArn *bool `json:"supportARN"` + EnvironmentCount *int32 `json:"environmentCount"` + RegionCount *int32 `json:"regionCount"` + ZoneCount *int32 `json:"zoneCount"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -406,7 +422,7 @@ func (o *Provider) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "nameCN", "nameEN", "logo", "enabled", "supportARN", "environmentCount", "regionCount", "zoneCount", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "nameCN", "nameEN", "logo", "enabled", "supportARN", "environmentCount", "regionCount", "zoneCount", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/model_provider_list.go b/api/kbcloud/model_provider_list.go index 688295be..1e177524 100644 --- a/api/kbcloud/model_provider_list.go +++ b/api/kbcloud/model_provider_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ProviderList The list of cloud providers. +// ProviderList The list of cloud providers. type ProviderList struct { // The list of cloud providers. Items []Provider `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewProviderList instantiates a new ProviderList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewProviderListWithDefaults() *ProviderList { this := ProviderList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ProviderList) GetItems() []Provider { if o == nil || o.Items == nil { @@ -60,6 +69,8 @@ func (o *ProviderList) SetItems(v []Provider) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ProviderList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *ProviderList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_query_history.go b/api/kbcloud/model_query_history.go index 079d7f12..0b40edef 100644 --- a/api/kbcloud/model_query_history.go +++ b/api/kbcloud/model_query_history.go @@ -2,14 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type QueryHistory struct { // executed sql statements Sql *string `json:"sql,omitempty"` @@ -20,10 +25,11 @@ type QueryHistory struct { // sql executed duration Duration *int32 `json:"duration,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewQueryHistory instantiates a new QueryHistory object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewQueryHistoryWithDefaults() *QueryHistory { this := QueryHistory{} return &this } - // GetSql returns the Sql field value if set, zero value otherwise. func (o *QueryHistory) GetSql() string { if o == nil || o.Sql == nil { @@ -69,6 +74,7 @@ func (o *QueryHistory) SetSql(v string) { o.Sql = &v } + // GetErrMassage returns the ErrMassage field value if set, zero value otherwise. func (o *QueryHistory) GetErrMassage() string { if o == nil || o.ErrMassage == nil { @@ -97,6 +103,7 @@ func (o *QueryHistory) SetErrMassage(v string) { o.ErrMassage = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *QueryHistory) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -125,6 +132,7 @@ func (o *QueryHistory) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetDuration returns the Duration field value if set, zero value otherwise. func (o *QueryHistory) GetDuration() int32 { if o == nil || o.Duration == nil { @@ -153,6 +161,8 @@ func (o *QueryHistory) SetDuration(v int32) { o.Duration = &v } + + // MarshalJSON serializes the struct using spec logic. func (o QueryHistory) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -185,17 +195,17 @@ func (o QueryHistory) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *QueryHistory) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Sql *string `json:"sql,omitempty"` - ErrMassage *string `json:"errMassage,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Duration *int32 `json:"duration,omitempty"` + Sql *string `json:"sql,omitempty"` + ErrMassage *string `json:"errMassage,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Duration *int32 `json:"duration,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"sql", "errMassage", "createdAt", "duration"}) + common.DeleteKeys(additionalProperties, &[]string{ "sql", "errMassage", "createdAt", "duration", }) } else { return err } diff --git a/api/kbcloud/model_query_response.go b/api/kbcloud/model_query_response.go index 5e8c6c0e..1705fdd8 100644 --- a/api/kbcloud/model_query_response.go +++ b/api/kbcloud/model_query_response.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type QueryResponse struct { // result set of query Data []Result `json:"data,omitempty"` // error message set of query ErrMessage common.NullableList[string] `json:"errMessage,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewQueryResponse instantiates a new QueryResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewQueryResponseWithDefaults() *QueryResponse { this := QueryResponse{} return &this } - // GetData returns the Data field value if set, zero value otherwise. func (o *QueryResponse) GetData() []Result { if o == nil || o.Data == nil { @@ -61,6 +70,7 @@ func (o *QueryResponse) SetData(v []Result) { o.Data = v } + // GetErrMessage returns the ErrMessage field value if set, zero value otherwise (both if not set or set to explicit null). func (o *QueryResponse) GetErrMessage() []string { if o == nil || o.ErrMessage.Get() == nil { @@ -74,7 +84,7 @@ func (o *QueryResponse) GetErrMessage() []string { // 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 *QueryResponse) GetErrMessageOk() (*[]string, bool) { - if o == nil { + if o == nil { return nil, false } return o.ErrMessage.Get(), o.ErrMessage.IsSet() @@ -89,7 +99,6 @@ func (o *QueryResponse) HasErrMessage() bool { func (o *QueryResponse) SetErrMessage(v []string) { o.ErrMessage.Set(&v) } - // SetErrMessageNil sets the value for ErrMessage to be an explicit nil. func (o *QueryResponse) SetErrMessageNil() { o.ErrMessage.Set(nil) @@ -100,6 +109,8 @@ func (o *QueryResponse) UnsetErrMessage() { o.ErrMessage.Unset() } + + // MarshalJSON serializes the struct using spec logic. func (o QueryResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -122,7 +133,7 @@ func (o QueryResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *QueryResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data []Result `json:"data,omitempty"` + Data []Result `json:"data,omitempty"` ErrMessage common.NullableList[string] `json:"errMessage,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -130,7 +141,7 @@ func (o *QueryResponse) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"data", "errMessage"}) + common.DeleteKeys(additionalProperties, &[]string{ "data", "errMessage", }) } else { return err } diff --git a/api/kbcloud/model_reconfigure_create.go b/api/kbcloud/model_reconfigure_create.go index d2ef48c7..9fd97b7a 100644 --- a/api/kbcloud/model_reconfigure_create.go +++ b/api/kbcloud/model_reconfigure_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// ReconfigureCreate ReconfigureCreate is the payload to reconfigure a KubeBlocks cluster + + +// ReconfigureCreate ReconfigureCreate is the payload to reconfigure a KubeBlocks cluster type ReconfigureCreate struct { // component type Component *string `json:"component,omitempty"` @@ -19,10 +24,11 @@ type ReconfigureCreate struct { // Specify parameters list to be updated Parameters map[string]string `json:"parameters"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewReconfigureCreate instantiates a new ReconfigureCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewReconfigureCreateWithDefaults() *ReconfigureCreate { this := ReconfigureCreate{} return &this } - // GetComponent returns the Component field value if set, zero value otherwise. func (o *ReconfigureCreate) GetComponent() string { if o == nil || o.Component == nil { @@ -69,6 +74,7 @@ func (o *ReconfigureCreate) SetComponent(v string) { o.Component = &v } + // GetConfigFileName returns the ConfigFileName field value if set, zero value otherwise. func (o *ReconfigureCreate) GetConfigFileName() string { if o == nil || o.ConfigFileName == nil { @@ -97,6 +103,7 @@ func (o *ReconfigureCreate) SetConfigFileName(v string) { o.ConfigFileName = &v } + // GetParameters returns the Parameters field value. func (o *ReconfigureCreate) GetParameters() map[string]string { if o == nil { @@ -120,6 +127,8 @@ func (o *ReconfigureCreate) SetParameters(v map[string]string) { o.Parameters = v } + + // MarshalJSON serializes the struct using spec logic. func (o ReconfigureCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,9 +152,9 @@ func (o ReconfigureCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ReconfigureCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Component *string `json:"component,omitempty"` - ConfigFileName *string `json:"configFileName,omitempty"` - Parameters *map[string]string `json:"parameters"` + Component *string `json:"component,omitempty"` + ConfigFileName *string `json:"configFileName,omitempty"` + Parameters *map[string]string `json:"parameters"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -155,7 +164,7 @@ func (o *ReconfigureCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"component", "configFileName", "parameters"}) + common.DeleteKeys(additionalProperties, &[]string{ "component", "configFileName", "parameters", }) } else { return err } diff --git a/api/kbcloud/model_recycle_bin_cluster.go b/api/kbcloud/model_recycle_bin_cluster.go index e92882d1..c7330162 100644 --- a/api/kbcloud/model_recycle_bin_cluster.go +++ b/api/kbcloud/model_recycle_bin_cluster.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RecycleBinCluster KubeBlocks cluster(in recycle bin) information + + +// RecycleBinCluster KubeBlocks cluster(in recycle bin) information type RecycleBinCluster struct { // Cluster Recycle Bin ID Id *string `json:"id,omitempty"` @@ -70,10 +74,11 @@ type RecycleBinCluster struct { // ExpiredAt is a timestamp representing the server time when this object will be expired, and deleted automatically. ExpiredAt *time.Time `json:"expiredAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRecycleBinCluster instantiates a new RecycleBinCluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -101,7 +106,6 @@ func NewRecycleBinClusterWithDefaults() *RecycleBinCluster { this.SingleZone = &singleZone return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *RecycleBinCluster) GetId() string { if o == nil || o.Id == nil { @@ -130,6 +134,7 @@ func (o *RecycleBinCluster) SetId(v string) { o.Id = &v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *RecycleBinCluster) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -158,6 +163,7 @@ func (o *RecycleBinCluster) SetClusterId(v string) { o.ClusterId = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *RecycleBinCluster) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -186,6 +192,7 @@ func (o *RecycleBinCluster) SetOrgName(v string) { o.OrgName = &v } + // GetCloudProvider returns the CloudProvider field value if set, zero value otherwise. func (o *RecycleBinCluster) GetCloudProvider() string { if o == nil || o.CloudProvider == nil { @@ -214,6 +221,7 @@ func (o *RecycleBinCluster) SetCloudProvider(v string) { o.CloudProvider = &v } + // GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. func (o *RecycleBinCluster) GetEnvironmentId() string { if o == nil || o.EnvironmentId == nil { @@ -242,6 +250,7 @@ func (o *RecycleBinCluster) SetEnvironmentId(v string) { o.EnvironmentId = &v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *RecycleBinCluster) GetEnvironmentName() string { if o == nil { @@ -265,6 +274,7 @@ func (o *RecycleBinCluster) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetEnvironmentType returns the EnvironmentType field value if set, zero value otherwise. func (o *RecycleBinCluster) GetEnvironmentType() string { if o == nil || o.EnvironmentType == nil { @@ -293,6 +303,7 @@ func (o *RecycleBinCluster) SetEnvironmentType(v string) { o.EnvironmentType = &v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *RecycleBinCluster) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -321,6 +332,7 @@ func (o *RecycleBinCluster) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetNamespace returns the Namespace field value if set, zero value otherwise. func (o *RecycleBinCluster) GetNamespace() string { if o == nil || o.Namespace == nil { @@ -349,6 +361,7 @@ func (o *RecycleBinCluster) SetNamespace(v string) { o.Namespace = &v } + // GetName returns the Name field value. func (o *RecycleBinCluster) GetName() string { if o == nil { @@ -372,6 +385,7 @@ func (o *RecycleBinCluster) SetName(v string) { o.Name = v } + // GetHash returns the Hash field value if set, zero value otherwise. func (o *RecycleBinCluster) GetHash() string { if o == nil || o.Hash == nil { @@ -400,6 +414,7 @@ func (o *RecycleBinCluster) SetHash(v string) { o.Hash = &v } + // GetEngine returns the Engine field value. func (o *RecycleBinCluster) GetEngine() string { if o == nil { @@ -423,6 +438,7 @@ func (o *RecycleBinCluster) SetEngine(v string) { o.Engine = v } + // GetValues returns the Values field value if set, zero value otherwise. func (o *RecycleBinCluster) GetValues() map[string]interface{} { if o == nil || o.Values == nil { @@ -451,6 +467,7 @@ func (o *RecycleBinCluster) SetValues(v map[string]interface{}) { o.Values = v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *RecycleBinCluster) GetVersion() string { if o == nil || o.Version == nil { @@ -479,6 +496,7 @@ func (o *RecycleBinCluster) SetVersion(v string) { o.Version = &v } + // GetReplicas returns the Replicas field value if set, zero value otherwise. func (o *RecycleBinCluster) GetReplicas() int32 { if o == nil || o.Replicas == nil { @@ -507,6 +525,7 @@ func (o *RecycleBinCluster) SetReplicas(v int32) { o.Replicas = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *RecycleBinCluster) GetCpu() float64 { if o == nil || o.Cpu == nil { @@ -535,6 +554,7 @@ func (o *RecycleBinCluster) SetCpu(v float64) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *RecycleBinCluster) GetMemory() float64 { if o == nil || o.Memory == nil { @@ -563,6 +583,7 @@ func (o *RecycleBinCluster) SetMemory(v float64) { o.Memory = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *RecycleBinCluster) GetStorage() float64 { if o == nil || o.Storage == nil { @@ -591,6 +612,7 @@ func (o *RecycleBinCluster) SetStorage(v float64) { o.Storage = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *RecycleBinCluster) GetStatus() string { if o == nil || o.Status == nil { @@ -619,6 +641,7 @@ func (o *RecycleBinCluster) SetStatus(v string) { o.Status = &v } + // GetState returns the State field value if set, zero value otherwise. func (o *RecycleBinCluster) GetState() string { if o == nil || o.State == nil { @@ -647,6 +670,7 @@ func (o *RecycleBinCluster) SetState(v string) { o.State = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *RecycleBinCluster) GetMode() string { if o == nil || o.Mode == nil { @@ -675,6 +699,7 @@ func (o *RecycleBinCluster) SetMode(v string) { o.Mode = &v } + // GetComponents returns the Components field value if set, zero value otherwise. func (o *RecycleBinCluster) GetComponents() []ComponentsItem { if o == nil || o.Components == nil { @@ -703,6 +728,7 @@ func (o *RecycleBinCluster) SetComponents(v []ComponentsItem) { o.Components = v } + // GetSingleZone returns the SingleZone field value if set, zero value otherwise. func (o *RecycleBinCluster) GetSingleZone() bool { if o == nil || o.SingleZone == nil { @@ -731,6 +757,7 @@ func (o *RecycleBinCluster) SetSingleZone(v bool) { o.SingleZone = &v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *RecycleBinCluster) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -759,6 +786,7 @@ func (o *RecycleBinCluster) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetBackup returns the Backup field value if set, zero value otherwise. func (o *RecycleBinCluster) GetBackup() ClusterBackup { if o == nil || o.Backup == nil { @@ -787,6 +815,7 @@ func (o *RecycleBinCluster) SetBackup(v ClusterBackup) { o.Backup = &v } + // GetStoppedAt returns the StoppedAt field value if set, zero value otherwise. func (o *RecycleBinCluster) GetStoppedAt() time.Time { if o == nil || o.StoppedAt == nil { @@ -815,6 +844,7 @@ func (o *RecycleBinCluster) SetStoppedAt(v time.Time) { o.StoppedAt = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *RecycleBinCluster) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -843,6 +873,7 @@ func (o *RecycleBinCluster) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetExpiredAt returns the ExpiredAt field value if set, zero value otherwise. func (o *RecycleBinCluster) GetExpiredAt() time.Time { if o == nil || o.ExpiredAt == nil { @@ -871,6 +902,8 @@ func (o *RecycleBinCluster) SetExpiredAt(v time.Time) { o.ExpiredAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RecycleBinCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -977,34 +1010,34 @@ func (o RecycleBinCluster) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RecycleBinCluster) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - ClusterId *string `json:"clusterId,omitempty"` - OrgName *string `json:"orgName,omitempty"` - CloudProvider *string `json:"cloudProvider,omitempty"` - EnvironmentId *string `json:"environmentId,omitempty"` - EnvironmentName *string `json:"environmentName"` - EnvironmentType *string `json:"environmentType,omitempty"` - CloudRegion *string `json:"cloudRegion,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Name *string `json:"name"` - Hash *string `json:"hash,omitempty"` - Engine *string `json:"engine"` - Values map[string]interface{} `json:"values,omitempty"` - Version *string `json:"version,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - Cpu *float64 `json:"cpu,omitempty"` - Memory *float64 `json:"memory,omitempty"` - Storage *float64 `json:"storage,omitempty"` - Status *string `json:"status,omitempty"` - State *string `json:"state,omitempty"` - Mode *string `json:"mode,omitempty"` - Components []ComponentsItem `json:"components,omitempty"` - SingleZone *bool `json:"singleZone,omitempty"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - Backup *ClusterBackup `json:"backup,omitempty"` - StoppedAt *time.Time `json:"stoppedAt,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` + Id *string `json:"id,omitempty"` + ClusterId *string `json:"clusterId,omitempty"` + OrgName *string `json:"orgName,omitempty"` + CloudProvider *string `json:"cloudProvider,omitempty"` + EnvironmentId *string `json:"environmentId,omitempty"` + EnvironmentName *string `json:"environmentName"` + EnvironmentType *string `json:"environmentType,omitempty"` + CloudRegion *string `json:"cloudRegion,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name"` + Hash *string `json:"hash,omitempty"` + Engine *string `json:"engine"` + Values map[string]interface{} `json:"values,omitempty"` + Version *string `json:"version,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Cpu *float64 `json:"cpu,omitempty"` + Memory *float64 `json:"memory,omitempty"` + Storage *float64 `json:"storage,omitempty"` + Status *string `json:"status,omitempty"` + State *string `json:"state,omitempty"` + Mode *string `json:"mode,omitempty"` + Components []ComponentsItem `json:"components,omitempty"` + SingleZone *bool `json:"singleZone,omitempty"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + Backup *ClusterBackup `json:"backup,omitempty"` + StoppedAt *time.Time `json:"stoppedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -1020,7 +1053,7 @@ func (o *RecycleBinCluster) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "clusterId", "orgName", "cloudProvider", "environmentId", "environmentName", "environmentType", "cloudRegion", "namespace", "name", "hash", "engine", "values", "version", "replicas", "cpu", "memory", "storage", "status", "state", "mode", "components", "singleZone", "availabilityZones", "backup", "stoppedAt", "createdAt", "expiredAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "clusterId", "orgName", "cloudProvider", "environmentId", "environmentName", "environmentType", "cloudRegion", "namespace", "name", "hash", "engine", "values", "version", "replicas", "cpu", "memory", "storage", "status", "state", "mode", "components", "singleZone", "availabilityZones", "backup", "stoppedAt", "createdAt", "expiredAt", }) } else { return err } @@ -1050,7 +1083,7 @@ func (o *RecycleBinCluster) UnmarshalJSON(bytes []byte) (err error) { o.Components = all.Components o.SingleZone = all.SingleZone o.AvailabilityZones = all.AvailabilityZones - if all.Backup != nil && all.Backup.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Backup != nil && all.Backup.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Backup = all.Backup diff --git a/api/kbcloud/model_recycle_bin_cluster_list.go b/api/kbcloud/model_recycle_bin_cluster_list.go index 79a2243f..36b7ada3 100644 --- a/api/kbcloud/model_recycle_bin_cluster_list.go +++ b/api/kbcloud/model_recycle_bin_cluster_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RecycleBinClusterList recycleBinClusterList is a list of KubeBlocks clusters in the recycle bin + + +// RecycleBinClusterList recycleBinClusterList is a list of KubeBlocks clusters in the recycle bin type RecycleBinClusterList struct { // Items is the KubeBlocks cluster objects in the recycleBinClusterList Items []RecycleBinClusterListItem `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRecycleBinClusterList instantiates a new RecycleBinClusterList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewRecycleBinClusterListWithDefaults() *RecycleBinClusterList { this := RecycleBinClusterList{} return &this } - // GetItems returns the Items field value. func (o *RecycleBinClusterList) GetItems() []RecycleBinClusterListItem { if o == nil { @@ -60,6 +65,8 @@ func (o *RecycleBinClusterList) SetItems(v []RecycleBinClusterListItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RecycleBinClusterList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *RecycleBinClusterList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_recycle_bin_cluster_list_item.go b/api/kbcloud/model_recycle_bin_cluster_list_item.go index 50c6744b..f47433be 100644 --- a/api/kbcloud/model_recycle_bin_cluster_list_item.go +++ b/api/kbcloud/model_recycle_bin_cluster_list_item.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RecycleBinClusterListItem information of kubeblocks cluster in recycle bin + + +// RecycleBinClusterListItem information of kubeblocks cluster in recycle bin type RecycleBinClusterListItem struct { // Cloud Provider CloudProvider string `json:"cloudProvider"` @@ -50,10 +54,11 @@ type RecycleBinClusterListItem struct { // ExpiredAt is a timestamp representing the server time when this object will be expired, and deleted automatically. ExpiredAt *time.Time `json:"expiredAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRecycleBinClusterListItem instantiates a new RecycleBinClusterListItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -78,7 +83,6 @@ func NewRecycleBinClusterListItemWithDefaults() *RecycleBinClusterListItem { this := RecycleBinClusterListItem{} return &this } - // GetCloudProvider returns the CloudProvider field value. func (o *RecycleBinClusterListItem) GetCloudProvider() string { if o == nil { @@ -102,6 +106,7 @@ func (o *RecycleBinClusterListItem) SetCloudProvider(v string) { o.CloudProvider = v } + // GetCloudRegion returns the CloudRegion field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetCloudRegion() string { if o == nil || o.CloudRegion == nil { @@ -130,6 +135,7 @@ func (o *RecycleBinClusterListItem) SetCloudRegion(v string) { o.CloudRegion = &v } + // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetAvailabilityZones() []string { if o == nil || o.AvailabilityZones == nil { @@ -158,6 +164,7 @@ func (o *RecycleBinClusterListItem) SetAvailabilityZones(v []string) { o.AvailabilityZones = v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -186,6 +193,7 @@ func (o *RecycleBinClusterListItem) SetDisplayName(v string) { o.DisplayName = &v } + // GetEngine returns the Engine field value. func (o *RecycleBinClusterListItem) GetEngine() string { if o == nil { @@ -209,6 +217,7 @@ func (o *RecycleBinClusterListItem) SetEngine(v string) { o.Engine = v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetMode() string { if o == nil || o.Mode == nil { @@ -237,6 +246,7 @@ func (o *RecycleBinClusterListItem) SetMode(v string) { o.Mode = &v } + // GetEnvironmentName returns the EnvironmentName field value. func (o *RecycleBinClusterListItem) GetEnvironmentName() string { if o == nil { @@ -260,6 +270,7 @@ func (o *RecycleBinClusterListItem) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetId returns the Id field value. func (o *RecycleBinClusterListItem) GetId() string { if o == nil { @@ -283,6 +294,7 @@ func (o *RecycleBinClusterListItem) SetId(v string) { o.Id = v } + // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -311,6 +323,7 @@ func (o *RecycleBinClusterListItem) SetClusterId(v string) { o.ClusterId = &v } + // GetName returns the Name field value. func (o *RecycleBinClusterListItem) GetName() string { if o == nil { @@ -334,6 +347,7 @@ func (o *RecycleBinClusterListItem) SetName(v string) { o.Name = v } + // GetVersion returns the Version field value. func (o *RecycleBinClusterListItem) GetVersion() string { if o == nil { @@ -357,6 +371,7 @@ func (o *RecycleBinClusterListItem) SetVersion(v string) { o.Version = v } + // GetClassCode returns the ClassCode field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetClassCode() string { if o == nil || o.ClassCode == nil { @@ -385,6 +400,7 @@ func (o *RecycleBinClusterListItem) SetClassCode(v string) { o.ClassCode = &v } + // GetStorage returns the Storage field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetStorage() string { if o == nil || o.Storage == nil { @@ -413,6 +429,7 @@ func (o *RecycleBinClusterListItem) SetStorage(v string) { o.Storage = &v } + // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -441,6 +458,7 @@ func (o *RecycleBinClusterListItem) SetOrgName(v string) { o.OrgName = &v } + // GetState returns the State field value. func (o *RecycleBinClusterListItem) GetState() string { if o == nil { @@ -464,6 +482,7 @@ func (o *RecycleBinClusterListItem) SetState(v string) { o.State = v } + // GetStoppedAt returns the StoppedAt field value. func (o *RecycleBinClusterListItem) GetStoppedAt() time.Time { if o == nil { @@ -487,6 +506,7 @@ func (o *RecycleBinClusterListItem) SetStoppedAt(v time.Time) { o.StoppedAt = v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -515,6 +535,7 @@ func (o *RecycleBinClusterListItem) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetExpiredAt returns the ExpiredAt field value if set, zero value otherwise. func (o *RecycleBinClusterListItem) GetExpiredAt() time.Time { if o == nil || o.ExpiredAt == nil { @@ -543,6 +564,8 @@ func (o *RecycleBinClusterListItem) SetExpiredAt(v time.Time) { o.ExpiredAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RecycleBinClusterListItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -609,24 +632,24 @@ func (o RecycleBinClusterListItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RecycleBinClusterListItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CloudProvider *string `json:"cloudProvider"` - CloudRegion *string `json:"cloudRegion,omitempty"` - AvailabilityZones []string `json:"availabilityZones,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Engine *string `json:"engine"` - Mode *string `json:"mode,omitempty"` - EnvironmentName *string `json:"environmentName"` - Id *string `json:"id"` - ClusterId *string `json:"clusterId,omitempty"` - Name *string `json:"name"` - Version *string `json:"version"` - ClassCode *string `json:"classCode,omitempty"` - Storage *string `json:"storage,omitempty"` - OrgName *string `json:"orgName,omitempty"` - State *string `json:"state"` - StoppedAt *time.Time `json:"stoppedAt"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - ExpiredAt *time.Time `json:"expiredAt,omitempty"` + CloudProvider *string `json:"cloudProvider"` + CloudRegion *string `json:"cloudRegion,omitempty"` + AvailabilityZones []string `json:"availabilityZones,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Engine *string `json:"engine"` + Mode *string `json:"mode,omitempty"` + EnvironmentName *string `json:"environmentName"` + Id *string `json:"id"` + ClusterId *string `json:"clusterId,omitempty"` + Name *string `json:"name"` + Version *string `json:"version"` + ClassCode *string `json:"classCode,omitempty"` + Storage *string `json:"storage,omitempty"` + OrgName *string `json:"orgName,omitempty"` + State *string `json:"state"` + StoppedAt *time.Time `json:"stoppedAt"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + ExpiredAt *time.Time `json:"expiredAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -657,7 +680,7 @@ func (o *RecycleBinClusterListItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cloudProvider", "cloudRegion", "availabilityZones", "displayName", "engine", "mode", "environmentName", "id", "clusterId", "name", "version", "classCode", "storage", "orgName", "state", "stoppedAt", "createdAt", "expiredAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "cloudProvider", "cloudRegion", "availabilityZones", "displayName", "engine", "mode", "environmentName", "id", "clusterId", "name", "version", "classCode", "storage", "orgName", "state", "stoppedAt", "createdAt", "expiredAt", }) } else { return err } diff --git a/api/kbcloud/model_region.go b/api/kbcloud/model_region.go index 7deec622..b9196e37 100644 --- a/api/kbcloud/model_region.go +++ b/api/kbcloud/model_region.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Region The region that the cloud provider has. + + +// Region The region that the cloud provider has. type Region struct { // The name of the region. Name string `json:"name"` @@ -32,10 +36,11 @@ type Region struct { // The time when the region was last updated. UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegion instantiates a new Region object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -61,7 +66,6 @@ func NewRegionWithDefaults() *Region { this := Region{} return &this } - // GetName returns the Name field value. func (o *Region) GetName() string { if o == nil { @@ -85,6 +89,7 @@ func (o *Region) SetName(v string) { o.Name = v } + // GetNameCn returns the NameCn field value. func (o *Region) GetNameCn() string { if o == nil { @@ -108,6 +113,7 @@ func (o *Region) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *Region) GetNameEn() string { if o == nil { @@ -131,6 +137,7 @@ func (o *Region) SetNameEn(v string) { o.NameEn = v } + // GetProvider returns the Provider field value. func (o *Region) GetProvider() string { if o == nil { @@ -154,6 +161,7 @@ func (o *Region) SetProvider(v string) { o.Provider = v } + // GetGroup returns the Group field value. func (o *Region) GetGroup() string { if o == nil { @@ -177,6 +185,7 @@ func (o *Region) SetGroup(v string) { o.Group = v } + // GetEnabled returns the Enabled field value. func (o *Region) GetEnabled() bool { if o == nil { @@ -200,6 +209,7 @@ func (o *Region) SetEnabled(v bool) { o.Enabled = v } + // GetZoneCount returns the ZoneCount field value. func (o *Region) GetZoneCount() int32 { if o == nil { @@ -223,6 +233,7 @@ func (o *Region) SetZoneCount(v int32) { o.ZoneCount = v } + // GetCreatedAt returns the CreatedAt field value. func (o *Region) GetCreatedAt() time.Time { if o == nil { @@ -246,6 +257,7 @@ func (o *Region) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Region) GetUpdatedAt() time.Time { if o == nil { @@ -269,6 +281,8 @@ func (o *Region) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o Region) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -302,13 +316,13 @@ func (o Region) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Region) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Provider *string `json:"provider"` - Group *string `json:"group"` - Enabled *bool `json:"enabled"` - ZoneCount *int32 `json:"zoneCount"` + Name *string `json:"name"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Provider *string `json:"provider"` + Group *string `json:"group"` + Enabled *bool `json:"enabled"` + ZoneCount *int32 `json:"zoneCount"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` }{} @@ -344,7 +358,7 @@ func (o *Region) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "nameCN", "nameEN", "provider", "group", "enabled", "zoneCount", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "nameCN", "nameEN", "provider", "group", "enabled", "zoneCount", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/model_region_list.go b/api/kbcloud/model_region_list.go index 4cfb3757..0ca63032 100644 --- a/api/kbcloud/model_region_list.go +++ b/api/kbcloud/model_region_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RegionList The list of regions. +// RegionList The list of regions. type RegionList struct { // The list of regions. Items []Region `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRegionList instantiates a new RegionList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewRegionListWithDefaults() *RegionList { this := RegionList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *RegionList) GetItems() []Region { if o == nil || o.Items == nil { @@ -60,6 +69,8 @@ func (o *RegionList) SetItems(v []Region) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RegionList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *RegionList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_restore.go b/api/kbcloud/model_restore.go index 9d7d6f83..4981a809 100644 --- a/api/kbcloud/model_restore.go +++ b/api/kbcloud/model_restore.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Restore create a KubeBlocks restore API + + +// Restore create a KubeBlocks restore API type Restore struct { // organization name OrgName *string `json:"orgName,omitempty"` @@ -22,8 +26,8 @@ type Restore struct { // component name of cluster ComponentName string `json:"componentName"` // target pod name - TargetPodName *string `json:"targetPodName,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` + TargetPodName *string `json:"targetPodName,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` // kubeBlocks restore name Name *string `json:"name,omitempty"` // restore parameters to inject env of the restore CR. @@ -33,10 +37,11 @@ type Restore struct { // restore status Status *RestoreStatus `json:"status,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestore instantiates a new Restore object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -56,7 +61,6 @@ func NewRestoreWithDefaults() *Restore { this := Restore{} return &this } - // GetOrgName returns the OrgName field value if set, zero value otherwise. func (o *Restore) GetOrgName() string { if o == nil || o.OrgName == nil { @@ -85,6 +89,7 @@ func (o *Restore) SetOrgName(v string) { o.OrgName = &v } + // GetBackupName returns the BackupName field value. func (o *Restore) GetBackupName() string { if o == nil { @@ -108,6 +113,7 @@ func (o *Restore) SetBackupName(v string) { o.BackupName = v } + // GetClusterName returns the ClusterName field value. func (o *Restore) GetClusterName() string { if o == nil { @@ -131,6 +137,7 @@ func (o *Restore) SetClusterName(v string) { o.ClusterName = v } + // GetComponentName returns the ComponentName field value. func (o *Restore) GetComponentName() string { if o == nil { @@ -154,6 +161,7 @@ func (o *Restore) SetComponentName(v string) { o.ComponentName = v } + // GetTargetPodName returns the TargetPodName field value if set, zero value otherwise. func (o *Restore) GetTargetPodName() string { if o == nil || o.TargetPodName == nil { @@ -182,6 +190,7 @@ func (o *Restore) SetTargetPodName(v string) { o.TargetPodName = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Restore) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -210,6 +219,7 @@ func (o *Restore) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Restore) GetName() string { if o == nil || o.Name == nil { @@ -238,6 +248,7 @@ func (o *Restore) SetName(v string) { o.Name = &v } + // GetParameters returns the Parameters field value if set, zero value otherwise. func (o *Restore) GetParameters() RestoreParameters { if o == nil || o.Parameters == nil { @@ -266,6 +277,7 @@ func (o *Restore) SetParameters(v RestoreParameters) { o.Parameters = &v } + // GetRestoreTime returns the RestoreTime field value if set, zero value otherwise. func (o *Restore) GetRestoreTime() string { if o == nil || o.RestoreTime == nil { @@ -294,6 +306,7 @@ func (o *Restore) SetRestoreTime(v string) { o.RestoreTime = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Restore) GetStatus() RestoreStatus { if o == nil || o.Status == nil { @@ -322,6 +335,8 @@ func (o *Restore) SetStatus(v RestoreStatus) { o.Status = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Restore) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -366,16 +381,16 @@ func (o Restore) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Restore) UnmarshalJSON(bytes []byte) (err error) { all := struct { - OrgName *string `json:"orgName,omitempty"` - BackupName *string `json:"backupName"` - ClusterName *string `json:"clusterName"` - ComponentName *string `json:"componentName"` - TargetPodName *string `json:"targetPodName,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - Name *string `json:"name,omitempty"` - Parameters *RestoreParameters `json:"parameters,omitempty"` - RestoreTime *string `json:"restoreTime,omitempty"` - Status *RestoreStatus `json:"status,omitempty"` + OrgName *string `json:"orgName,omitempty"` + BackupName *string `json:"backupName"` + ClusterName *string `json:"clusterName"` + ComponentName *string `json:"componentName"` + TargetPodName *string `json:"targetPodName,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Name *string `json:"name,omitempty"` + Parameters *RestoreParameters `json:"parameters,omitempty"` + RestoreTime *string `json:"restoreTime,omitempty"` + Status *RestoreStatus `json:"status,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -391,7 +406,7 @@ func (o *Restore) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"orgName", "backupName", "clusterName", "componentName", "targetPodName", "createdAt", "name", "parameters", "restoreTime", "status"}) + common.DeleteKeys(additionalProperties, &[]string{ "orgName", "backupName", "clusterName", "componentName", "targetPodName", "createdAt", "name", "parameters", "restoreTime", "status", }) } else { return err } @@ -404,12 +419,12 @@ func (o *Restore) UnmarshalJSON(bytes []byte) (err error) { o.TargetPodName = all.TargetPodName o.CreatedAt = all.CreatedAt o.Name = all.Name - if all.Parameters != nil && all.Parameters.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Parameters != nil && all.Parameters.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Parameters = all.Parameters o.RestoreTime = all.RestoreTime - if all.Status != nil && all.Status.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Status != nil && all.Status.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Status = all.Status diff --git a/api/kbcloud/model_restore_create.go b/api/kbcloud/model_restore_create.go index 8f4e9e59..b1568083 100644 --- a/api/kbcloud/model_restore_create.go +++ b/api/kbcloud/model_restore_create.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RestoreCreate RestoreCreate is the payload to restore a KubeBlocks cluster + + +// RestoreCreate RestoreCreate is the payload to restore a KubeBlocks cluster type RestoreCreate struct { // the env name of the target environment to restore EnvironmentName string `json:"environmentName"` @@ -25,10 +30,11 @@ type RestoreCreate struct { // the volume claim restore policy, support values: [Serial, Parallel] VolumeRestorePolicy *VolumeRestorePolicy `json:"volumeRestorePolicy,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreCreate instantiates a new RestoreCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +58,6 @@ func NewRestoreCreateWithDefaults() *RestoreCreate { this.VolumeRestorePolicy = &volumeRestorePolicy return &this } - // GetEnvironmentName returns the EnvironmentName field value. func (o *RestoreCreate) GetEnvironmentName() string { if o == nil { @@ -76,6 +81,7 @@ func (o *RestoreCreate) SetEnvironmentName(v string) { o.EnvironmentName = v } + // GetBackupId returns the BackupId field value. func (o *RestoreCreate) GetBackupId() string { if o == nil { @@ -99,6 +105,7 @@ func (o *RestoreCreate) SetBackupId(v string) { o.BackupId = v } + // GetCluster returns the Cluster field value. func (o *RestoreCreate) GetCluster() Cluster { if o == nil { @@ -122,6 +129,7 @@ func (o *RestoreCreate) SetCluster(v Cluster) { o.Cluster = v } + // GetRestoreTimeStr returns the RestoreTimeStr field value if set, zero value otherwise. func (o *RestoreCreate) GetRestoreTimeStr() string { if o == nil || o.RestoreTimeStr == nil { @@ -150,6 +158,7 @@ func (o *RestoreCreate) SetRestoreTimeStr(v string) { o.RestoreTimeStr = &v } + // GetDoReadyRestoreAfterClusterRunning returns the DoReadyRestoreAfterClusterRunning field value if set, zero value otherwise. func (o *RestoreCreate) GetDoReadyRestoreAfterClusterRunning() bool { if o == nil || o.DoReadyRestoreAfterClusterRunning == nil { @@ -178,6 +187,7 @@ func (o *RestoreCreate) SetDoReadyRestoreAfterClusterRunning(v bool) { o.DoReadyRestoreAfterClusterRunning = &v } + // GetVolumeRestorePolicy returns the VolumeRestorePolicy field value if set, zero value otherwise. func (o *RestoreCreate) GetVolumeRestorePolicy() VolumeRestorePolicy { if o == nil || o.VolumeRestorePolicy == nil { @@ -206,6 +216,8 @@ func (o *RestoreCreate) SetVolumeRestorePolicy(v VolumeRestorePolicy) { o.VolumeRestorePolicy = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -234,12 +246,12 @@ func (o RestoreCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RestoreCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - EnvironmentName *string `json:"environmentName"` - BackupId *string `json:"backupId"` - Cluster *Cluster `json:"cluster"` - RestoreTimeStr *string `json:"restoreTimeStr,omitempty"` - DoReadyRestoreAfterClusterRunning *bool `json:"doReadyRestoreAfterClusterRunning,omitempty"` - VolumeRestorePolicy *VolumeRestorePolicy `json:"volumeRestorePolicy,omitempty"` + EnvironmentName *string `json:"environmentName"` + BackupId *string `json:"backupId"` + Cluster *Cluster `json:"cluster"` + RestoreTimeStr *string `json:"restoreTimeStr,omitempty"` + DoReadyRestoreAfterClusterRunning *bool `json:"doReadyRestoreAfterClusterRunning,omitempty"` + VolumeRestorePolicy *VolumeRestorePolicy `json:"volumeRestorePolicy,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -255,7 +267,7 @@ func (o *RestoreCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"environmentName", "backupId", "cluster", "restoreTimeStr", "doReadyRestoreAfterClusterRunning", "volumeRestorePolicy"}) + common.DeleteKeys(additionalProperties, &[]string{ "environmentName", "backupId", "cluster", "restoreTimeStr", "doReadyRestoreAfterClusterRunning", "volumeRestorePolicy", }) } else { return err } @@ -269,7 +281,7 @@ func (o *RestoreCreate) UnmarshalJSON(bytes []byte) (err error) { o.Cluster = *all.Cluster o.RestoreTimeStr = all.RestoreTimeStr o.DoReadyRestoreAfterClusterRunning = all.DoReadyRestoreAfterClusterRunning - if all.VolumeRestorePolicy != nil && !all.VolumeRestorePolicy.IsValid() { + if all.VolumeRestorePolicy != nil &&!all.VolumeRestorePolicy.IsValid() { hasInvalidField = true } else { o.VolumeRestorePolicy = all.VolumeRestorePolicy diff --git a/api/kbcloud/model_restore_list.go b/api/kbcloud/model_restore_list.go index 0cb231e8..03314340 100644 --- a/api/kbcloud/model_restore_list.go +++ b/api/kbcloud/model_restore_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RestoreList restoreList is a list of restore object + + +// RestoreList restoreList is a list of restore object type RestoreList struct { // Items is the list of restore objects in the list Items []Restore `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreList instantiates a new RestoreList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewRestoreListWithDefaults() *RestoreList { this := RestoreList{} return &this } - // GetItems returns the Items field value. func (o *RestoreList) GetItems() []Restore { if o == nil { @@ -60,6 +65,8 @@ func (o *RestoreList) SetItems(v []Restore) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *RestoreList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_restore_log.go b/api/kbcloud/model_restore_log.go index e144f693..485e969c 100644 --- a/api/kbcloud/model_restore_log.go +++ b/api/kbcloud/model_restore_log.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RestoreLog restore workload logs +// RestoreLog restore workload logs type RestoreLog struct { // items is the list of restoreLogByPod objects Items []RestoreLogByPod `json:"items,omitempty"` // restore id RestoreId *string `json:"restoreId,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreLog instantiates a new RestoreLog object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewRestoreLogWithDefaults() *RestoreLog { this := RestoreLog{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *RestoreLog) GetItems() []RestoreLogByPod { if o == nil || o.Items == nil { @@ -62,6 +71,7 @@ func (o *RestoreLog) SetItems(v []RestoreLogByPod) { o.Items = v } + // GetRestoreId returns the RestoreId field value if set, zero value otherwise. func (o *RestoreLog) GetRestoreId() string { if o == nil || o.RestoreId == nil { @@ -90,6 +100,8 @@ func (o *RestoreLog) SetRestoreId(v string) { o.RestoreId = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreLog) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,15 +124,15 @@ func (o RestoreLog) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RestoreLog) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Items []RestoreLogByPod `json:"items,omitempty"` - RestoreId *string `json:"restoreId,omitempty"` + Items []RestoreLogByPod `json:"items,omitempty"` + RestoreId *string `json:"restoreId,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items", "restoreId"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", "restoreId", }) } else { return err } diff --git a/api/kbcloud/model_restore_log_by_pod.go b/api/kbcloud/model_restore_log_by_pod.go index 36a96878..c122eb64 100644 --- a/api/kbcloud/model_restore_log_by_pod.go +++ b/api/kbcloud/model_restore_log_by_pod.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// RestoreLogByPod info of restore workload log + + +// RestoreLogByPod info of restore workload log type RestoreLogByPod struct { // restore pod log Log *string `json:"log,omitempty"` @@ -21,10 +26,11 @@ type RestoreLogByPod struct { // Date/time when the restore pod was created. CreationTimestamp *time.Time `json:"creationTimestamp,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreLogByPod instantiates a new RestoreLogByPod object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -41,7 +47,6 @@ func NewRestoreLogByPodWithDefaults() *RestoreLogByPod { this := RestoreLogByPod{} return &this } - // GetLog returns the Log field value if set, zero value otherwise. func (o *RestoreLogByPod) GetLog() string { if o == nil || o.Log == nil { @@ -70,6 +75,7 @@ func (o *RestoreLogByPod) SetLog(v string) { o.Log = &v } + // GetOwnerObjectKey returns the OwnerObjectKey field value if set, zero value otherwise. func (o *RestoreLogByPod) GetOwnerObjectKey() string { if o == nil || o.OwnerObjectKey == nil { @@ -98,6 +104,7 @@ func (o *RestoreLogByPod) SetOwnerObjectKey(v string) { o.OwnerObjectKey = &v } + // GetPodName returns the PodName field value if set, zero value otherwise. func (o *RestoreLogByPod) GetPodName() string { if o == nil || o.PodName == nil { @@ -126,6 +133,7 @@ func (o *RestoreLogByPod) SetPodName(v string) { o.PodName = &v } + // GetCreationTimestamp returns the CreationTimestamp field value if set, zero value otherwise. func (o *RestoreLogByPod) GetCreationTimestamp() time.Time { if o == nil || o.CreationTimestamp == nil { @@ -154,6 +162,8 @@ func (o *RestoreLogByPod) SetCreationTimestamp(v time.Time) { o.CreationTimestamp = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreLogByPod) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -186,9 +196,9 @@ func (o RestoreLogByPod) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RestoreLogByPod) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Log *string `json:"log,omitempty"` - OwnerObjectKey *string `json:"ownerObjectKey,omitempty"` - PodName *string `json:"podName,omitempty"` + Log *string `json:"log,omitempty"` + OwnerObjectKey *string `json:"ownerObjectKey,omitempty"` + PodName *string `json:"podName,omitempty"` CreationTimestamp *time.Time `json:"creationTimestamp,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -196,7 +206,7 @@ func (o *RestoreLogByPod) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"log", "ownerObjectKey", "podName", "creationTimestamp"}) + common.DeleteKeys(additionalProperties, &[]string{ "log", "ownerObjectKey", "podName", "creationTimestamp", }) } else { return err } diff --git a/api/kbcloud/model_restore_parameters.go b/api/kbcloud/model_restore_parameters.go index 932aa2a2..9248659b 100644 --- a/api/kbcloud/model_restore_parameters.go +++ b/api/kbcloud/model_restore_parameters.go @@ -2,17 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// RestoreParameters restore parameters to inject env of the restore CR. + + +// RestoreParameters restore parameters to inject env of the restore CR. type RestoreParameters struct { // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreParameters instantiates a new RestoreParameters object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +62,7 @@ func (o *RestoreParameters) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{}) + common.DeleteKeys(additionalProperties, &[]string{ }) } else { return err } diff --git a/api/kbcloud/model_restore_status.go b/api/kbcloud/model_restore_status.go index 8f4cb45f..9ffad349 100644 --- a/api/kbcloud/model_restore_status.go +++ b/api/kbcloud/model_restore_status.go @@ -2,25 +2,35 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// RestoreStatus restore status + +// RestoreStatus restore status type RestoreStatus struct { Actions []RestoreStatusActionsItem `json:"actions,omitempty"` // completion time - CompletionTimestamp *string `json:"completionTimestamp,omitempty"` - Conditions []RestoreStatusConditionsItem `json:"conditions,omitempty"` + CompletionTimestamp *string `json:"completionTimestamp,omitempty"` + Conditions []RestoreStatusConditionsItem `json:"conditions,omitempty"` // restore phase Phase *string `json:"phase,omitempty"` // start time StartTimestamp *string `json:"startTimestamp,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreStatus instantiates a new RestoreStatus object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewRestoreStatusWithDefaults() *RestoreStatus { this := RestoreStatus{} return &this } - // GetActions returns the Actions field value if set, zero value otherwise. func (o *RestoreStatus) GetActions() []RestoreStatusActionsItem { if o == nil || o.Actions == nil { @@ -66,6 +75,7 @@ func (o *RestoreStatus) SetActions(v []RestoreStatusActionsItem) { o.Actions = v } + // GetCompletionTimestamp returns the CompletionTimestamp field value if set, zero value otherwise. func (o *RestoreStatus) GetCompletionTimestamp() string { if o == nil || o.CompletionTimestamp == nil { @@ -94,6 +104,7 @@ func (o *RestoreStatus) SetCompletionTimestamp(v string) { o.CompletionTimestamp = &v } + // GetConditions returns the Conditions field value if set, zero value otherwise. func (o *RestoreStatus) GetConditions() []RestoreStatusConditionsItem { if o == nil || o.Conditions == nil { @@ -122,6 +133,7 @@ func (o *RestoreStatus) SetConditions(v []RestoreStatusConditionsItem) { o.Conditions = v } + // GetPhase returns the Phase field value if set, zero value otherwise. func (o *RestoreStatus) GetPhase() string { if o == nil || o.Phase == nil { @@ -150,6 +162,7 @@ func (o *RestoreStatus) SetPhase(v string) { o.Phase = &v } + // GetStartTimestamp returns the StartTimestamp field value if set, zero value otherwise. func (o *RestoreStatus) GetStartTimestamp() string { if o == nil || o.StartTimestamp == nil { @@ -178,6 +191,8 @@ func (o *RestoreStatus) SetStartTimestamp(v string) { o.StartTimestamp = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -209,18 +224,18 @@ func (o RestoreStatus) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RestoreStatus) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Actions []RestoreStatusActionsItem `json:"actions,omitempty"` - CompletionTimestamp *string `json:"completionTimestamp,omitempty"` - Conditions []RestoreStatusConditionsItem `json:"conditions,omitempty"` - Phase *string `json:"phase,omitempty"` - StartTimestamp *string `json:"startTimestamp,omitempty"` + Actions []RestoreStatusActionsItem `json:"actions,omitempty"` + CompletionTimestamp *string `json:"completionTimestamp,omitempty"` + Conditions []RestoreStatusConditionsItem `json:"conditions,omitempty"` + Phase *string `json:"phase,omitempty"` + StartTimestamp *string `json:"startTimestamp,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"actions", "completionTimestamp", "conditions", "phase", "startTimestamp"}) + common.DeleteKeys(additionalProperties, &[]string{ "actions", "completionTimestamp", "conditions", "phase", "startTimestamp", }) } else { return err } diff --git a/api/kbcloud/model_restore_status_actions_item.go b/api/kbcloud/model_restore_status_actions_item.go index cd770321..773e410d 100644 --- a/api/kbcloud/model_restore_status_actions_item.go +++ b/api/kbcloud/model_restore_status_actions_item.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type RestoreStatusActionsItem struct { Message *string `json:"message,omitempty"` // action name @@ -13,10 +22,11 @@ type RestoreStatusActionsItem struct { // action status, enum values: [Processing, Completed, Failed] Status *string `json:"status,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreStatusActionsItem instantiates a new RestoreStatusActionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewRestoreStatusActionsItemWithDefaults() *RestoreStatusActionsItem { this := RestoreStatusActionsItem{} return &this } - // GetMessage returns the Message field value if set, zero value otherwise. func (o *RestoreStatusActionsItem) GetMessage() string { if o == nil || o.Message == nil { @@ -62,6 +71,7 @@ func (o *RestoreStatusActionsItem) SetMessage(v string) { o.Message = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *RestoreStatusActionsItem) GetName() string { if o == nil || o.Name == nil { @@ -90,6 +100,7 @@ func (o *RestoreStatusActionsItem) SetName(v string) { o.Name = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *RestoreStatusActionsItem) GetStatus() string { if o == nil || o.Status == nil { @@ -118,6 +129,8 @@ func (o *RestoreStatusActionsItem) SetStatus(v string) { o.Status = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreStatusActionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -144,15 +157,15 @@ func (o RestoreStatusActionsItem) MarshalJSON() ([]byte, error) { func (o *RestoreStatusActionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { Message *string `json:"message,omitempty"` - Name *string `json:"name,omitempty"` - Status *string `json:"status,omitempty"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"message", "name", "status"}) + common.DeleteKeys(additionalProperties, &[]string{ "message", "name", "status", }) } else { return err } diff --git a/api/kbcloud/model_restore_status_conditions_item.go b/api/kbcloud/model_restore_status_conditions_item.go index 614022cc..6c1faec0 100644 --- a/api/kbcloud/model_restore_status_conditions_item.go +++ b/api/kbcloud/model_restore_status_conditions_item.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type RestoreStatusConditionsItem struct { Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` + Reason *string `json:"reason,omitempty"` // conditionType Type *string `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRestoreStatusConditionsItem instantiates a new RestoreStatusConditionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewRestoreStatusConditionsItemWithDefaults() *RestoreStatusConditionsItem { this := RestoreStatusConditionsItem{} return &this } - // GetMessage returns the Message field value if set, zero value otherwise. func (o *RestoreStatusConditionsItem) GetMessage() string { if o == nil || o.Message == nil { @@ -61,6 +70,7 @@ func (o *RestoreStatusConditionsItem) SetMessage(v string) { o.Message = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *RestoreStatusConditionsItem) GetReason() string { if o == nil || o.Reason == nil { @@ -89,6 +99,7 @@ func (o *RestoreStatusConditionsItem) SetReason(v string) { o.Reason = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *RestoreStatusConditionsItem) GetType() string { if o == nil || o.Type == nil { @@ -117,6 +128,8 @@ func (o *RestoreStatusConditionsItem) SetType(v string) { o.Type = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RestoreStatusConditionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,15 +156,15 @@ func (o RestoreStatusConditionsItem) MarshalJSON() ([]byte, error) { func (o *RestoreStatusConditionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` - Type *string `json:"type,omitempty"` + Reason *string `json:"reason,omitempty"` + Type *string `json:"type,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"message", "reason", "type"}) + common.DeleteKeys(additionalProperties, &[]string{ "message", "reason", "type", }) } else { return err } diff --git a/api/kbcloud/model_result.go b/api/kbcloud/model_result.go index ccd0247a..83cd490f 100644 --- a/api/kbcloud/model_result.go +++ b/api/kbcloud/model_result.go @@ -2,20 +2,30 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Result struct { - Pagination *Pagination `json:"pagination,omitempty"` - Columns []string `json:"columns,omitempty"` - Rows [][]interface{} `json:"rows,omitempty"` - Stats *ResultStats `json:"stats,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` + Columns []string `json:"columns,omitempty"` + Rows [][]interface{} `json:"rows,omitempty"` + Stats *ResultStats `json:"stats,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewResult instantiates a new Result object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -32,7 +42,6 @@ func NewResultWithDefaults() *Result { this := Result{} return &this } - // GetPagination returns the Pagination field value if set, zero value otherwise. func (o *Result) GetPagination() Pagination { if o == nil || o.Pagination == nil { @@ -61,6 +70,7 @@ func (o *Result) SetPagination(v Pagination) { o.Pagination = &v } + // GetColumns returns the Columns field value if set, zero value otherwise. func (o *Result) GetColumns() []string { if o == nil || o.Columns == nil { @@ -89,6 +99,7 @@ func (o *Result) SetColumns(v []string) { o.Columns = v } + // GetRows returns the Rows field value if set, zero value otherwise. func (o *Result) GetRows() [][]interface{} { if o == nil || o.Rows == nil { @@ -117,6 +128,7 @@ func (o *Result) SetRows(v [][]interface{}) { o.Rows = v } + // GetStats returns the Stats field value if set, zero value otherwise. func (o *Result) GetStats() ResultStats { if o == nil || o.Stats == nil { @@ -145,6 +157,8 @@ func (o *Result) SetStats(v ResultStats) { o.Stats = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Result) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -173,29 +187,29 @@ func (o Result) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Result) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Pagination *Pagination `json:"pagination,omitempty"` - Columns []string `json:"columns,omitempty"` - Rows [][]interface{} `json:"rows,omitempty"` - Stats *ResultStats `json:"stats,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` + Columns []string `json:"columns,omitempty"` + Rows [][]interface{} `json:"rows,omitempty"` + Stats *ResultStats `json:"stats,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"pagination", "columns", "rows", "stats"}) + common.DeleteKeys(additionalProperties, &[]string{ "pagination", "columns", "rows", "stats", }) } else { return err } hasInvalidField := false - if all.Pagination != nil && all.Pagination.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Pagination != nil && all.Pagination.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Pagination = all.Pagination o.Columns = all.Columns o.Rows = all.Rows - if all.Stats != nil && all.Stats.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Stats != nil && all.Stats.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Stats = all.Stats diff --git a/api/kbcloud/model_result_stats.go b/api/kbcloud/model_result_stats.go index ce1e43aa..d52318d7 100644 --- a/api/kbcloud/model_result_stats.go +++ b/api/kbcloud/model_result_stats.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) + + type ResultStats struct { - ColumnsCount *int32 `json:"columns_count,omitempty"` - RowsCount *int32 `json:"rows_count,omitempty"` - RowsAffected *int32 `json:"rows_affected,omitempty"` - QueryStartTime *time.Time `json:"query_start_time,omitempty"` + ColumnsCount *int32 `json:"columns_count,omitempty"` + RowsCount *int32 `json:"rows_count,omitempty"` + RowsAffected *int32 `json:"rows_affected,omitempty"` + QueryStartTime *time.Time `json:"query_start_time,omitempty"` QueryFinishTime *time.Time `json:"query_finish_time,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewResultStats instantiates a new ResultStats object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +43,6 @@ func NewResultStatsWithDefaults() *ResultStats { this := ResultStats{} return &this } - // GetColumnsCount returns the ColumnsCount field value if set, zero value otherwise. func (o *ResultStats) GetColumnsCount() int32 { if o == nil || o.ColumnsCount == nil { @@ -66,6 +71,7 @@ func (o *ResultStats) SetColumnsCount(v int32) { o.ColumnsCount = &v } + // GetRowsCount returns the RowsCount field value if set, zero value otherwise. func (o *ResultStats) GetRowsCount() int32 { if o == nil || o.RowsCount == nil { @@ -94,6 +100,7 @@ func (o *ResultStats) SetRowsCount(v int32) { o.RowsCount = &v } + // GetRowsAffected returns the RowsAffected field value if set, zero value otherwise. func (o *ResultStats) GetRowsAffected() int32 { if o == nil || o.RowsAffected == nil { @@ -122,6 +129,7 @@ func (o *ResultStats) SetRowsAffected(v int32) { o.RowsAffected = &v } + // GetQueryStartTime returns the QueryStartTime field value if set, zero value otherwise. func (o *ResultStats) GetQueryStartTime() time.Time { if o == nil || o.QueryStartTime == nil { @@ -150,6 +158,7 @@ func (o *ResultStats) SetQueryStartTime(v time.Time) { o.QueryStartTime = &v } + // GetQueryFinishTime returns the QueryFinishTime field value if set, zero value otherwise. func (o *ResultStats) GetQueryFinishTime() time.Time { if o == nil || o.QueryFinishTime == nil { @@ -178,6 +187,8 @@ func (o *ResultStats) SetQueryFinishTime(v time.Time) { o.QueryFinishTime = &v } + + // MarshalJSON serializes the struct using spec logic. func (o ResultStats) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -217,10 +228,10 @@ func (o ResultStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ResultStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ColumnsCount *int32 `json:"columns_count,omitempty"` - RowsCount *int32 `json:"rows_count,omitempty"` - RowsAffected *int32 `json:"rows_affected,omitempty"` - QueryStartTime *time.Time `json:"query_start_time,omitempty"` + ColumnsCount *int32 `json:"columns_count,omitempty"` + RowsCount *int32 `json:"rows_count,omitempty"` + RowsAffected *int32 `json:"rows_affected,omitempty"` + QueryStartTime *time.Time `json:"query_start_time,omitempty"` QueryFinishTime *time.Time `json:"query_finish_time,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -228,7 +239,7 @@ func (o *ResultStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"columns_count", "rows_count", "rows_affected", "query_start_time", "query_finish_time"}) + common.DeleteKeys(additionalProperties, &[]string{ "columns_count", "rows_count", "rows_affected", "query_start_time", "query_finish_time", }) } else { return err } diff --git a/api/kbcloud/model_role.go b/api/kbcloud/model_role.go index aa29cd53..d16a68e4 100644 --- a/api/kbcloud/model_role.go +++ b/api/kbcloud/model_role.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( - "time" + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" - "github.com/apecloud/kb-cloud-client-go/api/common" ) -// Role Role information + + +// Role Role information type Role struct { // The name of the role Name *string `json:"name,omitempty"` @@ -23,10 +28,11 @@ type Role struct { // The time when the role was updated. Read-Only UpdatedAt *time.Time `json:"updatedAt,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRole instantiates a new Role object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -43,7 +49,6 @@ func NewRoleWithDefaults() *Role { this := Role{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *Role) GetName() string { if o == nil || o.Name == nil { @@ -72,6 +77,7 @@ func (o *Role) SetName(v string) { o.Name = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *Role) GetType() string { if o == nil || o.Type == nil { @@ -100,6 +106,7 @@ func (o *Role) SetType(v string) { o.Type = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *Role) GetDescription() string { if o == nil || o.Description == nil { @@ -128,6 +135,7 @@ func (o *Role) SetDescription(v string) { o.Description = &v } + // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *Role) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -156,6 +164,7 @@ func (o *Role) SetCreatedAt(v time.Time) { o.CreatedAt = &v } + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Role) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { @@ -184,6 +193,8 @@ func (o *Role) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Role) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -223,18 +234,18 @@ func (o Role) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Role) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Description *string `json:"description,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "type", "description", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "type", "description", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/model_role_create.go b/api/kbcloud/model_role_create.go index 4983f681..dc885975 100644 --- a/api/kbcloud/model_role_create.go +++ b/api/kbcloud/model_role_create.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RoleCreate Role create +// RoleCreate Role create type RoleCreate struct { // The name of the role Name *string `json:"name,omitempty"` // The description of the role Description *string `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRoleCreate instantiates a new RoleCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewRoleCreateWithDefaults() *RoleCreate { this := RoleCreate{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *RoleCreate) GetName() string { if o == nil || o.Name == nil { @@ -62,6 +71,7 @@ func (o *RoleCreate) SetName(v string) { o.Name = &v } + // GetDescription returns the Description field value if set, zero value otherwise. func (o *RoleCreate) GetDescription() string { if o == nil || o.Description == nil { @@ -90,6 +100,8 @@ func (o *RoleCreate) SetDescription(v string) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RoleCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -112,7 +124,7 @@ func (o RoleCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *RoleCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -120,7 +132,7 @@ func (o *RoleCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "description"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "description", }) } else { return err } diff --git a/api/kbcloud/model_role_list.go b/api/kbcloud/model_role_list.go index 4cae2847..d8b0afdf 100644 --- a/api/kbcloud/model_role_list.go +++ b/api/kbcloud/model_role_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// RoleList RoleList is a list of Roles + + +// RoleList RoleList is a list of Roles type RoleList struct { // Items is the list of Role objects in the list Items []Role `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRoleList instantiates a new RoleList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewRoleListWithDefaults() *RoleList { this := RoleList{} return &this } - // GetItems returns the Items field value. func (o *RoleList) GetItems() []Role { if o == nil { @@ -60,6 +65,8 @@ func (o *RoleList) SetItems(v []Role) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o RoleList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *RoleList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_role_update.go b/api/kbcloud/model_role_update.go index 96a82883..608eaac5 100644 --- a/api/kbcloud/model_role_update.go +++ b/api/kbcloud/model_role_update.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// RoleUpdate Role update +// RoleUpdate Role update type RoleUpdate struct { // The description of the role Description *string `json:"description,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewRoleUpdate instantiates a new RoleUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewRoleUpdateWithDefaults() *RoleUpdate { this := RoleUpdate{} return &this } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *RoleUpdate) GetDescription() string { if o == nil || o.Description == nil { @@ -60,6 +69,8 @@ func (o *RoleUpdate) SetDescription(v string) { o.Description = &v } + + // MarshalJSON serializes the struct using spec logic. func (o RoleUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *RoleUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"description"}) + common.DeleteKeys(additionalProperties, &[]string{ "description", }) } else { return err } diff --git a/api/kbcloud/model_sort_type.go b/api/kbcloud/model_sort_type.go index 14ca9f6f..9ae6419d 100644 --- a/api/kbcloud/model_sort_type.go +++ b/api/kbcloud/model_sort_type.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // SortType Represents the type of sorting. type SortType string // List of SortType. const ( - SortTypeAsc SortType = "asc" + SortTypeAsc SortType = "asc" SortTypeDesc SortType = "desc" ) diff --git a/api/kbcloud/model_sql_req_res.go b/api/kbcloud/model_sql_req_res.go index c3023180..6e94b03a 100644 --- a/api/kbcloud/model_sql_req_res.go +++ b/api/kbcloud/model_sql_req_res.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type SqlReqRes struct { // SQL request or response body Body *string `json:"body,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewSqlReqRes instantiates a new SqlReqRes object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewSqlReqResWithDefaults() *SqlReqRes { this := SqlReqRes{} return &this } - // GetBody returns the Body field value if set, zero value otherwise. func (o *SqlReqRes) GetBody() string { if o == nil || o.Body == nil { @@ -59,6 +68,8 @@ func (o *SqlReqRes) SetBody(v string) { o.Body = &v } + + // MarshalJSON serializes the struct using spec logic. func (o SqlReqRes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *SqlReqRes) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"body"}) + common.DeleteKeys(additionalProperties, &[]string{ "body", }) } else { return err } diff --git a/api/kbcloud/model_storage_class_info.go b/api/kbcloud/model_storage_class_info.go index 73795ea5..dc777686 100644 --- a/api/kbcloud/model_storage_class_info.go +++ b/api/kbcloud/model_storage_class_info.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageClassInfo StorageClassInfo provides detailed information about a specific storage class. + + +// StorageClassInfo StorageClassInfo provides detailed information about a specific storage class. type StorageClassInfo struct { // the name of the storage class Name string `json:"name"` @@ -60,10 +64,11 @@ type StorageClassInfo struct { // the List stands for stats for the storage volumes of nodes. StatsByNodeList StorageClassInfoStatsByNodeList `json:"statsByNodeList"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageClassInfo instantiates a new StorageClassInfo object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -102,7 +107,6 @@ func NewStorageClassInfoWithDefaults() *StorageClassInfo { this := StorageClassInfo{} return &this } - // GetName returns the Name field value. func (o *StorageClassInfo) GetName() string { if o == nil { @@ -126,6 +130,7 @@ func (o *StorageClassInfo) SetName(v string) { o.Name = v } + // GetCreationTimestamp returns the CreationTimestamp field value. func (o *StorageClassInfo) GetCreationTimestamp() string { if o == nil { @@ -149,6 +154,7 @@ func (o *StorageClassInfo) SetCreationTimestamp(v string) { o.CreationTimestamp = v } + // GetProvisioner returns the Provisioner field value. func (o *StorageClassInfo) GetProvisioner() string { if o == nil { @@ -172,6 +178,7 @@ func (o *StorageClassInfo) SetProvisioner(v string) { o.Provisioner = v } + // GetParameters returns the Parameters field value. func (o *StorageClassInfo) GetParameters() map[string]string { if o == nil { @@ -195,6 +202,7 @@ func (o *StorageClassInfo) SetParameters(v map[string]string) { o.Parameters = v } + // GetLabels returns the Labels field value. func (o *StorageClassInfo) GetLabels() map[string]string { if o == nil { @@ -218,6 +226,7 @@ func (o *StorageClassInfo) SetLabels(v map[string]string) { o.Labels = v } + // GetAnnotations returns the Annotations field value. func (o *StorageClassInfo) GetAnnotations() map[string]string { if o == nil { @@ -241,6 +250,7 @@ func (o *StorageClassInfo) SetAnnotations(v map[string]string) { o.Annotations = v } + // GetReclaimPolicy returns the ReclaimPolicy field value. func (o *StorageClassInfo) GetReclaimPolicy() string { if o == nil { @@ -264,6 +274,7 @@ func (o *StorageClassInfo) SetReclaimPolicy(v string) { o.ReclaimPolicy = v } + // GetAllowVolumeExpansion returns the AllowVolumeExpansion field value. func (o *StorageClassInfo) GetAllowVolumeExpansion() bool { if o == nil { @@ -287,6 +298,7 @@ func (o *StorageClassInfo) SetAllowVolumeExpansion(v bool) { o.AllowVolumeExpansion = v } + // GetVolumeBindingMode returns the VolumeBindingMode field value. func (o *StorageClassInfo) GetVolumeBindingMode() string { if o == nil { @@ -310,6 +322,7 @@ func (o *StorageClassInfo) SetVolumeBindingMode(v string) { o.VolumeBindingMode = v } + // GetPvcCount returns the PvcCount field value. func (o *StorageClassInfo) GetPvcCount() string { if o == nil { @@ -333,6 +346,7 @@ func (o *StorageClassInfo) SetPvcCount(v string) { o.PvcCount = v } + // GetAllowClone returns the AllowClone field value. func (o *StorageClassInfo) GetAllowClone() bool { if o == nil { @@ -356,6 +370,7 @@ func (o *StorageClassInfo) SetAllowClone(v bool) { o.AllowClone = v } + // GetAllowSnapshot returns the AllowSnapshot field value. func (o *StorageClassInfo) GetAllowSnapshot() bool { if o == nil { @@ -379,6 +394,7 @@ func (o *StorageClassInfo) SetAllowSnapshot(v bool) { o.AllowSnapshot = v } + // GetIsDefaultClass returns the IsDefaultClass field value. func (o *StorageClassInfo) GetIsDefaultClass() bool { if o == nil { @@ -402,6 +418,7 @@ func (o *StorageClassInfo) SetIsDefaultClass(v bool) { o.IsDefaultClass = v } + // GetType returns the Type field value. func (o *StorageClassInfo) GetType() string { if o == nil { @@ -425,6 +442,7 @@ func (o *StorageClassInfo) SetType(v string) { o.Type = v } + // GetHostPath returns the HostPath field value if set, zero value otherwise. func (o *StorageClassInfo) GetHostPath() string { if o == nil || o.HostPath == nil { @@ -453,6 +471,7 @@ func (o *StorageClassInfo) SetHostPath(v string) { o.HostPath = &v } + // GetMountOptions returns the MountOptions field value. func (o *StorageClassInfo) GetMountOptions() []string { if o == nil { @@ -476,6 +495,7 @@ func (o *StorageClassInfo) SetMountOptions(v []string) { o.MountOptions = v } + // GetCreatedAt returns the CreatedAt field value. func (o *StorageClassInfo) GetCreatedAt() time.Time { if o == nil { @@ -499,6 +519,7 @@ func (o *StorageClassInfo) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDescription returns the Description field value. func (o *StorageClassInfo) GetDescription() string { if o == nil { @@ -522,6 +543,7 @@ func (o *StorageClassInfo) SetDescription(v string) { o.Description = v } + // GetDisplayName returns the DisplayName field value. func (o *StorageClassInfo) GetDisplayName() string { if o == nil { @@ -545,6 +567,7 @@ func (o *StorageClassInfo) SetDisplayName(v string) { o.DisplayName = v } + // GetEnabled returns the Enabled field value. func (o *StorageClassInfo) GetEnabled() bool { if o == nil { @@ -568,6 +591,7 @@ func (o *StorageClassInfo) SetEnabled(v bool) { o.Enabled = v } + // GetId returns the Id field value. func (o *StorageClassInfo) GetId() string { if o == nil { @@ -591,6 +615,7 @@ func (o *StorageClassInfo) SetId(v string) { o.Id = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *StorageClassInfo) GetUpdatedAt() time.Time { if o == nil { @@ -614,6 +639,7 @@ func (o *StorageClassInfo) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + // GetStatsByNodeList returns the StatsByNodeList field value. func (o *StorageClassInfo) GetStatsByNodeList() StorageClassInfoStatsByNodeList { if o == nil { @@ -637,6 +663,8 @@ func (o *StorageClassInfo) SetStatsByNodeList(v StorageClassInfoStatsByNodeList) o.StatsByNodeList = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageClassInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -686,29 +714,29 @@ func (o StorageClassInfo) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageClassInfo) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - CreationTimestamp *string `json:"creationTimestamp"` - Provisioner *string `json:"provisioner"` - Parameters *map[string]string `json:"parameters"` - Labels *map[string]string `json:"labels"` - Annotations *map[string]string `json:"annotations"` - ReclaimPolicy *string `json:"reclaimPolicy"` - AllowVolumeExpansion *bool `json:"allowVolumeExpansion"` - VolumeBindingMode *string `json:"volumeBindingMode"` - PvcCount *string `json:"pvcCount"` - AllowClone *bool `json:"allowClone"` - AllowSnapshot *bool `json:"allowSnapshot"` - IsDefaultClass *bool `json:"isDefaultClass"` - Type *string `json:"type"` - HostPath *string `json:"hostPath,omitempty"` - MountOptions *[]string `json:"mountOptions"` - CreatedAt *time.Time `json:"createdAt"` - Description *string `json:"description"` - DisplayName *string `json:"displayName"` - Enabled *bool `json:"enabled"` - Id *string `json:"id"` - UpdatedAt *time.Time `json:"updatedAt"` - StatsByNodeList *StorageClassInfoStatsByNodeList `json:"statsByNodeList"` + Name *string `json:"name"` + CreationTimestamp *string `json:"creationTimestamp"` + Provisioner *string `json:"provisioner"` + Parameters *map[string]string `json:"parameters"` + Labels *map[string]string `json:"labels"` + Annotations *map[string]string `json:"annotations"` + ReclaimPolicy *string `json:"reclaimPolicy"` + AllowVolumeExpansion *bool `json:"allowVolumeExpansion"` + VolumeBindingMode *string `json:"volumeBindingMode"` + PvcCount *string `json:"pvcCount"` + AllowClone *bool `json:"allowClone"` + AllowSnapshot *bool `json:"allowSnapshot"` + IsDefaultClass *bool `json:"isDefaultClass"` + Type *string `json:"type"` + HostPath *string `json:"hostPath,omitempty"` + MountOptions *[]string `json:"mountOptions"` + CreatedAt *time.Time `json:"createdAt"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + Enabled *bool `json:"enabled"` + Id *string `json:"id"` + UpdatedAt *time.Time `json:"updatedAt"` + StatsByNodeList *StorageClassInfoStatsByNodeList `json:"statsByNodeList"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -781,7 +809,7 @@ func (o *StorageClassInfo) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "creationTimestamp", "provisioner", "parameters", "labels", "annotations", "reclaimPolicy", "allowVolumeExpansion", "volumeBindingMode", "pvcCount", "allowClone", "allowSnapshot", "isDefaultClass", "type", "hostPath", "mountOptions", "createdAt", "description", "displayName", "enabled", "id", "updatedAt", "statsByNodeList"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "creationTimestamp", "provisioner", "parameters", "labels", "annotations", "reclaimPolicy", "allowVolumeExpansion", "volumeBindingMode", "pvcCount", "allowClone", "allowSnapshot", "isDefaultClass", "type", "hostPath", "mountOptions", "createdAt", "description", "displayName", "enabled", "id", "updatedAt", "statsByNodeList", }) } else { return err } diff --git a/api/kbcloud/model_storage_class_info_stats_by_node_list.go b/api/kbcloud/model_storage_class_info_stats_by_node_list.go index ccdc3649..c1fbeb0b 100644 --- a/api/kbcloud/model_storage_class_info_stats_by_node_list.go +++ b/api/kbcloud/model_storage_class_info_stats_by_node_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageClassInfoStatsByNodeList the List stands for stats for the storage volumes of nodes. + + +// StorageClassInfoStatsByNodeList the List stands for stats for the storage volumes of nodes. type StorageClassInfoStatsByNodeList struct { // the list of storage volumes stats by node Items []StorageVolumeStatsByNode `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageClassInfoStatsByNodeList instantiates a new StorageClassInfoStatsByNodeList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewStorageClassInfoStatsByNodeListWithDefaults() *StorageClassInfoStatsByNo this := StorageClassInfoStatsByNodeList{} return &this } - // GetItems returns the Items field value. func (o *StorageClassInfoStatsByNodeList) GetItems() []StorageVolumeStatsByNode { if o == nil { @@ -60,6 +65,8 @@ func (o *StorageClassInfoStatsByNodeList) SetItems(v []StorageVolumeStatsByNode) o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageClassInfoStatsByNodeList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *StorageClassInfoStatsByNodeList) UnmarshalJSON(bytes []byte) (err error } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_storage_class_list.go b/api/kbcloud/model_storage_class_list.go index 4931b5b3..4e3f57f2 100644 --- a/api/kbcloud/model_storage_class_list.go +++ b/api/kbcloud/model_storage_class_list.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// StorageClassList StorageClassList stands for stats for storage classes. + + +// StorageClassList StorageClassList stands for stats for storage classes. type StorageClassList struct { // the list of storage classes Items []StorageClassInfo `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageClassList instantiates a new StorageClassList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -36,7 +42,6 @@ func NewStorageClassListWithDefaults() *StorageClassList { this := StorageClassList{} return &this } - // GetItems returns the Items field value. func (o *StorageClassList) GetItems() []StorageClassInfo { if o == nil { @@ -60,6 +65,8 @@ func (o *StorageClassList) SetItems(v []StorageClassInfo) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageClassList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -87,7 +94,7 @@ func (o *StorageClassList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err } diff --git a/api/kbcloud/model_storage_option.go b/api/kbcloud/model_storage_option.go index 88510cc3..1d898149 100644 --- a/api/kbcloud/model_storage_option.go +++ b/api/kbcloud/model_storage_option.go @@ -2,26 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type StorageOption struct { - Title LocalizedDescription `json:"title"` - Name string `json:"name"` - Min int32 `json:"min"` - Max int32 `json:"max"` - Default int32 `json:"default"` - Step int32 `json:"step"` + Title LocalizedDescription `json:"title"` + Name string `json:"name"` + Min int32 `json:"min"` + Max int32 `json:"max"` + Default int32 `json:"default"` + Step int32 `json:"step"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageOption instantiates a new StorageOption object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -44,7 +50,6 @@ func NewStorageOptionWithDefaults() *StorageOption { this := StorageOption{} return &this } - // GetTitle returns the Title field value. func (o *StorageOption) GetTitle() LocalizedDescription { if o == nil { @@ -68,6 +73,7 @@ func (o *StorageOption) SetTitle(v LocalizedDescription) { o.Title = v } + // GetName returns the Name field value. func (o *StorageOption) GetName() string { if o == nil { @@ -91,6 +97,7 @@ func (o *StorageOption) SetName(v string) { o.Name = v } + // GetMin returns the Min field value. func (o *StorageOption) GetMin() int32 { if o == nil { @@ -114,6 +121,7 @@ func (o *StorageOption) SetMin(v int32) { o.Min = v } + // GetMax returns the Max field value. func (o *StorageOption) GetMax() int32 { if o == nil { @@ -137,6 +145,7 @@ func (o *StorageOption) SetMax(v int32) { o.Max = v } + // GetDefault returns the Default field value. func (o *StorageOption) GetDefault() int32 { if o == nil { @@ -160,6 +169,7 @@ func (o *StorageOption) SetDefault(v int32) { o.Default = v } + // GetStep returns the Step field value. func (o *StorageOption) GetStep() int32 { if o == nil { @@ -183,6 +193,8 @@ func (o *StorageOption) SetStep(v int32) { o.Step = v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageOption) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -205,12 +217,12 @@ func (o StorageOption) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageOption) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Title *LocalizedDescription `json:"title"` - Name *string `json:"name"` - Min *int32 `json:"min"` - Max *int32 `json:"max"` - Default *int32 `json:"default"` - Step *int32 `json:"step"` + Title *LocalizedDescription `json:"title"` + Name *string `json:"name"` + Min *int32 `json:"min"` + Max *int32 `json:"max"` + Default *int32 `json:"default"` + Step *int32 `json:"step"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -235,7 +247,7 @@ func (o *StorageOption) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"title", "name", "min", "max", "default", "step"}) + common.DeleteKeys(additionalProperties, &[]string{ "title", "name", "min", "max", "default", "step", }) } else { return err } diff --git a/api/kbcloud/model_storage_volume_stats_by_node.go b/api/kbcloud/model_storage_volume_stats_by_node.go index 15b32709..8b5c1f3c 100644 --- a/api/kbcloud/model_storage_volume_stats_by_node.go +++ b/api/kbcloud/model_storage_volume_stats_by_node.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// StorageVolumeStatsByNode storageVolumeStatsByNode provides detailed information about storage volumes of nodes. + + +// StorageVolumeStatsByNode storageVolumeStatsByNode provides detailed information about storage volumes of nodes. type StorageVolumeStatsByNode struct { // the name of the node NodeName *string `json:"nodeName,omitempty"` @@ -17,10 +26,11 @@ type StorageVolumeStatsByNode struct { // the sum of capacity of PVC on the node Capacity *string `json:"capacity,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewStorageVolumeStatsByNode instantiates a new StorageVolumeStatsByNode object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewStorageVolumeStatsByNodeWithDefaults() *StorageVolumeStatsByNode { this := StorageVolumeStatsByNode{} return &this } - // GetNodeName returns the NodeName field value if set, zero value otherwise. func (o *StorageVolumeStatsByNode) GetNodeName() string { if o == nil || o.NodeName == nil { @@ -66,6 +75,7 @@ func (o *StorageVolumeStatsByNode) SetNodeName(v string) { o.NodeName = &v } + // GetNodeStatus returns the NodeStatus field value if set, zero value otherwise. func (o *StorageVolumeStatsByNode) GetNodeStatus() string { if o == nil || o.NodeStatus == nil { @@ -94,6 +104,7 @@ func (o *StorageVolumeStatsByNode) SetNodeStatus(v string) { o.NodeStatus = &v } + // GetVolumeNum returns the VolumeNum field value if set, zero value otherwise. func (o *StorageVolumeStatsByNode) GetVolumeNum() string { if o == nil || o.VolumeNum == nil { @@ -122,6 +133,7 @@ func (o *StorageVolumeStatsByNode) SetVolumeNum(v string) { o.VolumeNum = &v } + // GetCapacity returns the Capacity field value if set, zero value otherwise. func (o *StorageVolumeStatsByNode) GetCapacity() string { if o == nil || o.Capacity == nil { @@ -150,6 +162,8 @@ func (o *StorageVolumeStatsByNode) SetCapacity(v string) { o.Capacity = &v } + + // MarshalJSON serializes the struct using spec logic. func (o StorageVolumeStatsByNode) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -178,17 +192,17 @@ func (o StorageVolumeStatsByNode) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *StorageVolumeStatsByNode) UnmarshalJSON(bytes []byte) (err error) { all := struct { - NodeName *string `json:"nodeName,omitempty"` + NodeName *string `json:"nodeName,omitempty"` NodeStatus *string `json:"nodeStatus,omitempty"` - VolumeNum *string `json:"VolumeNum,omitempty"` - Capacity *string `json:"capacity,omitempty"` + VolumeNum *string `json:"VolumeNum,omitempty"` + Capacity *string `json:"capacity,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"nodeName", "nodeStatus", "VolumeNum", "capacity"}) + common.DeleteKeys(additionalProperties, &[]string{ "nodeName", "nodeStatus", "VolumeNum", "capacity", }) } else { return err } diff --git a/api/kbcloud/model_sysbench.go b/api/kbcloud/model_sysbench.go index a12eb9dd..0b7f5f58 100644 --- a/api/kbcloud/model_sysbench.go +++ b/api/kbcloud/model_sysbench.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Sysbench sysbench is the sysbench benchmark object + + +// Sysbench sysbench is the sysbench benchmark object type Sysbench struct { // Step of sysbench Step *SysbenchStep `json:"step,omitempty"` @@ -51,10 +56,11 @@ type Sysbench struct { // Extra arguments for sysbench ExtraArgs *string `json:"extraArgs,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewSysbench instantiates a new Sysbench object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -100,7 +106,6 @@ func NewSysbenchWithDefaults() *Sysbench { this.TestType = &testType return &this } - // GetStep returns the Step field value if set, zero value otherwise. func (o *Sysbench) GetStep() SysbenchStep { if o == nil || o.Step == nil { @@ -129,6 +134,7 @@ func (o *Sysbench) SetStep(v SysbenchStep) { o.Step = &v } + // GetLimitCpu returns the LimitCpu field value if set, zero value otherwise. func (o *Sysbench) GetLimitCpu() string { if o == nil || o.LimitCpu == nil { @@ -157,6 +163,7 @@ func (o *Sysbench) SetLimitCpu(v string) { o.LimitCpu = &v } + // GetLimitMemory returns the LimitMemory field value if set, zero value otherwise. func (o *Sysbench) GetLimitMemory() string { if o == nil || o.LimitMemory == nil { @@ -185,6 +192,7 @@ func (o *Sysbench) SetLimitMemory(v string) { o.LimitMemory = &v } + // GetRequestCpu returns the RequestCpu field value if set, zero value otherwise. func (o *Sysbench) GetRequestCpu() string { if o == nil || o.RequestCpu == nil { @@ -213,6 +221,7 @@ func (o *Sysbench) SetRequestCpu(v string) { o.RequestCpu = &v } + // GetRequestMemory returns the RequestMemory field value if set, zero value otherwise. func (o *Sysbench) GetRequestMemory() string { if o == nil || o.RequestMemory == nil { @@ -241,6 +250,7 @@ func (o *Sysbench) SetRequestMemory(v string) { o.RequestMemory = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Sysbench) GetName() string { if o == nil || o.Name == nil { @@ -269,6 +279,7 @@ func (o *Sysbench) SetName(v string) { o.Name = &v } + // GetCluster returns the Cluster field value. func (o *Sysbench) GetCluster() string { if o == nil { @@ -292,6 +303,7 @@ func (o *Sysbench) SetCluster(v string) { o.Cluster = v } + // GetDatabase returns the Database field value. func (o *Sysbench) GetDatabase() string { if o == nil { @@ -315,6 +327,7 @@ func (o *Sysbench) SetDatabase(v string) { o.Database = v } + // GetThreads returns the Threads field value if set, zero value otherwise. func (o *Sysbench) GetThreads() int32 { if o == nil || o.Threads == nil { @@ -343,6 +356,7 @@ func (o *Sysbench) SetThreads(v int32) { o.Threads = &v } + // GetDuration returns the Duration field value if set, zero value otherwise. func (o *Sysbench) GetDuration() int32 { if o == nil || o.Duration == nil { @@ -371,6 +385,7 @@ func (o *Sysbench) SetDuration(v int32) { o.Duration = &v } + // GetTableSize returns the TableSize field value if set, zero value otherwise. func (o *Sysbench) GetTableSize() int32 { if o == nil || o.TableSize == nil { @@ -399,6 +414,7 @@ func (o *Sysbench) SetTableSize(v int32) { o.TableSize = &v } + // GetTableNum returns the TableNum field value if set, zero value otherwise. func (o *Sysbench) GetTableNum() int32 { if o == nil || o.TableNum == nil { @@ -427,6 +443,7 @@ func (o *Sysbench) SetTableNum(v int32) { o.TableNum = &v } + // GetTestType returns the TestType field value if set, zero value otherwise. func (o *Sysbench) GetTestType() SysbenchTestType { if o == nil || o.TestType == nil { @@ -455,6 +472,7 @@ func (o *Sysbench) SetTestType(v SysbenchTestType) { o.TestType = &v } + // GetReadPercent returns the ReadPercent field value if set, zero value otherwise. func (o *Sysbench) GetReadPercent() int32 { if o == nil || o.ReadPercent == nil { @@ -483,6 +501,7 @@ func (o *Sysbench) SetReadPercent(v int32) { o.ReadPercent = &v } + // GetWritePercent returns the WritePercent field value if set, zero value otherwise. func (o *Sysbench) GetWritePercent() int32 { if o == nil || o.WritePercent == nil { @@ -511,6 +530,7 @@ func (o *Sysbench) SetWritePercent(v int32) { o.WritePercent = &v } + // GetUsername returns the Username field value. func (o *Sysbench) GetUsername() string { if o == nil { @@ -534,6 +554,7 @@ func (o *Sysbench) SetUsername(v string) { o.Username = v } + // GetPassword returns the Password field value. func (o *Sysbench) GetPassword() string { if o == nil { @@ -557,6 +578,7 @@ func (o *Sysbench) SetPassword(v string) { o.Password = v } + // GetAddress returns the Address field value. func (o *Sysbench) GetAddress() string { if o == nil { @@ -580,6 +602,7 @@ func (o *Sysbench) SetAddress(v string) { o.Address = v } + // GetExtraArgs returns the ExtraArgs field value if set, zero value otherwise. func (o *Sysbench) GetExtraArgs() string { if o == nil || o.ExtraArgs == nil { @@ -608,6 +631,8 @@ func (o *Sysbench) SetExtraArgs(v string) { o.ExtraArgs = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Sysbench) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -671,25 +696,25 @@ func (o Sysbench) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Sysbench) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Step *SysbenchStep `json:"step,omitempty"` - LimitCpu *string `json:"limitCpu,omitempty"` - LimitMemory *string `json:"limitMemory,omitempty"` - RequestCpu *string `json:"requestCpu,omitempty"` - RequestMemory *string `json:"requestMemory,omitempty"` - Name *string `json:"name,omitempty"` - Cluster *string `json:"cluster"` - Database *string `json:"database"` - Threads *int32 `json:"threads,omitempty"` - Duration *int32 `json:"duration,omitempty"` - TableSize *int32 `json:"tableSize,omitempty"` - TableNum *int32 `json:"tableNum,omitempty"` - TestType *SysbenchTestType `json:"testType,omitempty"` - ReadPercent *int32 `json:"readPercent,omitempty"` - WritePercent *int32 `json:"writePercent,omitempty"` - Username *string `json:"username"` - Password *string `json:"password"` - Address *string `json:"address"` - ExtraArgs *string `json:"extraArgs,omitempty"` + Step *SysbenchStep `json:"step,omitempty"` + LimitCpu *string `json:"limitCpu,omitempty"` + LimitMemory *string `json:"limitMemory,omitempty"` + RequestCpu *string `json:"requestCpu,omitempty"` + RequestMemory *string `json:"requestMemory,omitempty"` + Name *string `json:"name,omitempty"` + Cluster *string `json:"cluster"` + Database *string `json:"database"` + Threads *int32 `json:"threads,omitempty"` + Duration *int32 `json:"duration,omitempty"` + TableSize *int32 `json:"tableSize,omitempty"` + TableNum *int32 `json:"tableNum,omitempty"` + TestType *SysbenchTestType `json:"testType,omitempty"` + ReadPercent *int32 `json:"readPercent,omitempty"` + WritePercent *int32 `json:"writePercent,omitempty"` + Username *string `json:"username"` + Password *string `json:"password"` + Address *string `json:"address"` + ExtraArgs *string `json:"extraArgs,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -711,13 +736,13 @@ func (o *Sysbench) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"step", "limitCpu", "limitMemory", "requestCpu", "requestMemory", "name", "cluster", "database", "threads", "duration", "tableSize", "tableNum", "testType", "readPercent", "writePercent", "username", "password", "address", "extraArgs"}) + common.DeleteKeys(additionalProperties, &[]string{ "step", "limitCpu", "limitMemory", "requestCpu", "requestMemory", "name", "cluster", "database", "threads", "duration", "tableSize", "tableNum", "testType", "readPercent", "writePercent", "username", "password", "address", "extraArgs", }) } else { return err } hasInvalidField := false - if all.Step != nil && !all.Step.IsValid() { + if all.Step != nil &&!all.Step.IsValid() { hasInvalidField = true } else { o.Step = all.Step @@ -733,7 +758,7 @@ func (o *Sysbench) UnmarshalJSON(bytes []byte) (err error) { o.Duration = all.Duration o.TableSize = all.TableSize o.TableNum = all.TableNum - if all.TestType != nil && !all.TestType.IsValid() { + if all.TestType != nil &&!all.TestType.IsValid() { hasInvalidField = true } else { o.TestType = all.TestType diff --git a/api/kbcloud/model_sysbench_step.go b/api/kbcloud/model_sysbench_step.go index 56dadcd7..f03fac2d 100644 --- a/api/kbcloud/model_sysbench_step.go +++ b/api/kbcloud/model_sysbench_step.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // SysbenchStep Step of sysbench type SysbenchStep string // List of SysbenchStep. const ( SysbenchStepPrepare SysbenchStep = "prepare" - SysbenchStepRun SysbenchStep = "run" + SysbenchStepRun SysbenchStep = "run" SysbenchStepCleanup SysbenchStep = "cleanup" - SysbenchStepAll SysbenchStep = "all" + SysbenchStepAll SysbenchStep = "all" ) var allowedSysbenchStepEnumValues = []SysbenchStep{ diff --git a/api/kbcloud/model_sysbench_test_type.go b/api/kbcloud/model_sysbench_test_type.go index 0cd8324a..a461a9a4 100644 --- a/api/kbcloud/model_sysbench_test_type.go +++ b/api/kbcloud/model_sysbench_test_type.go @@ -2,31 +2,36 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // SysbenchTestType Test type for sysbench type SysbenchTestType string // List of SysbenchTestType. const ( - SysbenchTestTypeOltpDelete SysbenchTestType = "oltp_delete" - SysbenchTestTypeOltpInsert SysbenchTestType = "oltp_insert" - SysbenchTestTypeOltpPointSelect SysbenchTestType = "oltp_point_select" - SysbenchTestTypeOltpReadOnly SysbenchTestType = "oltp_read_only" - SysbenchTestTypeOltpReadWrite SysbenchTestType = "oltp_read_write" - SysbenchTestTypeOltpUpdateIndex SysbenchTestType = "oltp_update_index" + SysbenchTestTypeOltpDelete SysbenchTestType = "oltp_delete" + SysbenchTestTypeOltpInsert SysbenchTestType = "oltp_insert" + SysbenchTestTypeOltpPointSelect SysbenchTestType = "oltp_point_select" + SysbenchTestTypeOltpReadOnly SysbenchTestType = "oltp_read_only" + SysbenchTestTypeOltpReadWrite SysbenchTestType = "oltp_read_write" + SysbenchTestTypeOltpUpdateIndex SysbenchTestType = "oltp_update_index" SysbenchTestTypeOltpUpdateNonIndex SysbenchTestType = "oltp_update_non_index" - SysbenchTestTypeOltpWriteOnly SysbenchTestType = "oltp_write_only" + SysbenchTestTypeOltpWriteOnly SysbenchTestType = "oltp_write_only" SysbenchTestTypeSelectRandomPoints SysbenchTestType = "select_random_points" SysbenchTestTypeSelectRandomRanges SysbenchTestType = "select_random_ranges" - SysbenchTestTypeBulkInsert SysbenchTestType = "bulk_insert" - SysbenchTestTypeOltpReadWritePct SysbenchTestType = "oltp_read_write_pct" + SysbenchTestTypeBulkInsert SysbenchTestType = "bulk_insert" + SysbenchTestTypeOltpReadWritePct SysbenchTestType = "oltp_read_write_pct" ) var allowedSysbenchTestTypeEnumValues = []SysbenchTestType{ diff --git a/api/kbcloud/model_tag.go b/api/kbcloud/model_tag.go index 7d8974e8..80807deb 100644 --- a/api/kbcloud/model_tag.go +++ b/api/kbcloud/model_tag.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Tag tag info + + +// Tag tag info type Tag struct { // The id of the tag Id string `json:"id"` @@ -19,10 +24,11 @@ type Tag struct { // The value corresponding to the key Value *string `json:"value,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTag instantiates a new Tag object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +46,6 @@ func NewTagWithDefaults() *Tag { this := Tag{} return &this } - // GetId returns the Id field value. func (o *Tag) GetId() string { if o == nil { @@ -64,6 +69,7 @@ func (o *Tag) SetId(v string) { o.Id = v } + // GetKey returns the Key field value if set, zero value otherwise. func (o *Tag) GetKey() string { if o == nil || o.Key == nil { @@ -92,6 +98,7 @@ func (o *Tag) SetKey(v string) { o.Key = &v } + // GetValue returns the Value field value if set, zero value otherwise. func (o *Tag) GetValue() string { if o == nil || o.Value == nil { @@ -120,6 +127,8 @@ func (o *Tag) SetValue(v string) { o.Value = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Tag) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -143,8 +152,8 @@ func (o Tag) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Tag) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Key *string `json:"key,omitempty"` + Id *string `json:"id"` + Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -155,7 +164,7 @@ func (o *Tag) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "key", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "key", "value", }) } else { return err } diff --git a/api/kbcloud/model_tag_cluster.go b/api/kbcloud/model_tag_cluster.go index 9555882a..3be72876 100644 --- a/api/kbcloud/model_tag_cluster.go +++ b/api/kbcloud/model_tag_cluster.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type TagCluster struct { // The cluster id corresponding to the tag ClusterId *string `json:"clusterId,omitempty"` - Tags []Tag `json:"tags,omitempty"` + Tags []Tag `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTagCluster instantiates a new TagCluster object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewTagClusterWithDefaults() *TagCluster { this := TagCluster{} return &this } - // GetClusterId returns the ClusterId field value if set, zero value otherwise. func (o *TagCluster) GetClusterId() string { if o == nil || o.ClusterId == nil { @@ -60,6 +69,7 @@ func (o *TagCluster) SetClusterId(v string) { o.ClusterId = &v } + // GetTags returns the Tags field value if set, zero value otherwise. func (o *TagCluster) GetTags() []Tag { if o == nil || o.Tags == nil { @@ -88,6 +98,8 @@ func (o *TagCluster) SetTags(v []Tag) { o.Tags = v } + + // MarshalJSON serializes the struct using spec logic. func (o TagCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -111,14 +123,14 @@ func (o TagCluster) MarshalJSON() ([]byte, error) { func (o *TagCluster) UnmarshalJSON(bytes []byte) (err error) { all := struct { ClusterId *string `json:"clusterId,omitempty"` - Tags []Tag `json:"tags,omitempty"` + Tags []Tag `json:"tags,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"clusterId", "tags"}) + common.DeleteKeys(additionalProperties, &[]string{ "clusterId", "tags", }) } else { return err } diff --git a/api/kbcloud/model_tag_create.go b/api/kbcloud/model_tag_create.go index 23ad5ddd..1d397369 100644 --- a/api/kbcloud/model_tag_create.go +++ b/api/kbcloud/model_tag_create.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// TagCreate Tag create + + +// TagCreate Tag create type TagCreate struct { // The cluster id corresponding to the tag ClusterId string `json:"clusterId"` // The key value pair of the tag needed to create Items []TagCreateItemsItem `json:"items"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTagCreate instantiates a new TagCreate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewTagCreateWithDefaults() *TagCreate { this := TagCreate{} return &this } - // GetClusterId returns the ClusterId field value. func (o *TagCreate) GetClusterId() string { if o == nil { @@ -63,6 +68,7 @@ func (o *TagCreate) SetClusterId(v string) { o.ClusterId = v } + // GetItems returns the Items field value. func (o *TagCreate) GetItems() []TagCreateItemsItem { if o == nil { @@ -86,6 +92,8 @@ func (o *TagCreate) SetItems(v []TagCreateItemsItem) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o TagCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,8 +112,8 @@ func (o TagCreate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TagCreate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ClusterId *string `json:"clusterId"` - Items *[]TagCreateItemsItem `json:"items"` + ClusterId *string `json:"clusterId"` + Items *[]TagCreateItemsItem `json:"items"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -118,7 +126,7 @@ func (o *TagCreate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"clusterId", "items"}) + common.DeleteKeys(additionalProperties, &[]string{ "clusterId", "items", }) } else { return err } diff --git a/api/kbcloud/model_tag_create_items_item.go b/api/kbcloud/model_tag_create_items_item.go index e5e5b335..745ea483 100644 --- a/api/kbcloud/model_tag_create_items_item.go +++ b/api/kbcloud/model_tag_create_items_item.go @@ -2,23 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + type TagCreateItemsItem struct { - Id *string `json:"id,omitempty"` - Key string `json:"key"` - Value string `json:"value"` + Id *string `json:"id,omitempty"` + Key string `json:"key"` + Value string `json:"value"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTagCreateItemsItem instantiates a new TagCreateItemsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +43,6 @@ func NewTagCreateItemsItemWithDefaults() *TagCreateItemsItem { this := TagCreateItemsItem{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *TagCreateItemsItem) GetId() string { if o == nil || o.Id == nil { @@ -66,6 +71,7 @@ func (o *TagCreateItemsItem) SetId(v string) { o.Id = &v } + // GetKey returns the Key field value. func (o *TagCreateItemsItem) GetKey() string { if o == nil { @@ -89,6 +95,7 @@ func (o *TagCreateItemsItem) SetKey(v string) { o.Key = v } + // GetValue returns the Value field value. func (o *TagCreateItemsItem) GetValue() string { if o == nil { @@ -112,6 +119,8 @@ func (o *TagCreateItemsItem) SetValue(v string) { o.Value = v } + + // MarshalJSON serializes the struct using spec logic. func (o TagCreateItemsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -133,8 +142,8 @@ func (o TagCreateItemsItem) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TagCreateItemsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Key *string `json:"key"` + Id *string `json:"id,omitempty"` + Key *string `json:"key"` Value *string `json:"value"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -148,7 +157,7 @@ func (o *TagCreateItemsItem) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "key", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "key", "value", }) } else { return err } diff --git a/api/kbcloud/model_tag_update.go b/api/kbcloud/model_tag_update.go index b854509b..943783a4 100644 --- a/api/kbcloud/model_tag_update.go +++ b/api/kbcloud/model_tag_update.go @@ -2,25 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// TagUpdate Tag update + + +// TagUpdate Tag update type TagUpdate struct { // The key of the tag Key string `json:"key"` // the value corresponding th the key Value string `json:"value"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTagUpdate instantiates a new TagUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +45,6 @@ func NewTagUpdateWithDefaults() *TagUpdate { this := TagUpdate{} return &this } - // GetKey returns the Key field value. func (o *TagUpdate) GetKey() string { if o == nil { @@ -63,6 +68,7 @@ func (o *TagUpdate) SetKey(v string) { o.Key = v } + // GetValue returns the Value field value. func (o *TagUpdate) GetValue() string { if o == nil { @@ -86,6 +92,8 @@ func (o *TagUpdate) SetValue(v string) { o.Value = v } + + // MarshalJSON serializes the struct using spec logic. func (o TagUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -104,7 +112,7 @@ func (o TagUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TagUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Key *string `json:"key"` + Key *string `json:"key"` Value *string `json:"value"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -118,7 +126,7 @@ func (o *TagUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"key", "value"}) + common.DeleteKeys(additionalProperties, &[]string{ "key", "value", }) } else { return err } diff --git a/api/kbcloud/model_tenant.go b/api/kbcloud/model_tenant.go index 4b516734..a0912fed 100644 --- a/api/kbcloud/model_tenant.go +++ b/api/kbcloud/model_tenant.go @@ -2,30 +2,40 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Tenant struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Mode *string `json:"mode,omitempty"` - CreateAt *string `json:"create_at,omitempty"` - Role *string `json:"role,omitempty"` - PrimaryZone *string `json:"primary_zone,omitempty"` - Status *string `json:"status,omitempty"` - PrimaryZoneProxy *string `json:"primary_zone_proxy,omitempty"` - ChartSet *string `json:"chart_set,omitempty"` - Resource *string `json:"resource,omitempty"` - Cpu *CPU `json:"cpu,omitempty"` - Memory *Memory `json:"memory,omitempty"` - LogDisk *LogDisk `json:"log_disk,omitempty"` - DataDisk *DataDisk `json:"data_disk,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Mode *string `json:"mode,omitempty"` + CreateAt *string `json:"create_at,omitempty"` + Role *string `json:"role,omitempty"` + PrimaryZone *string `json:"primary_zone,omitempty"` + Status *string `json:"status,omitempty"` + PrimaryZoneProxy *string `json:"primary_zone_proxy,omitempty"` + ChartSet *string `json:"chart_set,omitempty"` + Resource *string `json:"resource,omitempty"` + Cpu *CPU `json:"cpu,omitempty"` + Memory *Memory `json:"memory,omitempty"` + LogDisk *LogDisk `json:"log_disk,omitempty"` + DataDisk *DataDisk `json:"data_disk,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTenant instantiates a new Tenant object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -42,7 +52,6 @@ func NewTenantWithDefaults() *Tenant { this := Tenant{} return &this } - // GetId returns the Id field value if set, zero value otherwise. func (o *Tenant) GetId() string { if o == nil || o.Id == nil { @@ -71,6 +80,7 @@ func (o *Tenant) SetId(v string) { o.Id = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Tenant) GetName() string { if o == nil || o.Name == nil { @@ -99,6 +109,7 @@ func (o *Tenant) SetName(v string) { o.Name = &v } + // GetMode returns the Mode field value if set, zero value otherwise. func (o *Tenant) GetMode() string { if o == nil || o.Mode == nil { @@ -127,6 +138,7 @@ func (o *Tenant) SetMode(v string) { o.Mode = &v } + // GetCreateAt returns the CreateAt field value if set, zero value otherwise. func (o *Tenant) GetCreateAt() string { if o == nil || o.CreateAt == nil { @@ -155,6 +167,7 @@ func (o *Tenant) SetCreateAt(v string) { o.CreateAt = &v } + // GetRole returns the Role field value if set, zero value otherwise. func (o *Tenant) GetRole() string { if o == nil || o.Role == nil { @@ -183,6 +196,7 @@ func (o *Tenant) SetRole(v string) { o.Role = &v } + // GetPrimaryZone returns the PrimaryZone field value if set, zero value otherwise. func (o *Tenant) GetPrimaryZone() string { if o == nil || o.PrimaryZone == nil { @@ -211,6 +225,7 @@ func (o *Tenant) SetPrimaryZone(v string) { o.PrimaryZone = &v } + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Tenant) GetStatus() string { if o == nil || o.Status == nil { @@ -239,6 +254,7 @@ func (o *Tenant) SetStatus(v string) { o.Status = &v } + // GetPrimaryZoneProxy returns the PrimaryZoneProxy field value if set, zero value otherwise. func (o *Tenant) GetPrimaryZoneProxy() string { if o == nil || o.PrimaryZoneProxy == nil { @@ -267,6 +283,7 @@ func (o *Tenant) SetPrimaryZoneProxy(v string) { o.PrimaryZoneProxy = &v } + // GetChartSet returns the ChartSet field value if set, zero value otherwise. func (o *Tenant) GetChartSet() string { if o == nil || o.ChartSet == nil { @@ -295,6 +312,7 @@ func (o *Tenant) SetChartSet(v string) { o.ChartSet = &v } + // GetResource returns the Resource field value if set, zero value otherwise. func (o *Tenant) GetResource() string { if o == nil || o.Resource == nil { @@ -323,6 +341,7 @@ func (o *Tenant) SetResource(v string) { o.Resource = &v } + // GetCpu returns the Cpu field value if set, zero value otherwise. func (o *Tenant) GetCpu() CPU { if o == nil || o.Cpu == nil { @@ -351,6 +370,7 @@ func (o *Tenant) SetCpu(v CPU) { o.Cpu = &v } + // GetMemory returns the Memory field value if set, zero value otherwise. func (o *Tenant) GetMemory() Memory { if o == nil || o.Memory == nil { @@ -379,6 +399,7 @@ func (o *Tenant) SetMemory(v Memory) { o.Memory = &v } + // GetLogDisk returns the LogDisk field value if set, zero value otherwise. func (o *Tenant) GetLogDisk() LogDisk { if o == nil || o.LogDisk == nil { @@ -407,6 +428,7 @@ func (o *Tenant) SetLogDisk(v LogDisk) { o.LogDisk = &v } + // GetDataDisk returns the DataDisk field value if set, zero value otherwise. func (o *Tenant) GetDataDisk() DataDisk { if o == nil || o.DataDisk == nil { @@ -435,6 +457,8 @@ func (o *Tenant) SetDataDisk(v DataDisk) { o.DataDisk = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Tenant) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -493,27 +517,27 @@ func (o Tenant) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Tenant) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Mode *string `json:"mode,omitempty"` - CreateAt *string `json:"create_at,omitempty"` - Role *string `json:"role,omitempty"` - PrimaryZone *string `json:"primary_zone,omitempty"` - Status *string `json:"status,omitempty"` - PrimaryZoneProxy *string `json:"primary_zone_proxy,omitempty"` - ChartSet *string `json:"chart_set,omitempty"` - Resource *string `json:"resource,omitempty"` - Cpu *CPU `json:"cpu,omitempty"` - Memory *Memory `json:"memory,omitempty"` - LogDisk *LogDisk `json:"log_disk,omitempty"` - DataDisk *DataDisk `json:"data_disk,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Mode *string `json:"mode,omitempty"` + CreateAt *string `json:"create_at,omitempty"` + Role *string `json:"role,omitempty"` + PrimaryZone *string `json:"primary_zone,omitempty"` + Status *string `json:"status,omitempty"` + PrimaryZoneProxy *string `json:"primary_zone_proxy,omitempty"` + ChartSet *string `json:"chart_set,omitempty"` + Resource *string `json:"resource,omitempty"` + Cpu *CPU `json:"cpu,omitempty"` + Memory *Memory `json:"memory,omitempty"` + LogDisk *LogDisk `json:"log_disk,omitempty"` + DataDisk *DataDisk `json:"data_disk,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"id", "name", "mode", "create_at", "role", "primary_zone", "status", "primary_zone_proxy", "chart_set", "resource", "cpu", "memory", "log_disk", "data_disk"}) + common.DeleteKeys(additionalProperties, &[]string{ "id", "name", "mode", "create_at", "role", "primary_zone", "status", "primary_zone_proxy", "chart_set", "resource", "cpu", "memory", "log_disk", "data_disk", }) } else { return err } @@ -529,19 +553,19 @@ func (o *Tenant) UnmarshalJSON(bytes []byte) (err error) { o.PrimaryZoneProxy = all.PrimaryZoneProxy o.ChartSet = all.ChartSet o.Resource = all.Resource - if all.Cpu != nil && all.Cpu.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Cpu != nil && all.Cpu.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Cpu = all.Cpu - if all.Memory != nil && all.Memory.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Memory != nil && all.Memory.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.Memory = all.Memory - if all.LogDisk != nil && all.LogDisk.UnparsedObject != nil && o.UnparsedObject == nil { + if all.LogDisk != nil && all.LogDisk.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.LogDisk = all.LogDisk - if all.DataDisk != nil && all.DataDisk.UnparsedObject != nil && o.UnparsedObject == nil { + if all.DataDisk != nil && all.DataDisk.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.DataDisk = all.DataDisk diff --git a/api/kbcloud/model_tls_cert.go b/api/kbcloud/model_tls_cert.go index 2682d4a2..d4c5bbc0 100644 --- a/api/kbcloud/model_tls_cert.go +++ b/api/kbcloud/model_tls_cert.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type TlsCert struct { // Configuration for TLS including all certificates and keys TlsConfig *TlsConfig `json:"tlsConfig,omitempty"` @@ -20,10 +29,11 @@ type TlsCert struct { // Expiration days of Truststore certificate ExpirationDaysTruststore *int32 `json:"expirationDaysTruststore,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTlsCert instantiates a new TlsCert object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -40,7 +50,6 @@ func NewTlsCertWithDefaults() *TlsCert { this := TlsCert{} return &this } - // GetTlsConfig returns the TlsConfig field value if set, zero value otherwise. func (o *TlsCert) GetTlsConfig() TlsConfig { if o == nil || o.TlsConfig == nil { @@ -69,6 +78,7 @@ func (o *TlsCert) SetTlsConfig(v TlsConfig) { o.TlsConfig = &v } + // GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *TlsCert) GetComponentName() string { if o == nil || o.ComponentName == nil { @@ -97,6 +107,7 @@ func (o *TlsCert) SetComponentName(v string) { o.ComponentName = &v } + // GetExpirationDaysCa returns the ExpirationDaysCa field value if set, zero value otherwise. func (o *TlsCert) GetExpirationDaysCa() int32 { if o == nil || o.ExpirationDaysCa == nil { @@ -125,6 +136,7 @@ func (o *TlsCert) SetExpirationDaysCa(v int32) { o.ExpirationDaysCa = &v } + // GetExpirationDaysClient returns the ExpirationDaysClient field value if set, zero value otherwise. func (o *TlsCert) GetExpirationDaysClient() int32 { if o == nil || o.ExpirationDaysClient == nil { @@ -153,6 +165,7 @@ func (o *TlsCert) SetExpirationDaysClient(v int32) { o.ExpirationDaysClient = &v } + // GetExpirationDaysKeystore returns the ExpirationDaysKeystore field value if set, zero value otherwise. func (o *TlsCert) GetExpirationDaysKeystore() int32 { if o == nil || o.ExpirationDaysKeystore == nil { @@ -181,6 +194,7 @@ func (o *TlsCert) SetExpirationDaysKeystore(v int32) { o.ExpirationDaysKeystore = &v } + // GetExpirationDaysTruststore returns the ExpirationDaysTruststore field value if set, zero value otherwise. func (o *TlsCert) GetExpirationDaysTruststore() int32 { if o == nil || o.ExpirationDaysTruststore == nil { @@ -209,6 +223,8 @@ func (o *TlsCert) SetExpirationDaysTruststore(v int32) { o.ExpirationDaysTruststore = &v } + + // MarshalJSON serializes the struct using spec logic. func (o TlsCert) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -243,25 +259,25 @@ func (o TlsCert) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TlsCert) UnmarshalJSON(bytes []byte) (err error) { all := struct { - TlsConfig *TlsConfig `json:"tlsConfig,omitempty"` - ComponentName *string `json:"componentName,omitempty"` - ExpirationDaysCa *int32 `json:"expirationDaysCA,omitempty"` - ExpirationDaysClient *int32 `json:"expirationDaysClient,omitempty"` - ExpirationDaysKeystore *int32 `json:"expirationDaysKeystore,omitempty"` - ExpirationDaysTruststore *int32 `json:"expirationDaysTruststore,omitempty"` + TlsConfig *TlsConfig `json:"tlsConfig,omitempty"` + ComponentName *string `json:"componentName,omitempty"` + ExpirationDaysCa *int32 `json:"expirationDaysCA,omitempty"` + ExpirationDaysClient *int32 `json:"expirationDaysClient,omitempty"` + ExpirationDaysKeystore *int32 `json:"expirationDaysKeystore,omitempty"` + ExpirationDaysTruststore *int32 `json:"expirationDaysTruststore,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"tlsConfig", "componentName", "expirationDaysCA", "expirationDaysClient", "expirationDaysKeystore", "expirationDaysTruststore"}) + common.DeleteKeys(additionalProperties, &[]string{ "tlsConfig", "componentName", "expirationDaysCA", "expirationDaysClient", "expirationDaysKeystore", "expirationDaysTruststore", }) } else { return err } hasInvalidField := false - if all.TlsConfig != nil && all.TlsConfig.UnparsedObject != nil && o.UnparsedObject == nil { + if all.TlsConfig != nil && all.TlsConfig.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.TlsConfig = all.TlsConfig diff --git a/api/kbcloud/model_tls_config.go b/api/kbcloud/model_tls_config.go index 13a0eae2..2f24d6d2 100644 --- a/api/kbcloud/model_tls_config.go +++ b/api/kbcloud/model_tls_config.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// TlsConfig Configuration for TLS including all certificates and keys + +// TlsConfig Configuration for TLS including all certificates and keys type TlsConfig struct { // CA Certificate CaCert *string `json:"caCert,omitempty"` @@ -19,10 +28,11 @@ type TlsConfig struct { // Truststore in PEM format Truststore *string `json:"truststore,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTlsConfig instantiates a new TlsConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewTlsConfigWithDefaults() *TlsConfig { this := TlsConfig{} return &this } - // GetCaCert returns the CaCert field value if set, zero value otherwise. func (o *TlsConfig) GetCaCert() string { if o == nil || o.CaCert == nil { @@ -68,6 +77,7 @@ func (o *TlsConfig) SetCaCert(v string) { o.CaCert = &v } + // GetClientCert returns the ClientCert field value if set, zero value otherwise. func (o *TlsConfig) GetClientCert() string { if o == nil || o.ClientCert == nil { @@ -96,6 +106,7 @@ func (o *TlsConfig) SetClientCert(v string) { o.ClientCert = &v } + // GetClientKey returns the ClientKey field value if set, zero value otherwise. func (o *TlsConfig) GetClientKey() string { if o == nil || o.ClientKey == nil { @@ -124,6 +135,7 @@ func (o *TlsConfig) SetClientKey(v string) { o.ClientKey = &v } + // GetKeystore returns the Keystore field value if set, zero value otherwise. func (o *TlsConfig) GetKeystore() string { if o == nil || o.Keystore == nil { @@ -152,6 +164,7 @@ func (o *TlsConfig) SetKeystore(v string) { o.Keystore = &v } + // GetTruststore returns the Truststore field value if set, zero value otherwise. func (o *TlsConfig) GetTruststore() string { if o == nil || o.Truststore == nil { @@ -180,6 +193,8 @@ func (o *TlsConfig) SetTruststore(v string) { o.Truststore = &v } + + // MarshalJSON serializes the struct using spec logic. func (o TlsConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -211,10 +226,10 @@ func (o TlsConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TlsConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CaCert *string `json:"caCert,omitempty"` + CaCert *string `json:"caCert,omitempty"` ClientCert *string `json:"clientCert,omitempty"` - ClientKey *string `json:"clientKey,omitempty"` - Keystore *string `json:"keystore,omitempty"` + ClientKey *string `json:"clientKey,omitempty"` + Keystore *string `json:"keystore,omitempty"` Truststore *string `json:"truststore,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -222,7 +237,7 @@ func (o *TlsConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"caCert", "clientCert", "clientKey", "keystore", "truststore"}) + common.DeleteKeys(additionalProperties, &[]string{ "caCert", "clientCert", "clientKey", "keystore", "truststore", }) } else { return err } diff --git a/api/kbcloud/model_tls_request.go b/api/kbcloud/model_tls_request.go index c5c6d039..da74935a 100644 --- a/api/kbcloud/model_tls_request.go +++ b/api/kbcloud/model_tls_request.go @@ -2,18 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type TlsRequest struct { // Enable TLS or not Enable *bool `json:"enable,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTlsRequest instantiates a new TlsRequest object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -30,7 +40,6 @@ func NewTlsRequestWithDefaults() *TlsRequest { this := TlsRequest{} return &this } - // GetEnable returns the Enable field value if set, zero value otherwise. func (o *TlsRequest) GetEnable() bool { if o == nil || o.Enable == nil { @@ -59,6 +68,8 @@ func (o *TlsRequest) SetEnable(v bool) { o.Enable = &v } + + // MarshalJSON serializes the struct using spec logic. func (o TlsRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -85,7 +96,7 @@ func (o *TlsRequest) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"enable"}) + common.DeleteKeys(additionalProperties, &[]string{ "enable", }) } else { return err } diff --git a/api/kbcloud/model_tpcc.go b/api/kbcloud/model_tpcc.go index 3a5b1c99..c31e6707 100644 --- a/api/kbcloud/model_tpcc.go +++ b/api/kbcloud/model_tpcc.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Tpcc tpcc is the tpcc benchmark object + + +// Tpcc tpcc is the tpcc benchmark object type Tpcc struct { // Step of sysbench Step *TpccStep `json:"step,omitempty"` @@ -55,10 +60,11 @@ type Tpcc struct { // Extra arguments for tpcc ExtraArgs *string `json:"extraArgs,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTpcc instantiates a new Tpcc object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -100,7 +106,6 @@ func NewTpccWithDefaults() *Tpcc { this.RequestMemory = &requestMemory return &this } - // GetStep returns the Step field value if set, zero value otherwise. func (o *Tpcc) GetStep() TpccStep { if o == nil || o.Step == nil { @@ -129,6 +134,7 @@ func (o *Tpcc) SetStep(v TpccStep) { o.Step = &v } + // GetLimitCpu returns the LimitCpu field value if set, zero value otherwise. func (o *Tpcc) GetLimitCpu() string { if o == nil || o.LimitCpu == nil { @@ -157,6 +163,7 @@ func (o *Tpcc) SetLimitCpu(v string) { o.LimitCpu = &v } + // GetLimitMemory returns the LimitMemory field value if set, zero value otherwise. func (o *Tpcc) GetLimitMemory() string { if o == nil || o.LimitMemory == nil { @@ -185,6 +192,7 @@ func (o *Tpcc) SetLimitMemory(v string) { o.LimitMemory = &v } + // GetRequestCpu returns the RequestCpu field value if set, zero value otherwise. func (o *Tpcc) GetRequestCpu() string { if o == nil || o.RequestCpu == nil { @@ -213,6 +221,7 @@ func (o *Tpcc) SetRequestCpu(v string) { o.RequestCpu = &v } + // GetRequestMemory returns the RequestMemory field value if set, zero value otherwise. func (o *Tpcc) GetRequestMemory() string { if o == nil || o.RequestMemory == nil { @@ -241,6 +250,7 @@ func (o *Tpcc) SetRequestMemory(v string) { o.RequestMemory = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Tpcc) GetName() string { if o == nil || o.Name == nil { @@ -269,6 +279,7 @@ func (o *Tpcc) SetName(v string) { o.Name = &v } + // GetCluster returns the Cluster field value. func (o *Tpcc) GetCluster() string { if o == nil { @@ -292,6 +303,7 @@ func (o *Tpcc) SetCluster(v string) { o.Cluster = v } + // GetDatabase returns the Database field value. func (o *Tpcc) GetDatabase() string { if o == nil { @@ -315,6 +327,7 @@ func (o *Tpcc) SetDatabase(v string) { o.Database = v } + // GetUsername returns the Username field value. func (o *Tpcc) GetUsername() string { if o == nil { @@ -338,6 +351,7 @@ func (o *Tpcc) SetUsername(v string) { o.Username = v } + // GetPassword returns the Password field value. func (o *Tpcc) GetPassword() string { if o == nil { @@ -361,6 +375,7 @@ func (o *Tpcc) SetPassword(v string) { o.Password = v } + // GetAddress returns the Address field value. func (o *Tpcc) GetAddress() string { if o == nil { @@ -384,6 +399,7 @@ func (o *Tpcc) SetAddress(v string) { o.Address = v } + // GetThreads returns the Threads field value if set, zero value otherwise. func (o *Tpcc) GetThreads() int32 { if o == nil || o.Threads == nil { @@ -412,6 +428,7 @@ func (o *Tpcc) SetThreads(v int32) { o.Threads = &v } + // GetWarehouses returns the Warehouses field value if set, zero value otherwise. func (o *Tpcc) GetWarehouses() int32 { if o == nil || o.Warehouses == nil { @@ -440,6 +457,7 @@ func (o *Tpcc) SetWarehouses(v int32) { o.Warehouses = &v } + // GetDuration returns the Duration field value if set, zero value otherwise. func (o *Tpcc) GetDuration() int32 { if o == nil || o.Duration == nil { @@ -468,6 +486,7 @@ func (o *Tpcc) SetDuration(v int32) { o.Duration = &v } + // GetLimitTxPerMin returns the LimitTxPerMin field value if set, zero value otherwise. func (o *Tpcc) GetLimitTxPerMin() int32 { if o == nil || o.LimitTxPerMin == nil { @@ -496,6 +515,7 @@ func (o *Tpcc) SetLimitTxPerMin(v int32) { o.LimitTxPerMin = &v } + // GetNewOrderWeight returns the NewOrderWeight field value if set, zero value otherwise. func (o *Tpcc) GetNewOrderWeight() int32 { if o == nil || o.NewOrderWeight == nil { @@ -524,6 +544,7 @@ func (o *Tpcc) SetNewOrderWeight(v int32) { o.NewOrderWeight = &v } + // GetPaymentWeight returns the PaymentWeight field value if set, zero value otherwise. func (o *Tpcc) GetPaymentWeight() int32 { if o == nil || o.PaymentWeight == nil { @@ -552,6 +573,7 @@ func (o *Tpcc) SetPaymentWeight(v int32) { o.PaymentWeight = &v } + // GetOrderStatusWeight returns the OrderStatusWeight field value if set, zero value otherwise. func (o *Tpcc) GetOrderStatusWeight() int32 { if o == nil || o.OrderStatusWeight == nil { @@ -580,6 +602,7 @@ func (o *Tpcc) SetOrderStatusWeight(v int32) { o.OrderStatusWeight = &v } + // GetDeliveryWeight returns the DeliveryWeight field value if set, zero value otherwise. func (o *Tpcc) GetDeliveryWeight() int32 { if o == nil || o.DeliveryWeight == nil { @@ -608,6 +631,7 @@ func (o *Tpcc) SetDeliveryWeight(v int32) { o.DeliveryWeight = &v } + // GetStockLevelWeight returns the StockLevelWeight field value if set, zero value otherwise. func (o *Tpcc) GetStockLevelWeight() int32 { if o == nil || o.StockLevelWeight == nil { @@ -636,6 +660,7 @@ func (o *Tpcc) SetStockLevelWeight(v int32) { o.StockLevelWeight = &v } + // GetExtraArgs returns the ExtraArgs field value if set, zero value otherwise. func (o *Tpcc) GetExtraArgs() string { if o == nil || o.ExtraArgs == nil { @@ -664,6 +689,8 @@ func (o *Tpcc) SetExtraArgs(v string) { o.ExtraArgs = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Tpcc) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -733,27 +760,27 @@ func (o Tpcc) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Tpcc) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Step *TpccStep `json:"step,omitempty"` - LimitCpu *string `json:"limitCpu,omitempty"` - LimitMemory *string `json:"limitMemory,omitempty"` - RequestCpu *string `json:"requestCpu,omitempty"` - RequestMemory *string `json:"requestMemory,omitempty"` - Name *string `json:"name,omitempty"` - Cluster *string `json:"cluster"` - Database *string `json:"database"` - Username *string `json:"username"` - Password *string `json:"password"` - Address *string `json:"address"` - Threads *int32 `json:"threads,omitempty"` - Warehouses *int32 `json:"warehouses,omitempty"` - Duration *int32 `json:"duration,omitempty"` - LimitTxPerMin *int32 `json:"limitTxPerMin,omitempty"` - NewOrderWeight *int32 `json:"newOrderWeight,omitempty"` - PaymentWeight *int32 `json:"paymentWeight,omitempty"` - OrderStatusWeight *int32 `json:"orderStatusWeight,omitempty"` - DeliveryWeight *int32 `json:"deliveryWeight,omitempty"` - StockLevelWeight *int32 `json:"stockLevelWeight,omitempty"` - ExtraArgs *string `json:"extraArgs,omitempty"` + Step *TpccStep `json:"step,omitempty"` + LimitCpu *string `json:"limitCpu,omitempty"` + LimitMemory *string `json:"limitMemory,omitempty"` + RequestCpu *string `json:"requestCpu,omitempty"` + RequestMemory *string `json:"requestMemory,omitempty"` + Name *string `json:"name,omitempty"` + Cluster *string `json:"cluster"` + Database *string `json:"database"` + Username *string `json:"username"` + Password *string `json:"password"` + Address *string `json:"address"` + Threads *int32 `json:"threads,omitempty"` + Warehouses *int32 `json:"warehouses,omitempty"` + Duration *int32 `json:"duration,omitempty"` + LimitTxPerMin *int32 `json:"limitTxPerMin,omitempty"` + NewOrderWeight *int32 `json:"newOrderWeight,omitempty"` + PaymentWeight *int32 `json:"paymentWeight,omitempty"` + OrderStatusWeight *int32 `json:"orderStatusWeight,omitempty"` + DeliveryWeight *int32 `json:"deliveryWeight,omitempty"` + StockLevelWeight *int32 `json:"stockLevelWeight,omitempty"` + ExtraArgs *string `json:"extraArgs,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -775,13 +802,13 @@ func (o *Tpcc) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"step", "limitCpu", "limitMemory", "requestCpu", "requestMemory", "name", "cluster", "database", "username", "password", "address", "threads", "warehouses", "duration", "limitTxPerMin", "newOrderWeight", "paymentWeight", "orderStatusWeight", "deliveryWeight", "stockLevelWeight", "extraArgs"}) + common.DeleteKeys(additionalProperties, &[]string{ "step", "limitCpu", "limitMemory", "requestCpu", "requestMemory", "name", "cluster", "database", "username", "password", "address", "threads", "warehouses", "duration", "limitTxPerMin", "newOrderWeight", "paymentWeight", "orderStatusWeight", "deliveryWeight", "stockLevelWeight", "extraArgs", }) } else { return err } hasInvalidField := false - if all.Step != nil && !all.Step.IsValid() { + if all.Step != nil &&!all.Step.IsValid() { hasInvalidField = true } else { o.Step = all.Step diff --git a/api/kbcloud/model_tpcc_step.go b/api/kbcloud/model_tpcc_step.go index 912fdc60..8792393a 100644 --- a/api/kbcloud/model_tpcc_step.go +++ b/api/kbcloud/model_tpcc_step.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // TpccStep Step of sysbench type TpccStep string // List of TpccStep. const ( TpccStepPrepare TpccStep = "prepare" - TpccStepRun TpccStep = "run" + TpccStepRun TpccStep = "run" TpccStepCleanup TpccStep = "cleanup" - TpccStepAll TpccStep = "all" + TpccStepAll TpccStep = "all" ) var allowedTpccStepEnumValues = []TpccStep{ diff --git a/api/kbcloud/model_tree_node.go b/api/kbcloud/model_tree_node.go index e3bed2a3..ecb0996e 100644 --- a/api/kbcloud/model_tree_node.go +++ b/api/kbcloud/model_tree_node.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type TreeNode struct { // A string representing the level of the node. Level *string `json:"level,omitempty"` @@ -18,10 +27,11 @@ type TreeNode struct { // An array of child nodes. Children []TreeNode `json:"children,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewTreeNode instantiates a new TreeNode object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -38,7 +48,6 @@ func NewTreeNodeWithDefaults() *TreeNode { this := TreeNode{} return &this } - // GetLevel returns the Level field value if set, zero value otherwise. func (o *TreeNode) GetLevel() string { if o == nil || o.Level == nil { @@ -67,6 +76,7 @@ func (o *TreeNode) SetLevel(v string) { o.Level = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *TreeNode) GetName() string { if o == nil || o.Name == nil { @@ -95,6 +105,7 @@ func (o *TreeNode) SetName(v string) { o.Name = &v } + // GetUid returns the Uid field value if set, zero value otherwise. func (o *TreeNode) GetUid() string { if o == nil || o.Uid == nil { @@ -123,6 +134,7 @@ func (o *TreeNode) SetUid(v string) { o.Uid = &v } + // GetEvents returns the Events field value if set, zero value otherwise. func (o *TreeNode) GetEvents() []View_event { if o == nil || o.Events == nil { @@ -151,6 +163,7 @@ func (o *TreeNode) SetEvents(v []View_event) { o.Events = v } + // GetChildren returns the Children field value if set, zero value otherwise. func (o *TreeNode) GetChildren() []TreeNode { if o == nil || o.Children == nil { @@ -179,6 +192,8 @@ func (o *TreeNode) SetChildren(v []TreeNode) { o.Children = v } + + // MarshalJSON serializes the struct using spec logic. func (o TreeNode) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -210,18 +225,18 @@ func (o TreeNode) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *TreeNode) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Level *string `json:"level,omitempty"` - Name *string `json:"name,omitempty"` - Uid *string `json:"uid,omitempty"` - Events []View_event `json:"events,omitempty"` - Children []TreeNode `json:"children,omitempty"` + Level *string `json:"level,omitempty"` + Name *string `json:"name,omitempty"` + Uid *string `json:"uid,omitempty"` + Events []View_event `json:"events,omitempty"` + Children []TreeNode `json:"children,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"level", "name", "uid", "events", "children"}) + common.DeleteKeys(additionalProperties, &[]string{ "level", "name", "uid", "events", "children", }) } else { return err } diff --git a/api/kbcloud/model_user.go b/api/kbcloud/model_user.go index 73895eef..a16e0b33 100644 --- a/api/kbcloud/model_user.go +++ b/api/kbcloud/model_user.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// User User info + + +// User User info type User struct { // CreatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists CreatedAt time.Time `json:"createdAt"` @@ -28,10 +32,11 @@ type User struct { // Populated by the system. Read-only. Null for lists UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewUser instantiates a new User object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -52,7 +57,6 @@ func NewUserWithDefaults() *User { this := User{} return &this } - // GetCreatedAt returns the CreatedAt field value. func (o *User) GetCreatedAt() time.Time { if o == nil { @@ -76,6 +80,7 @@ func (o *User) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *User) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -104,6 +109,7 @@ func (o *User) SetDisplayName(v string) { o.DisplayName = &v } + // GetEmail returns the Email field value. func (o *User) GetEmail() string { if o == nil { @@ -127,6 +133,7 @@ func (o *User) SetEmail(v string) { o.Email = v } + // GetId returns the Id field value. func (o *User) GetId() string { if o == nil { @@ -150,6 +157,7 @@ func (o *User) SetId(v string) { o.Id = v } + // GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. func (o *User) GetPhoneNumber() string { if o == nil || o.PhoneNumber == nil { @@ -178,6 +186,7 @@ func (o *User) SetPhoneNumber(v string) { o.PhoneNumber = &v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *User) GetUpdatedAt() time.Time { if o == nil { @@ -201,6 +210,8 @@ func (o *User) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o User) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -235,12 +246,12 @@ func (o User) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *User) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CreatedAt *time.Time `json:"createdAt"` - DisplayName *string `json:"displayName,omitempty"` - Email *string `json:"email"` - Id *string `json:"id"` - PhoneNumber *string `json:"phoneNumber,omitempty"` - UpdatedAt *time.Time `json:"updatedAt"` + CreatedAt *time.Time `json:"createdAt"` + DisplayName *string `json:"displayName,omitempty"` + Email *string `json:"email"` + Id *string `json:"id"` + PhoneNumber *string `json:"phoneNumber,omitempty"` + UpdatedAt *time.Time `json:"updatedAt"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -259,7 +270,7 @@ func (o *User) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"createdAt", "displayName", "email", "id", "phoneNumber", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "createdAt", "displayName", "email", "id", "phoneNumber", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/model_user_update.go b/api/kbcloud/model_user_update.go index 65b0e78d..977946f0 100644 --- a/api/kbcloud/model_user_update.go +++ b/api/kbcloud/model_user_update.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) -// UserUpdate User update + + +// UserUpdate User update type UserUpdate struct { // The display name of the user DisplayName *string `json:"displayName,omitempty"` @@ -17,10 +26,11 @@ type UserUpdate struct { // The verification code for the user VerificationCode *string `json:"verificationCode,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewUserUpdate instantiates a new UserUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -37,7 +47,6 @@ func NewUserUpdateWithDefaults() *UserUpdate { this := UserUpdate{} return &this } - // GetDisplayName returns the DisplayName field value if set, zero value otherwise. func (o *UserUpdate) GetDisplayName() string { if o == nil || o.DisplayName == nil { @@ -66,6 +75,7 @@ func (o *UserUpdate) SetDisplayName(v string) { o.DisplayName = &v } + // GetEmail returns the Email field value if set, zero value otherwise. func (o *UserUpdate) GetEmail() string { if o == nil || o.Email == nil { @@ -94,6 +104,7 @@ func (o *UserUpdate) SetEmail(v string) { o.Email = &v } + // GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. func (o *UserUpdate) GetPhoneNumber() string { if o == nil || o.PhoneNumber == nil { @@ -122,6 +133,7 @@ func (o *UserUpdate) SetPhoneNumber(v string) { o.PhoneNumber = &v } + // GetVerificationCode returns the VerificationCode field value if set, zero value otherwise. func (o *UserUpdate) GetVerificationCode() string { if o == nil || o.VerificationCode == nil { @@ -150,6 +162,8 @@ func (o *UserUpdate) SetVerificationCode(v string) { o.VerificationCode = &v } + + // MarshalJSON serializes the struct using spec logic. func (o UserUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -178,9 +192,9 @@ func (o UserUpdate) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *UserUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - DisplayName *string `json:"displayName,omitempty"` - Email *string `json:"email,omitempty"` - PhoneNumber *string `json:"phoneNumber,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Email *string `json:"email,omitempty"` + PhoneNumber *string `json:"phoneNumber,omitempty"` VerificationCode *string `json:"verificationCode,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { @@ -188,7 +202,7 @@ func (o *UserUpdate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"displayName", "email", "phoneNumber", "verificationCode"}) + common.DeleteKeys(additionalProperties, &[]string{ "displayName", "email", "phoneNumber", "verificationCode", }) } else { return err } diff --git a/api/kbcloud/model_view.go b/api/kbcloud/model_view.go index 8644b91a..ba461094 100644 --- a/api/kbcloud/model_view.go +++ b/api/kbcloud/model_view.go @@ -2,11 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + -// View View is the schema for the views API + +// View View is the schema for the views API type View struct { // A label selector is a label query over a set of resources. InvolvedObjectsSelector *ViewInvolvedObjectsSelector `json:"involvedObjectsSelector,omitempty"` @@ -19,10 +28,11 @@ type View struct { // Progress describes the overall progress of the view. Progress *string `json:"progress,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewView instantiates a new View object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -39,7 +49,6 @@ func NewViewWithDefaults() *View { this := View{} return &this } - // GetInvolvedObjectsSelector returns the InvolvedObjectsSelector field value if set, zero value otherwise. func (o *View) GetInvolvedObjectsSelector() ViewInvolvedObjectsSelector { if o == nil || o.InvolvedObjectsSelector == nil { @@ -68,6 +77,7 @@ func (o *View) SetInvolvedObjectsSelector(v ViewInvolvedObjectsSelector) { o.InvolvedObjectsSelector = &v } + // GetTargetResource returns the TargetResource field value if set, zero value otherwise. func (o *View) GetTargetResource() string { if o == nil || o.TargetResource == nil { @@ -96,6 +106,7 @@ func (o *View) SetTargetResource(v string) { o.TargetResource = &v } + // GetViewDefRef returns the ViewDefRef field value if set, zero value otherwise. func (o *View) GetViewDefRef() string { if o == nil || o.ViewDefRef == nil { @@ -124,6 +135,7 @@ func (o *View) SetViewDefRef(v string) { o.ViewDefRef = &v } + // GetEvents returns the Events field value if set, zero value otherwise. func (o *View) GetEvents() []View_event { if o == nil || o.Events == nil { @@ -152,6 +164,7 @@ func (o *View) SetEvents(v []View_event) { o.Events = v } + // GetProgress returns the Progress field value if set, zero value otherwise. func (o *View) GetProgress() string { if o == nil || o.Progress == nil { @@ -180,6 +193,8 @@ func (o *View) SetProgress(v string) { o.Progress = &v } + + // MarshalJSON serializes the struct using spec logic. func (o View) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -212,23 +227,23 @@ func (o View) MarshalJSON() ([]byte, error) { func (o *View) UnmarshalJSON(bytes []byte) (err error) { all := struct { InvolvedObjectsSelector *ViewInvolvedObjectsSelector `json:"involvedObjectsSelector,omitempty"` - TargetResource *string `json:"targetResource,omitempty"` - ViewDefRef *string `json:"viewDefRef,omitempty"` - Events []View_event `json:"events,omitempty"` - Progress *string `json:"progress,omitempty"` + TargetResource *string `json:"targetResource,omitempty"` + ViewDefRef *string `json:"viewDefRef,omitempty"` + Events []View_event `json:"events,omitempty"` + Progress *string `json:"progress,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"involvedObjectsSelector", "targetResource", "viewDefRef", "events", "progress"}) + common.DeleteKeys(additionalProperties, &[]string{ "involvedObjectsSelector", "targetResource", "viewDefRef", "events", "progress", }) } else { return err } hasInvalidField := false - if all.InvolvedObjectsSelector != nil && all.InvolvedObjectsSelector.UnparsedObject != nil && o.UnparsedObject == nil { + if all.InvolvedObjectsSelector != nil && all.InvolvedObjectsSelector.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.InvolvedObjectsSelector = all.InvolvedObjectsSelector diff --git a/api/kbcloud/model_view_event.go b/api/kbcloud/model_view_event.go index e4b1d1b3..354e11af 100644 --- a/api/kbcloud/model_view_event.go +++ b/api/kbcloud/model_view_event.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// View_event Event related to the view + + +// View_event Event related to the view type View_event struct { // Group is the API group of the event. Group string `json:"group"` @@ -39,10 +44,11 @@ type View_event struct { // Reason is the reason of the event. Reason *string `json:"reason,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewView_event instantiates a new View_event object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -64,7 +70,6 @@ func NewView_eventWithDefaults() *View_event { this := View_event{} return &this } - // GetGroup returns the Group field value. func (o *View_event) GetGroup() string { if o == nil { @@ -88,6 +93,7 @@ func (o *View_event) SetGroup(v string) { o.Group = v } + // GetKind returns the Kind field value. func (o *View_event) GetKind() string { if o == nil { @@ -111,6 +117,7 @@ func (o *View_event) SetKind(v string) { o.Kind = v } + // GetName returns the Name field value. func (o *View_event) GetName() string { if o == nil { @@ -134,6 +141,7 @@ func (o *View_event) SetName(v string) { o.Name = v } + // GetNamespace returns the Namespace field value. func (o *View_event) GetNamespace() string { if o == nil { @@ -157,6 +165,7 @@ func (o *View_event) SetNamespace(v string) { o.Namespace = v } + // GetOwners returns the Owners field value if set, zero value otherwise. func (o *View_event) GetOwners() []Owner { if o == nil || o.Owners == nil { @@ -185,6 +194,7 @@ func (o *View_event) SetOwners(v []Owner) { o.Owners = v } + // GetProgress returns the Progress field value if set, zero value otherwise. func (o *View_event) GetProgress() string { if o == nil || o.Progress == nil { @@ -213,6 +223,7 @@ func (o *View_event) SetProgress(v string) { o.Progress = &v } + // GetMessage returns the Message field value if set, zero value otherwise. func (o *View_event) GetMessage() string { if o == nil || o.Message == nil { @@ -241,6 +252,7 @@ func (o *View_event) SetMessage(v string) { o.Message = &v } + // GetResourceVersion returns the ResourceVersion field value if set, zero value otherwise. func (o *View_event) GetResourceVersion() string { if o == nil || o.ResourceVersion == nil { @@ -269,6 +281,7 @@ func (o *View_event) SetResourceVersion(v string) { o.ResourceVersion = &v } + // GetType returns the Type field value. func (o *View_event) GetType() string { if o == nil { @@ -292,6 +305,7 @@ func (o *View_event) SetType(v string) { o.Type = v } + // GetVersion returns the Version field value if set, zero value otherwise. func (o *View_event) GetVersion() string { if o == nil || o.Version == nil { @@ -320,6 +334,7 @@ func (o *View_event) SetVersion(v string) { o.Version = &v } + // GetTime returns the Time field value if set, zero value otherwise. func (o *View_event) GetTime() string { if o == nil || o.Time == nil { @@ -348,6 +363,7 @@ func (o *View_event) SetTime(v string) { o.Time = &v } + // GetLevel returns the Level field value if set, zero value otherwise. func (o *View_event) GetLevel() string { if o == nil || o.Level == nil { @@ -376,6 +392,7 @@ func (o *View_event) SetLevel(v string) { o.Level = &v } + // GetReason returns the Reason field value if set, zero value otherwise. func (o *View_event) GetReason() string { if o == nil || o.Reason == nil { @@ -404,6 +421,8 @@ func (o *View_event) SetReason(v string) { o.Reason = &v } + + // MarshalJSON serializes the struct using spec logic. func (o View_event) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -449,19 +468,19 @@ func (o View_event) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *View_event) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Group *string `json:"group"` - Kind *string `json:"kind"` - Name *string `json:"name"` - Namespace *string `json:"namespace"` - Owners []Owner `json:"owners,omitempty"` - Progress *string `json:"progress,omitempty"` - Message *string `json:"message,omitempty"` + Group *string `json:"group"` + Kind *string `json:"kind"` + Name *string `json:"name"` + Namespace *string `json:"namespace"` + Owners []Owner `json:"owners,omitempty"` + Progress *string `json:"progress,omitempty"` + Message *string `json:"message,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` - Type *string `json:"type"` - Version *string `json:"version,omitempty"` - Time *string `json:"time,omitempty"` - Level *string `json:"level,omitempty"` - Reason *string `json:"reason,omitempty"` + Type *string `json:"type"` + Version *string `json:"version,omitempty"` + Time *string `json:"time,omitempty"` + Level *string `json:"level,omitempty"` + Reason *string `json:"reason,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -483,7 +502,7 @@ func (o *View_event) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"group", "kind", "name", "namespace", "owners", "progress", "message", "resourceVersion", "type", "version", "time", "level", "reason"}) + common.DeleteKeys(additionalProperties, &[]string{ "group", "kind", "name", "namespace", "owners", "progress", "message", "resourceVersion", "type", "version", "time", "level", "reason", }) } else { return err } diff --git a/api/kbcloud/model_view_involved_objects_selector.go b/api/kbcloud/model_view_involved_objects_selector.go index 556bf67b..a5e585e4 100644 --- a/api/kbcloud/model_view_involved_objects_selector.go +++ b/api/kbcloud/model_view_involved_objects_selector.go @@ -2,21 +2,31 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ViewInvolvedObjectsSelector A label selector is a label query over a set of resources. +// ViewInvolvedObjectsSelector A label selector is a label query over a set of resources. type ViewInvolvedObjectsSelector struct { // matchExpressions is a list of label selector requirements. The requirements are ANDed. MatchExpressions []ViewInvolvedObjectsSelectorMatchExpressionsItem `json:"matchExpressions,omitempty"` // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. MatchLabels map[string]string `json:"matchLabels,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewViewInvolvedObjectsSelector instantiates a new ViewInvolvedObjectsSelector object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -33,7 +43,6 @@ func NewViewInvolvedObjectsSelectorWithDefaults() *ViewInvolvedObjectsSelector { this := ViewInvolvedObjectsSelector{} return &this } - // GetMatchExpressions returns the MatchExpressions field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelector) GetMatchExpressions() []ViewInvolvedObjectsSelectorMatchExpressionsItem { if o == nil || o.MatchExpressions == nil { @@ -62,6 +71,7 @@ func (o *ViewInvolvedObjectsSelector) SetMatchExpressions(v []ViewInvolvedObject o.MatchExpressions = v } + // GetMatchLabels returns the MatchLabels field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelector) GetMatchLabels() map[string]string { if o == nil || o.MatchLabels == nil { @@ -90,6 +100,8 @@ func (o *ViewInvolvedObjectsSelector) SetMatchLabels(v map[string]string) { o.MatchLabels = v } + + // MarshalJSON serializes the struct using spec logic. func (o ViewInvolvedObjectsSelector) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -113,14 +125,14 @@ func (o ViewInvolvedObjectsSelector) MarshalJSON() ([]byte, error) { func (o *ViewInvolvedObjectsSelector) UnmarshalJSON(bytes []byte) (err error) { all := struct { MatchExpressions []ViewInvolvedObjectsSelectorMatchExpressionsItem `json:"matchExpressions,omitempty"` - MatchLabels map[string]string `json:"matchLabels,omitempty"` + MatchLabels map[string]string `json:"matchLabels,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"matchExpressions", "matchLabels"}) + common.DeleteKeys(additionalProperties, &[]string{ "matchExpressions", "matchLabels", }) } else { return err } diff --git a/api/kbcloud/model_view_involved_objects_selector_match_expressions_item.go b/api/kbcloud/model_view_involved_objects_selector_match_expressions_item.go index 4e4f38a9..5a1c6f2e 100644 --- a/api/kbcloud/model_view_involved_objects_selector_match_expressions_item.go +++ b/api/kbcloud/model_view_involved_objects_selector_match_expressions_item.go @@ -2,10 +2,19 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type ViewInvolvedObjectsSelectorMatchExpressionsItem struct { // key is the label key that the selector applies to. Key *string `json:"key,omitempty"` @@ -14,10 +23,11 @@ type ViewInvolvedObjectsSelectorMatchExpressionsItem struct { // values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. Values []string `json:"values,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewViewInvolvedObjectsSelectorMatchExpressionsItem instantiates a new ViewInvolvedObjectsSelectorMatchExpressionsItem object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +44,6 @@ func NewViewInvolvedObjectsSelectorMatchExpressionsItemWithDefaults() *ViewInvol this := ViewInvolvedObjectsSelectorMatchExpressionsItem{} return &this } - // GetKey returns the Key field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) GetKey() string { if o == nil || o.Key == nil { @@ -63,6 +72,7 @@ func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) SetKey(v string) { o.Key = &v } + // GetOperator returns the Operator field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) GetOperator() string { if o == nil || o.Operator == nil { @@ -91,6 +101,7 @@ func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) SetOperator(v string) o.Operator = &v } + // GetValues returns the Values field value if set, zero value otherwise. func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) GetValues() []string { if o == nil || o.Values == nil { @@ -119,6 +130,8 @@ func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) SetValues(v []string) o.Values = v } + + // MarshalJSON serializes the struct using spec logic. func (o ViewInvolvedObjectsSelectorMatchExpressionsItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -144,16 +157,16 @@ func (o ViewInvolvedObjectsSelectorMatchExpressionsItem) MarshalJSON() ([]byte, // UnmarshalJSON deserializes the given payload. func (o *ViewInvolvedObjectsSelectorMatchExpressionsItem) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Key *string `json:"key,omitempty"` - Operator *string `json:"operator,omitempty"` - Values []string `json:"values,omitempty"` + Key *string `json:"key,omitempty"` + Operator *string `json:"operator,omitempty"` + Values []string `json:"values,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"key", "operator", "values"}) + common.DeleteKeys(additionalProperties, &[]string{ "key", "operator", "values", }) } else { return err } diff --git a/api/kbcloud/model_volume.go b/api/kbcloud/model_volume.go index faa86412..7a02081f 100644 --- a/api/kbcloud/model_volume.go +++ b/api/kbcloud/model_volume.go @@ -2,22 +2,32 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + type Volume struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` IsDefault *string `json:"isDefault,omitempty"` - Location *string `json:"location,omitempty"` - Params *string `json:"params,omitempty"` - Comment *string `json:"comment,omitempty"` + Location *string `json:"location,omitempty"` + Params *string `json:"params,omitempty"` + Comment *string `json:"comment,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewVolume instantiates a new Volume object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -34,7 +44,6 @@ func NewVolumeWithDefaults() *Volume { this := Volume{} return &this } - // GetName returns the Name field value if set, zero value otherwise. func (o *Volume) GetName() string { if o == nil || o.Name == nil { @@ -63,6 +72,7 @@ func (o *Volume) SetName(v string) { o.Name = &v } + // GetType returns the Type field value if set, zero value otherwise. func (o *Volume) GetType() string { if o == nil || o.Type == nil { @@ -91,6 +101,7 @@ func (o *Volume) SetType(v string) { o.Type = &v } + // GetIsDefault returns the IsDefault field value if set, zero value otherwise. func (o *Volume) GetIsDefault() string { if o == nil || o.IsDefault == nil { @@ -119,6 +130,7 @@ func (o *Volume) SetIsDefault(v string) { o.IsDefault = &v } + // GetLocation returns the Location field value if set, zero value otherwise. func (o *Volume) GetLocation() string { if o == nil || o.Location == nil { @@ -147,6 +159,7 @@ func (o *Volume) SetLocation(v string) { o.Location = &v } + // GetParams returns the Params field value if set, zero value otherwise. func (o *Volume) GetParams() string { if o == nil || o.Params == nil { @@ -175,6 +188,7 @@ func (o *Volume) SetParams(v string) { o.Params = &v } + // GetComment returns the Comment field value if set, zero value otherwise. func (o *Volume) GetComment() string { if o == nil || o.Comment == nil { @@ -203,6 +217,8 @@ func (o *Volume) SetComment(v string) { o.Comment = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Volume) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -237,19 +253,19 @@ func (o Volume) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Volume) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` IsDefault *string `json:"isDefault,omitempty"` - Location *string `json:"location,omitempty"` - Params *string `json:"params,omitempty"` - Comment *string `json:"comment,omitempty"` + Location *string `json:"location,omitempty"` + Params *string `json:"params,omitempty"` + Comment *string `json:"comment,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "type", "isDefault", "location", "params", "comment"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "type", "isDefault", "location", "params", "comment", }) } else { return err } diff --git a/api/kbcloud/model_volume_restore_policy.go b/api/kbcloud/model_volume_restore_policy.go index cc93d507..6eee64be 100644 --- a/api/kbcloud/model_volume_restore_policy.go +++ b/api/kbcloud/model_volume_restore_policy.go @@ -2,20 +2,25 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // VolumeRestorePolicy the volume claim restore policy, support values: [Serial, Parallel] type VolumeRestorePolicy string // List of VolumeRestorePolicy. const ( - VolumeRestorePolicySerial VolumeRestorePolicy = "Serial" + VolumeRestorePolicySerial VolumeRestorePolicy = "Serial" VolumeRestorePolicyParallel VolumeRestorePolicy = "Parallel" ) diff --git a/api/kbcloud/model_webhook_config.go b/api/kbcloud/model_webhook_config.go index f1a275fb..90563d04 100644 --- a/api/kbcloud/model_webhook_config.go +++ b/api/kbcloud/model_webhook_config.go @@ -2,22 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// WebhookConfig Webhook config of alert receiver + + +// WebhookConfig Webhook config of alert receiver type WebhookConfig struct { Url string `json:"url"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewWebhookConfig instantiates a new WebhookConfig object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -35,7 +41,6 @@ func NewWebhookConfigWithDefaults() *WebhookConfig { this := WebhookConfig{} return &this } - // GetUrl returns the Url field value. func (o *WebhookConfig) GetUrl() string { if o == nil { @@ -59,6 +64,8 @@ func (o *WebhookConfig) SetUrl(v string) { o.Url = v } + + // MarshalJSON serializes the struct using spec logic. func (o WebhookConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +93,7 @@ func (o *WebhookConfig) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"url"}) + common.DeleteKeys(additionalProperties, &[]string{ "url", }) } else { return err } diff --git a/api/kbcloud/model_ycsb.go b/api/kbcloud/model_ycsb.go index 2b3e4ffb..13e06c84 100644 --- a/api/kbcloud/model_ycsb.go +++ b/api/kbcloud/model_ycsb.go @@ -2,15 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Ycsb ycsb is the ycsb benchmark object + + +// Ycsb ycsb is the ycsb benchmark object type Ycsb struct { // Step of benchmark Step *YcsbStep `json:"step,omitempty"` @@ -61,10 +66,11 @@ type Ycsb struct { // Redis sentinel password RedisSentinelPassword *string `json:"redisSentinelPassword,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewYcsb instantiates a new Ycsb object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -109,7 +115,6 @@ func NewYcsbWithDefaults() *Ycsb { this.Database = &database return &this } - // GetStep returns the Step field value if set, zero value otherwise. func (o *Ycsb) GetStep() YcsbStep { if o == nil || o.Step == nil { @@ -138,6 +143,7 @@ func (o *Ycsb) SetStep(v YcsbStep) { o.Step = &v } + // GetLimitCpu returns the LimitCpu field value if set, zero value otherwise. func (o *Ycsb) GetLimitCpu() string { if o == nil || o.LimitCpu == nil { @@ -166,6 +172,7 @@ func (o *Ycsb) SetLimitCpu(v string) { o.LimitCpu = &v } + // GetLimitMemory returns the LimitMemory field value if set, zero value otherwise. func (o *Ycsb) GetLimitMemory() string { if o == nil || o.LimitMemory == nil { @@ -194,6 +201,7 @@ func (o *Ycsb) SetLimitMemory(v string) { o.LimitMemory = &v } + // GetRequestCpu returns the RequestCpu field value if set, zero value otherwise. func (o *Ycsb) GetRequestCpu() string { if o == nil || o.RequestCpu == nil { @@ -222,6 +230,7 @@ func (o *Ycsb) SetRequestCpu(v string) { o.RequestCpu = &v } + // GetRequestMemory returns the RequestMemory field value if set, zero value otherwise. func (o *Ycsb) GetRequestMemory() string { if o == nil || o.RequestMemory == nil { @@ -250,6 +259,7 @@ func (o *Ycsb) SetRequestMemory(v string) { o.RequestMemory = &v } + // GetName returns the Name field value if set, zero value otherwise. func (o *Ycsb) GetName() string { if o == nil || o.Name == nil { @@ -278,6 +288,7 @@ func (o *Ycsb) SetName(v string) { o.Name = &v } + // GetDatabase returns the Database field value if set, zero value otherwise. func (o *Ycsb) GetDatabase() string { if o == nil || o.Database == nil { @@ -306,6 +317,7 @@ func (o *Ycsb) SetDatabase(v string) { o.Database = &v } + // GetCluster returns the Cluster field value. func (o *Ycsb) GetCluster() string { if o == nil { @@ -329,6 +341,7 @@ func (o *Ycsb) SetCluster(v string) { o.Cluster = v } + // GetUsername returns the Username field value. func (o *Ycsb) GetUsername() string { if o == nil { @@ -352,6 +365,7 @@ func (o *Ycsb) SetUsername(v string) { o.Username = v } + // GetPassword returns the Password field value. func (o *Ycsb) GetPassword() string { if o == nil { @@ -375,6 +389,7 @@ func (o *Ycsb) SetPassword(v string) { o.Password = v } + // GetAddress returns the Address field value. func (o *Ycsb) GetAddress() string { if o == nil { @@ -398,6 +413,7 @@ func (o *Ycsb) SetAddress(v string) { o.Address = v } + // GetRecordCount returns the RecordCount field value if set, zero value otherwise. func (o *Ycsb) GetRecordCount() int32 { if o == nil || o.RecordCount == nil { @@ -426,6 +442,7 @@ func (o *Ycsb) SetRecordCount(v int32) { o.RecordCount = &v } + // GetOperationCount returns the OperationCount field value if set, zero value otherwise. func (o *Ycsb) GetOperationCount() int32 { if o == nil || o.OperationCount == nil { @@ -454,6 +471,7 @@ func (o *Ycsb) SetOperationCount(v int32) { o.OperationCount = &v } + // GetReadProportion returns the ReadProportion field value if set, zero value otherwise. func (o *Ycsb) GetReadProportion() int32 { if o == nil || o.ReadProportion == nil { @@ -482,6 +500,7 @@ func (o *Ycsb) SetReadProportion(v int32) { o.ReadProportion = &v } + // GetUpdateProportion returns the UpdateProportion field value if set, zero value otherwise. func (o *Ycsb) GetUpdateProportion() int32 { if o == nil || o.UpdateProportion == nil { @@ -510,6 +529,7 @@ func (o *Ycsb) SetUpdateProportion(v int32) { o.UpdateProportion = &v } + // GetInsertProportion returns the InsertProportion field value if set, zero value otherwise. func (o *Ycsb) GetInsertProportion() int32 { if o == nil || o.InsertProportion == nil { @@ -538,6 +558,7 @@ func (o *Ycsb) SetInsertProportion(v int32) { o.InsertProportion = &v } + // GetReadModifyWriteProportion returns the ReadModifyWriteProportion field value if set, zero value otherwise. func (o *Ycsb) GetReadModifyWriteProportion() int32 { if o == nil || o.ReadModifyWriteProportion == nil { @@ -566,6 +587,7 @@ func (o *Ycsb) SetReadModifyWriteProportion(v int32) { o.ReadModifyWriteProportion = &v } + // GetScanProportion returns the ScanProportion field value if set, zero value otherwise. func (o *Ycsb) GetScanProportion() int32 { if o == nil || o.ScanProportion == nil { @@ -594,6 +616,7 @@ func (o *Ycsb) SetScanProportion(v int32) { o.ScanProportion = &v } + // GetThreads returns the Threads field value if set, zero value otherwise. func (o *Ycsb) GetThreads() int32 { if o == nil || o.Threads == nil { @@ -622,6 +645,7 @@ func (o *Ycsb) SetThreads(v int32) { o.Threads = &v } + // GetExtraArgs returns the ExtraArgs field value if set, zero value otherwise. func (o *Ycsb) GetExtraArgs() string { if o == nil || o.ExtraArgs == nil { @@ -650,6 +674,7 @@ func (o *Ycsb) SetExtraArgs(v string) { o.ExtraArgs = &v } + // GetRedisMode returns the RedisMode field value if set, zero value otherwise. func (o *Ycsb) GetRedisMode() YcsbRedisMode { if o == nil || o.RedisMode == nil { @@ -678,6 +703,7 @@ func (o *Ycsb) SetRedisMode(v YcsbRedisMode) { o.RedisMode = &v } + // GetRedisSentinelMaster returns the RedisSentinelMaster field value if set, zero value otherwise. func (o *Ycsb) GetRedisSentinelMaster() string { if o == nil || o.RedisSentinelMaster == nil { @@ -706,6 +732,7 @@ func (o *Ycsb) SetRedisSentinelMaster(v string) { o.RedisSentinelMaster = &v } + // GetRedisSentinelUsername returns the RedisSentinelUsername field value if set, zero value otherwise. func (o *Ycsb) GetRedisSentinelUsername() string { if o == nil || o.RedisSentinelUsername == nil { @@ -734,6 +761,7 @@ func (o *Ycsb) SetRedisSentinelUsername(v string) { o.RedisSentinelUsername = &v } + // GetRedisSentinelPassword returns the RedisSentinelPassword field value if set, zero value otherwise. func (o *Ycsb) GetRedisSentinelPassword() string { if o == nil || o.RedisSentinelPassword == nil { @@ -762,6 +790,8 @@ func (o *Ycsb) SetRedisSentinelPassword(v string) { o.RedisSentinelPassword = &v } + + // MarshalJSON serializes the struct using spec logic. func (o Ycsb) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -842,30 +872,30 @@ func (o Ycsb) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Ycsb) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Step *YcsbStep `json:"step,omitempty"` - LimitCpu *string `json:"limitCpu,omitempty"` - LimitMemory *string `json:"limitMemory,omitempty"` - RequestCpu *string `json:"requestCpu,omitempty"` - RequestMemory *string `json:"requestMemory,omitempty"` - Name *string `json:"name,omitempty"` - Database *string `json:"database,omitempty"` - Cluster *string `json:"cluster"` - Username *string `json:"username"` - Password *string `json:"password"` - Address *string `json:"address"` - RecordCount *int32 `json:"recordCount,omitempty"` - OperationCount *int32 `json:"operationCount,omitempty"` - ReadProportion *int32 `json:"readProportion,omitempty"` - UpdateProportion *int32 `json:"updateProportion,omitempty"` - InsertProportion *int32 `json:"insertProportion,omitempty"` - ReadModifyWriteProportion *int32 `json:"readModifyWriteProportion,omitempty"` - ScanProportion *int32 `json:"scanProportion,omitempty"` - Threads *int32 `json:"threads,omitempty"` - ExtraArgs *string `json:"extraArgs,omitempty"` - RedisMode *YcsbRedisMode `json:"redisMode,omitempty"` - RedisSentinelMaster *string `json:"redisSentinelMaster,omitempty"` - RedisSentinelUsername *string `json:"redisSentinelUsername,omitempty"` - RedisSentinelPassword *string `json:"redisSentinelPassword,omitempty"` + Step *YcsbStep `json:"step,omitempty"` + LimitCpu *string `json:"limitCpu,omitempty"` + LimitMemory *string `json:"limitMemory,omitempty"` + RequestCpu *string `json:"requestCpu,omitempty"` + RequestMemory *string `json:"requestMemory,omitempty"` + Name *string `json:"name,omitempty"` + Database *string `json:"database,omitempty"` + Cluster *string `json:"cluster"` + Username *string `json:"username"` + Password *string `json:"password"` + Address *string `json:"address"` + RecordCount *int32 `json:"recordCount,omitempty"` + OperationCount *int32 `json:"operationCount,omitempty"` + ReadProportion *int32 `json:"readProportion,omitempty"` + UpdateProportion *int32 `json:"updateProportion,omitempty"` + InsertProportion *int32 `json:"insertProportion,omitempty"` + ReadModifyWriteProportion *int32 `json:"readModifyWriteProportion,omitempty"` + ScanProportion *int32 `json:"scanProportion,omitempty"` + Threads *int32 `json:"threads,omitempty"` + ExtraArgs *string `json:"extraArgs,omitempty"` + RedisMode *YcsbRedisMode `json:"redisMode,omitempty"` + RedisSentinelMaster *string `json:"redisSentinelMaster,omitempty"` + RedisSentinelUsername *string `json:"redisSentinelUsername,omitempty"` + RedisSentinelPassword *string `json:"redisSentinelPassword,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return common.Unmarshal(bytes, &o.UnparsedObject) @@ -884,13 +914,13 @@ func (o *Ycsb) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"step", "limitCpu", "limitMemory", "requestCpu", "requestMemory", "name", "database", "cluster", "username", "password", "address", "recordCount", "operationCount", "readProportion", "updateProportion", "insertProportion", "readModifyWriteProportion", "scanProportion", "threads", "extraArgs", "redisMode", "redisSentinelMaster", "redisSentinelUsername", "redisSentinelPassword"}) + common.DeleteKeys(additionalProperties, &[]string{ "step", "limitCpu", "limitMemory", "requestCpu", "requestMemory", "name", "database", "cluster", "username", "password", "address", "recordCount", "operationCount", "readProportion", "updateProportion", "insertProportion", "readModifyWriteProportion", "scanProportion", "threads", "extraArgs", "redisMode", "redisSentinelMaster", "redisSentinelUsername", "redisSentinelPassword", }) } else { return err } hasInvalidField := false - if all.Step != nil && !all.Step.IsValid() { + if all.Step != nil &&!all.Step.IsValid() { hasInvalidField = true } else { o.Step = all.Step @@ -914,7 +944,7 @@ func (o *Ycsb) UnmarshalJSON(bytes []byte) (err error) { o.ScanProportion = all.ScanProportion o.Threads = all.Threads o.ExtraArgs = all.ExtraArgs - if all.RedisMode != nil && !all.RedisMode.IsValid() { + if all.RedisMode != nil &&!all.RedisMode.IsValid() { hasInvalidField = true } else { o.RedisMode = all.RedisMode diff --git a/api/kbcloud/model_ycsb_redis_mode.go b/api/kbcloud/model_ycsb_redis_mode.go index 7ac02bc9..47761781 100644 --- a/api/kbcloud/model_ycsb_redis_mode.go +++ b/api/kbcloud/model_ycsb_redis_mode.go @@ -2,22 +2,27 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // YcsbRedisMode Redis mode type YcsbRedisMode string // List of YcsbRedisMode. const ( - YcsbRedisModeSingle YcsbRedisMode = "single" + YcsbRedisModeSingle YcsbRedisMode = "single" YcsbRedisModeSentinel YcsbRedisMode = "sentinel" - YcsbRedisModeCluster YcsbRedisMode = "cluster" + YcsbRedisModeCluster YcsbRedisMode = "cluster" ) var allowedYcsbRedisModeEnumValues = []YcsbRedisMode{ diff --git a/api/kbcloud/model_ycsb_step.go b/api/kbcloud/model_ycsb_step.go index 483e40e2..ee1b9844 100644 --- a/api/kbcloud/model_ycsb_step.go +++ b/api/kbcloud/model_ycsb_step.go @@ -2,23 +2,28 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) + + // YcsbStep Step of benchmark type YcsbStep string // List of YcsbStep. const ( YcsbStepPrepare YcsbStep = "prepare" - YcsbStepRun YcsbStep = "run" + YcsbStepRun YcsbStep = "run" YcsbStepCleanup YcsbStep = "cleanup" - YcsbStepAll YcsbStep = "all" + YcsbStepAll YcsbStep = "all" ) var allowedYcsbStepEnumValues = []YcsbStep{ diff --git a/api/kbcloud/model_zone.go b/api/kbcloud/model_zone.go index 2e2d83b2..fa267a4a 100644 --- a/api/kbcloud/model_zone.go +++ b/api/kbcloud/model_zone.go @@ -2,16 +2,20 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud import ( + "github.com/google/uuid" "fmt" - "time" - "github.com/apecloud/kb-cloud-client-go/api/common" + "github.com/apecloud/kb-cloud-client-go/api" + ) -// Zone The zone that the region has. + + +// Zone The zone that the region has. type Zone struct { // The name of the zone. Name string `json:"name"` @@ -28,10 +32,11 @@ type Zone struct { // The time when the zone was last updated. UpdatedAt time.Time `json:"updatedAt"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewZone instantiates a new Zone object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +60,6 @@ func NewZoneWithDefaults() *Zone { this := Zone{} return &this } - // GetName returns the Name field value. func (o *Zone) GetName() string { if o == nil { @@ -79,6 +83,7 @@ func (o *Zone) SetName(v string) { o.Name = v } + // GetNameCn returns the NameCn field value. func (o *Zone) GetNameCn() string { if o == nil { @@ -102,6 +107,7 @@ func (o *Zone) SetNameCn(v string) { o.NameCn = v } + // GetNameEn returns the NameEn field value. func (o *Zone) GetNameEn() string { if o == nil { @@ -125,6 +131,7 @@ func (o *Zone) SetNameEn(v string) { o.NameEn = v } + // GetEnabled returns the Enabled field value. func (o *Zone) GetEnabled() bool { if o == nil { @@ -148,6 +155,7 @@ func (o *Zone) SetEnabled(v bool) { o.Enabled = v } + // GetRegion returns the Region field value. func (o *Zone) GetRegion() string { if o == nil { @@ -171,6 +179,7 @@ func (o *Zone) SetRegion(v string) { o.Region = v } + // GetCreatedAt returns the CreatedAt field value. func (o *Zone) GetCreatedAt() time.Time { if o == nil { @@ -194,6 +203,7 @@ func (o *Zone) SetCreatedAt(v time.Time) { o.CreatedAt = v } + // GetUpdatedAt returns the UpdatedAt field value. func (o *Zone) GetUpdatedAt() time.Time { if o == nil { @@ -217,6 +227,8 @@ func (o *Zone) SetUpdatedAt(v time.Time) { o.UpdatedAt = v } + + // MarshalJSON serializes the struct using spec logic. func (o Zone) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -248,11 +260,11 @@ func (o Zone) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *Zone) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Name *string `json:"name"` - NameCn *string `json:"nameCN"` - NameEn *string `json:"nameEN"` - Enabled *bool `json:"enabled"` - Region *string `json:"region"` + Name *string `json:"name"` + NameCn *string `json:"nameCN"` + NameEn *string `json:"nameEN"` + Enabled *bool `json:"enabled"` + Region *string `json:"region"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` }{} @@ -282,7 +294,7 @@ func (o *Zone) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"name", "nameCN", "nameEN", "enabled", "region", "createdAt", "updatedAt"}) + common.DeleteKeys(additionalProperties, &[]string{ "name", "nameCN", "nameEN", "enabled", "region", "createdAt", "updatedAt", }) } else { return err } diff --git a/api/kbcloud/model_zone_list.go b/api/kbcloud/model_zone_list.go index dfc47a5e..81615f65 100644 --- a/api/kbcloud/model_zone_list.go +++ b/api/kbcloud/model_zone_list.go @@ -2,19 +2,29 @@ // This product includes software developed at ApeCloud (https://www.apecloud.com/). // Copyright 2022-Present ApeCloud Co., Ltd + package kbcloud -import "github.com/apecloud/kb-cloud-client-go/api/common" +import ( + "github.com/google/uuid" + "fmt" + + "github.com/apecloud/kb-cloud-client-go/api" + +) + + -// ZoneList The list of zones. +// ZoneList The list of zones. type ZoneList struct { // The list of zones. Items []Zone `json:"items,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } + // NewZoneList instantiates a new ZoneList object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -31,7 +41,6 @@ func NewZoneListWithDefaults() *ZoneList { this := ZoneList{} return &this } - // GetItems returns the Items field value if set, zero value otherwise. func (o *ZoneList) GetItems() []Zone { if o == nil || o.Items == nil { @@ -60,6 +69,8 @@ func (o *ZoneList) SetItems(v []Zone) { o.Items = v } + + // MarshalJSON serializes the struct using spec logic. func (o ZoneList) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -86,7 +97,7 @@ func (o *ZoneList) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"items"}) + common.DeleteKeys(additionalProperties, &[]string{ "items", }) } else { return err }