Update SDK dependency (#177)

* Update dependencies

* Update dependencies

* Update dependencies

* Update dependencies

---------

Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
Henrique Santos 2023-12-21 09:33:36 +00:00 committed by GitHub
parent 506d1afdc2
commit c7effac5c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 382 additions and 382 deletions

View file

@ -179,7 +179,7 @@ func (r *userDataSource) Read(ctx context.Context, req datasource.ReadRequest, r
tflog.Info(ctx, "PostgresFlex user read")
}
func mapDataSourceFields(userResp *postgresflex.UserResponse, model *DataSourceModel) error {
func mapDataSourceFields(userResp *postgresflex.GetUserResponse, model *DataSourceModel) error {
if userResp == nil || userResp.Item == nil {
return fmt.Errorf("response is nil")
}

View file

@ -13,14 +13,14 @@ import (
func TestMapDataSourceFields(t *testing.T) {
tests := []struct {
description string
input *postgresflex.UserResponse
input *postgresflex.GetUserResponse
expected DataSourceModel
isValid bool
}{
{
"default_values",
&postgresflex.UserResponse{
Item: &postgresflex.UserResponseUser{},
&postgresflex.GetUserResponse{
Item: &postgresflex.UserResponse{},
},
DataSourceModel{
Id: types.StringValue("pid,iid,uid"),
@ -36,8 +36,8 @@ func TestMapDataSourceFields(t *testing.T) {
},
{
"simple_values",
&postgresflex.UserResponse{
Item: &postgresflex.UserResponseUser{
&postgresflex.GetUserResponse{
Item: &postgresflex.UserResponse{
Roles: &[]string{
"role_1",
"role_2",
@ -66,8 +66,8 @@ func TestMapDataSourceFields(t *testing.T) {
},
{
"null_fields_and_int_conversions",
&postgresflex.UserResponse{
Item: &postgresflex.UserResponseUser{
&postgresflex.GetUserResponse{
Item: &postgresflex.UserResponse{
Id: utils.Ptr("uid"),
Roles: &[]string{},
Username: nil,
@ -95,14 +95,14 @@ func TestMapDataSourceFields(t *testing.T) {
},
{
"nil_response_2",
&postgresflex.UserResponse{},
&postgresflex.GetUserResponse{},
DataSourceModel{},
false,
},
{
"no_resource_id",
&postgresflex.UserResponse{
Item: &postgresflex.UserResponseUser{},
&postgresflex.GetUserResponse{
Item: &postgresflex.UserResponse{},
},
DataSourceModel{},
false,

View file

@ -380,7 +380,7 @@ func mapFieldsCreate(userResp *postgresflex.CreateUserResponse, model *Model) er
return nil
}
func mapFields(userResp *postgresflex.UserResponse, model *Model) error {
func mapFields(userResp *postgresflex.GetUserResponse, model *Model) error {
if userResp == nil || userResp.Item == nil {
return fmt.Errorf("response is nil")
}

View file

@ -20,7 +20,7 @@ func TestMapFieldsCreate(t *testing.T) {
{
"default_values",
&postgresflex.CreateUserResponse{
Item: &postgresflex.InstanceUser{
Item: &postgresflex.User{
Id: utils.Ptr("uid"),
Password: utils.Ptr(""),
},
@ -41,7 +41,7 @@ func TestMapFieldsCreate(t *testing.T) {
{
"simple_values",
&postgresflex.CreateUserResponse{
Item: &postgresflex.InstanceUser{
Item: &postgresflex.User{
Id: utils.Ptr("uid"),
Roles: &[]string{
"role_1",
@ -74,7 +74,7 @@ func TestMapFieldsCreate(t *testing.T) {
{
"null_fields_and_int_conversions",
&postgresflex.CreateUserResponse{
Item: &postgresflex.InstanceUser{
Item: &postgresflex.User{
Id: utils.Ptr("uid"),
Roles: &[]string{},
Username: nil,
@ -111,7 +111,7 @@ func TestMapFieldsCreate(t *testing.T) {
{
"no_resource_id",
&postgresflex.CreateUserResponse{
Item: &postgresflex.InstanceUser{},
Item: &postgresflex.User{},
},
Model{},
false,
@ -119,7 +119,7 @@ func TestMapFieldsCreate(t *testing.T) {
{
"no_password",
&postgresflex.CreateUserResponse{
Item: &postgresflex.InstanceUser{
Item: &postgresflex.User{
Id: utils.Ptr("uid"),
},
},
@ -153,14 +153,14 @@ func TestMapFieldsCreate(t *testing.T) {
func TestMapFields(t *testing.T) {
tests := []struct {
description string
input *postgresflex.UserResponse
input *postgresflex.GetUserResponse
expected Model
isValid bool
}{
{
"default_values",
&postgresflex.UserResponse{
Item: &postgresflex.UserResponseUser{},
&postgresflex.GetUserResponse{
Item: &postgresflex.UserResponse{},
},
Model{
Id: types.StringValue("pid,iid,uid"),
@ -176,8 +176,8 @@ func TestMapFields(t *testing.T) {
},
{
"simple_values",
&postgresflex.UserResponse{
Item: &postgresflex.UserResponseUser{
&postgresflex.GetUserResponse{
Item: &postgresflex.UserResponse{
Roles: &[]string{
"role_1",
"role_2",
@ -206,8 +206,8 @@ func TestMapFields(t *testing.T) {
},
{
"null_fields_and_int_conversions",
&postgresflex.UserResponse{
Item: &postgresflex.UserResponseUser{
&postgresflex.GetUserResponse{
Item: &postgresflex.UserResponse{
Id: utils.Ptr("uid"),
Roles: &[]string{},
Username: nil,
@ -235,14 +235,14 @@ func TestMapFields(t *testing.T) {
},
{
"nil_response_2",
&postgresflex.UserResponse{},
&postgresflex.GetUserResponse{},
Model{},
false,
},
{
"no_resource_id",
&postgresflex.UserResponse{
Item: &postgresflex.UserResponseUser{},
&postgresflex.GetUserResponse{
Item: &postgresflex.UserResponse{},
},
Model{},
false,