@@ -1294,6 +1294,8 @@ func (o *{{ .StructName }}{{ .ObjectOrModel }}) getTypeFor(name string) attr.Typ
1294
1294
switch attr := attr.(type) {
1295
1295
case {{ .Package }}.ListNestedAttribute:
1296
1296
return attr.NestedObject.Type()
1297
+ case {{ .Package }}.MapNestedAttribute:
1298
+ return attr.NestedObject.Type()
1297
1299
default:
1298
1300
return attr.GetType()
1299
1301
}
@@ -1761,6 +1763,7 @@ func ResourceCreateFunction(resourceTyp properties.ResourceType, names *NameProv
1761
1763
var exhaustive bool
1762
1764
switch resourceTyp {
1763
1765
case properties .ResourceEntry :
1766
+ exhaustive = true
1764
1767
tmpl = resourceCreateFunction
1765
1768
case properties .ResourceUuid :
1766
1769
exhaustive = true
@@ -1778,9 +1781,14 @@ func ResourceCreateFunction(resourceTyp properties.ResourceType, names *NameProv
1778
1781
LowerCamelCase : naming .CamelCase ("" , listAttribute , "" , false ),
1779
1782
}
1780
1783
1784
+ var resourceIsMap bool
1785
+ if resourceTyp == properties .ResourceEntryPlural {
1786
+ resourceIsMap = true
1787
+ }
1781
1788
data := map [string ]interface {}{
1782
1789
"HasEncryptedResources" : paramSpec .HasEncryptedResources (),
1783
1790
"Exhaustive" : exhaustive ,
1791
+ "ResourceIsMap" : resourceIsMap ,
1784
1792
"ListAttribute" : listAttributeVariant ,
1785
1793
"EntryOrConfig" : paramSpec .EntryOrConfig (),
1786
1794
"HasEntryName" : paramSpec .HasEntryName (),
@@ -1857,6 +1865,9 @@ func ResourceReadFunction(resourceTyp properties.ResourceType, names *NameProvid
1857
1865
switch resourceTyp {
1858
1866
case properties .ResourceEntry :
1859
1867
tmpl = resourceReadFunction
1868
+ case properties .ResourceEntryPlural :
1869
+ tmpl = resourceReadManyFunction
1870
+ listAttribute = pascalCase (paramSpec .TerraformProviderConfig .PluralName )
1860
1871
case properties .ResourceUuid :
1861
1872
tmpl = resourceReadManyFunction
1862
1873
listAttribute = pascalCase (paramSpec .TerraformProviderConfig .PluralName )
@@ -1872,8 +1883,13 @@ func ResourceReadFunction(resourceTyp properties.ResourceType, names *NameProvid
1872
1883
LowerCamelCase : naming .CamelCase ("" , listAttribute , "" , false ),
1873
1884
}
1874
1885
1886
+ var resourceIsMap bool
1887
+ if resourceTyp == properties .ResourceEntryPlural {
1888
+ resourceIsMap = true
1889
+ }
1875
1890
data := map [string ]interface {}{
1876
1891
"ResourceOrDS" : "Resource" ,
1892
+ "ResourceIsMap" : resourceIsMap ,
1877
1893
"HasEncryptedResources" : paramSpec .HasEncryptedResources (),
1878
1894
"ListAttribute" : listAttributeVariant ,
1879
1895
"Exhaustive" : exhaustive ,
@@ -1910,6 +1926,9 @@ func ResourceUpdateFunction(resourceTyp properties.ResourceType, names *NameProv
1910
1926
switch resourceTyp {
1911
1927
case properties .ResourceEntry :
1912
1928
tmpl = resourceUpdateFunction
1929
+ case properties .ResourceEntryPlural :
1930
+ tmpl = resourceUpdateEntryListFunction
1931
+ listAttribute = pascalCase (paramSpec .TerraformProviderConfig .PluralName )
1913
1932
case properties .ResourceUuid :
1914
1933
tmpl = resourceUpdateManyFunction
1915
1934
listAttribute = pascalCase (paramSpec .TerraformProviderConfig .PluralName )
@@ -1925,8 +1944,14 @@ func ResourceUpdateFunction(resourceTyp properties.ResourceType, names *NameProv
1925
1944
LowerCamelCase : naming .CamelCase ("" , listAttribute , "" , false ),
1926
1945
}
1927
1946
1947
+ var resourceIsMap bool
1948
+ if resourceTyp == properties .ResourceEntryPlural {
1949
+ resourceIsMap = true
1950
+ }
1951
+
1928
1952
data := map [string ]interface {}{
1929
1953
"HasEncryptedResources" : paramSpec .HasEncryptedResources (),
1954
+ "ResourceIsMap" : resourceIsMap ,
1930
1955
"ListAttribute" : listAttributeVariant ,
1931
1956
"Exhaustive" : exhaustive ,
1932
1957
"EntryOrConfig" : paramSpec .EntryOrConfig (),
0 commit comments