Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Scope = Scope {
- unScope :: Text
- data GoogleAccessTokenRequest = GoogleAccessTokenRequest {
- _gatrGrantType :: Text
- _gatrAssertion :: Text
- mkTokenRequest :: Text -> GoogleAccessTokenRequest
- data TokenProblem
- = BearerTokenDecodeProblem UnicodeException
- | BearerTokenSignsaferProblem Error
- | TokenFetchProblem JSONException
- | TokenRequestNonOK Status
- tokenProblemMessage :: TokenProblem -> Text
- data ServiceAccountProblem = ServiceAccountFileDecodeProblem String
- resolveConfigurationJson :: (QErrM m, FromJSON a) => Environment -> ConfigurationJSON a -> m (Either String a)
- resolveConfigurationInput :: QErrM m => Environment -> ConfigurationInput -> m Text
- resolveConfigurationInputs :: QErrM m => Environment -> ConfigurationInputs -> m [Text]
- initConnection :: MonadIO m => ServiceAccount -> Text -> Maybe RetryOptions -> m BigQueryConnection
- getAccessToken :: MonadIO m => ServiceAccount -> m (Either TokenProblem TokenResp)
- getUsableToken :: MonadIO m => BigQueryConnection -> m (Either TokenProblem TokenResp)
- data BigQueryProblem = TokenProblem TokenProblem
- runBigQuery :: MonadIO m => BigQueryConnection -> Request -> m (Either BigQueryProblem (Response ByteString))
- withGoogleApiRetries :: MonadIO m => RetryOptions -> m (Response body) -> m (Response body)
Documentation
data GoogleAccessTokenRequest Source #
GoogleAccessTokenRequest | |
|
mkTokenRequest :: Text -> GoogleAccessTokenRequest Source #
data TokenProblem Source #
BearerTokenDecodeProblem UnicodeException | |
BearerTokenSignsaferProblem Error | |
TokenFetchProblem JSONException | |
TokenRequestNonOK Status |
tokenProblemMessage :: TokenProblem -> Text Source #
resolveConfigurationJson :: (QErrM m, FromJSON a) => Environment -> ConfigurationJSON a -> m (Either String a) Source #
resolveConfigurationInput :: QErrM m => Environment -> ConfigurationInput -> m Text Source #
resolveConfigurationInputs :: QErrM m => Environment -> ConfigurationInputs -> m [Text] Source #
initConnection :: MonadIO m => ServiceAccount -> Text -> Maybe RetryOptions -> m BigQueryConnection Source #
getAccessToken :: MonadIO m => ServiceAccount -> m (Either TokenProblem TokenResp) Source #
getUsableToken :: MonadIO m => BigQueryConnection -> m (Either TokenProblem TokenResp) Source #
Get a usable token. If the token has expired refresh it.
data BigQueryProblem Source #
Instances
Show BigQueryProblem Source # | |
Defined in Hasura.Backends.BigQuery.Connection showsPrec :: Int -> BigQueryProblem -> ShowS # show :: BigQueryProblem -> String # showList :: [BigQueryProblem] -> ShowS # | |
Generic BigQueryProblem Source # | |
Defined in Hasura.Backends.BigQuery.Connection type Rep BigQueryProblem :: Type -> Type # from :: BigQueryProblem -> Rep BigQueryProblem x # to :: Rep BigQueryProblem x -> BigQueryProblem # | |
ToJSON BigQueryProblem Source # | |
Defined in Hasura.Backends.BigQuery.Connection toJSON :: BigQueryProblem -> Value toEncoding :: BigQueryProblem -> Encoding toJSONList :: [BigQueryProblem] -> Value toEncodingList :: [BigQueryProblem] -> Encoding | |
type Rep BigQueryProblem Source # | |
Defined in Hasura.Backends.BigQuery.Connection |
runBigQuery :: MonadIO m => BigQueryConnection -> Request -> m (Either BigQueryProblem (Response ByteString)) Source #
withGoogleApiRetries :: MonadIO m => RetryOptions -> m (Response body) -> m (Response body) Source #
Uses up to specified number retries for Google API requests with the specified base delay, uses full jitter backoff, see https://aws.amazon.com/ru/blogs/architecture/exponential-backoff-and-jitter/ HTTP statuses for transient errors were taken from https://github.com/googleapis/python-api-core/blob/34ebdcc251d4f3d7d496e8e0b78847645a06650b/google/api_core/retry.py#L112-L115