Please add the FromExternal method to InstanceIdentity in apis/memorystore/v1alpha1/instance_identity.go.
This requires refactoring the struct to support gcpurls.
var InstanceIdentityFormat = gcpurls.Template[InstanceIdentity]("memorystore.googleapis.com", "projects/{project}/locations/{location}/instances/{instance}")
type InstanceIdentity struct {
Project string
Location string
Instance string
}
func (i *InstanceIdentity) FromExternal(ref string) error {
parsed, match, err := InstanceIdentityFormat.Parse(ref)
if err != nil {
return fmt.Errorf("format of Instance external=%q was not known (use %s): %w", ref, InstanceIdentityFormat.CanonicalFormat(), err)
}
if !match {
return fmt.Errorf("format of Instance external=%q was not known (use %s)", ref, InstanceIdentityFormat.CanonicalFormat())
}
*i = *parsed
return nil
}
Please add the FromExternal method to InstanceIdentity in
apis/memorystore/v1alpha1/instance_identity.go.This requires refactoring the struct to support
gcpurls.