func (c *CredentialCollection) CloudCredential(cloudName string) (*CloudCredential, error) {
	credentialValue, ok := c.Credentials[cloudName]
	if !ok {
		return nil, errors.NotFoundf("credentials for cloud %s", cloudName)
	}
	if credential, ok := credentialValue.(CloudCredential); ok {
		return &credential, nil
	}
	credentialValue, err := cloudCredentialChecker{}.Coerce(
		credentialValue, []string{"credentials." + cloudName},
	)
	if err != nil {
		return nil, errors.Trace(err)
	}
	credential := credentialValue.(CloudCredential)
	credential.validateDefaultCredential()
	c.Credentials[cloudName] = credential
	return &credential, nil
}
// CloudCredential returns a copy of the CloudCredential for the specified cloud or
// an error when the CloudCredential was not found or failed to pass validation.
CloudCredential returns a copy of the CloudCredential for the specified cloud or
an error when the CloudCredential was not found or failed to pass validation.
// CloudCredential returns a copy of the CloudCredential for the specified cloud or // an error when the CloudCredential was not found or failed to pass validation .
func (c *CredentialCollection) CloudCredential(cloudName string) (*CloudCredential, error) {
	credentialValue, ok := c.Credentials[cloudName]
	if !ok {
		return nil, errors.NotFoundf("credentials for cloud %s", cloudName)
	}
	if credential, ok := credentialValue.(CloudCredential); ok {
		return &credential, nil
	}
	credentialValue, err := cloudCredentialChecker{}.Coerce(
		credentialValue, []string{"credentials." + cloudName},
	)
	if err != nil {
		return nil, errors.Trace(err)
	}
	credential := credentialValue.(CloudCredential)
	credential.validateDefaultCredential()
	c.Credentials[cloudName] = credential
	return &credential, nil
}
func ( c * CredentialCollection ) CloudCredential ( cloudName string ) ( * CloudCredential , error ) { credentialValue , ok := c . Credentials [ cloudName ] if ! ok { return nil , errors . NotFoundf ( " " , cloudName ) } if credential , ok := credentialValue . ( CloudCredential ) ; ok { return & credential , nil } credentialValue , err := cloudCredentialChecker { } . Coerce ( credentialValue , [ ] string { " " + cloudName } , ) if err != nil { return nil , errors . Trace ( err ) } credential := credentialValue . ( CloudCredential ) credential . validateDefaultCredential ( ) c . Credentials [ cloudName ] = credential return & credential , nil }
CloudCredential returns a copy of the CloudCredential for the specified cloud or
an error when the CloudCredential was not found or failed to pass validation.
CloudCredential returns a copy of the CloudCredential for the specified cloud or an error when the CloudCredential was not found or failed to pass validation .