fix: fix sqlserverflexalpha
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / Code coverage report (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / Code coverage report (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
This commit is contained in:
parent
d90236b02e
commit
6b581aed5c
25 changed files with 1973 additions and 2504 deletions
|
|
@ -42,7 +42,7 @@ func mapDataSourceFields(userResp *sqlserverflexalpha.GetUserResponse, model *da
|
|||
|
||||
// Map roles
|
||||
if user.Roles == nil {
|
||||
model.Roles = types.SetNull(types.StringType)
|
||||
model.Roles = types.List(types.SetNull(types.StringType))
|
||||
} else {
|
||||
var roles []attr.Value
|
||||
for _, role := range *user.Roles {
|
||||
|
|
@ -52,7 +52,7 @@ func mapDataSourceFields(userResp *sqlserverflexalpha.GetUserResponse, model *da
|
|||
if diags.HasError() {
|
||||
return fmt.Errorf("failed to map roles: %w", core.DiagsToError(diags))
|
||||
}
|
||||
model.Roles = rolesSet
|
||||
model.Roles = types.List(rolesSet)
|
||||
}
|
||||
|
||||
// Set remaining attributes
|
||||
|
|
@ -141,7 +141,7 @@ func mapFieldsCreate(userResp *sqlserverflexalpha.CreateUserResponse, model *res
|
|||
if user.Roles != nil {
|
||||
var roles []attr.Value
|
||||
for _, role := range *user.Roles {
|
||||
roles = append(roles, types.StringValue(role))
|
||||
roles = append(roles, types.StringValue(string(role)))
|
||||
}
|
||||
rolesSet, diags := types.SetValue(types.StringType, roles)
|
||||
if diags.HasError() {
|
||||
|
|
@ -154,6 +154,9 @@ func mapFieldsCreate(userResp *sqlserverflexalpha.CreateUserResponse, model *res
|
|||
model.Roles = types.List(types.SetNull(types.StringType))
|
||||
}
|
||||
|
||||
model.Password = types.StringPointerValue(user.Password)
|
||||
model.Uri = types.StringPointerValue(user.Uri)
|
||||
|
||||
model.Host = types.StringPointerValue(user.Host)
|
||||
model.Port = types.Int64PointerValue(user.Port)
|
||||
model.Region = types.StringValue(region)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue