func (m Meta) MarshalYAML() (interface{}, error) {
	var minver string
	if m.MinJujuVersion != version.Zero {
		minver = m.MinJujuVersion.String()
	}

	return struct {
		Name           string                           `yaml:"name"`
		Summary        string                           `yaml:"summary"`
		Description    string                           `yaml:"description"`
		Provides       map[string]marshaledRelation     `yaml:"provides,omitempty"`
		Requires       map[string]marshaledRelation     `yaml:"requires,omitempty"`
		Peers          map[string]marshaledRelation     `yaml:"peers,omitempty"`
		ExtraBindings  map[string]interface{}           `yaml:"extra-bindings,omitempty"`
		Categories     []string                         `yaml:"categories,omitempty"`
		Tags           []string                         `yaml:"tags,omitempty"`
		Subordinate    bool                             `yaml:"subordinate,omitempty"`
		Series         []string                         `yaml:"series,omitempty"`
		Storage        map[string]Storage               `yaml:"storage,omitempty"`
		Devices        map[string]Device                `yaml:"devices,omitempty"`
		Deployment     *Deployment                      `yaml:"deployment,omitempty"`
		Terms          []string                         `yaml:"terms,omitempty"`
		MinJujuVersion string                           `yaml:"min-juju-version,omitempty"`
		Resources      map[string]marshaledResourceMeta `yaml:"resources,omitempty"`
		Containers     map[string]marshaledContainer    `yaml:"containers,omitempty"`
		Assumes        *assumes.ExpressionTree          `yaml:"assumes,omitempty"`
	}{
		Name:           m.Name,
		Summary:        m.Summary,
		Description:    m.Description,
		Provides:       marshaledRelations(m.Provides),
		Requires:       marshaledRelations(m.Requires),
		Peers:          marshaledRelations(m.Peers),
		ExtraBindings:  marshaledExtraBindings(m.ExtraBindings),
		Categories:     m.Categories,
		Tags:           m.Tags,
		Subordinate:    m.Subordinate,
		Series:         m.Series,
		Storage:        m.Storage,
		Devices:        m.Devices,
		Deployment:     m.Deployment,
		Terms:          m.Terms,
		MinJujuVersion: minver,
		Resources:      marshaledResources(m.Resources),
		Containers:     marshaledContainers(m.Containers),
		Assumes:        m.Assumes,
	}, nil
}
// MarshalYAML implements yaml.Marshaler (yaml.v2).
// It is recommended to call Check() before calling this method,
// otherwise you make get metadata which is not v1 nor v2 format.
MarshalYAML implements yaml.Marshaler (yaml.v2).
It is recommended to call Check() before calling this method,
otherwise you make get metadata which is not v1 nor v2 format.
// MarshalYAML implements yaml . Marshaler ( yaml . v2 ) . // It is recommended to call Check () before calling this method // otherwise you make get metadata which is not v1 nor v2 format .
func (m Meta) MarshalYAML() (interface{}, error) {
	var minver string
	if m.MinJujuVersion != version.Zero {
		minver = m.MinJujuVersion.String()
	}
	return struct {
		Name           string                           `yaml:"name"`
		Summary        string                           `yaml:"summary"`
		Description    string                           `yaml:"description"`
		Provides       map[string]marshaledRelation     `yaml:"provides,omitempty"`
		Requires       map[string]marshaledRelation     `yaml:"requires,omitempty"`
		Peers          map[string]marshaledRelation     `yaml:"peers,omitempty"`
		ExtraBindings  map[string]interface{}           `yaml:"extra-bindings,omitempty"`
		Categories     []string                         `yaml:"categories,omitempty"`
		Tags           []string                         `yaml:"tags,omitempty"`
		Subordinate    bool                             `yaml:"subordinate,omitempty"`
		Series         []string                         `yaml:"series,omitempty"`
		Storage        map[string]Storage               `yaml:"storage,omitempty"`
		Devices        map[string]Device                `yaml:"devices,omitempty"`
		Deployment     *Deployment                      `yaml:"deployment,omitempty"`
		Terms          []string                         `yaml:"terms,omitempty"`
		MinJujuVersion string                           `yaml:"min-juju-version,omitempty"`
		Resources      map[string]marshaledResourceMeta `yaml:"resources,omitempty"`
		Containers     map[string]marshaledContainer    `yaml:"containers,omitempty"`
		Assumes        *assumes.ExpressionTree          `yaml:"assumes,omitempty"`
	}{
		Name:           m.Name,
		Summary:        m.Summary,
		Description:    m.Description,
		Provides:       marshaledRelations(m.Provides),
		Requires:       marshaledRelations(m.Requires),
		Peers:          marshaledRelations(m.Peers),
		ExtraBindings:  marshaledExtraBindings(m.ExtraBindings),
		Categories:     m.Categories,
		Tags:           m.Tags,
		Subordinate:    m.Subordinate,
		Series:         m.Series,
		Storage:        m.Storage,
		Devices:        m.Devices,
		Deployment:     m.Deployment,
		Terms:          m.Terms,
		MinJujuVersion: minver,
		Resources:      marshaledResources(m.Resources),
		Containers:     marshaledContainers(m.Containers),
		Assumes:        m.Assumes,
	}, nil
}
func ( m Meta ) MarshalYAML ( ) ( interface { } , error ) { var minver string if m . MinJujuVersion != version . Zero { minver = m . MinJujuVersion . String ( ) } return struct { Name string `yaml:"name"` Summary string `yaml:"summary"` Description string `yaml:"description"` Provides map [ string ] marshaledRelation `yaml:"provides,omitempty"` Requires map [ string ] marshaledRelation `yaml:"requires,omitempty"` Peers map [ string ] marshaledRelation `yaml:"peers,omitempty"` ExtraBindings map [ string ] interface { } `yaml:"extra-bindings,omitempty"` Categories [ ] string `yaml:"categories,omitempty"` Tags [ ] string `yaml:"tags,omitempty"` Subordinate bool `yaml:"subordinate,omitempty"` Series [ ] string `yaml:"series,omitempty"` Storage map [ string ] Storage `yaml:"storage,omitempty"` Devices map [ string ] Device `yaml:"devices,omitempty"` Deployment * Deployment `yaml:"deployment,omitempty"` Terms [ ] string `yaml:"terms,omitempty"` MinJujuVersion string `yaml:"min-juju-version,omitempty"` Resources map [ string ] marshaledResourceMeta `yaml:"resources,omitempty"` Containers map [ string ] marshaledContainer `yaml:"containers,omitempty"` Assumes * assumes . ExpressionTree `yaml:"assumes,omitempty"` } { Name : m . Name , Summary : m . Summary , Description : m . Description , Provides : marshaledRelations ( m . Provides ) , Requires : marshaledRelations ( m . Requires ) , Peers : marshaledRelations ( m . Peers ) , ExtraBindings : marshaledExtraBindings ( m . ExtraBindings ) , Categories : m . Categories , Tags : m . Tags , Subordinate : m . Subordinate , Series : m . Series , Storage : m . Storage , Devices : m . Devices , Deployment : m . Deployment , Terms : m . Terms , MinJujuVersion : minver , Resources : marshaledResources ( m . Resources ) , Containers : marshaledContainers ( m . Containers ) , Assumes : m . Assumes , } , nil }
MarshalYAML implements yaml.Marshaler (yaml.v2).
MarshalYAML implements yaml . Marshaler ( yaml . v2 ) .