Skip to content

Commit 869bf46

Browse files
committed
chore: auto update client api apecloud/apecloud@8abe94a
1 parent 0266fd6 commit 869bf46

File tree

8 files changed

+97
-271
lines changed

8 files changed

+97
-271
lines changed

.generator/schemas/adminapi.yaml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9491,9 +9491,6 @@ paths:
94919491
application/json:
94929492
schema:
94939493
$ref: '#/components/schemas/engineLicenseCreate'
9494-
multipart/form-data:
9495-
schema:
9496-
$ref: '#/components/schemas/engineLicenseFormData'
94979494
responses:
94989495
'200':
94999496
content:
@@ -9595,9 +9592,6 @@ paths:
95959592
application/json:
95969593
schema:
95979594
$ref: '#/components/schemas/engineLicenseEntityCreate'
9598-
multipart/form-data:
9599-
schema:
9600-
$ref: '#/components/schemas/engineLicenseEntityFormData'
96019595
description: Engine license entity data
96029596
required: true
96039597
responses:
@@ -25659,20 +25653,14 @@ components:
2565925653
type:
2566025654
type: string
2566125655
description: Type of the license (optional)
25662-
required:
25663-
- name
25664-
- engineName
25665-
- type
25666-
engineLicenseFormData:
25667-
description: the data of the engine license
25668-
type: object
25669-
properties:
2567025656
licenseFile:
2567125657
type: string
2567225658
format: binary
2567325659
description: The license file to upload
2567425660
required:
25675-
- licenseFile
25661+
- name
25662+
- engineName
25663+
- type
2567625664
engineLicenseEntity:
2567725665
type: object
2567825666
required:
@@ -25721,19 +25709,14 @@ components:
2572125709
description:
2572225710
type: string
2572325711
description: Description of the entity
25724-
required:
25725-
- licenseId
25726-
- nodeName
25727-
- key
25728-
engineLicenseEntityFormData:
25729-
description: the data of the engine license entity
25730-
type: object
25731-
properties:
2573225712
licenseFile:
2573325713
type: string
2573425714
format: binary
2573525715
description: The key file to upload
2573625716
required:
25717+
- licenseId
25718+
- nodeName
25719+
- key
2573725720
- licenseFile
2573825721
engineTypeItem:
2573925722
type: object

apecloud

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit f31fadcb31ee74404ca4887c083723548bd6898a
1+
Subproject commit 8abe94aa4b93d266b1ee6a5579fb13af42791f81

