@@ -340,9 +340,6 @@ type Resource struct {
340340 // The version name provided by the user through CI
341341 TargetVersionName string `yaml:"-"`
342342
343- // The compiler to generate the downstream files, for example "terraformgoogleconversion-codegen".
344- Compiler string `yaml:"-"`
345-
346343 // The API "resource type kind" used for this resource e.g., "Function".
347344 // If this is not set, then :name is used instead, which is strongly
348345 // preferred wherever possible. Its main purpose is for supporting
@@ -898,7 +895,7 @@ func (r *Resource) addWriteOnlyFields(props []*Type, propWithWoConfigured *Type)
898895 }
899896 // Don't add write only fields to tgc, as write only fields don't exist in tfplan json,
900897 // the input of tfplan2cai.
901- if ! strings .HasPrefix (r .ProductMetadata .ProviderName , "tgc " ) {
898+ if strings .Contains (r .ProductMetadata .Compiler , "terraformgoogleconversion " ) {
902899 woFieldName := fmt .Sprintf ("%sWo" , propWithWoConfigured .Name )
903900 woVersionFieldName := fmt .Sprintf ("%sVersion" , woFieldName )
904901 writeOnlyField := buildWriteOnlyField (woFieldName , woVersionFieldName , propWithWoConfigured )
@@ -1448,10 +1445,6 @@ func ignoreReadFields(props []*Type) []string {
14481445 return fields
14491446}
14501447
1451- func (r * Resource ) SetCompiler (t string ) {
1452- r .Compiler = fmt .Sprintf ("%s-codegen" , strings .ToLower (t ))
1453- }
1454-
14551448// Returns the id format of an object, or self_link_uri if none is explicitly defined
14561449// We prefer the long name of a resource as the id so that users can reference
14571450// resources in a standard way, and most APIs accept short name, long name or self_link
@@ -2596,5 +2589,5 @@ func (r Resource) CaiResourceName() string {
25962589}
25972590
25982591func (r Resource ) IsTgcCompiler () bool {
2599- return r .Compiler == "terraformgoogleconversionnext-codegen"
2592+ return r .ProductMetadata . Compiler == "terraformgoogleconversionnext-codegen"
26002593}
0 commit comments