Skip to content

Commit

Permalink
Merge branch 'main' into mendy/add-python-low-level-http-client
Browse files Browse the repository at this point in the history
  • Loading branch information
svix-mman authored Jan 23, 2025
2 parents db7adbe + 9acb5e5 commit 0277b9f
Show file tree
Hide file tree
Showing 213 changed files with 1,383 additions and 7,402 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
* Libs/Rust **(Breaking)**: Add optional `EventTypeDeleteOptions` parameter to `EventType::delete`
* Libs/Rust **(Breaking)**: Add optional `PostOptions` parameter to `Endpoint::recover`,
`Endpoint::rotate_secret`, `Integration::rotate_key` and `MessageAttempt::resend`
* Libs/Rust **(Breaking)**: Remove model files that were not referenced by any operations available
through the `Svix` object
* Libs/Rust **(Breaking)**: Switch `Patch` struct fields from `Option<Option<T>>` to
`js_option::JsOption<T>`
* Libs/Rust **(Breaking)**: Change `rate_limit` from `i32` to `u16` in several places
* Libs/Rust **(Breaking)**: Remove `settings` parameter from `EnvironmentIn::new`
* Libs/Go **(Breaking)**: Rename `Statistics.AggregateAppStats` to `AggregateAppStatsWithOptions`;
the old name is used for a version of the method without the `PostOptions`, like elsewhere
* Libs/Go: Add `Authentication.ExpireAll` (and `ExpireAllWithOptions`)
Expand Down
50 changes: 34 additions & 16 deletions go/backgroundtask.go → go/background_task.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// this file is @generated (with minor manual changes)
package svix

