public static function newFromResponse($name, $response, $token, $url) {
    $container = new Container($name);
    $container->bytes = $response->header('X-Container-Bytes-Used', 0);
    $container->count = $response->header('X-Container-Object-Count', 0);
    $container->baseUrl = $url;
    $container->url = $url . '/' . rawurlencode($name);
    $container->token = $token;

    $container->acl = ACL::newFromHeaders($response->headers());

    $prefix = Container::CONTAINER_METADATA_HEADER_PREFIX;
    $metadata = Container::extractHeaderAttributes($response->headers(), $prefix);
    $container->setMetadata($metadata);

    return $container;
  }