api/kbcloud/admin/api_engine.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package admin
77
import (
88
"context"
99
_context "context"
10-
_io "io"
1110
_nethttp "net/http"
1211
_neturl "net/url"
1312
"strings"
@@ -400,7 +399,7 @@ func (a *EngineApi) AvailableServiceVersion(ctx _context.Context, environmentNam
400399

401400
// CreateEngineLicenseEntity Create a new engine license entity.
402401
// create a new engine license entity
403-
func (a *EngineApi) CreateEngineLicenseEntity(ctx _context.Context, body EngineLicenseEntityCreate, licenseFile _io.Reader) (EngineLicenseEntity, *_nethttp.Response, error) {
402+
func (a *EngineApi) CreateEngineLicenseEntity(ctx _context.Context, body EngineLicenseEntityCreate) (EngineLicenseEntity, *_nethttp.Response, error) {
404403
var (
405404
localVarHTTPMethod = _nethttp.MethodPost
406405
localVarPostBody interface{}
@@ -429,24 +428,14 @@ func (a *EngineApi) CreateEngineLicenseEntity(ctx _context.Context, body EngineL
429428
localVarHeaderParams["Content-Type"] = "application/json"
430429
localVarHeaderParams["Accept"] = "application/json"
431430

432-
formFile := common.FormFile{}
433-
formFile.FormFileName = "licenseFile"
434-
localVarFile := licenseFile
435-
if localVarFile != nil {
436-
fbs, _ := _io.ReadAll(localVarFile)
437-
formFile.FileBytes = fbs
438-
}
439-
440-
localVarFormParams, err = common.BuildFormParams(body)
441-
if err != nil {
442-
return localVarReturnValue, nil, common.ReportError("Failed to build form params: %s", err.Error())
443-
}
431+
// body params
432+
localVarPostBody = &body
444433
common.SetAuthKeys(
445434
ctx,
446435
&localVarHeaderParams,
447436
[2]string{"BearerToken", "authorization"},
448437
)
449-
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, &formFile)
438+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
450439
if err != nil {
451440
return localVarReturnValue, nil, err
452441
}

api/kbcloud/admin/api_engine_license.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package admin
77
import (
88
"context"
99
_context "context"
10-
_io "io"
1110
_nethttp "net/http"
1211
_neturl "net/url"
1312

@@ -19,7 +18,7 @@ type EngineLicenseApi common.Service
1918

2019
// CreateEngineLicense Create engineLicense.
2120
// Create a new engineLicense
22-
func (a *EngineLicenseApi) CreateEngineLicense(ctx _context.Context, body EngineLicenseCreate, licenseFile _io.Reader) (EngineLicense, *_nethttp.Response, error) {
21+
func (a *EngineLicenseApi) CreateEngineLicense(ctx _context.Context, body EngineLicenseCreate) (EngineLicense, *_nethttp.Response, error) {
2322
var (
2423
localVarHTTPMethod = _nethttp.MethodPost
2524
localVarPostBody interface{}
@@ -48,24 +47,14 @@ func (a *EngineLicenseApi) CreateEngineLicense(ctx _context.Context, body Engine
4847
localVarHeaderParams["Content-Type"] = "application/json"
4948
localVarHeaderParams["Accept"] = "application/json"
5049

51-
formFile := common.FormFile{}
52-
formFile.FormFileName = "licenseFile"
53-
localVarFile := licenseFile
54-
if localVarFile != nil {
55-
fbs, _ := _io.ReadAll(localVarFile)
56-
formFile.FileBytes = fbs
57-
}
58-
59-
localVarFormParams, err = common.BuildFormParams(body)
60-
if err != nil {
61-
return localVarReturnValue, nil, common.ReportError("Failed to build form params: %s", err.Error())
62-
}
50+
// body params
51+
localVarPostBody = &body
6352
common.SetAuthKeys(
6453
ctx,
6554
&localVarHeaderParams,
6655
[2]string{"BearerToken", "authorization"},
6756
)
68-
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, &formFile)
57+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
6958
if err != nil {
7059
return localVarReturnValue, nil, err
7160
}

api/kbcloud/admin/model_engine_license_create.go

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package admin
66

77
import (
88
"fmt"
9+
_io "io"
910
"time"
1011

1112
"github.com/apecloud/kb-cloud-client-go/api/common"
@@ -24,6 +25,8 @@ type EngineLicenseCreate struct {
2425
EnvironmentId *string `json:"environmentID,omitempty"`
2526
// Type of the license (optional)
2627
Type string `json:"type"`
28+
// The license file to upload
29+
LicenseFile *_io.Reader `json:"licenseFile,omitempty"`
2730
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2831
UnparsedObject map[string]interface{} `json:"-"`
2932
AdditionalProperties map[string]interface{} `json:"-"`
@@ -202,6 +205,34 @@ func (o *EngineLicenseCreate) SetType(v string) {
202205
o.Type = v
203206
}
204207

208+
// GetLicenseFile returns the LicenseFile field value if set, zero value otherwise.
209+
func (o *EngineLicenseCreate) GetLicenseFile() _io.Reader {
210+
if o == nil || o.LicenseFile == nil {
211+
var ret _io.Reader
212+
return ret
213+
}
214+
return *o.LicenseFile
215+
}
216+
217+
// GetLicenseFileOk returns a tuple with the LicenseFile field value if set, nil otherwise
218+
// and a boolean to check if the value has been set.
219+
func (o *EngineLicenseCreate) GetLicenseFileOk() (*_io.Reader, bool) {
220+
if o == nil || o.LicenseFile == nil {
221+
return nil, false
222+
}
223+
return o.LicenseFile, true
224+
}
225+
226+
// HasLicenseFile returns a boolean if a field has been set.
227+
func (o *EngineLicenseCreate) HasLicenseFile() bool {
228+
return o != nil && o.LicenseFile != nil
229+
}
230+
231+
// SetLicenseFile gets a reference to the given _io.Reader and assigns it to the LicenseFile field.
232+
func (o *EngineLicenseCreate) SetLicenseFile(v _io.Reader) {
233+
o.LicenseFile = &v
234+
}
235+
205236
// MarshalJSON serializes the struct using spec logic.
206237
func (o EngineLicenseCreate) MarshalJSON() ([]byte, error) {
207238
toSerialize := map[string]interface{}{}
@@ -224,6 +255,9 @@ func (o EngineLicenseCreate) MarshalJSON() ([]byte, error) {
224255
toSerialize["environmentID"] = o.EnvironmentId
225256
}
226257
toSerialize["type"] = o.Type
258+
if o.LicenseFile != nil {
259+
toSerialize["licenseFile"] = o.LicenseFile
260+
}
227261

228262
for key, value := range o.AdditionalProperties {
229263
toSerialize[key] = value
@@ -234,12 +268,13 @@ func (o EngineLicenseCreate) MarshalJSON() ([]byte, error) {
234268
// UnmarshalJSON deserializes the given payload.
235269
func (o *EngineLicenseCreate) UnmarshalJSON(bytes []byte) (err error) {
236270
all := struct {
237-
Name *string `json:"name"`
238-
EngineName *string `json:"engineName"`
239-
Description *string `json:"description,omitempty"`
240-
ExpiredAt *time.Time `json:"expiredAt,omitempty"`
241-
EnvironmentId *string `json:"environmentID,omitempty"`
242-
Type *string `json:"type"`
271+
Name *string `json:"name"`
272+
EngineName *string `json:"engineName"`
273+
Description *string `json:"description,omitempty"`
274+
ExpiredAt *time.Time `json:"expiredAt,omitempty"`
275+
EnvironmentId *string `json:"environmentID,omitempty"`
276+
Type *string `json:"type"`
277+
LicenseFile *_io.Reader `json:"licenseFile,omitempty"`
243278
}{}
244279
if err = common.Unmarshal(bytes, &all); err != nil {
245280
return err
@@ -255,7 +290,7 @@ func (o *EngineLicenseCreate) UnmarshalJSON(bytes []byte) (err error) {
255290
}
256291
additionalProperties := make(map[string]interface{})
257292
if err = common.Unmarshal(bytes, &additionalProperties); err == nil {
258-
common.DeleteKeys(additionalProperties, &[]string{"name", "engineName", "description", "expiredAt", "environmentID", "type"})
293+
common.DeleteKeys(additionalProperties, &[]string{"name", "engineName", "description", "expiredAt", "environmentID", "type", "licenseFile"})
259294
} else {
260295
return err
261296
}
@@ -265,6 +300,7 @@ func (o *EngineLicenseCreate) UnmarshalJSON(bytes []byte) (err error) {
265300
o.ExpiredAt = all.ExpiredAt
266301
o.EnvironmentId = all.EnvironmentId
267302
o.Type = *all.Type
303+
o.LicenseFile = all.LicenseFile
268304

269305
if len(additionalProperties) > 0 {
270306
o.AdditionalProperties = additionalProperties

api/kbcloud/admin/model_engine_license_entity_create.go

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package admin
66

77
import (
88
"fmt"
9+
_io "io"
910

1011
"github.com/apecloud/kb-cloud-client-go/api/common"
1112
)
@@ -19,6 +20,8 @@ type EngineLicenseEntityCreate struct {
1920
Key string `json:"key"`
2021
// Description of the entity
2122
Description *string `json:"description,omitempty"`
23+
// The key file to upload
24+
LicenseFile _io.Reader `json:"licenseFile"`
2225
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2326
UnparsedObject map[string]interface{} `json:"-"`
2427
AdditionalProperties map[string]interface{} `json:"-"`
@@ -28,11 +31,12 @@ type EngineLicenseEntityCreate struct {
2831
// This constructor will assign default values to properties that have it defined,
2932
// and makes sure properties required by API are set, but the set of arguments
3033
// will change when the set of required properties is changed.
31-
func NewEngineLicenseEntityCreate(licenseId string, nodeName string, key string) *EngineLicenseEntityCreate {
34+
func NewEngineLicenseEntityCreate(licenseId string, nodeName string, key string, licenseFile _io.Reader) *EngineLicenseEntityCreate {
3235
this := EngineLicenseEntityCreate{}
3336
this.LicenseId = licenseId
3437
this.NodeName = nodeName
3538
this.Key = key
39+
this.LicenseFile = licenseFile
3640
return &this
3741
}
3842

@@ -141,6 +145,29 @@ func (o *EngineLicenseEntityCreate) SetDescription(v string) {
141145
o.Description = &v
142146
}
143147

148+
// GetLicenseFile returns the LicenseFile field value.
149+
func (o *EngineLicenseEntityCreate) GetLicenseFile() _io.Reader {
150+
if o == nil {
151+
var ret _io.Reader
152+
return ret
153+
}
154+
return o.LicenseFile
155+
}
156+
157+
// GetLicenseFileOk returns a tuple with the LicenseFile field value
158+
// and a boolean to check if the value has been set.
159+
func (o *EngineLicenseEntityCreate) GetLicenseFileOk() (*_io.Reader, bool) {
160+
if o == nil {
161+
return nil, false
162+
}
163+
return &o.LicenseFile, true
164+
}
165+
166+
// SetLicenseFile sets field value.
167+
func (o *EngineLicenseEntityCreate) SetLicenseFile(v _io.Reader) {
168+
o.LicenseFile = v
169+
}
170+
144171
// MarshalJSON serializes the struct using spec logic.
145172
func (o EngineLicenseEntityCreate) MarshalJSON() ([]byte, error) {
146173
toSerialize := map[string]interface{}{}
@@ -153,6 +180,7 @@ func (o EngineLicenseEntityCreate) MarshalJSON() ([]byte, error) {
153180
if o.Description != nil {
154181
toSerialize["description"] = o.Description
155182
}
183+
toSerialize["licenseFile"] = o.LicenseFile
156184

157185
for key, value := range o.AdditionalProperties {
158186
toSerialize[key] = value
@@ -163,10 +191,11 @@ func (o EngineLicenseEntityCreate) MarshalJSON() ([]byte, error) {
163191
// UnmarshalJSON deserializes the given payload.
164192
func (o *EngineLicenseEntityCreate) UnmarshalJSON(bytes []byte) (err error) {
165193
all := struct {
166-
LicenseId *string `json:"licenseId"`
167-
NodeName *string `json:"nodeName"`
168-
Key *string `json:"key"`
169-
Description *string `json:"description,omitempty"`
194+
LicenseId *string `json:"licenseId"`
195+
NodeName *string `json:"nodeName"`
196+
Key *string `json:"key"`
197+
Description *string `json:"description,omitempty"`
198+
LicenseFile *_io.Reader `json:"licenseFile"`
170199
}{}
171200
if err = common.Unmarshal(bytes, &all); err != nil {
172201
return err
@@ -180,16 +209,20 @@ func (o *EngineLicenseEntityCreate) UnmarshalJSON(bytes []byte) (err error) {
180209
if all.Key == nil {
181210
return fmt.Errorf("required field key missing")
182211
}
212+
if all.LicenseFile == nil {
213+
return fmt.Errorf("required field licenseFile missing")
214+
}
183215
additionalProperties := make(map[string]interface{})
184216
if err = common.Unmarshal(bytes, &additionalProperties); err == nil {
185-
common.DeleteKeys(additionalProperties, &[]string{"licenseId", "nodeName", "key", "description"})
217+
common.DeleteKeys(additionalProperties, &[]string{"licenseId", "nodeName", "key", "description", "licenseFile"})
186218
} else {
187219
return err
188220
}
189221
o.LicenseId = *all.LicenseId
190222
o.NodeName = *all.NodeName
191223
o.Key = *all.Key
192224
o.Description = all.Description
225+
o.LicenseFile = *all.LicenseFile
193226

194227
if len(additionalProperties) > 0 {
195228
o.AdditionalProperties = additionalProperties

0 commit comments

Comments
 (0)