MCPcopy
hub / github.com/googleapis/mcp-toolbox / UnmarshalYAML

Method UnmarshalYAML

internal/tools/cloudgda/cloudgda.go:73–87  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

71}
72
73func (q *QueryDataContext) UnmarshalYAML(b []byte) error {
74 var raw map[string]any
75 if err := yaml.Unmarshal(b, &raw); err != nil {
76 return fmt.Errorf("failed to unmarshal context from yaml: %w", err)
77 }
78 jsonBytes, err := json.Marshal(raw)
79 if err != nil {
80 return fmt.Errorf("failed to marshal context map: %w", err)
81 }
82 q.QueryDataContext = &geminidataanalyticspb.QueryDataContext{}
83 if err := protojson.Unmarshal(jsonBytes, q.QueryDataContext); err != nil {
84 return fmt.Errorf("failed to unmarshal context to proto: %w", err)
85 }
86 return nil
87}
88
89// GenerationOptions wraps geminidataanalyticspb.GenerationOptions to support YAML decoding via protojson.
90type GenerationOptions struct {

Callers

nothing calls this directly

Calls 1

UnmarshalMethod · 0.80

Tested by

no test coverage detected