Skip to content

Commit 7e72e33

Browse files
committed
Rename NewCustomListType to NewCustomNestedListType
1 parent 85be3a7 commit 7e72e33

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

tools/codegen/codespec/api_to_provider_spec_mapper_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func TestConvertToProviderSpec_nested(t *testing.T) {
186186
TFSchemaName: "nested_list_array_attr",
187187
TFModelName: "NestedListArrayAttr",
188188
ComputedOptionalRequired: codespec.Required,
189-
CustomType: codespec.NewCustomListType("NestedListArrayAttr"),
189+
CustomType: codespec.NewCustomNestedListType("NestedListArrayAttr"),
190190
ListNested: &codespec.ListNestedAttribute{
191191
NestedObject: codespec.NestedAttributeObject{
192192
Attributes: codespec.Attributes{
@@ -414,7 +414,7 @@ func TestConvertToProviderSpec_nested_schemaOverrides(t *testing.T) {
414414
TFSchemaName: "nested_list_array_attr",
415415
TFModelName: "NestedListArrayAttr",
416416
ComputedOptionalRequired: codespec.Required,
417-
CustomType: codespec.NewCustomListType("NestedListArrayAttr"),
417+
CustomType: codespec.NewCustomNestedListType("NestedListArrayAttr"),
418418
ListNested: &codespec.ListNestedAttribute{
419419
NestedObject: codespec.NestedAttributeObject{
420420
Attributes: codespec.Attributes{

tools/codegen/codespec/attribute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (s *APISpecSchema) buildArrayAttr(name, ancestorsName string, computability
217217

218218
var customType *CustomType
219219
if useCustomNestedTypes {
220-
customType = NewCustomListType(fullName)
220+
customType = NewCustomNestedListType(fullName)
221221
}
222222
nestedObject := &NestedAttributeObject{Attributes: objectAttributes}
223223

tools/codegen/codespec/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func NewCustomObjectType(name string) *CustomType {
198198
}
199199
}
200200

201-
func NewCustomListType(name string) *CustomType {
201+
func NewCustomNestedListType(name string) *CustomType {
202202
return &CustomType{
203203
Package: CustomTypePkg,
204204
Model: fmt.Sprintf("customtype.NestedListValue[TF%sModel]", name),

tools/codegen/gofilegen/schema/schema_file_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var doubleCustomNestedListAttr = codespec.Attribute{
4444
TFModelName: "DoubleNestedListAttr",
4545
Description: admin.PtrString("double nested list attribute"),
4646
ComputedOptionalRequired: codespec.Optional,
47-
CustomType: codespec.NewCustomListType("DoubleNestedListAttr"),
47+
CustomType: codespec.NewCustomNestedListType("DoubleNestedListAttr"),
4848
ListNested: &codespec.ListNestedAttribute{
4949
NestedObject: codespec.NestedAttributeObject{
5050
Attributes: []codespec.Attribute{
@@ -263,7 +263,7 @@ func TestSchemaGenerationFromCodeSpec(t *testing.T) {
263263
TFModelName: "NestedListAttr",
264264
Description: admin.PtrString("nested list attribute"),
265265
ComputedOptionalRequired: codespec.Optional,
266-
CustomType: codespec.NewCustomListType("NestedListAttr"),
266+
CustomType: codespec.NewCustomNestedListType("NestedListAttr"),
267267
ListNested: &codespec.ListNestedAttribute{
268268
NestedObject: codespec.NestedAttributeObject{
269269
Attributes: []codespec.Attribute{stringAttr, intAttr, doubleCustomNestedListAttr},
@@ -333,7 +333,7 @@ func TestSchemaGenerationFromCodeSpec(t *testing.T) {
333333
TFModelName: "FirstNestedAttr",
334334
Description: admin.PtrString("first nested attribute"),
335335
ComputedOptionalRequired: codespec.Optional,
336-
CustomType: codespec.NewCustomListType("FirstNestedAttr"),
336+
CustomType: codespec.NewCustomNestedListType("FirstNestedAttr"),
337337
ListNested: &codespec.ListNestedAttribute{
338338
NestedObject: codespec.NestedAttributeObject{
339339
Attributes: []codespec.Attribute{doubleCustomNestedListAttr},
@@ -345,7 +345,7 @@ func TestSchemaGenerationFromCodeSpec(t *testing.T) {
345345
TFModelName: "SecondNestedAttr",
346346
Description: admin.PtrString("second nested attribute"),
347347
ComputedOptionalRequired: codespec.Optional,
348-
CustomType: codespec.NewCustomListType("SecondNestedAttr"),
348+
CustomType: codespec.NewCustomNestedListType("SecondNestedAttr"),
349349
ListNested: &codespec.ListNestedAttribute{
350350
NestedObject: codespec.NestedAttributeObject{
351351
Attributes: []codespec.Attribute{doubleCustomNestedListAttr},

0 commit comments

Comments
 (0)