Skip to content

Commit

Permalink
fix: update types to match published API types (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
staaldraad authored Jan 8, 2025
1 parent 46a0280 commit 0c3df9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/provider/pooler_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func TestAccPoolerDataSource(t *testing.T) {
JSON([]api.SupavisorConfigResponse{{
DatabaseType: api.PRIMARY,
ConnectionString: poolerUrl,
DefaultPoolSize: Ptr(float32(15)),
MaxClientConn: Ptr(float32(200)),
DefaultPoolSize: Ptr(int(15)),
MaxClientConn: Ptr(int(200)),
PoolMode: api.SupavisorConfigResponsePoolModeTransaction,
}})
// Run test
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/project_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ func (r *ProjectResource) ImportState(ctx context.Context, req resource.ImportSt
}

func createProject(ctx context.Context, data *ProjectResourceModel, client *api.ClientWithResponses) diag.Diagnostics {
body := api.V1CreateProjectBody{
body := api.V1CreateProjectBodyDto{
OrganizationId: data.OrganizationId.ValueString(),
Name: data.Name.ValueString(),
DbPass: data.DatabasePassword.ValueString(),
Region: api.V1CreateProjectBodyRegion(data.Region.ValueString()),
Region: api.V1CreateProjectBodyDtoRegion(data.Region.ValueString()),
}
if !data.InstanceSize.IsNull() {
body.DesiredInstanceSize = Ptr(api.DesiredInstanceSize(data.InstanceSize.ValueString()))
body.DesiredInstanceSize = Ptr(api.V1CreateProjectBodyDtoDesiredInstanceSize(data.InstanceSize.ValueString()))
}

httpResp, err := client.V1CreateAProjectWithResponse(ctx, body)
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/settings_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,21 +219,21 @@ func TestAccSettingsResource(t *testing.T) {
Reply(http.StatusOK).
JSON(api.AuthConfigResponse{
SiteUrl: Ptr("http://localhost:3000"),
JwtExp: Ptr(float32(3600)),
JwtExp: Ptr(int(3600)),
})
gock.New("https://api.supabase.com").
Patch("/v1/projects/mayuaycdtijbctgqbycg/config/auth").
Reply(http.StatusOK).
JSON(api.AuthConfigResponse{
SiteUrl: Ptr("http://localhost:3000"),
JwtExp: Ptr(float32(1800)),
JwtExp: Ptr(int(1800)),
})
gock.New("https://api.supabase.com").
Get("/v1/projects/mayuaycdtijbctgqbycg/config/auth").
Reply(http.StatusOK).
JSON(api.AuthConfigResponse{
SiteUrl: Ptr("http://localhost:3000"),
JwtExp: Ptr(float32(1800)),
JwtExp: Ptr(int(1800)),
})
// Run test
resource.Test(t, resource.TestCase{
Expand Down

0 comments on commit 0c3df9c

Please sign in to comment.