fix: add missing functions
This commit is contained in:
parent
b08b32ef1d
commit
76b61859da
11 changed files with 940 additions and 214 deletions
|
|
@ -193,7 +193,7 @@ type DefaultApi interface {
|
|||
@param region The region which should be addressed
|
||||
@return ApiGetFlavorsRequestRequest
|
||||
*/
|
||||
GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest
|
||||
GetFlavorsRequest(ctx context.Context, projectId string, region string, page, size *int64, sort *FlavorSort) ApiGetFlavorsRequestRequest
|
||||
/*
|
||||
GetFlavorsRequestExecute executes the request
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ type DefaultApi interface {
|
|||
@return GetFlavorsResponse
|
||||
|
||||
*/
|
||||
GetFlavorsRequestExecute(ctx context.Context, projectId string, region string) (*GetFlavorsResponse, error)
|
||||
GetFlavorsRequestExecute(ctx context.Context, projectId string, region string, page, size *int64, sort *FlavorSort) (*GetFlavorsResponse, error)
|
||||
/*
|
||||
GetInstanceRequest Get Specific Instance
|
||||
Get information about a specific available instance
|
||||
|
|
@ -2520,7 +2520,7 @@ Get all available flavors for a project.
|
|||
@param region The region which should be addressed
|
||||
@return ApiGetFlavorsRequestRequest
|
||||
*/
|
||||
func (a *APIClient) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest {
|
||||
func (a *APIClient) GetFlavorsRequest(ctx context.Context, projectId string, region string, page, size *int64, sort *FlavorSort) ApiGetFlavorsRequestRequest {
|
||||
return GetFlavorsRequestRequest{
|
||||
apiService: a.defaultApi,
|
||||
ctx: ctx,
|
||||
|
|
@ -2529,7 +2529,7 @@ func (a *APIClient) GetFlavorsRequest(ctx context.Context, projectId string, reg
|
|||
}
|
||||
}
|
||||
|
||||
func (a *APIClient) GetFlavorsRequestExecute(ctx context.Context, projectId string, region string) (*GetFlavorsResponse, error) {
|
||||
func (a *APIClient) GetFlavorsRequestExecute(ctx context.Context, projectId string, region string, page, size *int64, sort *FlavorSort) (*GetFlavorsResponse, error) {
|
||||
r := GetFlavorsRequestRequest{
|
||||
apiService: a.defaultApi,
|
||||
ctx: ctx,
|
||||
|
|
|
|||
|
|
@ -221,6 +221,26 @@ func setGetInstanceResponseGetStorageAttributeType(arg *GetInstanceResponseGetSt
|
|||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for encryption
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type GetInstanceResponseGetEncryptionAttributeType = *InstanceEncryption
|
||||
type GetInstanceResponseGetEncryptionArgType = InstanceEncryption
|
||||
type GetInstanceResponseGetEncryptionRetType = InstanceEncryption
|
||||
|
||||
func getGetInstanceResponseGetEncryptionAttributeTypeOk(arg GetInstanceResponseGetEncryptionAttributeType) (ret GetInstanceResponseGetEncryptionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetInstanceResponseGetEncryptionAttributeType(arg *GetInstanceResponseGetEncryptionAttributeType, val GetInstanceResponseGetEncryptionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for version
|
||||
*/
|
||||
|
|
@ -256,6 +276,7 @@ type GetInstanceResponse struct {
|
|||
// Whether the instance can be deleted or not.
|
||||
// REQUIRED
|
||||
IsDeletable GetInstanceResponsegetIsDeletableAttributeType `json:"isDeletable" required:"true"`
|
||||
Encryption GetInstanceResponseGetEncryptionAttributeType `json:"encryption,omitempty"`
|
||||
// The name of the instance.
|
||||
// REQUIRED
|
||||
Name GetInstanceResponseGetNameAttributeType `json:"name" required:"true"`
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ package wait
|
|||
|
||||
import (
|
||||
"context"
|
||||
"math"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
|
@ -144,16 +143,15 @@ func TestCreateInstanceWaitHandler(t *testing.T) {
|
|||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(
|
||||
tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
t.Run(tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
instanceId: instanceId,
|
||||
instanceState: tt.instanceState,
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
usersGetErrorStatus: tt.usersGetErrorStatus,
|
||||
}
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
instanceId: instanceId,
|
||||
instanceState: tt.instanceState,
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
usersGetErrorStatus: tt.usersGetErrorStatus,
|
||||
}
|
||||
|
||||
var wantRes *postgresflex.GetInstanceResponse
|
||||
if tt.wantResp {
|
||||
|
|
@ -172,8 +170,8 @@ func TestCreateInstanceWaitHandler(t *testing.T) {
|
|||
if !cmp.Equal(gotRes, wantRes) {
|
||||
t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -221,15 +219,14 @@ func TestUpdateInstanceWaitHandler(t *testing.T) {
|
|||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(
|
||||
tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
t.Run(tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
instanceId: instanceId,
|
||||
instanceState: tt.instanceState,
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
}
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
instanceId: instanceId,
|
||||
instanceState: tt.instanceState,
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
}
|
||||
|
||||
var wantRes *postgresflex.GetInstanceResponse
|
||||
if tt.wantResp {
|
||||
|
|
@ -248,8 +245,8 @@ func TestUpdateInstanceWaitHandler(t *testing.T) {
|
|||
if !cmp.Equal(gotRes, wantRes) {
|
||||
t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -378,22 +375,22 @@ func TestDeleteUserWaitHandler(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.desc, func(t *testing.T) {
|
||||
userId := "foo-bar"
|
||||
userId := int64(1001)
|
||||
|
||||
apiClient := &apiClientUserMocked{
|
||||
getFails: tt.getFails,
|
||||
userId: userId,
|
||||
isUserDeleted: !tt.deleteFails,
|
||||
}
|
||||
apiClient := &apiClientUserMocked{
|
||||
getFails: tt.getFails,
|
||||
userId: userId,
|
||||
isUserDeleted: !tt.deleteFails,
|
||||
}
|
||||
|
||||
handler := DeleteUserWaitHandler(context.Background(), apiClient, "", "", "", userId)
|
||||
handler := DeleteUserWaitHandler(context.Background(), apiClient, "", "", "", userId)
|
||||
|
||||
_, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background())
|
||||
_, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background())
|
||||
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
},
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue