Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default output to true for Fingerprint #11833

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions mmv1/api/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,11 @@ func (t *Type) SetDefault(r *Resource) {
if t.Description == "" {
t.Description = fmt.Sprintf("A reference to %s resource", t.Resource)
}
case t.IsA("Fingerprint"):
// Represents a fingerprint. A fingerprint is an output-only
// field used for optimistic locking during updates.
// They are fetched from the GCP response.
t.Output = true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should output be set true only if t.Output is nil ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. I can't imagine why someone would explicitly set Output: false, but I guess it could happen

default:
}

Expand Down Expand Up @@ -647,17 +652,6 @@ func (t *Type) GetDescription() string {
return strings.TrimSpace(strings.TrimRight(t.Description, "\n"))
}

// TODO rewrite: validation
// Represents a fingerprint. A fingerprint is an output-only
// field used for optimistic locking during updates.
// They are fetched from the GCP response.
// class Fingerprint < FetchedExternal
// func (t *Type) validate
// super
// @output = true if @output.nil?
// end
// end

// TODO rewrite: validation
// class Array < Composite
// check :item_type, type: [::String, NestedObject, ResourceRef, Enum], required: true
Expand Down
Loading