Skip to content

Commit

Permalink
go: Reorder methods in message_attempt.go
Browse files Browse the repository at this point in the history
To match codegen order.
  • Loading branch information
svix-jplatte committed Jan 10, 2025
1 parent 3608591 commit c5d2450
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions go/message_attempt.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func (m *MessageAttempt) List(
return m.ListByMsg(ctx, appId, msgId, options)
}

func (m *MessageAttempt) ListByMsg(
func (m *MessageAttempt) ListByEndpoint(
ctx context.Context,
appId string,
msgId string,
endpointId string,
options *MessageAttemptListOptions,
) (*ListResponseMessageAttemptOut, error) {
req := m.api.MessageAttemptAPI.V1MessageAttemptListByMsg(ctx, appId, msgId)
req := m.api.MessageAttemptAPI.V1MessageAttemptListByEndpoint(ctx, appId, endpointId)
if options != nil {
if options.Iterator != nil {
req = req.Iterator(*options.Iterator)
Expand All @@ -68,12 +68,12 @@ func (m *MessageAttempt) ListByMsg(
if options.Channel != nil {
req = req.Channel(*options.Channel)
}
if options.EndpointId != nil {
req = req.EndpointId(*options.EndpointId)
}
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)
}
Expand All @@ -85,13 +85,13 @@ func (m *MessageAttempt) ListByMsg(
return ret, nil
}

func (m *MessageAttempt) ListByEndpoint(
func (m *MessageAttempt) ListByMsg(
ctx context.Context,
appId string,
endpointId string,
msgId string,
options *MessageAttemptListOptions,
) (*ListResponseMessageAttemptOut, error) {
req := m.api.MessageAttemptAPI.V1MessageAttemptListByEndpoint(ctx, appId, endpointId)
req := m.api.MessageAttemptAPI.V1MessageAttemptListByMsg(ctx, appId, msgId)
if options != nil {
if options.Iterator != nil {
req = req.Iterator(*options.Iterator)
Expand All @@ -117,12 +117,12 @@ func (m *MessageAttempt) ListByEndpoint(
if options.Channel != nil {
req = req.Channel(*options.Channel)
}
if options.EndpointId != nil {
req = req.EndpointId(*options.EndpointId)
}
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)
}
Expand All @@ -134,46 +134,6 @@ func (m *MessageAttempt) ListByEndpoint(
return ret, nil
}

func (m *MessageAttempt) Get(
ctx context.Context,
appId string,
msgId string,
attemptID string,
) (*MessageAttemptOut, error) {
req := m.api.MessageAttemptAPI.V1MessageAttemptGet(ctx, appId, msgId, attemptID)
ret, res, err := req.Execute()
if err != nil {
return nil, wrapError(err, res)
}
return ret, nil
}

func (m *MessageAttempt) Resend(
ctx context.Context,
appId string,
msgId string,
endpointId string,
) error {
return m.ResendWithOptions(ctx, appId, msgId, endpointId, nil)
}

func (m *MessageAttempt) ResendWithOptions(
ctx context.Context,
appId string,
msgId string,
endpointId string,
options *PostOptions,
) error {
req := m.api.MessageAttemptAPI.V1MessageAttemptResend(ctx, appId, msgId, endpointId)
if options != nil {
if options.IdempotencyKey != nil {
req = req.IdempotencyKey(*options.IdempotencyKey)
}
}
res, err := req.Execute()
return wrapError(err, res)
}

func (m *MessageAttempt) ListAttemptedMessages(
ctx context.Context,
appId string,
Expand Down Expand Up @@ -217,6 +177,31 @@ func (m *MessageAttempt) ListAttemptedMessages(
return ret, nil
}

func (m *MessageAttempt) Get(
ctx context.Context,
appId string,
msgId string,
attemptID string,
) (*MessageAttemptOut, error) {
req := m.api.MessageAttemptAPI.V1MessageAttemptGet(ctx, appId, msgId, attemptID)
ret, res, err := req.Execute()
if err != nil {
return nil, wrapError(err, res)
}
return ret, nil
}

func (m *MessageAttempt) ExpungeContent(
ctx context.Context,
appId string,
msgId string,
attemptId string,
) error {
req := m.api.MessageAttemptAPI.V1MessageAttemptExpungeContent(ctx, appId, msgId, attemptId)
res, err := req.Execute()
return wrapError(err, res)
}

func (m *MessageAttempt) ListAttemptedDestinations(
ctx context.Context,
appId string,
Expand Down Expand Up @@ -281,13 +266,28 @@ func (m *MessageAttempt) ListAttemptsForEndpoint(
return ret, nil
}

func (m *MessageAttempt) ExpungeContent(
func (m *MessageAttempt) Resend(
ctx context.Context,
appId string,
msgId string,
attemptId string,
endpointId string,
) error {
req := m.api.MessageAttemptAPI.V1MessageAttemptExpungeContent(ctx, appId, msgId, attemptId)
return m.ResendWithOptions(ctx, appId, msgId, endpointId, nil)
}

func (m *MessageAttempt) ResendWithOptions(
ctx context.Context,
appId string,
msgId string,
endpointId string,
options *PostOptions,
) error {
req := m.api.MessageAttemptAPI.V1MessageAttemptResend(ctx, appId, msgId, endpointId)
if options != nil {
if options.IdempotencyKey != nil {
req = req.IdempotencyKey(*options.IdempotencyKey)
}
}
res, err := req.Execute()
return wrapError(err, res)
}

0 comments on commit c5d2450

Please sign in to comment.