Skip to content
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
6 changes: 6 additions & 0 deletions .generator/src/generator/templates/api.j2
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,15 @@ func (a *{{ classname }}) {{ operation.operationId }}WithPagination(ctx _context
return
}
}
{%- if pagination.cursorParam %}
if len(results) == 0 {
break
}
{%- else %}
if len(results) < int(pageSize_) {
break
}
{%- endif %}
{%- if pagination.pageOffsetParam %}
if {{ get_container(operation, pagination.pageOffsetParam) }} == nil {
{{ get_container(operation, pagination.pageOffsetParam) }} = &pageSize_
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV2/api_audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (a *AuditApi) ListAuditLogsWithPagination(ctx _context.Context, o ...ListAu
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -387,7 +387,7 @@ func (a *AuditApi) SearchAuditLogsWithPagination(ctx _context.Context, o ...Sear
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV2/api_ci_visibility_pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (a *CIVisibilityPipelinesApi) ListCIAppPipelineEventsWithPagination(ctx _co
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -541,7 +541,7 @@ func (a *CIVisibilityPipelinesApi) SearchCIAppPipelineEventsWithPagination(ctx _
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV2/api_ci_visibility_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (a *CIVisibilityTestsApi) ListCIAppTestEventsWithPagination(ctx _context.Co
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -463,7 +463,7 @@ func (a *CIVisibilityTestsApi) SearchCIAppTestEventsWithPagination(ctx _context.
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/api_container_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (a *ContainerImagesApi) ListContainerImagesWithPagination(ctx _context.Cont
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/api_containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (a *ContainersApi) ListContainersWithPagination(ctx _context.Context, o ...
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV2/api_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (a *EventsApi) ListEventsWithPagination(ctx _context.Context, o ...ListEven
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -557,7 +557,7 @@ func (a *EventsApi) SearchEventsWithPagination(ctx _context.Context, o ...Search
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV2/api_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (a *LogsApi) ListLogsWithPagination(ctx _context.Context, o ...ListLogsOpti
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -497,7 +497,7 @@ func (a *LogsApi) ListLogsGetWithPagination(ctx _context.Context, o ...ListLogsG
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/api_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ func (a *MetricsApi) ListTagConfigurationsWithPagination(ctx _context.Context, o
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/api_processes.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (a *ProcessesApi) ListProcessesWithPagination(ctx _context.Context, o ...Li
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV2/api_rum.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ func (a *RUMApi) ListRUMEventsWithPagination(ctx _context.Context, o ...ListRUME
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -739,7 +739,7 @@ func (a *RUMApi) SearchRUMEventsWithPagination(ctx _context.Context, body RUMSea
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
10 changes: 5 additions & 5 deletions api/datadogV2/api_security_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -5044,7 +5044,7 @@ func (a *SecurityMonitoringApi) ListFindingsWithPagination(ctx _context.Context,
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -5625,7 +5625,7 @@ func (a *SecurityMonitoringApi) ListSecurityFindingsWithPagination(ctx _context.
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -6244,7 +6244,7 @@ func (a *SecurityMonitoringApi) ListSecurityMonitoringSignalsWithPagination(ctx
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -7962,7 +7962,7 @@ func (a *SecurityMonitoringApi) SearchSecurityFindingsWithPagination(ctx _contex
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -8251,7 +8251,7 @@ func (a *SecurityMonitoringApi) SearchSecurityMonitoringSignalsWithPagination(ct
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV2/api_spans.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (a *SpansApi) ListSpansWithPagination(ctx _context.Context, body SpansListR
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down Expand Up @@ -444,7 +444,7 @@ func (a *SpansApi) ListSpansGetWithPagination(ctx _context.Context, o ...ListSpa
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/api_test_optimization.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (a *TestOptimizationApi) SearchFlakyTestsWithPagination(ctx _context.Contex
return
}
}
if len(results) < int(pageSize_) {
if len(results) == 0 {
break
}
cursorMeta, ok := resp.GetMetaOk()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,21 @@ interactions:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
id: 2
method: GET
url: https://api.datadoghq.com/api/v2/audit/events?page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWUFpUWhuWTNRM3VVUUFBQUFCQldVRnBVV2h3YmtGQlEwczJhSGMyTWtoNGNtOTNRVUUifQ
response:
body: '{"data":[]}'
code: 200
duration: 0ms
headers:
Content-Type:
- application/json
status: 200 OK
version: 2
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,24 @@ interactions:
Content-Type:
- application/json
status: 200 OK
- request:
body: |
{"filter":{"from":"now-15m","to":"now"},"options":{"timezone":"GMT"},"page":{"cursor":"eyJhZnRlciI6IkFRQUFBWUFpT2hnV2pkb1otUUFBQUFCQldVRnBUMmgzVFVGQlJHSkxUR1pvU1U1MFRrOW5RVUUifQ","limit":2},"sort":"timestamp"}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
id: 2
method: POST
url: https://api.datadoghq.com/api/v2/audit/events/search
response:
body: '{"data":[]}'
code: 200
duration: 0ms
headers:
Content-Type:
- application/json
status: 200 OK
version: 2
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,21 @@ interactions:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
id: 2
method: GET
url: https://api.datadoghq.com/api/v2/container_images?page%5Bsize%5D=2&page%5Bcursor%5D=bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OmZmMTUxZWYyNDZkN2I0ZDZiOGZlMzE5MjNiMjk4ZDg0ZThmMjA2MzI3MDFiYmI2ZWQ5N2ZjYzU4YTAxNTBmODA%3D
response:
body: '{"data":[]}'
code: 200
duration: 0ms
headers:
Content-Type:
- application/json
status: 200 OK
version: 2
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,21 @@ interactions:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
id: 2
method: GET
url: https://api.datadoghq.com/api/v2/containers?page%5Bsize%5D=2&page%5Bcursor%5D=c3RhcnRlZDoxNjk3MTE4NDExMDAwLjAwMDAwMHxpZC5yYXc6ODY4OWY2ODUtZTQ0MS00ODJjLTYwNDMtNWQ5ZA%3D%3D
response:
body: '{"data":[]}'
code: 200
duration: 0ms
headers:
Content-Type:
- application/json
status: 200 OK
version: 2
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,21 @@ interactions:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
id: 2
method: GET
url: https://api.datadoghq.com/api/v2/events?filter%5Bfrom%5D=now-15m&filter%5Bto%5D=now&page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWUdDRlRXSTJoUnZQZ0FBQUFBQUFBQVlBQUFBQUVGWlIwTkdWRmRKUVVGRVVqbERWbEZ5ZEdoZlMxOXJRZ0FBQUNRQUFBQUFNREU0TVRneU1UVXRNelU0T0MwME1EZGhMV0V5TURndE1qUmxZekE1TmpVMVptTmkifQ
response:
body: '{"data":[]}'
code: 200
duration: 0ms
headers:
Content-Type:
- application/json
status: 200 OK
version: 2
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,24 @@ interactions:
Content-Type:
- application/json
status: 200 OK
- request:
body: |
{"filter":{"from":"now-15m","to":"now"},"options":{"timezone":"GMT"},"page":{"cursor":"eyJhZnRlciI6IkFnQUFBWUdDRlhBZ0lWRnZQZ0FBQUFBQUFBQVlBQUFBQUVGWlIwTkdXRUZuUVVGQmVGaEhkVTlPZUY5MU9FWmpTd0FBQUNRQUFBQUFNREU0TVRneU1UVXROekF5TUMwMFpXTTJMV0l3WVdJdFpEVTFZbU0zTlRZMlpUUTMifQ","limit":2},"sort":"timestamp"}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
id: 2
method: POST
url: https://api.datadoghq.com/api/v2/events/search
response:
body: '{"data":[]}'
code: 200
duration: 0ms
headers:
Content-Type:
- application/json
status: 200 OK
version: 2
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,21 @@ interactions:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
id: 2
method: GET
url: https://api.datadoghq.com/api/v2/logs/events?page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWUFkTDlKNG1jT2g2QUFBQUFCQldVRmtUQzFPUzBGQlFucExkREpLZFZOYVlrTjNRVUkifQ
response:
body: '{"data":[]}'
code: 200
duration: 0ms
headers:
Content-Type:
- application/json
status: 200 OK
version: 2
Loading
Loading