// PersonalCloudMetadata loads any personal cloud metadata defined
// in the Juju Home directory. If not cloud metadata is found,
// that is not an error; nil is returned.
327688
func PersonalCloudMetadata() (map[string]Cloud, error) {
	clouds, err := ParseCloudMetadataFile(JujuPersonalCloudsPath())
	if err != nil && os.IsNotExist(err) {
		return nil, nil
	}
	return clouds, err
}
1298732
func (c *Files) GetMetadata(in *GetMetadataInput) (out *GetMetadataOutput, err error) {
	body, err := c.call("/files/get_metadata", in)
	if err != nil {
		return
	}
	defer body.Close()

	err = json.NewDecoder(body).Decode(&out)
	return
}
209236
func (s *InitiateDocumentVersionUploadOutput) SetMetadata(v *DocumentMetadata) *InitiateDocumentVersionUploadOutput {
	s.Metadata = v
	return s
}
259178
func parseMetadata(r io.Reader) (*Metadata, error) {
	var metadata Metadata
	json := json.NewDecoder(r)
	if err := json.Decode(&metadata); err != nil {
		return nil, err
	}

	if metadata.UUID == "" {
		return nil, ErrBadMetadata
	}

	return &metadata, nil
}
681833
func (s *DescribeActiveReceiptRuleSetOutput) SetMetadata(v *ReceiptRuleSetMetadata) *DescribeActiveReceiptRuleSetOutput {
	s.Metadata = v
	return s
}
119079
func (s *Store) LoadMetadata(path string) (name, version string, err error) {
	metadataBytes, err := s.ReadWriter.ReadFile(path)
	if err != nil {
		err = errors.Wrapf(err, "error reading metadata at %s", path)
		return "", "", err
	}
	ccMetadata := &ChaincodeMetadata{}
	err = json.Unmarshal(metadataBytes, ccMetadata)
	if err != nil {
		err = errors.Wrapf(err, "error unmarshaling metadata at %s", path)
		return "", "", err
	}

	return ccMetadata.Name, ccMetadata.Version, nil
}
1098495
func (s *MeshData) SetMetadata(v *ResourceMetadata) *MeshData {
	s.Metadata = v
	return s
}
626916
func (s *HeadObjectOutput) SetMetadata(v map[string]*string) *HeadObjectOutput {
	s.Metadata = v
	return s
}
1188777
func (i *InstallationPermissions) GetMetadata() string {
	if i == nil || i.Metadata == nil {
		return ""
	}
	return *i.Metadata
}
365314
func (r Virtual_Guest) SetUserMetadata(metadata []string) (resp bool, err error) {
	params := []interface{}{
		metadata,
	}
	err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "setUserMetadata", params, &r.Options, &resp)
	return
}
269116
func (c *Client) GetLeagueMetadata(leagueKey string) (*League, error) {
	content, err := c.GetFantasyContent(
		fmt.Sprintf("%s/league/%s/metadata",
			YahooBaseURL,
			leagueKey))
	if err != nil {
		return nil, err
	}
	return &content.League, nil
}
265032
func (c *Container) Metadata(key string) string {
	return c.Config[UserNamespacePrefix+key]
}
1340807
func (s *GetFolderOutput) SetMetadata(v *FolderMetadata) *GetFolderOutput {
	s.Metadata = v
	return s
}
794423
func getMetadata(args environs.StartInstanceParams, os jujuos.OSType) (map[string]string, error) {
	userData, err := providerinit.ComposeUserData(args.InstanceConfig, nil, GCERenderer{})
	if err != nil {
		return nil, errors.Annotate(err, "cannot make user data")
	}
	logger.Debugf("GCE user data; %d bytes", len(userData))

	metadata := make(map[string]string)
	for tag, value := range args.InstanceConfig.Tags {
		metadata[tag] = value
	}
	switch os {
	case jujuos.Ubuntu:
		// We store a gz snapshop of information that is used by
		// cloud-init and unpacked in to the /var/lib/cloud/instances folder
		// for the instance. Due to a limitation with GCE and binary blobs
		// we base64 encode the data before storing it.
		metadata[metadataKeyCloudInit] = string(userData)
		// Valid encoding values are determined by the cloudinit GCE data source.
		// See: http://cloudinit.readthedocs.org
		metadata[metadataKeyEncoding] = "base64"

	case jujuos.Windows:
		metadata[metadataKeyWindowsUserdata] = string(userData)

		validChars := append(utils.UpperAlpha, append(utils.LowerAlpha, utils.Digits...)...)

		// The hostname must have maximum 15 characters
		winHostname := "juju" + utils.RandomString(11, validChars)
		metadata[metadataKeyWindowsSysprep] = fmt.Sprintf(winSetHostnameScript, winHostname)
	default:
		return nil, errors.Errorf("cannot pack metadata for os %s on the gce provider", os.String())
	}

	return metadata, nil
}
1231394
func (s *TrustedAdvisorCheckDescription) SetMetadata(v []*string) *TrustedAdvisorCheckDescription {
	s.Metadata = v
	return s
}
860326
func (s *S3ObjectMetadata) SetUserMetadata(v map[string]*string) *S3ObjectMetadata {
	s.UserMetadata = v
	return s
}
889546
func (serv *v2MetadataService) GetMetadata(diffID layer.DiffID) ([]V2Metadata, error) {
	if serv.store == nil {
		return nil, errors.New("no metadata storage")
	}
	jsonBytes, err := serv.store.Get(serv.diffIDNamespace(), serv.diffIDKey(diffID))
	if err != nil {
		return nil, err
	}

	var metadata []V2Metadata
	if err := json.Unmarshal(jsonBytes, &metadata); err != nil {
		return nil, err
	}

	return metadata, nil
}