@@ -171,7 +171,9 @@ type Type struct {
171171
172172 Sensitive bool `yaml:"sensitive,omitempty"` // Adds `Sensitive: true` to the schema
173173
174- WriteOnly bool `yaml:"write_only,omitempty"` // Adds `WriteOnly: true` to the schema
174+ // TODO: remove this field after all references are migrated
175+ // see: https://github.com/GoogleCloudPlatform/magic-modules/pull/14933#pullrequestreview-3166578379
176+ WriteOnlyLegacy bool `yaml:"write_only_legacy,omitempty"` // Adds `WriteOnlyLegacy: true` to the schema
175177
176178 // Does not set this value to the returned API value. Useful for fields
177179 // like secrets where the returned API value is not helpful.
@@ -395,11 +397,11 @@ func (t *Type) Validate(rName string) {
395397 log .Fatalf ("'default_value' and 'default_from_api' cannot be both set in resource %s" , rName )
396398 }
397399
398- if t .WriteOnly && (t .DefaultFromApi || t .Output ) {
400+ if t .WriteOnlyLegacy && (t .DefaultFromApi || t .Output ) {
399401 log .Fatalf ("Property %s cannot be write_only and default_from_api or output at the same time in resource %s" , t .Name , rName )
400402 }
401403
402- if t .WriteOnly && t .Sensitive {
404+ if t .WriteOnlyLegacy && t .Sensitive {
403405 log .Fatalf ("Property %s cannot be write_only and sensitive at the same time in resource %s" , t .Name , rName )
404406 }
405407
@@ -750,7 +752,7 @@ func (t Type) WriteOnlyProperties() []*Type {
750752 }
751753 case t .IsA ("NestedObject" ):
752754 props = google .Select (t .UserProperties (), func (p * Type ) bool {
753- return p .WriteOnly
755+ return p .WriteOnlyLegacy
754756 })
755757 case t .IsA ("Map" ):
756758 props = google .Reject (t .ValueType .WriteOnlyProperties (), func (p * Type ) bool {
@@ -1224,8 +1226,8 @@ func (t *Type) IsForceNew() bool {
12241226 return t .Immutable
12251227 }
12261228
1227- // WriteOnly fields are never immutable
1228- if t .WriteOnly {
1229+ // WriteOnlyLegacy fields are never immutable
1230+ if t .WriteOnlyLegacy {
12291231 return false
12301232 }
12311233
0 commit comments