| 1 |
// Code generated by protoc-gen-go-aip. DO NOT EDIT. |
| 2 |
// |
| 3 |
// versions: |
| 4 |
// protoc-gen-go-aip development |
| 5 |
// protoc (unknown) |
| 6 |
// source: test/toplevelsingleton/testdata.proto |
| 7 |
|
| 8 |
package toplevelsingleton |
| 9 |
|
| 10 |
import ( |
| 11 |
resourcename "go.einride.tech/aip/resourcename" |
| 12 |
) |
| 13 |
|
| 14 |
type ConfigResourceName struct { |
| 15 |
} |
| 16 |
|
| 17 |
func (n ConfigResourceName) Validate() error { |
| 18 |
return nil |
| 19 |
} |
| 20 |
|
| 21 |
func (n ConfigResourceName) ContainsWildcard() bool { |
| 22 |
return false |
| 23 |
} |
| 24 |
|
| 25 |
func (n ConfigResourceName) String() string { |
| 26 |
return resourcename.Sprint( |
| 27 |
"config", |
| 28 |
) |
| 29 |
} |
| 30 |
|
| 31 |
func (n ConfigResourceName) MarshalString() (string, error) { |
| 32 |
if err := n.Validate(); err != nil { |
| 33 |
return "", err |
| 34 |
} |
| 35 |
return n.String(), nil |
| 36 |
} |
| 37 |
|
| 38 |
// MarshalText implements the encoding.TextMarshaler interface. |
| 39 |
func (n ConfigResourceName) MarshalText() ([]byte, error) { |
| 40 |
if err := n.Validate(); err != nil { |
| 41 |
return nil, err |
| 42 |
} |
| 43 |
return []byte(n.String()), nil |
| 44 |
} |
| 45 |
|
| 46 |
func (n *ConfigResourceName) UnmarshalString(name string) error { |
| 47 |
err := resourcename.Sscan( |
| 48 |
name, |
| 49 |
"config", |
| 50 |
) |
| 51 |
if err != nil { |
| 52 |
return err |
| 53 |
} |
| 54 |
return n.Validate() |
| 55 |
} |
| 56 |
|
| 57 |
// UnmarshalText implements the encoding.TextUnmarshaler interface. |
| 58 |
func (n *ConfigResourceName) UnmarshalText(text []byte) error { |
| 59 |
return n.UnmarshalString(string(text)) |
| 60 |
} |
| 61 |
|
| 62 |
func (n ConfigResourceName) Type() string { |
| 63 |
return "test1.testdata/Config" |
| 64 |
} |