@@ -340,8 +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:"-"`
345343
346344 // The API "resource type kind" used for this resource e.g., "Function".
347345 // If this is not set, then :name is used instead, which is strongly
@@ -898,7 +896,7 @@ func (r *Resource) addWriteOnlyFields(props []*Type, propWithWoConfigured *Type)
898896 }
899897 // Don't add write only fields to tgc, as write only fields don't exist in tfplan json,
900898 // the input of tfplan2cai.
901- if ! strings . HasPrefix ( r .ProductMetadata .ProviderName , "tgc" ) {
899+ if ! r .ProductMetadata .IsTgcCompiler ( ) {
902900 woFieldName := fmt .Sprintf ("%sWo" , propWithWoConfigured .Name )
903901 woVersionFieldName := fmt .Sprintf ("%sVersion" , woFieldName )
904902 writeOnlyField := buildWriteOnlyField (woFieldName , woVersionFieldName , propWithWoConfigured )
@@ -1448,9 +1446,7 @@ func ignoreReadFields(props []*Type) []string {
14481446 return fields
14491447}
14501448
1451- func (r * Resource ) SetCompiler (t string ) {
1452- r .Compiler = fmt .Sprintf ("%s-codegen" , strings .ToLower (t ))
1453- }
1449+
14541450
14551451// Returns the id format of an object, or self_link_uri if none is explicitly defined
14561452// We prefer the long name of a resource as the id so that users can reference
@@ -2596,5 +2592,5 @@ func (r Resource) CaiResourceName() string {
25962592}
25972593
25982594func (r Resource ) IsTgcCompiler () bool {
2599- return r .Compiler == "terraformgoogleconversionnext-codegen"
2595+ return r .ProductMetadata . Compiler == "terraformgoogleconversionnext-codegen"
26002596}
0 commit comments