From 8bf2f7b1f1ee84346ad50cd14607e437e5904827 Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Wed, 1 Nov 2023 17:04:04 -0400 Subject: [PATCH] named sturct variables (#2258) --- .generator/src/generator/templates/api.j2 | 4 ++-- .generator/src/generator/templates/client.j2 | 2 +- api/datadog/client.go | 2 +- api/datadogV1/api_dashboards.go | 4 ++-- api/datadogV1/api_monitors.go | 4 ++-- api/datadogV1/api_notebooks.go | 4 ++-- .../api_service_level_objective_corrections.go | 4 ++-- api/datadogV1/api_service_level_objectives.go | 4 ++-- api/datadogV1/api_synthetics.go | 4 ++-- api/datadogV2/api_audit.go | 8 ++++---- api/datadogV2/api_ci_visibility_pipelines.go | 8 ++++---- api/datadogV2/api_ci_visibility_tests.go | 8 ++++---- api/datadogV2/api_container_images.go | 4 ++-- api/datadogV2/api_containers.go | 4 ++-- api/datadogV2/api_downtimes.go | 4 ++-- api/datadogV2/api_events.go | 8 ++++---- api/datadogV2/api_incidents.go | 8 ++++---- api/datadogV2/api_logs.go | 8 ++++---- api/datadogV2/api_powerpack.go | 4 ++-- api/datadogV2/api_processes.go | 4 ++-- api/datadogV2/api_rum.go | 8 ++++---- api/datadogV2/api_security_monitoring.go | 12 ++++++------ api/datadogV2/api_service_definition.go | 4 ++-- api/datadogV2/api_spans.go | 8 ++++---- api/datadogV2/api_teams.go | 4 ++-- api/datadogV2/api_users.go | 4 ++-- 26 files changed, 70 insertions(+), 70 deletions(-) diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index bf75a210c21..feb59877dbd 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -365,7 +365,7 @@ func (a *{{ classname }}) {{ operation.operationId }}WithPagination(ctx _context resp, _, err := a.{{ operation.operationId }}(ctx{% for name, parameter in operation|parameters if parameter.required or parameter.in == "path" %}, {{ name|variable_name}}{% endfor %}{%- for name, parameter in operation|parameters if not parameter.required and parameter.in != "path" %}{%- if loop.first %}, o...{% endif %}{% endfor %}) if err != nil { var returnItem {{ itemType }} - items <- datadog.PaginationResult[{{ itemType }}]{returnItem, err} + items <- datadog.PaginationResult[{{ itemType }}]{Item: returnItem, Error: err} break } {%- if pagination.resultsPath %} @@ -386,7 +386,7 @@ func (a *{{ classname }}) {{ operation.operationId }}WithPagination(ctx _context for _, item := range results { select { - case items <- datadog.PaginationResult[{{ itemType }}]{item, nil}: + case items <- datadog.PaginationResult[{{ itemType }}]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/.generator/src/generator/templates/client.j2 b/.generator/src/generator/templates/client.j2 index 32a079a0095..692ffc9dc08 100644 --- a/.generator/src/generator/templates/client.j2 +++ b/.generator/src/generator/templates/client.j2 @@ -258,7 +258,7 @@ func (c *APIClient) PrepareRequest( return nil, err } } else { // form value - w.WriteField(k, iv) + _ = w.WriteField(k, iv) } } } diff --git a/api/datadog/client.go b/api/datadog/client.go index 1af30754b84..59d126ac725 100644 --- a/api/datadog/client.go +++ b/api/datadog/client.go @@ -258,7 +258,7 @@ func (c *APIClient) PrepareRequest( return nil, err } } else { // form value - w.WriteField(k, iv) + _ = w.WriteField(k, iv) } } } diff --git a/api/datadogV1/api_dashboards.go b/api/datadogV1/api_dashboards.go index c49f888719a..55942b01d7d 100644 --- a/api/datadogV1/api_dashboards.go +++ b/api/datadogV1/api_dashboards.go @@ -832,7 +832,7 @@ func (a *DashboardsApi) ListDashboardsWithPagination(ctx _context.Context, o ... resp, _, err := a.ListDashboards(ctx, o...) if err != nil { var returnItem DashboardSummaryDefinition - items <- datadog.PaginationResult[DashboardSummaryDefinition]{returnItem, err} + items <- datadog.PaginationResult[DashboardSummaryDefinition]{Item: returnItem, Error: err} break } respDashboards, ok := resp.GetDashboardsOk() @@ -843,7 +843,7 @@ func (a *DashboardsApi) ListDashboardsWithPagination(ctx _context.Context, o ... for _, item := range results { select { - case items <- datadog.PaginationResult[DashboardSummaryDefinition]{item, nil}: + case items <- datadog.PaginationResult[DashboardSummaryDefinition]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV1/api_monitors.go b/api/datadogV1/api_monitors.go index a4e650373f5..a86289549cf 100644 --- a/api/datadogV1/api_monitors.go +++ b/api/datadogV1/api_monitors.go @@ -746,14 +746,14 @@ func (a *MonitorsApi) ListMonitorsWithPagination(ctx _context.Context, o ...List resp, _, err := a.ListMonitors(ctx, o...) if err != nil { var returnItem Monitor - items <- datadog.PaginationResult[Monitor]{returnItem, err} + items <- datadog.PaginationResult[Monitor]{Item: returnItem, Error: err} break } results := resp for _, item := range results { select { - case items <- datadog.PaginationResult[Monitor]{item, nil}: + case items <- datadog.PaginationResult[Monitor]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV1/api_notebooks.go b/api/datadogV1/api_notebooks.go index 258a8097230..20f87495f90 100644 --- a/api/datadogV1/api_notebooks.go +++ b/api/datadogV1/api_notebooks.go @@ -428,7 +428,7 @@ func (a *NotebooksApi) ListNotebooksWithPagination(ctx _context.Context, o ...Li resp, _, err := a.ListNotebooks(ctx, o...) if err != nil { var returnItem NotebooksResponseData - items <- datadog.PaginationResult[NotebooksResponseData]{returnItem, err} + items <- datadog.PaginationResult[NotebooksResponseData]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -439,7 +439,7 @@ func (a *NotebooksApi) ListNotebooksWithPagination(ctx _context.Context, o ...Li for _, item := range results { select { - case items <- datadog.PaginationResult[NotebooksResponseData]{item, nil}: + case items <- datadog.PaginationResult[NotebooksResponseData]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV1/api_service_level_objective_corrections.go b/api/datadogV1/api_service_level_objective_corrections.go index 201195d406d..7d88be9196e 100644 --- a/api/datadogV1/api_service_level_objective_corrections.go +++ b/api/datadogV1/api_service_level_objective_corrections.go @@ -347,7 +347,7 @@ func (a *ServiceLevelObjectiveCorrectionsApi) ListSLOCorrectionWithPagination(ct resp, _, err := a.ListSLOCorrection(ctx, o...) if err != nil { var returnItem SLOCorrection - items <- datadog.PaginationResult[SLOCorrection]{returnItem, err} + items <- datadog.PaginationResult[SLOCorrection]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -358,7 +358,7 @@ func (a *ServiceLevelObjectiveCorrectionsApi) ListSLOCorrectionWithPagination(ct for _, item := range results { select { - case items <- datadog.PaginationResult[SLOCorrection]{item, nil}: + case items <- datadog.PaginationResult[SLOCorrection]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV1/api_service_level_objectives.go b/api/datadogV1/api_service_level_objectives.go index 13b497f1aab..6fab1ef3589 100644 --- a/api/datadogV1/api_service_level_objectives.go +++ b/api/datadogV1/api_service_level_objectives.go @@ -812,7 +812,7 @@ func (a *ServiceLevelObjectivesApi) ListSLOsWithPagination(ctx _context.Context, resp, _, err := a.ListSLOs(ctx, o...) if err != nil { var returnItem ServiceLevelObjective - items <- datadog.PaginationResult[ServiceLevelObjective]{returnItem, err} + items <- datadog.PaginationResult[ServiceLevelObjective]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -823,7 +823,7 @@ func (a *ServiceLevelObjectivesApi) ListSLOsWithPagination(ctx _context.Context, for _, item := range results { select { - case items <- datadog.PaginationResult[ServiceLevelObjective]{item, nil}: + case items <- datadog.PaginationResult[ServiceLevelObjective]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV1/api_synthetics.go b/api/datadogV1/api_synthetics.go index c371abc2803..1a8ff34e748 100644 --- a/api/datadogV1/api_synthetics.go +++ b/api/datadogV1/api_synthetics.go @@ -1743,7 +1743,7 @@ func (a *SyntheticsApi) ListTestsWithPagination(ctx _context.Context, o ...ListT resp, _, err := a.ListTests(ctx, o...) if err != nil { var returnItem SyntheticsTestDetails - items <- datadog.PaginationResult[SyntheticsTestDetails]{returnItem, err} + items <- datadog.PaginationResult[SyntheticsTestDetails]{Item: returnItem, Error: err} break } respTests, ok := resp.GetTestsOk() @@ -1754,7 +1754,7 @@ func (a *SyntheticsApi) ListTestsWithPagination(ctx _context.Context, o ...ListT for _, item := range results { select { - case items <- datadog.PaginationResult[SyntheticsTestDetails]{item, nil}: + case items <- datadog.PaginationResult[SyntheticsTestDetails]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_audit.go b/api/datadogV2/api_audit.go index 65ac55a1cf1..fcb402229bf 100644 --- a/api/datadogV2/api_audit.go +++ b/api/datadogV2/api_audit.go @@ -187,7 +187,7 @@ func (a *AuditApi) ListAuditLogsWithPagination(ctx _context.Context, o ...ListAu resp, _, err := a.ListAuditLogs(ctx, o...) if err != nil { var returnItem AuditLogsEvent - items <- datadog.PaginationResult[AuditLogsEvent]{returnItem, err} + items <- datadog.PaginationResult[AuditLogsEvent]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -198,7 +198,7 @@ func (a *AuditApi) ListAuditLogsWithPagination(ctx _context.Context, o ...ListAu for _, item := range results { select { - case items <- datadog.PaginationResult[AuditLogsEvent]{item, nil}: + case items <- datadog.PaginationResult[AuditLogsEvent]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -356,7 +356,7 @@ func (a *AuditApi) SearchAuditLogsWithPagination(ctx _context.Context, o ...Sear resp, _, err := a.SearchAuditLogs(ctx, o...) if err != nil { var returnItem AuditLogsEvent - items <- datadog.PaginationResult[AuditLogsEvent]{returnItem, err} + items <- datadog.PaginationResult[AuditLogsEvent]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -367,7 +367,7 @@ func (a *AuditApi) SearchAuditLogsWithPagination(ctx _context.Context, o ...Sear for _, item := range results { select { - case items <- datadog.PaginationResult[AuditLogsEvent]{item, nil}: + case items <- datadog.PaginationResult[AuditLogsEvent]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_ci_visibility_pipelines.go b/api/datadogV2/api_ci_visibility_pipelines.go index 4d86da0acfe..60aac46e424 100644 --- a/api/datadogV2/api_ci_visibility_pipelines.go +++ b/api/datadogV2/api_ci_visibility_pipelines.go @@ -341,7 +341,7 @@ func (a *CIVisibilityPipelinesApi) ListCIAppPipelineEventsWithPagination(ctx _co resp, _, err := a.ListCIAppPipelineEvents(ctx, o...) if err != nil { var returnItem CIAppPipelineEvent - items <- datadog.PaginationResult[CIAppPipelineEvent]{returnItem, err} + items <- datadog.PaginationResult[CIAppPipelineEvent]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -352,7 +352,7 @@ func (a *CIVisibilityPipelinesApi) ListCIAppPipelineEventsWithPagination(ctx _co for _, item := range results { select { - case items <- datadog.PaginationResult[CIAppPipelineEvent]{item, nil}: + case items <- datadog.PaginationResult[CIAppPipelineEvent]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -508,7 +508,7 @@ func (a *CIVisibilityPipelinesApi) SearchCIAppPipelineEventsWithPagination(ctx _ resp, _, err := a.SearchCIAppPipelineEvents(ctx, o...) if err != nil { var returnItem CIAppPipelineEvent - items <- datadog.PaginationResult[CIAppPipelineEvent]{returnItem, err} + items <- datadog.PaginationResult[CIAppPipelineEvent]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -519,7 +519,7 @@ func (a *CIVisibilityPipelinesApi) SearchCIAppPipelineEventsWithPagination(ctx _ for _, item := range results { select { - case items <- datadog.PaginationResult[CIAppPipelineEvent]{item, nil}: + case items <- datadog.PaginationResult[CIAppPipelineEvent]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_ci_visibility_tests.go b/api/datadogV2/api_ci_visibility_tests.go index beb13ad0897..b018bbaf171 100644 --- a/api/datadogV2/api_ci_visibility_tests.go +++ b/api/datadogV2/api_ci_visibility_tests.go @@ -258,7 +258,7 @@ func (a *CIVisibilityTestsApi) ListCIAppTestEventsWithPagination(ctx _context.Co resp, _, err := a.ListCIAppTestEvents(ctx, o...) if err != nil { var returnItem CIAppTestEvent - items <- datadog.PaginationResult[CIAppTestEvent]{returnItem, err} + items <- datadog.PaginationResult[CIAppTestEvent]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -269,7 +269,7 @@ func (a *CIVisibilityTestsApi) ListCIAppTestEventsWithPagination(ctx _context.Co for _, item := range results { select { - case items <- datadog.PaginationResult[CIAppTestEvent]{item, nil}: + case items <- datadog.PaginationResult[CIAppTestEvent]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -425,7 +425,7 @@ func (a *CIVisibilityTestsApi) SearchCIAppTestEventsWithPagination(ctx _context. resp, _, err := a.SearchCIAppTestEvents(ctx, o...) if err != nil { var returnItem CIAppTestEvent - items <- datadog.PaginationResult[CIAppTestEvent]{returnItem, err} + items <- datadog.PaginationResult[CIAppTestEvent]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -436,7 +436,7 @@ func (a *CIVisibilityTestsApi) SearchCIAppTestEventsWithPagination(ctx _context. for _, item := range results { select { - case items <- datadog.PaginationResult[CIAppTestEvent]{item, nil}: + case items <- datadog.PaginationResult[CIAppTestEvent]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_container_images.go b/api/datadogV2/api_container_images.go index 66aad0a991d..78a82f4e235 100644 --- a/api/datadogV2/api_container_images.go +++ b/api/datadogV2/api_container_images.go @@ -180,7 +180,7 @@ func (a *ContainerImagesApi) ListContainerImagesWithPagination(ctx _context.Cont resp, _, err := a.ListContainerImages(ctx, o...) if err != nil { var returnItem ContainerImageItem - items <- datadog.PaginationResult[ContainerImageItem]{returnItem, err} + items <- datadog.PaginationResult[ContainerImageItem]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -191,7 +191,7 @@ func (a *ContainerImagesApi) ListContainerImagesWithPagination(ctx _context.Cont for _, item := range results { select { - case items <- datadog.PaginationResult[ContainerImageItem]{item, nil}: + case items <- datadog.PaginationResult[ContainerImageItem]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_containers.go b/api/datadogV2/api_containers.go index 969606e0a3e..b14b8e18b10 100644 --- a/api/datadogV2/api_containers.go +++ b/api/datadogV2/api_containers.go @@ -180,7 +180,7 @@ func (a *ContainersApi) ListContainersWithPagination(ctx _context.Context, o ... resp, _, err := a.ListContainers(ctx, o...) if err != nil { var returnItem ContainerItem - items <- datadog.PaginationResult[ContainerItem]{returnItem, err} + items <- datadog.PaginationResult[ContainerItem]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -191,7 +191,7 @@ func (a *ContainersApi) ListContainersWithPagination(ctx _context.Context, o ... for _, item := range results { select { - case items <- datadog.PaginationResult[ContainerItem]{item, nil}: + case items <- datadog.PaginationResult[ContainerItem]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_downtimes.go b/api/datadogV2/api_downtimes.go index 42d16d87910..d7a2383104b 100644 --- a/api/datadogV2/api_downtimes.go +++ b/api/datadogV2/api_downtimes.go @@ -395,7 +395,7 @@ func (a *DowntimesApi) ListDowntimesWithPagination(ctx _context.Context, o ...Li resp, _, err := a.ListDowntimes(ctx, o...) if err != nil { var returnItem DowntimeResponseData - items <- datadog.PaginationResult[DowntimeResponseData]{returnItem, err} + items <- datadog.PaginationResult[DowntimeResponseData]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -406,7 +406,7 @@ func (a *DowntimesApi) ListDowntimesWithPagination(ctx _context.Context, o ...Li for _, item := range results { select { - case items <- datadog.PaginationResult[DowntimeResponseData]{item, nil}: + case items <- datadog.PaginationResult[DowntimeResponseData]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_events.go b/api/datadogV2/api_events.go index e88433cfab6..9374e394e84 100644 --- a/api/datadogV2/api_events.go +++ b/api/datadogV2/api_events.go @@ -193,7 +193,7 @@ func (a *EventsApi) ListEventsWithPagination(ctx _context.Context, o ...ListEven resp, _, err := a.ListEvents(ctx, o...) if err != nil { var returnItem EventResponse - items <- datadog.PaginationResult[EventResponse]{returnItem, err} + items <- datadog.PaginationResult[EventResponse]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -204,7 +204,7 @@ func (a *EventsApi) ListEventsWithPagination(ctx _context.Context, o ...ListEven for _, item := range results { select { - case items <- datadog.PaginationResult[EventResponse]{item, nil}: + case items <- datadog.PaginationResult[EventResponse]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -367,7 +367,7 @@ func (a *EventsApi) SearchEventsWithPagination(ctx _context.Context, o ...Search resp, _, err := a.SearchEvents(ctx, o...) if err != nil { var returnItem EventResponse - items <- datadog.PaginationResult[EventResponse]{returnItem, err} + items <- datadog.PaginationResult[EventResponse]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -378,7 +378,7 @@ func (a *EventsApi) SearchEventsWithPagination(ctx _context.Context, o ...Search for _, item := range results { select { - case items <- datadog.PaginationResult[EventResponse]{item, nil}: + case items <- datadog.PaginationResult[EventResponse]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_incidents.go b/api/datadogV2/api_incidents.go index cf401f10717..f920f9aa437 100644 --- a/api/datadogV2/api_incidents.go +++ b/api/datadogV2/api_incidents.go @@ -1145,7 +1145,7 @@ func (a *IncidentsApi) ListIncidentsWithPagination(ctx _context.Context, o ...Li resp, _, err := a.ListIncidents(ctx, o...) if err != nil { var returnItem IncidentResponseData - items <- datadog.PaginationResult[IncidentResponseData]{returnItem, err} + items <- datadog.PaginationResult[IncidentResponseData]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -1156,7 +1156,7 @@ func (a *IncidentsApi) ListIncidentsWithPagination(ctx _context.Context, o ...Li for _, item := range results { select { - case items <- datadog.PaginationResult[IncidentResponseData]{item, nil}: + case items <- datadog.PaginationResult[IncidentResponseData]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -1331,7 +1331,7 @@ func (a *IncidentsApi) SearchIncidentsWithPagination(ctx _context.Context, query resp, _, err := a.SearchIncidents(ctx, query, o...) if err != nil { var returnItem IncidentSearchResponseIncidentsData - items <- datadog.PaginationResult[IncidentSearchResponseIncidentsData]{returnItem, err} + items <- datadog.PaginationResult[IncidentSearchResponseIncidentsData]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -1350,7 +1350,7 @@ func (a *IncidentsApi) SearchIncidentsWithPagination(ctx _context.Context, query for _, item := range results { select { - case items <- datadog.PaginationResult[IncidentSearchResponseIncidentsData]{item, nil}: + case items <- datadog.PaginationResult[IncidentSearchResponseIncidentsData]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_logs.go b/api/datadogV2/api_logs.go index 6945fd97918..c89671634f9 100644 --- a/api/datadogV2/api_logs.go +++ b/api/datadogV2/api_logs.go @@ -223,7 +223,7 @@ func (a *LogsApi) ListLogsWithPagination(ctx _context.Context, o ...ListLogsOpti resp, _, err := a.ListLogs(ctx, o...) if err != nil { var returnItem Log - items <- datadog.PaginationResult[Log]{returnItem, err} + items <- datadog.PaginationResult[Log]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -234,7 +234,7 @@ func (a *LogsApi) ListLogsWithPagination(ctx _context.Context, o ...ListLogsOpti for _, item := range results { select { - case items <- datadog.PaginationResult[Log]{item, nil}: + case items <- datadog.PaginationResult[Log]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -459,7 +459,7 @@ func (a *LogsApi) ListLogsGetWithPagination(ctx _context.Context, o ...ListLogsG resp, _, err := a.ListLogsGet(ctx, o...) if err != nil { var returnItem Log - items <- datadog.PaginationResult[Log]{returnItem, err} + items <- datadog.PaginationResult[Log]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -470,7 +470,7 @@ func (a *LogsApi) ListLogsGetWithPagination(ctx _context.Context, o ...ListLogsG for _, item := range results { select { - case items <- datadog.PaginationResult[Log]{item, nil}: + case items <- datadog.PaginationResult[Log]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_powerpack.go b/api/datadogV2/api_powerpack.go index d9ca4c8d587..f2bbd7a6a8e 100644 --- a/api/datadogV2/api_powerpack.go +++ b/api/datadogV2/api_powerpack.go @@ -347,7 +347,7 @@ func (a *PowerpackApi) ListPowerpacksWithPagination(ctx _context.Context, o ...L resp, _, err := a.ListPowerpacks(ctx, o...) if err != nil { var returnItem PowerpackData - items <- datadog.PaginationResult[PowerpackData]{returnItem, err} + items <- datadog.PaginationResult[PowerpackData]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -358,7 +358,7 @@ func (a *PowerpackApi) ListPowerpacksWithPagination(ctx _context.Context, o ...L for _, item := range results { select { - case items <- datadog.PaginationResult[PowerpackData]{item, nil}: + case items <- datadog.PaginationResult[PowerpackData]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_processes.go b/api/datadogV2/api_processes.go index 9a1b73053d1..d35dd899d5e 100644 --- a/api/datadogV2/api_processes.go +++ b/api/datadogV2/api_processes.go @@ -181,7 +181,7 @@ func (a *ProcessesApi) ListProcessesWithPagination(ctx _context.Context, o ...Li resp, _, err := a.ListProcesses(ctx, o...) if err != nil { var returnItem ProcessSummary - items <- datadog.PaginationResult[ProcessSummary]{returnItem, err} + items <- datadog.PaginationResult[ProcessSummary]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -192,7 +192,7 @@ func (a *ProcessesApi) ListProcessesWithPagination(ctx _context.Context, o ...Li for _, item := range results { select { - case items <- datadog.PaginationResult[ProcessSummary]{item, nil}: + case items <- datadog.PaginationResult[ProcessSummary]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_rum.go b/api/datadogV2/api_rum.go index be974261d00..a2d89bcaba6 100644 --- a/api/datadogV2/api_rum.go +++ b/api/datadogV2/api_rum.go @@ -536,7 +536,7 @@ func (a *RUMApi) ListRUMEventsWithPagination(ctx _context.Context, o ...ListRUME resp, _, err := a.ListRUMEvents(ctx, o...) if err != nil { var returnItem RUMEvent - items <- datadog.PaginationResult[RUMEvent]{returnItem, err} + items <- datadog.PaginationResult[RUMEvent]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -547,7 +547,7 @@ func (a *RUMApi) ListRUMEventsWithPagination(ctx _context.Context, o ...ListRUME for _, item := range results { select { - case items <- datadog.PaginationResult[RUMEvent]{item, nil}: + case items <- datadog.PaginationResult[RUMEvent]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -674,7 +674,7 @@ func (a *RUMApi) SearchRUMEventsWithPagination(ctx _context.Context, body RUMSea resp, _, err := a.SearchRUMEvents(ctx, body) if err != nil { var returnItem RUMEvent - items <- datadog.PaginationResult[RUMEvent]{returnItem, err} + items <- datadog.PaginationResult[RUMEvent]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -685,7 +685,7 @@ func (a *RUMApi) SearchRUMEventsWithPagination(ctx _context.Context, body RUMSea for _, item := range results { select { - case items <- datadog.PaginationResult[RUMEvent]{item, nil}: + case items <- datadog.PaginationResult[RUMEvent]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_security_monitoring.go b/api/datadogV2/api_security_monitoring.go index 675d7ca3404..f683de2db41 100644 --- a/api/datadogV2/api_security_monitoring.go +++ b/api/datadogV2/api_security_monitoring.go @@ -1096,7 +1096,7 @@ func (a *SecurityMonitoringApi) ListFindingsWithPagination(ctx _context.Context, resp, _, err := a.ListFindings(ctx, o...) if err != nil { var returnItem Finding - items <- datadog.PaginationResult[Finding]{returnItem, err} + items <- datadog.PaginationResult[Finding]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -1107,7 +1107,7 @@ func (a *SecurityMonitoringApi) ListFindingsWithPagination(ctx _context.Context, for _, item := range results { select { - case items <- datadog.PaginationResult[Finding]{item, nil}: + case items <- datadog.PaginationResult[Finding]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -1482,7 +1482,7 @@ func (a *SecurityMonitoringApi) ListSecurityMonitoringSignalsWithPagination(ctx resp, _, err := a.ListSecurityMonitoringSignals(ctx, o...) if err != nil { var returnItem SecurityMonitoringSignal - items <- datadog.PaginationResult[SecurityMonitoringSignal]{returnItem, err} + items <- datadog.PaginationResult[SecurityMonitoringSignal]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -1493,7 +1493,7 @@ func (a *SecurityMonitoringApi) ListSecurityMonitoringSignalsWithPagination(ctx for _, item := range results { select { - case items <- datadog.PaginationResult[SecurityMonitoringSignal]{item, nil}: + case items <- datadog.PaginationResult[SecurityMonitoringSignal]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -1728,7 +1728,7 @@ func (a *SecurityMonitoringApi) SearchSecurityMonitoringSignalsWithPagination(ct resp, _, err := a.SearchSecurityMonitoringSignals(ctx, o...) if err != nil { var returnItem SecurityMonitoringSignal - items <- datadog.PaginationResult[SecurityMonitoringSignal]{returnItem, err} + items <- datadog.PaginationResult[SecurityMonitoringSignal]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -1739,7 +1739,7 @@ func (a *SecurityMonitoringApi) SearchSecurityMonitoringSignalsWithPagination(ct for _, item := range results { select { - case items <- datadog.PaginationResult[SecurityMonitoringSignal]{item, nil}: + case items <- datadog.PaginationResult[SecurityMonitoringSignal]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_service_definition.go b/api/datadogV2/api_service_definition.go index 04361a3ae43..c293417afca 100644 --- a/api/datadogV2/api_service_definition.go +++ b/api/datadogV2/api_service_definition.go @@ -385,7 +385,7 @@ func (a *ServiceDefinitionApi) ListServiceDefinitionsWithPagination(ctx _context resp, _, err := a.ListServiceDefinitions(ctx, o...) if err != nil { var returnItem ServiceDefinitionData - items <- datadog.PaginationResult[ServiceDefinitionData]{returnItem, err} + items <- datadog.PaginationResult[ServiceDefinitionData]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -396,7 +396,7 @@ func (a *ServiceDefinitionApi) ListServiceDefinitionsWithPagination(ctx _context for _, item := range results { select { - case items <- datadog.PaginationResult[ServiceDefinitionData]{item, nil}: + case items <- datadog.PaginationResult[ServiceDefinitionData]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_spans.go b/api/datadogV2/api_spans.go index 4e2c684d970..fac73350d9e 100644 --- a/api/datadogV2/api_spans.go +++ b/api/datadogV2/api_spans.go @@ -194,7 +194,7 @@ func (a *SpansApi) ListSpansWithPagination(ctx _context.Context, body SpansListR resp, _, err := a.ListSpans(ctx, body) if err != nil { var returnItem Span - items <- datadog.PaginationResult[Span]{returnItem, err} + items <- datadog.PaginationResult[Span]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -205,7 +205,7 @@ func (a *SpansApi) ListSpansWithPagination(ctx _context.Context, body SpansListR for _, item := range results { select { - case items <- datadog.PaginationResult[Span]{item, nil}: + case items <- datadog.PaginationResult[Span]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return @@ -406,7 +406,7 @@ func (a *SpansApi) ListSpansGetWithPagination(ctx _context.Context, o ...ListSpa resp, _, err := a.ListSpansGet(ctx, o...) if err != nil { var returnItem Span - items <- datadog.PaginationResult[Span]{returnItem, err} + items <- datadog.PaginationResult[Span]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -417,7 +417,7 @@ func (a *SpansApi) ListSpansGetWithPagination(ctx _context.Context, o ...ListSpa for _, item := range results { select { - case items <- datadog.PaginationResult[Span]{item, nil}: + case items <- datadog.PaginationResult[Span]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_teams.go b/api/datadogV2/api_teams.go index 78136878ee7..eb4f3941360 100644 --- a/api/datadogV2/api_teams.go +++ b/api/datadogV2/api_teams.go @@ -1096,7 +1096,7 @@ func (a *TeamsApi) ListTeamsWithPagination(ctx _context.Context, o ...ListTeamsO resp, _, err := a.ListTeams(ctx, o...) if err != nil { var returnItem Team - items <- datadog.PaginationResult[Team]{returnItem, err} + items <- datadog.PaginationResult[Team]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -1107,7 +1107,7 @@ func (a *TeamsApi) ListTeamsWithPagination(ctx _context.Context, o ...ListTeamsO for _, item := range results { select { - case items <- datadog.PaginationResult[Team]{item, nil}: + case items <- datadog.PaginationResult[Team]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return diff --git a/api/datadogV2/api_users.go b/api/datadogV2/api_users.go index cd0f07e5fc8..a476f83ea84 100644 --- a/api/datadogV2/api_users.go +++ b/api/datadogV2/api_users.go @@ -606,7 +606,7 @@ func (a *UsersApi) ListUsersWithPagination(ctx _context.Context, o ...ListUsersO resp, _, err := a.ListUsers(ctx, o...) if err != nil { var returnItem User - items <- datadog.PaginationResult[User]{returnItem, err} + items <- datadog.PaginationResult[User]{Item: returnItem, Error: err} break } respData, ok := resp.GetDataOk() @@ -617,7 +617,7 @@ func (a *UsersApi) ListUsersWithPagination(ctx _context.Context, o ...ListUsersO for _, item := range results { select { - case items <- datadog.PaginationResult[User]{item, nil}: + case items <- datadog.PaginationResult[User]{Item: item, Error: nil}: case <-ctx.Done(): close(items) return