import (
Expand All @@ -11,50 +12,67 @@ type BackgroundTask struct {
}

type BackgroundTaskListOptions struct {
// Filter the response based on the status.
Status *BackgroundTaskStatus
// Filter the response based on the type.
Task *BackgroundTaskType
// Limit the number of returned items
Limit *int32
// The iterator returned from a prior invocation
Iterator *string
Limit *int32
Order *Ordering
Status *BackgroundTaskStatus
Task *BackgroundTaskType
// The sorting order of the returned items
Order *Ordering
}

func (a *BackgroundTask) List(
// List background tasks executed in the past 90 days.
func (backgroundTask *BackgroundTask) List(
ctx context.Context,
options *BackgroundTaskListOptions,
) (*ListResponseBackgroundTaskOut, error) {
req := a.api.BackgroundTasksAPI.ListBackgroundTasks(ctx)
req := backgroundTask.api.BackgroundTasksAPI.ListBackgroundTasks(
ctx,
)

if options != nil {
if options.Iterator != nil {
req = req.Iterator(*options.Iterator)
if options.Status != nil {
req = req.Status(*options.Status)
}
if options.Task != nil {
req = req.Task(*options.Task)
}
if options.Limit != nil {
req = req.Limit(*options.Limit)
}
if options.Iterator != nil {
req = req.Iterator(*options.Iterator)
}
if options.Order != nil {
req = req.Order(*options.Order)
}
if options.Status != nil {
req = req.Status(*options.Status)
}
if options.Task != nil {
req = req.Task(*options.Task)
}
}

ret, res, err := req.Execute()
if err != nil {
return nil, wrapError(err, res)
}

return ret, nil
}

func (a *BackgroundTask) Get(
// Get a background task by ID.
func (backgroundTask *BackgroundTask) Get(
ctx context.Context,
taskId string,
) (*BackgroundTaskOut, error) {
req := a.api.BackgroundTasksAPI.GetBackgroundTask(ctx, taskId)
req := backgroundTask.api.BackgroundTasksAPI.GetBackgroundTask(
ctx,
taskId,
)

ret, res, err := req.Execute()
if err != nil {
return nil, wrapError(err, res)
}

return ret, nil
}
9 changes: 5 additions & 4 deletions go/endpoint.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// this file is @generated (with minor manual changes)
package svix

import (
Expand Down Expand Up @@ -444,22 +445,22 @@ func (endpoint *Endpoint) SendExampleWithOptions(
}

// Get basic statistics for the endpoint.
func (e *Endpoint) GetStats(
func (endpoint *Endpoint) GetStats(
ctx context.Context,
appId string,
endpointId string,
) (*EndpointStats, error) {
return e.GetStatsWithOptions(ctx, appId, endpointId, EndpointStatsOptions{})
return endpoint.GetStatsWithOptions(ctx, appId, endpointId, EndpointStatsOptions{})
}

// Get basic statistics for the endpoint.
func (e *Endpoint) GetStatsWithOptions(
func (endpoint *Endpoint) GetStatsWithOptions(
ctx context.Context,
appId string,
endpointId string,
options EndpointStatsOptions,
) (*EndpointStats, error) {
req := e.api.EndpointAPI.V1EndpointGetStats(
req := endpoint.api.EndpointAPI.V1EndpointGetStats(
ctx,
appId,
endpointId,
Expand Down
18 changes: 10 additions & 8 deletions go/event_type.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// this file is @generated (with some manual changes)
package svix

import (
Expand All @@ -23,6 +24,11 @@ type EventTypeListOptions struct {
WithContent *bool
}

type EventTypeDeleteOptions struct {
// By default event types are archived when "deleted". Passing this to `true` deletes them entirely.
Expunge *bool
}

// Return the list of event types.
func (eventType *EventType) List(
ctx context.Context,
Expand Down Expand Up @@ -102,19 +108,19 @@ func (eventType *EventType) CreateWithOptions(
return ret, nil
}

func (e *EventType) ImportOpenApi(
func (eventType *EventType) ImportOpenApi(
ctx context.Context,
eventTypeImportOpenApiIn EventTypeImportOpenApiIn,
) (*EventTypeImportOpenApiOut, error) {
return e.ImportOpenApiWithOptions(ctx, eventTypeImportOpenApiIn, nil)
return eventType.ImportOpenApiWithOptions(ctx, eventTypeImportOpenApiIn, nil)
}

func (e *EventType) ImportOpenApiWithOptions(
func (eventType *EventType) ImportOpenApiWithOptions(
ctx context.Context,
eventTypeImportOpenApiIn EventTypeImportOpenApiIn,
options *PostOptions,
) (*EventTypeImportOpenApiOut, error) {
req := e.api.EventTypeAPI.V1EventTypeImportOpenapi(ctx).EventTypeImportOpenApiIn(eventTypeImportOpenApiIn)
req := eventType.api.EventTypeAPI.V1EventTypeImportOpenapi(ctx).EventTypeImportOpenApiIn(eventTypeImportOpenApiIn)
if options != nil && options.IdempotencyKey != nil {
req = req.IdempotencyKey(*options.IdempotencyKey)
}
Expand Down Expand Up @@ -175,10 +181,6 @@ func (eventType *EventType) Delete(
return eventType.DeleteWithOptions(ctx, eventTypeName, nil)
}

type EventTypeDeleteOptions struct {
Expunge *bool
}

func (eventType *EventType) DeleteWithOptions(
ctx context.Context,
eventTypeName string,
Expand Down
1 change: 1 addition & 0 deletions go/message.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// this file is @generated (with some manual changes)
package svix

import (
Expand Down
40 changes: 22 additions & 18 deletions go/message_attempt.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// this file is @generated (with manual changes)
package svix

import (
Expand All @@ -12,8 +13,11 @@ type MessageAttempt struct {
}

type MessageAttemptListOptions struct {
Iterator *string
Limit *int32
// Limit the number of returned items
Limit *int32
// The iterator returned from a prior invocation
Iterator *string
// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)
Status *MessageStatus
EventTypes *[]string
Before *time.Time
Expand Down Expand Up @@ -55,38 +59,38 @@ func (messageAttempt *MessageAttempt) ListByEndpoint(
)

if options != nil {
if options.Iterator != nil {
req = req.Iterator(*options.Iterator)
}
if options.Limit != nil {
req = req.Limit(*options.Limit)
}
if options.Iterator != nil {
req = req.Iterator(*options.Iterator)
}
if options.Status != nil {
req = req.Status(*options.Status)
}
if options.EventTypes != nil {
req = req.EventTypes(*options.EventTypes)
if options.StatusCodeClass != nil {
req = req.StatusCodeClass(*options.StatusCodeClass)
}
if options.Channel != nil {
req = req.Channel(*options.Channel)
}
if options.Tag != nil {
req = req.Tag(*options.Tag)
}
if options.Before != nil {
req = req.Before(*options.Before)
}
if options.After != nil {
req = req.After(*options.After)
}
if options.StatusCodeClass != nil {
req.StatusCodeClass(*options.StatusCodeClass)
}
if options.Channel != nil {
req = req.Channel(*options.Channel)
}
if options.WithContent != nil {
req = req.WithContent(*options.WithContent)
}
if options.WithMsg != nil {
req = req.WithMsg(*options.WithMsg)
}
if options.Tag != nil {
req = req.Tag(*options.Tag)
if options.EventTypes != nil {
req = req.EventTypes(*options.EventTypes)
}
}

Expand Down Expand Up @@ -268,12 +272,12 @@ func (messageAttempt *MessageAttempt) ListAttemptedDestinations(
) (*ListResponseMessageEndpointOut, error) {
req := messageAttempt.api.MessageAttemptAPI.V1MessageAttemptListAttemptedDestinations(ctx, appId, msgId)
if options != nil {
if options.Iterator != nil {
req = req.Iterator(*options.Iterator)
}
if options.Limit != nil {
req = req.Limit(*options.Limit)
}
if options.Iterator != nil {
req = req.Iterator(*options.Iterator)
}
}
ret, res, err := req.Execute()
if err != nil {
Expand Down
Loading

0 comments on commit 0277b9f

Please sign in to comment.