-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | git-lfs protocol
--   
--   An implementation of the git-lfs protocol.
@package git-lfs
@version 1.2.5

-- | This implementation of the git-lfs API uses http Request and Response,
--   but leaves actually connecting up the http client to the user.
--   
--   You'll want to use a Manager that supports https, since the protocol
--   uses http basic auth.
--   
--   Some LFS servers, notably Github's, may require a User-Agent header in
--   some of the requests, in order to allow eg, uploads. No such header is
--   added by default, so be sure to add your own.
module Network.GitLFS
data TransferRequest
TransferRequest :: TransferRequestOperation -> [TransferAdapter] -> Maybe GitRef -> [TransferRequestObject] -> TransferRequest
[req_operation] :: TransferRequest -> TransferRequestOperation
[req_transfers] :: TransferRequest -> [TransferAdapter]
[req_ref] :: TransferRequest -> Maybe GitRef
[req_objects] :: TransferRequest -> [TransferRequestObject]
data TransferRequestOperation
RequestDownload :: TransferRequestOperation
RequestUpload :: TransferRequestOperation
data TransferAdapter
Basic :: TransferAdapter
data TransferRequestObject
TransferRequestObject :: SHA256 -> Integer -> TransferRequestObject
[req_oid] :: TransferRequestObject -> SHA256
[req_size] :: TransferRequestObject -> Integer

-- | Makes a Request that will start the process of making a transfer to or
--   from the LFS endpoint.
startTransferRequest :: Endpoint -> TransferRequest -> Request
data TransferResponse op
TransferResponse :: Maybe TransferAdapter -> [TransferResponseOperation op] -> TransferResponse op
[transfer] :: TransferResponse op -> Maybe TransferAdapter
[objects] :: TransferResponse op -> [TransferResponseOperation op]
data TransferResponseOperation op
TransferResponseOperation :: SHA256 -> Integer -> Maybe Bool -> Maybe op -> Maybe TransferResponseObjectError -> TransferResponseOperation op
[resp_oid] :: TransferResponseOperation op -> SHA256
[resp_size] :: TransferResponseOperation op -> Integer
[resp_authenticated] :: TransferResponseOperation op -> Maybe Bool
[resp_actions] :: TransferResponseOperation op -> Maybe op
[resp_error] :: TransferResponseOperation op -> Maybe TransferResponseObjectError

-- | Class of types that can be responses to a transfer request, that
--   contain an operation to use to make the transfer.
class (FromJSON op, ToJSON op) => IsTransferResponseOperation op
data DownloadOperation
DownloadOperation :: OperationParams -> DownloadOperation
[download] :: DownloadOperation -> OperationParams
data UploadOperation
UploadOperation :: OperationParams -> Maybe OperationParams -> UploadOperation
[upload] :: UploadOperation -> OperationParams
[verify] :: UploadOperation -> Maybe OperationParams
data OperationParams
OperationParams :: Url -> Maybe (Map HTTPHeader HTTPHeaderValue) -> Maybe NumSeconds -> Maybe Text -> OperationParams
[href] :: OperationParams -> Url
[header] :: OperationParams -> Maybe (Map HTTPHeader HTTPHeaderValue)
[expires_in] :: OperationParams -> Maybe NumSeconds
[expires_at] :: OperationParams -> Maybe Text
data ParsedTransferResponse op
ParsedTransferResponse :: TransferResponse op -> ParsedTransferResponse op
ParsedTransferResponseError :: TransferResponseError -> ParsedTransferResponse op
ParseFailed :: String -> ParsedTransferResponse op

-- | Parse the body of a response to a transfer request.
parseTransferResponse :: IsTransferResponseOperation op => ByteString -> ParsedTransferResponse op

-- | Builds a http request to perform a download.
downloadOperationRequest :: DownloadOperation -> Maybe Request

-- | Builds http request to perform an upload. The content to upload is
--   provided, along with its SHA256 and size.
--   
--   When the LFS server requested verification, there will be a second
--   Request that does that; it should be run only after the upload has
--   succeeded.
--   
--   When the LFS server already contains the object, an empty list may be
--   returned.
uploadOperationRequests :: UploadOperation -> (ServerSupportsChunks -> RequestBody) -> SHA256 -> Integer -> Maybe [Request]

-- | When the LFS server indicates that it supports Transfer-Encoding
--   chunked, this will contain a true value, and the RequestBody provided
--   to uploadOperationRequests may be created using
--   RequestBodyStreamChunked. Otherwise, that should be avoided as the
--   server may not support the chunked encoding.
newtype ServerSupportsChunks
ServerSupportsChunks :: Bool -> ServerSupportsChunks

-- | The endpoint of a git-lfs server.
data Endpoint

-- | Guesses the LFS endpoint from the http url of a git remote.
--   
--   
--   https://github.com/git-lfs/git-lfs/blob/master/docs/api/server-discovery.md
guessEndpoint :: URI -> Maybe Endpoint

-- | Smart constructor for an Endpoint, given the API URL.
mkEndpoint :: URI -> Maybe Endpoint

-- | When an Endpoint is used to generate a Request, this allows adjusting
--   that Request.
--   
--   This can be used to add http basic authentication to an Endpoint:
--   
--   
--   modifyEndpointRequest (guessEndpoint u) (applyBasicAuth "user" "pass")
--   
modifyEndpointRequest :: Endpoint -> (Request -> Request) -> Endpoint

