damsel/proto/webhooker.thrift

158 lines
3.7 KiB
Thrift
Raw Normal View History

include "base.thrift"
include "domain.thrift"
namespace java com.rbkmoney.damsel.webhooker
namespace erlang webhooker
typedef string Url
typedef string Key
typedef i64 WebhookID
exception WebhookNotFound {}
struct Webhook {
1: required WebhookID id
2: required domain.PartyID party_id
3: required EventFilter event_filter
4: required Url url
5: required Key pub_key
6: required bool enabled
}
struct WebhookParams {
1: required domain.PartyID party_id
2: required EventFilter event_filter
3: required Url url
}
union EventFilter {
1: PartyEventFilter party
2: InvoiceEventFilter invoice
3: CustomerEventFilter customer
}
struct PartyEventFilter {
2017-04-10 15:46:28 +00:00
1: required set<PartyEventType> types
}
union PartyEventType {
1: ClaimEventType claim
}
union ClaimEventType {
1: ClaimCreated created
2: ClaimDenied denied
3: ClaimAccepted accepted
}
struct ClaimCreated {}
struct ClaimDenied {}
struct ClaimAccepted {}
struct InvoiceEventFilter {
2017-04-10 15:46:28 +00:00
1: required set<InvoiceEventType> types
2: optional domain.ShopID shop_id
}
union InvoiceEventType {
1: InvoiceCreated created
2: InvoiceStatusChanged status_changed
3: InvoicePaymentEventType payment
}
struct InvoiceCreated {}
struct InvoiceStatusChanged {
2017-04-19 15:36:45 +00:00
1: optional InvoiceStatus value
}
2017-04-19 15:36:45 +00:00
union InvoiceStatus {
1: InvoiceUnpaid unpaid
2: InvoicePaid paid
3: InvoiceCancelled cancelled
4: InvoiceFulfilled fulfilled
}
struct InvoiceUnpaid {}
struct InvoicePaid {}
struct InvoiceCancelled {}
struct InvoiceFulfilled {}
union InvoicePaymentEventType {
1: InvoicePaymentCreated created
2: InvoicePaymentStatusChanged status_changed
3: InvoicePaymentRefundChange invoice_payment_refund_change
}
struct InvoicePaymentCreated {}
struct InvoicePaymentStatusChanged {
2017-04-19 15:36:45 +00:00
1: optional InvoicePaymentStatus value
}
2018-03-16 13:29:27 +00:00
union InvoicePaymentRefundChange {
1: InvoicePaymentRefundCreated invoice_payment_refund_created
2: InvoicePaymentRefundStatusChanged invoice_payment_refund_status_changed
}
struct InvoicePaymentRefundCreated {}
struct InvoicePaymentRefundStatusChanged {
1: required InvoicePaymentRefundStatus value
}
2017-04-19 15:36:45 +00:00
union InvoicePaymentStatus {
1: InvoicePaymentPending pending
4: InvoicePaymentProcessed processed
2: InvoicePaymentCaptured captured
5: InvoicePaymentCancelled cancelled
3: InvoicePaymentFailed failed
6: InvoicePaymentRefunded refunded
2017-04-19 15:36:45 +00:00
}
struct InvoicePaymentPending {}
struct InvoicePaymentProcessed {}
struct InvoicePaymentCaptured {}
struct InvoicePaymentCancelled {}
struct InvoicePaymentFailed {}
struct InvoicePaymentRefunded {}
2017-04-19 15:36:45 +00:00
union InvoicePaymentRefundStatus {
1: InvoicePaymentRefundPending pending
2: InvoicePaymentRefundSucceeded succeeded
3: InvoicePaymentRefundFailed failed
}
struct InvoicePaymentRefundPending {}
struct InvoicePaymentRefundSucceeded {}
struct InvoicePaymentRefundFailed {}
struct CustomerEventFilter {
1: required set<CustomerEventType> types
2: optional domain.ShopID shop_id
}
union CustomerEventType {
1: CustomerCreated created
2: CustomerDeleted deleted
3: CustomerStatusReady ready
4: CustomerBindingEvent binding
}
struct CustomerCreated {}
struct CustomerDeleted {}
struct CustomerStatusReady {}
union CustomerBindingEvent {
1: CustomerBindingStarted started
2: CustomerBindingSucceeded succeeded
3: CustomerBindingFailed failed
}
struct CustomerBindingStarted {}
struct CustomerBindingSucceeded {}
struct CustomerBindingFailed {}
service WebhookManager {
list<Webhook> GetList(1: domain.PartyID party_id)
Webhook Get(1: WebhookID webhook_id) throws (1: WebhookNotFound ex1)
Webhook Create(1: WebhookParams webhook_params)
void Delete(1: WebhookID webhook_id) throws (1: WebhookNotFound ex1)
}