Skip to content

go: Add generated query parameter structs #1573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions go/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ type Application struct {
}

type ApplicationListOptions struct {
// Limit the number of returned items
Limit *int32
// The iterator returned from a prior invocation
Iterator *string
Limit *int32
Order *Ordering
// The sorting order of the returned items
Order *Ordering
}

func (a *Application) List(ctx context.Context, options *ApplicationListOptions) (*ListResponseApplicationOut, error) {
Expand Down
9 changes: 7 additions & 2 deletions go/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ type Endpoint struct {
}

type EndpointListOptions struct {
// Limit the number of returned items
Limit *int32
// The iterator returned from a prior invocation
Iterator *string
Limit *int32
Order *Ordering
// The sorting order of the returned items
Order *Ordering
}

type EndpointStatsOptions struct {
// Filter the range to data starting from this date
Since *time.Time
// Filter the range to data ending by this date
Until *time.Time
}

Expand Down
14 changes: 9 additions & 5 deletions go/eventtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ type (
)

type EventTypeListOptions struct {
Iterator *string
Limit *int32
WithContent *bool
IncludeArchived *bool
// N.b. `openapi.Ordering` aliased for re-export via `endpoint.go`
// Limit the number of returned items
Limit *int32
// The iterator returned from a prior invocation
Iterator *string
// The sorting order of the returned items
Order *Ordering
// When `true` archived (deleted but not expunged) items are included in the response
IncludeArchived *bool
// When `true` the full item (including the schema) is included in the response
WithContent *bool
}

func (e *EventType) List(ctx context.Context, options *EventTypeListOptions) (*ListResponseEventTypeOut, error) {
Expand Down
6 changes: 4 additions & 2 deletions go/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ type Integration struct {
}

type IntegrationListOptions struct {
// Limit the number of returned items
Limit *int32
// The iterator returned from a prior invocation
Iterator *string
Limit *int32
// N.b. `openapi.Ordering` aliased for re-export via `endpoint.go`
// The sorting order of the returned items
Order *Ordering
}

Expand Down
22 changes: 15 additions & 7 deletions go/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@ type (
)

type MessageListOptions struct {
Iterator *string
Limit *int32
EventTypes *[]string
Before *time.Time
After *time.Time
Channel *string
Tag *string
// Limit the number of returned items
Limit *int32
// The iterator returned from a prior invocation
Iterator *string
// Filter response based on the channel
Channel *string
// Only include items created before a certain date
Before *time.Time
// Only include items created after a certain date
After *time.Time
// When `true` message payloads are included in the response
WithContent *bool
// Filter messages matching the provided tag
Tag *string
// Filter response based on the event type
EventTypes *[]string
}

func (m *Message) List(ctx context.Context, appId string, options *MessageListOptions) (*ListResponseMessageOut, error) {
Expand Down
7 changes: 5 additions & 2 deletions go/operational_webhook_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ type OperationalWebhookEndpoint struct {
}

type OperationalWebhookEndpointListOptions struct {
// Limit the number of returned items
Limit *int32
// The iterator returned from a prior invocation
Iterator *string
Limit *int32
Order *openapi.Ordering
// The sorting order of the returned items
Order *Ordering
}

func (e *OperationalWebhookEndpoint) List(ctx context.Context, options *OperationalWebhookEndpointListOptions) (*ListResponseOperationalWebhookEndpointOut, error) {
Expand Down