def authorizations(service_id, credentials, reported_metrics)
      # We can safely assume that reported metrics that do not have an
      # associated report usage are non-limited metrics.

      # First, let's check if there is a problem that has nothing to do with
      # limits (disabled application, bad credentials, etc.).
      auth = with_3scale_error_rescue(service_id, credentials) do
        auths_params = { service_id: service_id,
                         extensions: EXTENSIONS }.merge!(credentials.creds)

        if credentials.oauth?
          threescale_client.oauth_authorize(auths_params)
        else
          threescale_client.authorize(auths_params)
        end
      end

      if !auth.success? && !auth.limits_exceeded?
        return reported_metrics.inject({}) do |acc, metric|
          acc[metric] = Authorization.deny(auth.error_code)
          acc
        end
      end

      auths_according_to_limits(auth, reported_metrics)
    end
def authorizations(service_id, credentials, reported_metrics)
      # We can safely assume that reported metrics that do not have an
      # associated report usage are non-limited metrics.

      # First, let's check if there is a problem that has nothing to do with
      # limits (disabled application, bad credentials, etc.).
      auth = with_3scale_error_rescue(service_id, credentials) do
        auths_params = { service_id: service_id,
                         extensions: EXTENSIONS }.merge!(credentials.creds)

        if credentials.oauth?
          threescale_client.oauth_authorize(auths_params)
        else
          threescale_client.authorize(auths_params)
        end
      end

      if !auth.success? && !auth.limits_exceeded?
        return reported_metrics.inject({}) do |acc, metric|
          acc[metric] = Authorization.deny(auth.error_code)
          acc
        end
      end

      auths_according_to_limits(auth, reported_metrics)
    end
Returns the authorization status of all the limited metrics of the
 application identified by the received (service_id, credentials) pair and
 also, the authorization of those metrics passed in reported_metrics that
 are not limited.

 @return Array<Authorization>