Scalr\Api\Service\User\V1beta0\Controller\CloudCredentials::getCloudCredentials PHP Method

getCloudCredentials() public method

Gets CloudCredentials entity
public getCloudCredentials ( string $cloudCredentialsId, boolean $modify = false ) : CloudCredentials
$cloudCredentialsId string Unique identifier of the CloudCredentials
$modify boolean Obtaining CloudCredentials in modification purposes
return Scalr\Model\Entity\CloudCredentials
    public function getCloudCredentials($cloudCredentialsId, $modify = false)
    {
        $cloudCredentials = Entity\CloudCredentials::findPk($cloudCredentialsId);
        if (empty($cloudCredentials) || !$this->hasPermissions($cloudCredentials, $modify)) {
            throw new ApiErrorException(404, ErrorMessage::ERR_OBJECT_NOT_FOUND, "Requested Cloud Credentials either does not exist or is not owned by you.");
        }
        return $cloudCredentials;
    }