| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Claude.V1.Messages.Batches
Description
/v1/messages/batches
This module provides types for the Claude Message Batches API. Batches allow asynchronous processing of multiple messages at once.
Synopsis
- data CreateBatch = CreateBatch {
- requests :: Vector BatchRequest
- _CreateBatch :: CreateBatch
- data BatchRequest = BatchRequest {
- custom_id :: Text
- params :: CreateMessage
- data BatchObject = BatchObject {}
- data ProcessingStatus
- data RequestCounts = RequestCounts {}
- data BatchResult = BatchResult {}
- data BatchResultType
- data ListBatchesResponse = ListBatchesResponse {}
- type API = "messages" :> ("batches" :> ((ReqBody '[JSON] CreateBatch :> Post '[JSON] BatchObject) :<|> ((Capture "batch_id" Text :> Get '[JSON] BatchObject) :<|> ((QueryParam "limit" Natural :> (QueryParam "before_id" Text :> (QueryParam "after_id" Text :> Get '[JSON] ListBatchesResponse))) :<|> (Capture "batch_id" Text :> ("cancel" :> Post '[JSON] BatchObject))))))
Request types
data CreateBatch Source #
Request body for creating a batch
Constructors
| CreateBatch | |
Fields
| |
Instances
_CreateBatch :: CreateBatch Source #
Default CreateBatch
data BatchRequest Source #
A single request within a batch
Constructors
| BatchRequest | |
Fields
| |
Instances
| FromJSON BatchRequest Source # | |||||
Defined in Claude.V1.Messages.Batches | |||||
| ToJSON BatchRequest Source # | |||||
Defined in Claude.V1.Messages.Batches Methods toJSON :: BatchRequest -> Value # toEncoding :: BatchRequest -> Encoding # toJSONList :: [BatchRequest] -> Value # toEncodingList :: [BatchRequest] -> Encoding # omitField :: BatchRequest -> Bool # | |||||
| Generic BatchRequest Source # | |||||
Defined in Claude.V1.Messages.Batches Associated Types
| |||||
| Show BatchRequest Source # | |||||
Defined in Claude.V1.Messages.Batches Methods showsPrec :: Int -> BatchRequest -> ShowS # show :: BatchRequest -> String # showList :: [BatchRequest] -> ShowS # | |||||
| type Rep BatchRequest Source # | |||||
Defined in Claude.V1.Messages.Batches type Rep BatchRequest = D1 ('MetaData "BatchRequest" "Claude.V1.Messages.Batches" "claude-1.0.0-1j0Plg9n3EjAvfVKcV8Pl0" 'False) (C1 ('MetaCons "BatchRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "custom_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "params") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CreateMessage))) | |||||
Response types
data BatchObject Source #
A batch object returned from the API
Constructors
| BatchObject | |
Fields
| |
Instances
| FromJSON BatchObject Source # | |||||
Defined in Claude.V1.Messages.Batches | |||||
| ToJSON BatchObject Source # | |||||
Defined in Claude.V1.Messages.Batches Methods toJSON :: BatchObject -> Value # toEncoding :: BatchObject -> Encoding # toJSONList :: [BatchObject] -> Value # toEncodingList :: [BatchObject] -> Encoding # omitField :: BatchObject -> Bool # | |||||
| Generic BatchObject Source # | |||||
Defined in Claude.V1.Messages.Batches Associated Types
| |||||
| Show BatchObject Source # | |||||
Defined in Claude.V1.Messages.Batches Methods showsPrec :: Int -> BatchObject -> ShowS # show :: BatchObject -> String # showList :: [BatchObject] -> ShowS # | |||||
| type Rep BatchObject Source # | |||||
Defined in Claude.V1.Messages.Batches type Rep BatchObject = D1 ('MetaData "BatchObject" "Claude.V1.Messages.Batches" "claude-1.0.0-1j0Plg9n3EjAvfVKcV8Pl0" 'False) (C1 ('MetaCons "BatchObject" 'PrefixI 'True) (((S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "type_") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "processing_status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProcessingStatus) :*: S1 ('MetaSel ('Just "request_counts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RequestCounts))) :*: ((S1 ('MetaSel ('Just "ended_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime)) :*: S1 ('MetaSel ('Just "created_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime)) :*: (S1 ('MetaSel ('Just "expires_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime) :*: (S1 ('MetaSel ('Just "cancel_initiated_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime)) :*: S1 ('MetaSel ('Just "results_url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))))) | |||||
data ProcessingStatus Source #
Processing status of a batch
Constructors
| In_Progress | |
| Canceling | |
| Ended |
Instances
| FromJSON ProcessingStatus Source # | |||||
Defined in Claude.V1.Messages.Batches Methods parseJSON :: Value -> Parser ProcessingStatus # parseJSONList :: Value -> Parser [ProcessingStatus] # | |||||
| ToJSON ProcessingStatus Source # | |||||
Defined in Claude.V1.Messages.Batches Methods toJSON :: ProcessingStatus -> Value # toEncoding :: ProcessingStatus -> Encoding # toJSONList :: [ProcessingStatus] -> Value # toEncodingList :: [ProcessingStatus] -> Encoding # omitField :: ProcessingStatus -> Bool # | |||||
| Generic ProcessingStatus Source # | |||||
Defined in Claude.V1.Messages.Batches Associated Types
Methods from :: ProcessingStatus -> Rep ProcessingStatus x # to :: Rep ProcessingStatus x -> ProcessingStatus # | |||||
| Show ProcessingStatus Source # | |||||
Defined in Claude.V1.Messages.Batches Methods showsPrec :: Int -> ProcessingStatus -> ShowS # show :: ProcessingStatus -> String # showList :: [ProcessingStatus] -> ShowS # | |||||
| Eq ProcessingStatus Source # | |||||
Defined in Claude.V1.Messages.Batches Methods (==) :: ProcessingStatus -> ProcessingStatus -> Bool # (/=) :: ProcessingStatus -> ProcessingStatus -> Bool # | |||||
| type Rep ProcessingStatus Source # | |||||
Defined in Claude.V1.Messages.Batches type Rep ProcessingStatus = D1 ('MetaData "ProcessingStatus" "Claude.V1.Messages.Batches" "claude-1.0.0-1j0Plg9n3EjAvfVKcV8Pl0" 'False) (C1 ('MetaCons "In_Progress" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Canceling" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Ended" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data RequestCounts Source #
Counts of requests in various states
Constructors
| RequestCounts | |
Instances
| FromJSON RequestCounts Source # | |||||
Defined in Claude.V1.Messages.Batches Methods parseJSON :: Value -> Parser RequestCounts # parseJSONList :: Value -> Parser [RequestCounts] # | |||||
| ToJSON RequestCounts Source # | |||||
Defined in Claude.V1.Messages.Batches Methods toJSON :: RequestCounts -> Value # toEncoding :: RequestCounts -> Encoding # toJSONList :: [RequestCounts] -> Value # toEncodingList :: [RequestCounts] -> Encoding # omitField :: RequestCounts -> Bool # | |||||
| Generic RequestCounts Source # | |||||
Defined in Claude.V1.Messages.Batches Associated Types
| |||||
| Show RequestCounts Source # | |||||
Defined in Claude.V1.Messages.Batches Methods showsPrec :: Int -> RequestCounts -> ShowS # show :: RequestCounts -> String # showList :: [RequestCounts] -> ShowS # | |||||
| type Rep RequestCounts Source # | |||||
Defined in Claude.V1.Messages.Batches type Rep RequestCounts = D1 ('MetaData "RequestCounts" "Claude.V1.Messages.Batches" "claude-1.0.0-1j0Plg9n3EjAvfVKcV8Pl0" 'False) (C1 ('MetaCons "RequestCounts" 'PrefixI 'True) ((S1 ('MetaSel ('Just "processing") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "succeeded") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)) :*: (S1 ('MetaSel ('Just "errored") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "canceled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "expired") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural))))) | |||||
data BatchResult Source #
A single result from a batch
Constructors
| BatchResult | |
Fields
| |
Instances
| FromJSON BatchResult Source # | |||||
Defined in Claude.V1.Messages.Batches | |||||
| ToJSON BatchResult Source # | |||||
Defined in Claude.V1.Messages.Batches Methods toJSON :: BatchResult -> Value # toEncoding :: BatchResult -> Encoding # toJSONList :: [BatchResult] -> Value # toEncodingList :: [BatchResult] -> Encoding # omitField :: BatchResult -> Bool # | |||||
| Generic BatchResult Source # | |||||
Defined in Claude.V1.Messages.Batches Associated Types
| |||||
| Show BatchResult Source # | |||||
Defined in Claude.V1.Messages.Batches Methods showsPrec :: Int -> BatchResult -> ShowS # show :: BatchResult -> String # showList :: [BatchResult] -> ShowS # | |||||
| type Rep BatchResult Source # | |||||
Defined in Claude.V1.Messages.Batches type Rep BatchResult = D1 ('MetaData "BatchResult" "Claude.V1.Messages.Batches" "claude-1.0.0-1j0Plg9n3EjAvfVKcV8Pl0" 'False) (C1 ('MetaCons "BatchResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "custom_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "result") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BatchResultType))) | |||||
data BatchResultType Source #
Type of result for a batch request
Instances
| FromJSON BatchResultType Source # | |||||
Defined in Claude.V1.Messages.Batches Methods parseJSON :: Value -> Parser BatchResultType # parseJSONList :: Value -> Parser [BatchResultType] # | |||||
| ToJSON BatchResultType Source # | |||||
Defined in Claude.V1.Messages.Batches Methods toJSON :: BatchResultType -> Value # toEncoding :: BatchResultType -> Encoding # toJSONList :: [BatchResultType] -> Value # toEncodingList :: [BatchResultType] -> Encoding # omitField :: BatchResultType -> Bool # | |||||
| Generic BatchResultType Source # | |||||
Defined in Claude.V1.Messages.Batches Associated Types
Methods from :: BatchResultType -> Rep BatchResultType x # to :: Rep BatchResultType x -> BatchResultType # | |||||
| Show BatchResultType Source # | |||||
Defined in Claude.V1.Messages.Batches Methods showsPrec :: Int -> BatchResultType -> ShowS # show :: BatchResultType -> String # showList :: [BatchResultType] -> ShowS # | |||||
| type Rep BatchResultType Source # | |||||
Defined in Claude.V1.Messages.Batches type Rep BatchResultType = D1 ('MetaData "BatchResultType" "Claude.V1.Messages.Batches" "claude-1.0.0-1j0Plg9n3EjAvfVKcV8Pl0" 'False) ((C1 ('MetaCons "Succeeded" 'PrefixI 'True) (S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MessageResponse)) :+: C1 ('MetaCons "Errored" 'PrefixI 'True) (S1 ('MetaSel ('Just "error") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Error))) :+: (C1 ('MetaCons "Canceled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Expired" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data ListBatchesResponse Source #
Pagination response for listing batches
Constructors
| ListBatchesResponse | |
Instances
| FromJSON ListBatchesResponse Source # | |||||
Defined in Claude.V1.Messages.Batches Methods parseJSON :: Value -> Parser ListBatchesResponse # parseJSONList :: Value -> Parser [ListBatchesResponse] # | |||||
| ToJSON ListBatchesResponse Source # | |||||
Defined in Claude.V1.Messages.Batches Methods toJSON :: ListBatchesResponse -> Value # toEncoding :: ListBatchesResponse -> Encoding # toJSONList :: [ListBatchesResponse] -> Value # toEncodingList :: [ListBatchesResponse] -> Encoding # omitField :: ListBatchesResponse -> Bool # | |||||
| Generic ListBatchesResponse Source # | |||||
Defined in Claude.V1.Messages.Batches Associated Types
Methods from :: ListBatchesResponse -> Rep ListBatchesResponse x # to :: Rep ListBatchesResponse x -> ListBatchesResponse # | |||||
| Show ListBatchesResponse Source # | |||||
Defined in Claude.V1.Messages.Batches Methods showsPrec :: Int -> ListBatchesResponse -> ShowS # show :: ListBatchesResponse -> String # showList :: [ListBatchesResponse] -> ShowS # | |||||
| type Rep ListBatchesResponse Source # | |||||
Defined in Claude.V1.Messages.Batches type Rep ListBatchesResponse = D1 ('MetaData "ListBatchesResponse" "Claude.V1.Messages.Batches" "claude-1.0.0-1j0Plg9n3EjAvfVKcV8Pl0" 'False) (C1 ('MetaCons "ListBatchesResponse" 'PrefixI 'True) ((S1 ('MetaSel ('Just "data_") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector BatchObject)) :*: S1 ('MetaSel ('Just "has_more") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "first_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "last_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) | |||||
Servant
type API = "messages" :> ("batches" :> ((ReqBody '[JSON] CreateBatch :> Post '[JSON] BatchObject) :<|> ((Capture "batch_id" Text :> Get '[JSON] BatchObject) :<|> ((QueryParam "limit" Natural :> (QueryParam "before_id" Text :> (QueryParam "after_id" Text :> Get '[JSON] ListBatchesResponse))) :<|> (Capture "batch_id" Text :> ("cancel" :> Post '[JSON] BatchObject)))))) Source #
Servant API for /v1/messages/batches