chore: adjust pagination for postgres database and flavor listing (#20)
* feat: implement pagination for database listing * fix: change database_id attribute type from string to int64 * refactor: rename getDatabase to getDatabaseById for clarity * fix: improve error handling for database not found scenario * feat: add validation for database_id and name attributes; implement separate functions for fetching databases by ID and name * feat: implement database client interface and update database fetching functions * refactor: rename matcher to filter for clarity and update pagination logic * feat: implement flavors retrieval with pagination and filtering support * refactor: rename flavor import for consistency and clarity * feat: add support for InstanceStatePending in wait handler logic * refactor: simplify GetFlavorsRequest and GetFlavorsRequestExecute by removing pagination parameters * refactor: improve readability of test cases by formatting function signatures and restructuring test runs * refactor: remove pagination parameters from GetFlavorsRequest in test case * refactor: simplify function signatures and improve readability in datasource and resource files * refactor: add descriptions for user-related attributes in datasource schema * refactor: enhance user resource schema with additional attributes and improve logging * refactor: delete unused file * refactor: standardize formatting and improve function naming for user resource management * refactor: remove skip from TestMapFields and update roles initialization in resource tests * fix: golangci lint issues * fix: golangci lint issues again * fix: golangci lint issues again
This commit is contained in:
parent
0150fea302
commit
979220be66
26 changed files with 3630 additions and 2759 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, page, size *int64, sort *FlavorSort) ApiGetFlavorsRequestRequest
|
||||
GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest
|
||||
/*
|
||||
GetFlavorsRequestExecute executes the request
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ type DefaultApi interface {
|
|||
@return GetFlavorsResponse
|
||||
|
||||
*/
|
||||
GetFlavorsRequestExecute(ctx context.Context, projectId string, region string, page, size *int64, sort *FlavorSort) (*GetFlavorsResponse, error)
|
||||
GetFlavorsRequestExecute(ctx context.Context, projectId string, region string) (*GetFlavorsResponse, error)
|
||||
/*
|
||||
GetInstanceRequest Get Specific Instance
|
||||
Get information about a specific available instance
|
||||
|
|
@ -2520,27 +2520,21 @@ 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, page, size *int64, sort *FlavorSort) ApiGetFlavorsRequestRequest {
|
||||
func (a *APIClient) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest {
|
||||
return GetFlavorsRequestRequest{
|
||||
apiService: a.defaultApi,
|
||||
ctx: ctx,
|
||||
projectId: projectId,
|
||||
region: region,
|
||||
page: page,
|
||||
size: size,
|
||||
sort: sort,
|
||||
}
|
||||
}
|
||||
|
||||
func (a *APIClient) GetFlavorsRequestExecute(ctx context.Context, projectId string, region string, page, size *int64, sort *FlavorSort) (*GetFlavorsResponse, error) {
|
||||
func (a *APIClient) GetFlavorsRequestExecute(ctx context.Context, projectId string, region string) (*GetFlavorsResponse, error) {
|
||||
r := GetFlavorsRequestRequest{
|
||||
apiService: a.defaultApi,
|
||||
ctx: ctx,
|
||||
projectId: projectId,
|
||||
region: region,
|
||||
page: page,
|
||||
size: size,
|
||||
sort: sort,
|
||||
}
|
||||
return r.Execute()
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -142,6 +142,8 @@ func PartialUpdateInstanceWaitHandler(
|
|||
return false, nil, nil
|
||||
case InstanceStateProgressing:
|
||||
return false, nil, nil
|
||||
case InstanceStatePending:
|
||||
return false, nil, nil
|
||||
case InstanceStateTerminating:
|
||||
return false, nil, nil
|
||||
case InstanceStateSuccess:
|
||||
|
|
@ -154,96 +156,3 @@ func PartialUpdateInstanceWaitHandler(
|
|||
handler.SetTimeout(45 * time.Minute)
|
||||
return handler
|
||||
}
|
||||
|
||||
//// DeleteInstanceWaitHandler will wait for instance deletion
|
||||
//func DeleteInstanceWaitHandler(
|
||||
// ctx context.Context,
|
||||
// a APIClientInstanceInterface,
|
||||
// projectId, region, instanceId string,
|
||||
//) *wait.AsyncActionHandler[struct{}] {
|
||||
// handler := wait.New(
|
||||
// func() (waitFinished bool, response *struct{}, err error) {
|
||||
// s, err := a.GetInstanceRequestExecute(ctx, projectId, region, instanceId)
|
||||
// if err != nil {
|
||||
// return false, nil, err
|
||||
// }
|
||||
// if s == nil || s.Id == nil || *s.Id != instanceId || s.Status == nil {
|
||||
// return false, nil, nil
|
||||
// }
|
||||
// // TODO - maybe we want to validate status if no 404 error (only unknown or terminating should be valid)
|
||||
// // switch *s.Status {
|
||||
// // default:
|
||||
// // return true, nil, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Status)
|
||||
// // case InstanceStateSuccess:
|
||||
// // return false, nil, nil
|
||||
// // case InstanceStateTerminating:
|
||||
// // return false, nil, nil
|
||||
// // }
|
||||
//
|
||||
// // TODO - add tflog for ignored cases
|
||||
// oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped
|
||||
// if !ok {
|
||||
// return false, nil, err
|
||||
// }
|
||||
// if oapiErr.StatusCode != 404 {
|
||||
// return false, nil, err
|
||||
// }
|
||||
// return true, nil, nil
|
||||
// },
|
||||
// )
|
||||
// handler.SetTimeout(5 * time.Minute)
|
||||
// return handler
|
||||
//}
|
||||
//
|
||||
//// TODO - remove
|
||||
//// ForceDeleteInstanceWaitHandler will wait for instance deletion
|
||||
//func ForceDeleteInstanceWaitHandler(
|
||||
// ctx context.Context,
|
||||
// a APIClientInstanceInterface,
|
||||
// projectId, region, instanceId string,
|
||||
//) *wait.AsyncActionHandler[struct{}] {
|
||||
// handler := wait.New(
|
||||
// func() (waitFinished bool, response *struct{}, err error) {
|
||||
// _, err = a.GetInstanceRequestExecute(ctx, projectId, region, instanceId)
|
||||
// if err == nil {
|
||||
// return false, nil, nil
|
||||
// }
|
||||
// oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped
|
||||
// if !ok {
|
||||
// return false, nil, err
|
||||
// }
|
||||
// if oapiErr.StatusCode != 404 {
|
||||
// return false, nil, err
|
||||
// }
|
||||
// return true, nil, nil
|
||||
// },
|
||||
// )
|
||||
// handler.SetTimeout(15 * time.Minute)
|
||||
// return handler
|
||||
//}
|
||||
|
||||
// DeleteUserWaitHandler will wait for delete
|
||||
func DeleteUserWaitHandler(
|
||||
ctx context.Context,
|
||||
a APIClientUserInterface,
|
||||
projectId, region, instanceId string, userId int64,
|
||||
) *wait.AsyncActionHandler[struct{}] {
|
||||
handler := wait.New(
|
||||
func() (waitFinished bool, response *struct{}, err error) {
|
||||
_, err = a.GetUserRequestExecute(ctx, projectId, region, instanceId, userId)
|
||||
if err == nil {
|
||||
return false, nil, nil
|
||||
}
|
||||
oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped
|
||||
if !ok {
|
||||
return false, nil, err
|
||||
}
|
||||
if oapiErr.StatusCode != 404 {
|
||||
return false, nil, err
|
||||
}
|
||||
return true, nil, nil
|
||||
},
|
||||
)
|
||||
handler.SetTimeout(1 * time.Minute)
|
||||
return handler
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,10 @@ type apiClientInstanceMocked struct {
|
|||
usersGetErrorStatus int
|
||||
}
|
||||
|
||||
func (a *apiClientInstanceMocked) GetInstanceRequestExecute(_ context.Context, _, _, _ string) (*postgresflex.GetInstanceResponse, error) {
|
||||
func (a *apiClientInstanceMocked) GetInstanceRequestExecute(
|
||||
_ context.Context,
|
||||
_, _, _ string,
|
||||
) (*postgresflex.GetInstanceResponse, error) {
|
||||
if a.instanceGetFails {
|
||||
return nil, &oapierror.GenericOpenAPIError{
|
||||
StatusCode: 500,
|
||||
|
|
@ -43,7 +46,10 @@ func (a *apiClientInstanceMocked) GetInstanceRequestExecute(_ context.Context, _
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (a *apiClientInstanceMocked) ListUsersRequestExecute(_ context.Context, _, _, _ string) (*postgresflex.ListUserResponse, error) {
|
||||
func (a *apiClientInstanceMocked) ListUsersRequestExecute(
|
||||
_ context.Context,
|
||||
_, _, _ string,
|
||||
) (*postgresflex.ListUserResponse, error) {
|
||||
if a.usersGetErrorStatus != 0 {
|
||||
return nil, &oapierror.GenericOpenAPIError{
|
||||
StatusCode: a.usersGetErrorStatus,
|
||||
|
|
@ -59,31 +65,6 @@ func (a *apiClientInstanceMocked) ListUsersRequestExecute(_ context.Context, _,
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Used for testing user operations
|
||||
type apiClientUserMocked struct {
|
||||
getFails bool
|
||||
userId int64
|
||||
isUserDeleted bool
|
||||
}
|
||||
|
||||
func (a *apiClientUserMocked) GetUserRequestExecute(_ context.Context, _, _, _ string, _ int64) (*postgresflex.GetUserResponse, error) {
|
||||
if a.getFails {
|
||||
return nil, &oapierror.GenericOpenAPIError{
|
||||
StatusCode: 500,
|
||||
}
|
||||
}
|
||||
|
||||
if a.isUserDeleted {
|
||||
return nil, &oapierror.GenericOpenAPIError{
|
||||
StatusCode: 404,
|
||||
}
|
||||
}
|
||||
|
||||
return &postgresflex.GetUserResponse{
|
||||
Id: &a.userId,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func TestCreateInstanceWaitHandler(t *testing.T) {
|
||||
tests := []struct {
|
||||
desc string
|
||||
|
|
@ -213,28 +194,30 @@ 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,
|
||||
instanceNetwork: tt.instanceNetwork,
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
usersGetErrorStatus: tt.usersGetErrorStatus,
|
||||
}
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
instanceId: instanceId,
|
||||
instanceState: tt.instanceState,
|
||||
instanceNetwork: tt.instanceNetwork,
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
usersGetErrorStatus: tt.usersGetErrorStatus,
|
||||
}
|
||||
|
||||
handler := CreateInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId)
|
||||
handler := CreateInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId)
|
||||
|
||||
gotRes, err := handler.SetTimeout(10 * time.Millisecond).SetSleepBeforeWait(1 * time.Millisecond).WaitWithContext(context.Background())
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
gotRes, err := handler.SetTimeout(10 * time.Millisecond).SetSleepBeforeWait(1 * time.Millisecond).WaitWithContext(context.Background())
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
|
||||
if !cmp.Equal(gotRes, tt.wantRes) {
|
||||
t.Fatalf("handler gotRes = %v, want %v", gotRes, tt.wantRes)
|
||||
}
|
||||
})
|
||||
if !cmp.Equal(gotRes, tt.wantRes) {
|
||||
t.Fatalf("handler gotRes = %v, want %v", gotRes, tt.wantRes)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -324,160 +307,29 @@ func TestUpdateInstanceWaitHandler(t *testing.T) {
|
|||
wantRes: nil,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
instanceId: instanceId,
|
||||
instanceState: tt.instanceState,
|
||||
instanceNetwork: tt.instanceNetwork,
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
}
|
||||
|
||||
handler := PartialUpdateInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId)
|
||||
|
||||
gotRes, 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 !cmp.Equal(gotRes, tt.wantRes) {
|
||||
t.Fatalf("handler gotRes = %v, want %v", gotRes, tt.wantRes)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeleteInstanceWaitHandler(t *testing.T) {
|
||||
tests := []struct {
|
||||
desc string
|
||||
instanceGetFails bool
|
||||
instanceState string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
desc: "delete_failed",
|
||||
instanceGetFails: false,
|
||||
instanceState: InstanceStateFailed,
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
desc: "get_fails",
|
||||
instanceGetFails: true,
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(
|
||||
tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
instanceId: instanceId,
|
||||
instanceState: tt.instanceState,
|
||||
instanceNetwork: tt.instanceNetwork,
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
}
|
||||
|
||||
handler := DeleteInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId)
|
||||
|
||||
_, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background())
|
||||
handler := PartialUpdateInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId)
|
||||
|
||||
gotRes, 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 !cmp.Equal(gotRes, tt.wantRes) {
|
||||
t.Fatalf("handler gotRes = %v, want %v", gotRes, tt.wantRes)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func TestForceDeleteInstanceWaitHandler(t *testing.T) {
|
||||
tests := []struct {
|
||||
desc string
|
||||
instanceGetFails bool
|
||||
instanceState string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
desc: "delete_failed",
|
||||
instanceGetFails: false,
|
||||
instanceState: InstanceStateUnknown,
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
desc: "get_fails",
|
||||
instanceGetFails: true,
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(
|
||||
tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
instanceGetFails: tt.instanceGetFails,
|
||||
instanceIsForceDeleted: tt.instanceState == InstanceStateFailed,
|
||||
instanceId: instanceId,
|
||||
instanceState: tt.instanceState,
|
||||
}
|
||||
|
||||
handler := ForceDeleteInstanceWaitHandler(context.Background(), apiClient, "", "", instanceId)
|
||||
|
||||
_, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background())
|
||||
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeleteUserWaitHandler(t *testing.T) {
|
||||
tests := []struct {
|
||||
desc string
|
||||
deleteFails bool
|
||||
getFails bool
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
desc: "delete_succeeded",
|
||||
deleteFails: false,
|
||||
getFails: false,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
desc: "delete_failed",
|
||||
deleteFails: true,
|
||||
getFails: false,
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
desc: "get_fails",
|
||||
deleteFails: false,
|
||||
getFails: true,
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.desc, func(t *testing.T) {
|
||||
userId := int64(1001)
|
||||
|
||||
apiClient := &apiClientUserMocked{
|
||||
getFails: tt.getFails,
|
||||
userId: userId,
|
||||
isUserDeleted: !tt.deleteFails,
|
||||
}
|
||||
|
||||
handler := DeleteUserWaitHandler(context.Background(), apiClient, "", "", "", userId)
|
||||
|
||||
_, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background())
|
||||
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService CreateDatabaseRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -88,9 +88,9 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService CreateInstanceRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -147,11 +147,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService CreateUserRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -209,13 +209,13 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService DeleteDatabaseRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
databaseNameValue := "databaseName-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -264,11 +264,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService DeleteInstanceRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -316,13 +316,13 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService DeleteUserRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
userIdValue := int64(123)
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -371,13 +371,13 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService GetBackupRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
backupIdValue := int64(123)
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -435,11 +435,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService GetCollationsRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/collations"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -496,13 +496,13 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService GetDatabaseRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
databaseNameValue := "databaseName-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -560,9 +560,9 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService GetFlavorsRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/flavors"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -621,11 +621,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService GetInstanceRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -682,11 +682,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService GetStoragesRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/storages/{flavorId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
flavorIdValue := "flavorId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(flavorIdValue, "flavorId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(flavorIdValue, "flavorId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -743,13 +743,13 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService GetUserRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
userIdValue := int64(123)
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -807,9 +807,9 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService GetVersionsRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/versions"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -865,11 +865,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ListBackupsRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/backups"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -926,11 +926,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ListCompatibilitiesRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -987,11 +987,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ListCurrentRunningRestoreJobs", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/restore-jobs"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1048,11 +1048,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ListDatabasesRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/databases"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1109,9 +1109,9 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ListInstancesRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1167,11 +1167,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ListRolesRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/roles"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1228,11 +1228,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ListUsersRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1289,11 +1289,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ProtectInstanceRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/protections"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1351,13 +1351,13 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService ResetUserRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
userIdValue := int64(123)
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1415,13 +1415,13 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService TriggerBackupRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
databaseNameValue := "databaseName-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1470,13 +1470,13 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService TriggerRestoreRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}/restores"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
databaseNameValue := "databaseName-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1525,11 +1525,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService UpdateInstancePartiallyRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
@ -1578,11 +1578,11 @@ func Test_sqlserverflexalpha_DefaultApiService(t *testing.T) {
|
|||
t.Run("Test DefaultApiService UpdateInstanceRequest", func(t *testing.T) {
|
||||
_apiUrlPath := "/v3alpha1/projects/{projectId}/regions/{region}/instances/{instanceId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")))
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")))
|
||||
instanceIdValue := "instanceId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1)
|
||||
_apiUrlPath = strings.ReplaceAll(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")))
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue