Skip to content

Commit 3593012

Browse files
release: 4.7.0 (#104)
* fix(encoder): correctly serialize NullStruct * fix(types): remove brand field from elemental content types * chore(internal): remove mock server code * chore: update mock server docs * fix: allow canceling a request while it is waiting to retry * codegen metadata * chore(internal): move custom custom `json` tags to `api` * codegen metadata * codegen metadata * chore(internal): codegen related update * codegen metadata * fix(types): remove UserTokenParam, inline fields to add_single params in tokens * chore(internal): codegen related update * chore(ci): skip uploading artifacts on stainless-internal branches * chore(internal): minor cleanup * chore(internal): use explicit returns * chore(internal): use explicit returns in more places * feat(api): add list/invoke methods to journeys * fix(types): make clicked/delivered/opened/sent optional in MessageDetails * codegen metadata * release: 4.7.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 97c16c6 commit 3593012

Some content is hidden

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

85 files changed

+1416
-1099
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,37 @@ on:
1313
- 'stl-preview-base/**'
1414

1515
jobs:
16+
build:
17+
timeout-minutes: 10
18+
name: build
19+
permissions:
20+
contents: read
21+
id-token: write
22+
runs-on: ${{ github.repository == 'stainless-sdks/courier-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
23+
if: |-
24+
github.repository == 'stainless-sdks/courier-go' &&
25+
(github.event_name == 'push' || github.event.pull_request.head.repo.fork)
26+
steps:
27+
- uses: actions/checkout@v6
28+
29+
- name: Get GitHub OIDC Token
30+
if: |-
31+
github.repository == 'stainless-sdks/courier-go' &&
32+
!startsWith(github.ref, 'refs/heads/stl/')
33+
id: github-oidc
34+
uses: actions/github-script@v8
35+
with:
36+
script: core.setOutput('github_token', await core.getIDToken());
37+
38+
- name: Upload tarball
39+
if: |-
40+
github.repository == 'stainless-sdks/courier-go' &&
41+
!startsWith(github.ref, 'refs/heads/stl/')
42+
env:
43+
URL: https://pkg.stainless.com/s
44+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
45+
SHA: ${{ github.sha }}
46+
run: ./scripts/utils/upload-artifact.sh
1647
lint:
1748
timeout-minutes: 10
1849
name: lint

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "4.6.0"
2+
".": "4.7.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 81
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-3fc1c86b4a83a16393aaf17d1fb3ac6098d30dd057ba872973b57285a7a3f0d0.yml
3-
openapi_spec_hash: 02a545d217b13399f311e99561f9de1d
4-
config_hash: 0789c3cddc625bb9712b3bded274ab6c
1+
configured_endpoints: 83
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-19330fca8fa9bbae835ec9d9f83b37b3df364d9b462090b9623bfc9b6eae99c2.yml
3+
openapi_spec_hash: 0bc6889464c9ac2542b4837f569c1837
4+
config_hash: 1ae49ed522c8423378d9463cdd0fb880

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
# Changelog
22

3+
## 4.7.0 (2026-03-12)
4+
5+
Full Changelog: [v4.6.0...v4.7.0](https://github.com/trycourier/courier-go/compare/v4.6.0...v4.7.0)
6+
7+
### Features
8+
9+
* **api:** add list/invoke methods to journeys ([27e1dcc](https://github.com/trycourier/courier-go/commit/27e1dccf03274f02edad426f8690b599710f52dd))
10+
11+
12+
### Bug Fixes
13+
14+
* allow canceling a request while it is waiting to retry ([e0f0298](https://github.com/trycourier/courier-go/commit/e0f029888b77c6d7cb9d76e821f0ed3c63dc1264))
15+
* **encoder:** correctly serialize NullStruct ([e95d4d3](https://github.com/trycourier/courier-go/commit/e95d4d378d8b7b3dbf9a88523bc41e3391eed6e6))
16+
* **types:** make clicked/delivered/opened/sent optional in MessageDetails ([30f9abb](https://github.com/trycourier/courier-go/commit/30f9abb4b5f9867930e573ca111328c6aa639274))
17+
* **types:** remove brand field from elemental content types ([acee88a](https://github.com/trycourier/courier-go/commit/acee88a7ee6b473fa50b550e34688e741ff7e7e7))
18+
* **types:** remove UserTokenParam, inline fields to add_single params in tokens ([ec13158](https://github.com/trycourier/courier-go/commit/ec1315823a666bf460b2b2f8dab879f0eb0571a3))
19+
20+
21+
### Chores
22+
23+
* **ci:** skip uploading artifacts on stainless-internal branches ([e69a68a](https://github.com/trycourier/courier-go/commit/e69a68a751f9353fbe3e89eb22df678bb8040305))
24+
* **internal:** codegen related update ([664ab02](https://github.com/trycourier/courier-go/commit/664ab027d92780ee94fce45b9e26b06bccc6860a))
25+
* **internal:** codegen related update ([4cacfaf](https://github.com/trycourier/courier-go/commit/4cacfaf2b5db40ed1b4b58b14ff8805073ebdcd8))
26+
* **internal:** minor cleanup ([d23c040](https://github.com/trycourier/courier-go/commit/d23c04090a220530b5565c864755368dcebeac02))
27+
* **internal:** move custom custom `json` tags to `api` ([1988dac](https://github.com/trycourier/courier-go/commit/1988dac7e49bef9ca18174ee4790347c7542f6e4))
28+
* **internal:** remove mock server code ([4a2dda0](https://github.com/trycourier/courier-go/commit/4a2dda0870c2c9714209d3ceba1e4d228eb94a98))
29+
* **internal:** use explicit returns ([6c2484b](https://github.com/trycourier/courier-go/commit/6c2484bc752e0a7632e1eb594ad49f1b59a635c7))
30+
* **internal:** use explicit returns in more places ([85aeba9](https://github.com/trycourier/courier-go/commit/85aeba9702077aa52c310ec1186f02792b917286))
31+
* update mock server docs ([4f70490](https://github.com/trycourier/courier-go/commit/4f70490f1a85ab031815bce6a26819b5c5db3520))
32+
33+
34+
### Documentation
35+
36+
* add AUTO-GENERATED-OVERVIEW markers for README sync ([#105](https://github.com/trycourier/courier-go/issues/105)) ([c25c36c](https://github.com/trycourier/courier-go/commit/c25c36cf92b37a28b5a51e6c3057db7129f7760d))
37+
* sync README from mintlify-docs (2026-02-20 18:11 UTC) ([#106](https://github.com/trycourier/courier-go/issues/106)) ([988d3c3](https://github.com/trycourier/courier-go/commit/988d3c3c2ae7b365344c20f7d8c3879e9d81e57a))
38+
* sync README from mintlify-docs (2026-02-20 18:36 UTC) ([#107](https://github.com/trycourier/courier-go/issues/107)) ([97c16c6](https://github.com/trycourier/courier-go/commit/97c16c65243ef89433eced0556f28064ce68cd9a))
39+
340
## 4.6.0 (2026-02-06)
441

542
Full Changelog: [v4.5.0...v4.6.0](https://github.com/trycourier/courier-go/compare/v4.5.0...v4.6.0)

CONTRIBUTING.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ $ go mod edit -replace github.com/trycourier/courier-go/v4=/path/to/courier-go
4646

4747
## Running tests
4848

49-
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
50-
51-
```sh
52-
# you will need npm installed
53-
$ npx prism mock path/to/your/openapi.yml
54-
```
55-
5649
```sh
5750
$ ./scripts/test
5851
```

api.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,23 @@ Methods:
149149
- <code title="post /automations/invoke">client.Automations.Invoke.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#AutomationInvokeService.InvokeAdHoc">InvokeAdHoc</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#AutomationInvokeInvokeAdHocParams">AutomationInvokeInvokeAdHocParams</a>) (\*<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#AutomationInvokeResponse">AutomationInvokeResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
150150
- <code title="post /automations/{templateId}/invoke">client.Automations.Invoke.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#AutomationInvokeService.InvokeByTemplate">InvokeByTemplate</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, templateID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#AutomationInvokeInvokeByTemplateParams">AutomationInvokeInvokeByTemplateParams</a>) (\*<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#AutomationInvokeResponse">AutomationInvokeResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
151151

152+
# Journeys
153+
154+
Params Types:
155+
156+
- <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneysInvokeRequestParam">JourneysInvokeRequestParam</a>
157+
158+
Response Types:
159+
160+
- <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#Journey">Journey</a>
161+
- <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneysInvokeResponse">JourneysInvokeResponse</a>
162+
- <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneysListResponse">JourneysListResponse</a>
163+
164+
Methods:
165+
166+
- <code title="get /journeys">client.Journeys.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneyService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneyListParams">JourneyListParams</a>) (\*<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneysListResponse">JourneysListResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
167+
- <code title="post /journeys/{templateId}/invoke">client.Journeys.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneyService.Invoke">Invoke</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, templateID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneyInvokeParams">JourneyInvokeParams</a>) (\*<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#JourneysInvokeResponse">JourneysInvokeResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
168+
152169
# Brands
153170

154171
Params Types:
@@ -453,10 +470,6 @@ Methods:
453470

454471
## Tokens
455472

456-
Params Types:
457-
458-
- <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#UserTokenParam">UserTokenParam</a>
459-
460473
Response Types:
461474

462475
- <a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4">courier</a>.<a href="https://pkg.go.dev/github.com/trycourier/courier-go/v4#UserToken">UserToken</a>

audience.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,31 @@ func (r *AudienceService) Get(ctx context.Context, audienceID string, opts ...op
4343
opts = slices.Concat(r.Options, opts)
4444
if audienceID == "" {
4545
err = errors.New("missing required audience_id parameter")
46-
return
46+
return nil, err
4747
}
4848
path := fmt.Sprintf("audiences/%s", audienceID)
4949
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
50-
return
50+
return res, err
5151
}
5252

5353
// Creates or updates audience.
5454
func (r *AudienceService) Update(ctx context.Context, audienceID string, body AudienceUpdateParams, opts ...option.RequestOption) (res *AudienceUpdateResponse, err error) {
5555
opts = slices.Concat(r.Options, opts)
5656
if audienceID == "" {
5757
err = errors.New("missing required audience_id parameter")
58-
return
58+
return nil, err
5959
}
6060
path := fmt.Sprintf("audiences/%s", audienceID)
6161
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...)
62-
return
62+
return res, err
6363
}
6464

6565
// Get the audiences associated with the authorization token.
6666
func (r *AudienceService) List(ctx context.Context, query AudienceListParams, opts ...option.RequestOption) (res *AudienceListResponse, err error) {
6767
opts = slices.Concat(r.Options, opts)
6868
path := "audiences"
6969
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
70-
return
70+
return res, err
7171
}
7272

7373
// Deletes the specified audience.
@@ -76,36 +76,36 @@ func (r *AudienceService) Delete(ctx context.Context, audienceID string, opts ..
7676
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
7777
if audienceID == "" {
7878
err = errors.New("missing required audience_id parameter")
79-
return
79+
return err
8080
}
8181
path := fmt.Sprintf("audiences/%s", audienceID)
8282
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...)
83-
return
83+
return err
8484
}
8585

8686
// Get list of members of an audience.
8787
func (r *AudienceService) ListMembers(ctx context.Context, audienceID string, query AudienceListMembersParams, opts ...option.RequestOption) (res *AudienceListMembersResponse, err error) {
8888
opts = slices.Concat(r.Options, opts)
8989
if audienceID == "" {
9090
err = errors.New("missing required audience_id parameter")
91-
return
91+
return nil, err
9292
}
9393
path := fmt.Sprintf("audiences/%s/members", audienceID)
9494
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
95-
return
95+
return res, err
9696
}
9797

9898
type Audience struct {
9999
// A unique identifier representing the audience_id
100-
ID string `json:"id,required"`
101-
CreatedAt string `json:"created_at,required"`
100+
ID string `json:"id" api:"required"`
101+
CreatedAt string `json:"created_at" api:"required"`
102102
// A description of the audience
103-
Description string `json:"description,required"`
103+
Description string `json:"description" api:"required"`
104104
// The name of the audience
105-
Name string `json:"name,required"`
106-
UpdatedAt string `json:"updated_at,required"`
105+
Name string `json:"name" api:"required"`
106+
UpdatedAt string `json:"updated_at" api:"required"`
107107
// Filter configuration for audience membership containing an array of filter rules
108-
Filter shared.AudienceFilterConfig `json:"filter,nullable"`
108+
Filter shared.AudienceFilterConfig `json:"filter" api:"nullable"`
109109
// The logical operator (AND/OR) for the top-level filter
110110
//
111111
// Any of "AND", "OR".
@@ -139,7 +139,7 @@ const (
139139
)
140140

141141
type AudienceUpdateResponse struct {
142-
Audience Audience `json:"audience,required"`
142+
Audience Audience `json:"audience" api:"required"`
143143
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
144144
JSON struct {
145145
Audience respjson.Field
@@ -155,8 +155,8 @@ func (r *AudienceUpdateResponse) UnmarshalJSON(data []byte) error {
155155
}
156156

157157
type AudienceListResponse struct {
158-
Items []Audience `json:"items,required"`
159-
Paging shared.Paging `json:"paging,required"`
158+
Items []Audience `json:"items" api:"required"`
159+
Paging shared.Paging `json:"paging" api:"required"`
160160
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
161161
JSON struct {
162162
Items respjson.Field
@@ -173,8 +173,8 @@ func (r *AudienceListResponse) UnmarshalJSON(data []byte) error {
173173
}
174174

175175
type AudienceListMembersResponse struct {
176-
Items []AudienceListMembersResponseItem `json:"items,required"`
177-
Paging shared.Paging `json:"paging,required"`
176+
Items []AudienceListMembersResponseItem `json:"items" api:"required"`
177+
Paging shared.Paging `json:"paging" api:"required"`
178178
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
179179
JSON struct {
180180
Items respjson.Field
@@ -191,11 +191,11 @@ func (r *AudienceListMembersResponse) UnmarshalJSON(data []byte) error {
191191
}
192192

193193
type AudienceListMembersResponseItem struct {
194-
AddedAt string `json:"added_at,required"`
195-
AudienceID string `json:"audience_id,required"`
196-
AudienceVersion int64 `json:"audience_version,required"`
197-
MemberID string `json:"member_id,required"`
198-
Reason string `json:"reason,required"`
194+
AddedAt string `json:"added_at" api:"required"`
195+
AudienceID string `json:"audience_id" api:"required"`
196+
AudienceVersion int64 `json:"audience_version" api:"required"`
197+
MemberID string `json:"member_id" api:"required"`
198+
Reason string `json:"reason" api:"required"`
199199
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
200200
JSON struct {
201201
AddedAt respjson.Field

audience_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
func TestAudienceGet(t *testing.T) {
18-
t.Skip("Prism tests are disabled")
18+
t.Skip("Mock server tests are disabled")
1919
baseURL := "http://localhost:4010"
2020
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2121
baseURL = envURL
@@ -38,7 +38,7 @@ func TestAudienceGet(t *testing.T) {
3838
}
3939

4040
func TestAudienceUpdateWithOptionalParams(t *testing.T) {
41-
t.Skip("Prism tests are disabled")
41+
t.Skip("Mock server tests are disabled")
4242
baseURL := "http://localhost:4010"
4343
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
4444
baseURL = envURL
@@ -77,7 +77,7 @@ func TestAudienceUpdateWithOptionalParams(t *testing.T) {
7777
}
7878

7979
func TestAudienceListWithOptionalParams(t *testing.T) {
80-
t.Skip("Prism tests are disabled")
80+
t.Skip("Mock server tests are disabled")
8181
baseURL := "http://localhost:4010"
8282
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
8383
baseURL = envURL
@@ -102,7 +102,7 @@ func TestAudienceListWithOptionalParams(t *testing.T) {
102102
}
103103

104104
func TestAudienceDelete(t *testing.T) {
105-
t.Skip("Prism tests are disabled")
105+
t.Skip("Mock server tests are disabled")
106106
baseURL := "http://localhost:4010"
107107
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
108108
baseURL = envURL
@@ -125,7 +125,7 @@ func TestAudienceDelete(t *testing.T) {
125125
}
126126

127127
func TestAudienceListMembersWithOptionalParams(t *testing.T) {
128-
t.Skip("Prism tests are disabled")
128+
t.Skip("Mock server tests are disabled")
129129
baseURL := "http://localhost:4010"
130130
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
131131
baseURL = envURL

auditevent.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,28 @@ func (r *AuditEventService) Get(ctx context.Context, auditEventID string, opts .
4343
opts = slices.Concat(r.Options, opts)
4444
if auditEventID == "" {
4545
err = errors.New("missing required audit-event-id parameter")
46-
return
46+
return nil, err
4747
}
4848
path := fmt.Sprintf("audit-events/%s", auditEventID)
4949
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
50-
return
50+
return res, err
5151
}
5252

5353
// Fetch the list of audit events
5454
func (r *AuditEventService) List(ctx context.Context, query AuditEventListParams, opts ...option.RequestOption) (res *AuditEventListResponse, err error) {
5555
opts = slices.Concat(r.Options, opts)
5656
path := "audit-events"
5757
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
58-
return
58+
return res, err
5959
}
6060

6161
type AuditEvent struct {
62-
Actor AuditEventActor `json:"actor,required"`
63-
AuditEventID string `json:"auditEventId,required"`
64-
Source string `json:"source,required"`
65-
Target string `json:"target,required"`
66-
Timestamp string `json:"timestamp,required"`
67-
Type string `json:"type,required"`
62+
Actor AuditEventActor `json:"actor" api:"required"`
63+
AuditEventID string `json:"auditEventId" api:"required"`
64+
Source string `json:"source" api:"required"`
65+
Target string `json:"target" api:"required"`
66+
Timestamp string `json:"timestamp" api:"required"`
67+
Type string `json:"type" api:"required"`
6868
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
6969
JSON struct {
7070
Actor respjson.Field
@@ -85,8 +85,8 @@ func (r *AuditEvent) UnmarshalJSON(data []byte) error {
8585
}
8686

8787
type AuditEventActor struct {
88-
ID string `json:"id,required"`
89-
Email string `json:"email,nullable"`
88+
ID string `json:"id" api:"required"`
89+
Email string `json:"email" api:"nullable"`
9090
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
9191
JSON struct {
9292
ID respjson.Field
@@ -103,8 +103,8 @@ func (r *AuditEventActor) UnmarshalJSON(data []byte) error {
103103
}
104104

105105
type AuditEventListResponse struct {
106-
Paging shared.Paging `json:"paging,required"`
107-
Results []AuditEvent `json:"results,required"`
106+
Paging shared.Paging `json:"paging" api:"required"`
107+
Results []AuditEvent `json:"results" api:"required"`
108108
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
109109
JSON struct {
110110
Paging respjson.Field

auditevent_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
func TestAuditEventGet(t *testing.T) {
17-
t.Skip("Prism tests are disabled")
17+
t.Skip("Mock server tests are disabled")
1818
baseURL := "http://localhost:4010"
1919
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2020
baseURL = envURL
@@ -37,7 +37,7 @@ func TestAuditEventGet(t *testing.T) {
3737
}
3838

3939
func TestAuditEventListWithOptionalParams(t *testing.T) {
40-
t.Skip("Prism tests are disabled")
40+
t.Skip("Mock server tests are disabled")
4141
baseURL := "http://localhost:4010"
4242
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
4343
baseURL = envURL

0 commit comments

Comments
 (0)