Skip to content

Commit fa9b806

Browse files
authored
refactor: notification event reconciling (#3581)
1 parent ee22348 commit fa9b806

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4677
-2738
lines changed

api/api.gen.go

Lines changed: 1252 additions & 1214 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/go/client.gen.go

Lines changed: 1216 additions & 1177 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/javascript/src/client/schemas.ts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5706,6 +5706,29 @@ export interface components {
57065706
[key: string]: unknown
57075707
} | null
57085708
}
5709+
/** @description The response of the event delivery attempt. */
5710+
EventDeliveryAttemptResponse: {
5711+
/**
5712+
* Status Code
5713+
* @description Status code of the response if available.
5714+
*/
5715+
readonly statusCode?: number
5716+
/**
5717+
* Response Body
5718+
* @description The body of the response.
5719+
*/
5720+
readonly body: string
5721+
/**
5722+
* Response Duration
5723+
* @description The duration of the response in milliseconds.
5724+
*/
5725+
readonly durationMs: number
5726+
/**
5727+
* URL
5728+
* @description URL where the event was sent in case of notification channel with webhook type.
5729+
*/
5730+
readonly url?: string
5731+
}
57095732
/**
57105733
* @description The expiration duration enum
57115734
* @enum {string}
@@ -8056,6 +8079,27 @@ export interface components {
80568079
/** Threshold */
80578080
readonly threshold: components['schemas']['NotificationRuleBalanceThresholdValue']
80588081
}
8082+
/** @description The delivery attempt of the notification event. */
8083+
NotificationEventDeliveryAttempt: {
8084+
/**
8085+
* State of teh delivery attempt
8086+
* @description State of teh delivery attempt.
8087+
* @example SUCCESS
8088+
*/
8089+
readonly state: components['schemas']['NotificationEventDeliveryStatusState']
8090+
/**
8091+
* Response returned by the notification event recipient
8092+
* @description Response returned by the notification event recipient.
8093+
*/
8094+
readonly response: components['schemas']['EventDeliveryAttemptResponse']
8095+
/**
8096+
* Timestamp of the delivery attempt
8097+
* Format: date-time
8098+
* @description Timestamp of the delivery attempt.
8099+
* @example 2023-01-01T01:01:01.001Z
8100+
*/
8101+
readonly timestamp: Date
8102+
}
80598103
/** @description The delivery status of the notification event. */
80608104
NotificationEventDeliveryStatus: {
80618105
/**
@@ -8086,6 +8130,18 @@ export interface components {
80868130
* @description Set of key-value pairs managed by the system. Cannot be modified by user.
80878131
*/
80888132
readonly annotations?: components['schemas']['Annotations']
8133+
/**
8134+
* Timestamp of the next delivery attempt
8135+
* Format: date-time
8136+
* @description Timestamp of the next delivery attempt. If null it means there will be no more delivery attempts.
8137+
* @example 2023-01-01T01:01:01.001Z
8138+
*/
8139+
readonly nextAttempt?: Date
8140+
/**
8141+
* Delivery Attempts
8142+
* @description List of delivery attempts.
8143+
*/
8144+
readonly attempts: components['schemas']['NotificationEventDeliveryAttempt'][]
80898145
}
80908146
/**
80918147
* Delivery State
@@ -11859,6 +11915,8 @@ export type EntitlementV2PaginatedResponse =
1185911915
export type EntitlementValue = components['schemas']['EntitlementValue']
1186011916
export type ErrorExtension = components['schemas']['ErrorExtension']
1186111917
export type Event = components['schemas']['Event']
11918+
export type EventDeliveryAttemptResponse =
11919+
components['schemas']['EventDeliveryAttemptResponse']
1186211920
export type ExpirationDuration = components['schemas']['ExpirationDuration']
1186311921
export type ExpirationPeriod = components['schemas']['ExpirationPeriod']
1186411922
export type Feature = components['schemas']['Feature']
@@ -12013,6 +12071,8 @@ export type NotificationEventBalanceThresholdPayload =
1201312071
components['schemas']['NotificationEventBalanceThresholdPayload']
1201412072
export type NotificationEventBalanceThresholdPayloadData =
1201512073
components['schemas']['NotificationEventBalanceThresholdPayloadData']
12074+
export type NotificationEventDeliveryAttempt =
12075+
components['schemas']['NotificationEventDeliveryAttempt']
1201612076
export type NotificationEventDeliveryStatus =
1201712077
components['schemas']['NotificationEventDeliveryStatus']
1201812078
export type NotificationEventDeliveryStatusState =

api/client/python/openmeter/_generated/models/__init__.py

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/python/openmeter/_generated/models/_models.py

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapi.cloud.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17101,6 +17101,33 @@ components:
1710117101
x-go-type-import:
1710217102
path: github.com/cloudevents/sdk-go/v2/event
1710317103
x-go-type: event.Event
17104+
EventDeliveryAttemptResponse:
17105+
type: object
17106+
required:
17107+
- body
17108+
- durationMs
17109+
properties:
17110+
statusCode:
17111+
type: integer
17112+
description: Status code of the response if available.
17113+
title: Status Code
17114+
readOnly: true
17115+
body:
17116+
type: string
17117+
description: The body of the response.
17118+
title: Response Body
17119+
readOnly: true
17120+
durationMs:
17121+
type: integer
17122+
description: The duration of the response in milliseconds.
17123+
title: Response Duration
17124+
readOnly: true
17125+
url:
17126+
type: string
17127+
description: URL where the event was sent in case of notification channel with webhook type.
17128+
title: URL
17129+
readOnly: true
17130+
description: The response of the event delivery attempt.
1710417131
ExpirationDuration:
1710517132
type: string
1710617133
enum:
@@ -20385,13 +20412,42 @@ components:
2038520412
title: Threshold
2038620413
readOnly: true
2038720414
description: Data of the payload for notification event with `entitlements.balance.threshold` type.
20415+
NotificationEventDeliveryAttempt:
20416+
type: object
20417+
required:
20418+
- state
20419+
- response
20420+
- timestamp
20421+
properties:
20422+
state:
20423+
allOf:
20424+
- $ref: '#/components/schemas/NotificationEventDeliveryStatusState'
20425+
description: State of teh delivery attempt.
20426+
title: State of teh delivery attempt
20427+
example: SUCCESS
20428+
readOnly: true
20429+
response:
20430+
allOf:
20431+
- $ref: '#/components/schemas/EventDeliveryAttemptResponse'
20432+
description: Response returned by the notification event recipient.
20433+
title: Response returned by the notification event recipient
20434+
readOnly: true
20435+
timestamp:
20436+
type: string
20437+
format: date-time
20438+
description: Timestamp of the delivery attempt.
20439+
example: '2023-01-01T01:01:01.001Z'
20440+
title: Timestamp of the delivery attempt
20441+
readOnly: true
20442+
description: The delivery attempt of the notification event.
2038820443
NotificationEventDeliveryStatus:
2038920444
type: object
2039020445
required:
2039120446
- state
2039220447
- reason
2039320448
- updatedAt
2039420449
- channel
20450+
- attempts
2039520451
properties:
2039620452
state:
2039720453
allOf:
@@ -20424,6 +20480,20 @@ components:
2042420480
description: Set of key-value pairs managed by the system. Cannot be modified by user.
2042520481
title: Annotations
2042620482
readOnly: true
20483+
nextAttempt:
20484+
type: string
20485+
format: date-time
20486+
description: Timestamp of the next delivery attempt. If null it means there will be no more delivery attempts.
20487+
example: '2023-01-01T01:01:01.001Z'
20488+
title: Timestamp of the next delivery attempt
20489+
readOnly: true
20490+
attempts:
20491+
type: array
20492+
items:
20493+
$ref: '#/components/schemas/NotificationEventDeliveryAttempt'
20494+
description: List of delivery attempts.
20495+
title: Delivery Attempts
20496+
readOnly: true
2042720497
description: The delivery status of the notification event.
2042820498
NotificationEventDeliveryStatusState:
2042920499
type: string

0 commit comments

Comments
 (0)