in teamcity/auth.go [183:231]
func (r *authResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse) {
var config authResourceModel
diags := req.Config.Get(ctx, &config)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
}
if config.Modules.BuiltIn != nil {
if config.Modules.BuiltIn.ChangePasswords.ValueBool() == true {
if config.Modules.BuiltIn.ResetPasswords.IsNull() {
resp.Diagnostics.AddAttributeError(
path.Root("modules").AtName("built_in").AtName("reset_passwords"),
"'reset_passwords' must be specified if 'change_passwords' is enabled",
"",
)
}
} else {
if config.Modules.BuiltIn.ResetPasswords.IsNull() != true {
resp.Diagnostics.AddAttributeError(
path.Root("modules").AtName("built_in").AtName("reset_passwords"),
"'reset_passwords' cannot be specified if 'change_passwords' is disabled",
"",
)
}
}
}
if config.Modules.Google != nil {
if config.Modules.Google.AllDomains.ValueBool() == true {
if config.Modules.Google.Domains.IsNull() != true {
resp.Diagnostics.AddAttributeError(
path.Root("modules").AtName("google").AtName("domains"),
"'domains' cannot be specified if 'all_domains' is enabled",
"",
)
}
} else {
if config.Modules.Google.Domains.IsNull() == true {
resp.Diagnostics.AddAttributeError(
path.Root("modules").AtName("google").AtName("domains"),
"'domains' must be specified if 'all_domains' is disabled",
"",
)
}
}
}
}