You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"An unexpected error was encountered trying to convert an attribute value from the configuration. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
148
-
"Error: can't use tftypes.String<\"testvalue\"> as value of List with ElementType types.primitive, can only use tftypes.String values",
146
+
"List Type Validation Error",
147
+
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
148
+
"expected List value, received tftypes.Value with value: tftypes.String<\"testvalue\">",
"An unexpected error was encountered trying to convert an attribute value from the configuration. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
94
94
"Error: can't use tftypes.String<\"testvalue\"> as value of List with ElementType types.primitive, can only use tftypes.String values",
"An unexpected error was encountered trying to convert an attribute value from the configuration. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
180
180
"Error: can't use tftypes.String<\"testvalue\"> as value of List with ElementType types.primitive, can only use tftypes.String values",
// Validate validates all elements of the list that are of type
117
+
// xattr.TypeWithValidate.
118
+
func (lListType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics {
119
+
vardiags diag.Diagnostics
120
+
121
+
ifin.Type() ==nil {
122
+
returndiags
123
+
}
124
+
125
+
if!in.Type().Is(tftypes.List{}) {
126
+
err:=fmt.Errorf("expected List value, received %T with value: %v", in, in)
127
+
diags.AddAttributeError(
128
+
path,
129
+
"List Type Validation Error",
130
+
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error(),
131
+
)
132
+
returndiags
133
+
}
134
+
135
+
if!in.IsKnown() ||in.IsNull() {
136
+
returndiags
137
+
}
138
+
139
+
varelems []tftypes.Value
140
+
141
+
iferr:=in.As(&elems); err!=nil {
142
+
diags.AddAttributeError(
143
+
path,
144
+
"List Type Validation Error",
145
+
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error(),
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
798
+
"expected List value, received tftypes.Value with value: tftypes.Set[tftypes.String]<tftypes.String<\"testvalue\">>",
// Validate validates all elements of the map that are of type
121
+
// xattr.TypeWithValidate.
122
+
func (mMapType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics {
123
+
vardiags diag.Diagnostics
124
+
125
+
ifin.Type() ==nil {
126
+
returndiags
127
+
}
128
+
129
+
if!in.Type().Is(tftypes.Map{}) {
130
+
err:=fmt.Errorf("expected Map value, received %T with value: %v", in, in)
131
+
diags.AddAttributeError(
132
+
path,
133
+
"Map Type Validation Error",
134
+
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error(),
135
+
)
136
+
returndiags
137
+
}
138
+
139
+
if!in.IsKnown() ||in.IsNull() {
140
+
returndiags
141
+
}
142
+
143
+
varelemsmap[string]tftypes.Value
144
+
145
+
iferr:=in.As(&elems); err!=nil {
146
+
diags.AddAttributeError(
147
+
path,
148
+
"Map Type Validation Error",
149
+
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error(),
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
812
+
"expected Map value, received tftypes.Value with value: tftypes.List[tftypes.String]<tftypes.String<\"testvalue\">>",
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error(),
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
554
+
"expected Set value, received tftypes.Value with value: tftypes.List[tftypes.String]<tftypes.String<\"testvalue\">>",
0 commit comments