-- | Command to run via ssh with to discover an endpoint. The FilePath is
--   the location of the git repository on the ssh server.
--   
--   Note that, when sshing to the server, you should take care that the
--   hostname you pass to ssh is really a hostname and not something that
--   ssh will parse an an option, such as -oProxyCommand=".
sshDiscoverEndpointCommand :: FilePath -> TransferRequestOperation -> [String]

-- | Parse the json output when doing ssh endpoint discovery.
parseSshDiscoverEndpointResponse :: ByteString -> Maybe Endpoint

-- | This is an error with a TransferRequest as a whole. It's also possible
--   for a TransferRequest to overall succeed, but fail for some objects;
--   such failures use TransferResponseObjectError.
data TransferResponseError
TransferResponseError :: Text -> Maybe Text -> Maybe Url -> TransferResponseError
[resperr_message] :: TransferResponseError -> Text
[resperr_request_id] :: TransferResponseError -> Maybe Text
[resperr_documentation_url] :: TransferResponseError -> Maybe Url

-- | An error with a single object within a TransferRequest.
data TransferResponseObjectError
TransferResponseObjectError :: Int -> Text -> TransferResponseObjectError
[respobjerr_code] :: TransferResponseObjectError -> Int
[respobjerr_message] :: TransferResponseObjectError -> Text
type Url = Text
type SHA256 = Text
data GitRef
GitRef :: Text -> GitRef
[name] :: GitRef -> Text
type NumSeconds = Integer
type HTTPHeader = Text
type HTTPHeaderValue = Text
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.DownloadOperation
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.GitRef
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.OperationParams
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.SshDiscoveryResponse
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.TransferAdapter
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.TransferRequest
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.TransferRequestObject
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.TransferRequestOperation
instance Network.GitLFS.IsTransferResponseOperation op => Data.Aeson.Types.FromJSON.FromJSON (Network.GitLFS.TransferResponse op)
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.TransferResponseError
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.TransferResponseObjectError
instance Data.Aeson.Types.FromJSON.FromJSON op => Data.Aeson.Types.FromJSON.FromJSON (Network.GitLFS.TransferResponseOperation op)
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.UploadOperation
instance Data.Aeson.Types.FromJSON.FromJSON Network.GitLFS.Verification
instance GHC.Internal.Generics.Generic Network.GitLFS.DownloadOperation
instance GHC.Internal.Generics.Generic Network.GitLFS.GitRef
instance GHC.Internal.Generics.Generic Network.GitLFS.OperationParams
instance GHC.Internal.Generics.Generic Network.GitLFS.SshDiscoveryResponse
instance GHC.Internal.Generics.Generic Network.GitLFS.TransferRequest
instance GHC.Internal.Generics.Generic Network.GitLFS.TransferRequestObject
instance GHC.Internal.Generics.Generic (Network.GitLFS.TransferResponse op)
instance GHC.Internal.Generics.Generic Network.GitLFS.TransferResponseError
instance GHC.Internal.Generics.Generic Network.GitLFS.TransferResponseObjectError
instance GHC.Internal.Generics.Generic (Network.GitLFS.TransferResponseOperation op)
instance GHC.Internal.Generics.Generic Network.GitLFS.UploadOperation
instance GHC.Internal.Generics.Generic Network.GitLFS.Verification
instance Network.GitLFS.IsTransferResponseOperation Network.GitLFS.DownloadOperation
instance Network.GitLFS.IsTransferResponseOperation Network.GitLFS.UploadOperation
instance GHC.Internal.Show.Show Network.GitLFS.DownloadOperation
instance GHC.Internal.Show.Show Network.GitLFS.Endpoint
instance GHC.Internal.Show.Show Network.GitLFS.GitRef
instance GHC.Internal.Show.Show Network.GitLFS.OperationParams
instance GHC.Internal.Show.Show Network.GitLFS.SshDiscoveryResponse
instance GHC.Internal.Show.Show Network.GitLFS.TransferAdapter
instance GHC.Internal.Show.Show Network.GitLFS.TransferRequest
instance GHC.Internal.Show.Show Network.GitLFS.TransferRequestObject
instance GHC.Internal.Show.Show Network.GitLFS.TransferRequestOperation
instance GHC.Internal.Show.Show op => GHC.Internal.Show.Show (Network.GitLFS.TransferResponse op)
instance GHC.Internal.Show.Show Network.GitLFS.TransferResponseError
instance GHC.Internal.Show.Show Network.GitLFS.TransferResponseObjectError
instance GHC.Internal.Show.Show op => GHC.Internal.Show.Show (Network.GitLFS.TransferResponseOperation op)
instance GHC.Internal.Show.Show Network.GitLFS.UploadOperation
instance GHC.Internal.Show.Show Network.GitLFS.Verification
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.DownloadOperation
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.GitRef
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.OperationParams
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.SshDiscoveryResponse
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.TransferAdapter
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.TransferRequest
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.TransferRequestObject
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.TransferRequestOperation
instance Network.GitLFS.IsTransferResponseOperation op => Data.Aeson.Types.ToJSON.ToJSON (Network.GitLFS.TransferResponse op)
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.TransferResponseError
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.TransferResponseObjectError
instance Data.Aeson.Types.ToJSON.ToJSON op => Data.Aeson.Types.ToJSON.ToJSON (Network.GitLFS.TransferResponseOperation op)
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.UploadOperation
instance Data.Aeson.Types.ToJSON.ToJSON Network.GitLFS.Verification
