Skip to content

Commit 427fa59

Browse files
author
ci.datadog-api-spec
committed
pre-commit fixes
1 parent 21f6445 commit 427fa59

File tree

3,386 files changed

+59185
-34332
lines changed

Some content is hidden

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

3,386 files changed

+59185
-34332
lines changed

api/datadog/client.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
// This product includes software developed at Datadog (https://www.datadoghq.com/).
33
// Copyright 2019-Present Datadog, Inc.
44

5+
56
package datadog
67

78
import (
89
"bytes"
9-
"compress/gzip"
10-
"compress/zlib"
1110
"context"
11+
"compress/zlib"
12+
"compress/gzip"
1213
"encoding/xml"
1314
"errors"
1415
"fmt"
@@ -26,6 +27,7 @@ import (
2627
"strconv"
2728
"strings"
2829
"time"
30+
"unicode/utf8"
2931

3032
"golang.org/x/oauth2"
3133
)
@@ -39,14 +41,14 @@ var (
3941
// APIClient manages communication with the Datadog API V2 Collection API v1.0.
4042
// In most cases there should be only one, shared, APIClient.
4143
type APIClient struct {
42-
Cfg *Configuration
44+
Cfg *Configuration
4345
}
4446

4547
// FormFile holds parameters for a file in multipart/form-data request.
4648
type FormFile struct {
4749
FormFileName string
48-
FileName string
49-
FileBytes []byte
50+
FileName string
51+
FileBytes []byte
5052
}
5153

5254
// Service holds APIClient
@@ -180,7 +182,7 @@ func (c *APIClient) CallAPI(request *http.Request) (*http.Response, error) {
180182
}
181183
}
182184

183-
// Determine if a request should be retried
185+
// Determine if a request should be retried
184186
func (c *APIClient) shouldRetryRequest(response *http.Response, retryCount int) (*time.Duration, bool) {
185187
enableRetry := c.Cfg.RetryConfiguration.EnableRetry
186188
maxRetries := c.Cfg.RetryConfiguration.MaxRetries
@@ -517,9 +519,9 @@ func detectContentType(body interface{}) string {
517519

518520
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
519521
type GenericOpenAPIError struct {
520-
ErrorBody []byte
522+
ErrorBody []byte
521523
ErrorMessage string
522-
ErrorModel interface{}
524+
ErrorModel interface{}
523525
}
524526

525527
// Error returns non-empty string if there was an error.

api/datadog/configuration.go

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// This product includes software developed at Datadog (https://www.datadoghq.com/).
33
// Copyright 2019-Present Datadog, Inc.
44

5+
56
package datadog
67

78
import (
@@ -108,23 +109,22 @@ type RetryConfiguration struct {
108109
HTTPRetryTimeout time.Duration
109110
MaxRetries int
110111
}
111-
112112
// NewConfiguration returns a new Configuration object.
113113
func NewConfiguration() *Configuration {
114114
cfg := &Configuration{
115115
DefaultHeader: make(map[string]string),
116116
UserAgent: getUserAgent(),
117117
Debug: false,
118118
Compress: true,
119-
Servers: ServerConfigurations{
119+
Servers: ServerConfigurations{
120120
{
121121
URL: "https://{subdomain}.{site}",
122122
Description: "No description provided",
123-
Variables: map[string]ServerVariable{
123+
Variables: map[string]ServerVariable{
124124
"site": {
125125
Description: "The regional site for Datadog customers.",
126126
DefaultValue: "datadoghq.com",
127-
EnumValues: []string{
127+
EnumValues: []string{
128128
"datadoghq.com",
129129
"us3.datadoghq.com",
130130
"us5.datadoghq.com",
@@ -142,7 +142,7 @@ func NewConfiguration() *Configuration {
142142
{
143143
URL: "{protocol}://{name}",
144144
Description: "No description provided",
145-
Variables: map[string]ServerVariable{
145+
Variables: map[string]ServerVariable{
146146
"name": {
147147
Description: "Full site DNS name.",
148148
DefaultValue: "api.datadoghq.com",
@@ -156,7 +156,7 @@ func NewConfiguration() *Configuration {
156156
{
157157
URL: "https://{subdomain}.{site}",
158158
Description: "No description provided",
159-
Variables: map[string]ServerVariable{
159+
Variables: map[string]ServerVariable{
160160
"site": {
161161
Description: "Any Datadog deployment.",
162162
DefaultValue: "datadoghq.com",
@@ -173,11 +173,11 @@ func NewConfiguration() *Configuration {
173173
{
174174
URL: "https://{subdomain}.{site}",
175175
Description: "No description provided",
176-
Variables: map[string]ServerVariable{
176+
Variables: map[string]ServerVariable{
177177
"site": {
178178
Description: "The regional site for Datadog customers.",
179179
DefaultValue: "datadoghq.com",
180-
EnumValues: []string{
180+
EnumValues: []string{
181181
"datadoghq.com",
182182
"us3.datadoghq.com",
183183
"us5.datadoghq.com",
@@ -195,7 +195,7 @@ func NewConfiguration() *Configuration {
195195
{
196196
URL: "{protocol}://{name}",
197197
Description: "No description provided",
198-
Variables: map[string]ServerVariable{
198+
Variables: map[string]ServerVariable{
199199
"name": {
200200
Description: "Full site DNS name.",
201201
DefaultValue: "ip-ranges.datadoghq.com",
@@ -209,7 +209,7 @@ func NewConfiguration() *Configuration {
209209
{
210210
URL: "https://{subdomain}.datadoghq.com",
211211
Description: "No description provided",
212-
Variables: map[string]ServerVariable{
212+
Variables: map[string]ServerVariable{
213213
"subdomain": {
214214
Description: "The subdomain where the API is deployed.",
215215
DefaultValue: "ip-ranges",
@@ -221,11 +221,11 @@ func NewConfiguration() *Configuration {
221221
{
222222
URL: "https://{subdomain}.{site}",
223223
Description: "No description provided",
224-
Variables: map[string]ServerVariable{
224+
Variables: map[string]ServerVariable{
225225
"site": {
226226
Description: "The regional site for Datadog customers.",
227227
DefaultValue: "datadoghq.com",
228-
EnumValues: []string{
228+
EnumValues: []string{
229229
"datadoghq.com",
230230
"us3.datadoghq.com",
231231
"us5.datadoghq.com",
@@ -243,7 +243,7 @@ func NewConfiguration() *Configuration {
243243
{
244244
URL: "{protocol}://{name}",
245245
Description: "No description provided",
246-
Variables: map[string]ServerVariable{
246+
Variables: map[string]ServerVariable{
247247
"name": {
248248
Description: "Full site DNS name.",
249249
DefaultValue: "http-intake.logs.datadoghq.com",
@@ -257,7 +257,7 @@ func NewConfiguration() *Configuration {
257257
{
258258
URL: "https://{subdomain}.{site}",
259259
Description: "No description provided",
260-
Variables: map[string]ServerVariable{
260+
Variables: map[string]ServerVariable{
261261
"site": {
262262
Description: "Any Datadog deployment.",
263263
DefaultValue: "datadoghq.com",
@@ -273,11 +273,11 @@ func NewConfiguration() *Configuration {
273273
{
274274
URL: "https://{subdomain}.{site}",
275275
Description: "No description provided",
276-
Variables: map[string]ServerVariable{
276+
Variables: map[string]ServerVariable{
277277
"site": {
278278
Description: "The regional site for customers.",
279279
DefaultValue: "datadoghq.com",
280-
EnumValues: []string{
280+
EnumValues: []string{
281281
"datadoghq.com",
282282
"us3.datadoghq.com",
283283
"us5.datadoghq.com",
@@ -295,7 +295,7 @@ func NewConfiguration() *Configuration {
295295
{
296296
URL: "{protocol}://{name}",
297297
Description: "No description provided",
298-
Variables: map[string]ServerVariable{
298+
Variables: map[string]ServerVariable{
299299
"name": {
300300
Description: "Full site DNS name.",
301301
DefaultValue: "http-intake.logs.datadoghq.com",
@@ -309,7 +309,7 @@ func NewConfiguration() *Configuration {
309309
{
310310
URL: "https://{subdomain}.{site}",
311311
Description: "No description provided",
312-
Variables: map[string]ServerVariable{
312+
Variables: map[string]ServerVariable{
313313
"site": {
314314
Description: "Any Datadog deployment.",
315315
DefaultValue: "datadoghq.com",
@@ -323,57 +323,57 @@ func NewConfiguration() *Configuration {
323323
},
324324
},
325325
unstableOperations: map[string]bool{
326-
"v2.CreateOpenAPI": false,
327-
"v2.DeleteOpenAPI": false,
328-
"v2.GetOpenAPI": false,
329-
"v2.ListAPIs": false,
330-
"v2.UpdateOpenAPI": false,
331-
"v2.GetActiveBillingDimensions": false,
332-
"v2.GetMonthlyCostAttribution": false,
333-
"v2.CreateDORADeployment": false,
334-
"v2.CreateDORAIncident": false,
335-
"v2.CreateIncident": false,
336-
"v2.CreateIncidentIntegration": false,
337-
"v2.CreateIncidentTodo": false,
338-
"v2.DeleteIncident": false,
339-
"v2.DeleteIncidentIntegration": false,
340-
"v2.DeleteIncidentTodo": false,
341-
"v2.GetIncident": false,
342-
"v2.GetIncidentIntegration": false,
343-
"v2.GetIncidentTodo": false,
344-
"v2.ListIncidentAttachments": false,
345-
"v2.ListIncidentIntegrations": false,
346-
"v2.ListIncidents": false,
347-
"v2.ListIncidentTodos": false,
348-
"v2.SearchIncidents": false,
349-
"v2.UpdateIncident": false,
350-
"v2.UpdateIncidentAttachments": false,
351-
"v2.UpdateIncidentIntegration": false,
352-
"v2.UpdateIncidentTodo": false,
353-
"v2.QueryScalarData": false,
354-
"v2.QueryTimeseriesData": false,
355-
"v2.GetFinding": false,
356-
"v2.ListFindings": false,
357-
"v2.MuteFindings": false,
326+
"v2.CreateOpenAPI": false,
327+
"v2.DeleteOpenAPI": false,
328+
"v2.GetOpenAPI": false,
329+
"v2.ListAPIs": false,
330+
"v2.UpdateOpenAPI": false,
331+
"v2.GetActiveBillingDimensions": false,
332+
"v2.GetMonthlyCostAttribution": false,
333+
"v2.CreateDORADeployment": false,
334+
"v2.CreateDORAIncident": false,
335+
"v2.CreateIncident": false,
336+
"v2.CreateIncidentIntegration": false,
337+
"v2.CreateIncidentTodo": false,
338+
"v2.DeleteIncident": false,
339+
"v2.DeleteIncidentIntegration": false,
340+
"v2.DeleteIncidentTodo": false,
341+
"v2.GetIncident": false,
342+
"v2.GetIncidentIntegration": false,
343+
"v2.GetIncidentTodo": false,
344+
"v2.ListIncidentAttachments": false,
345+
"v2.ListIncidentIntegrations": false,
346+
"v2.ListIncidents": false,
347+
"v2.ListIncidentTodos": false,
348+
"v2.SearchIncidents": false,
349+
"v2.UpdateIncident": false,
350+
"v2.UpdateIncidentAttachments": false,
351+
"v2.UpdateIncidentIntegration": false,
352+
"v2.UpdateIncidentTodo": false,
353+
"v2.QueryScalarData": false,
354+
"v2.QueryTimeseriesData": false,
355+
"v2.GetFinding": false,
356+
"v2.ListFindings": false,
357+
"v2.MuteFindings": false,
358358
"v2.CreateScorecardOutcomesBatch": false,
359-
"v2.CreateScorecardRule": false,
360-
"v2.DeleteScorecardRule": false,
361-
"v2.ListScorecardOutcomes": false,
362-
"v2.ListScorecardRules": false,
363-
"v2.UpdateScorecardRule": false,
364-
"v2.CreateIncidentService": false,
365-
"v2.DeleteIncidentService": false,
366-
"v2.GetIncidentService": false,
367-
"v2.ListIncidentServices": false,
368-
"v2.UpdateIncidentService": false,
369-
"v2.CreateSLOReportJob": false,
370-
"v2.GetSLOReport": false,
371-
"v2.GetSLOReportJobStatus": false,
372-
"v2.CreateIncidentTeam": false,
373-
"v2.DeleteIncidentTeam": false,
374-
"v2.GetIncidentTeam": false,
375-
"v2.ListIncidentTeams": false,
376-
"v2.UpdateIncidentTeam": false,
359+
"v2.CreateScorecardRule": false,
360+
"v2.DeleteScorecardRule": false,
361+
"v2.ListScorecardOutcomes": false,
362+
"v2.ListScorecardRules": false,
363+
"v2.UpdateScorecardRule": false,
364+
"v2.CreateIncidentService": false,
365+
"v2.DeleteIncidentService": false,
366+
"v2.GetIncidentService": false,
367+
"v2.ListIncidentServices": false,
368+
"v2.UpdateIncidentService": false,
369+
"v2.CreateSLOReportJob": false,
370+
"v2.GetSLOReport": false,
371+
"v2.GetSLOReportJobStatus": false,
372+
"v2.CreateIncidentTeam": false,
373+
"v2.DeleteIncidentTeam": false,
374+
"v2.GetIncidentTeam": false,
375+
"v2.ListIncidentTeams": false,
376+
"v2.UpdateIncidentTeam": false,
377377
},
378378
RetryConfiguration: RetryConfiguration{
379379
EnableRetry: false,

api/datadog/encoding_json.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// This product includes software developed at Datadog (https://www.datadoghq.com/).
33
// Copyright 2019-Present Datadog, Inc.
44

5+
56
//go:build !goccy_gojson
67

78
package datadog
@@ -25,4 +26,4 @@ func NewEncoder(w io.Writer) *json.Encoder {
2526

2627
func NewDecoder(r io.Reader) *json.Decoder {
2728
return json.NewDecoder(r)
28-
}
29+
}

api/datadog/goccy_gojson.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// This product includes software developed at Datadog (https://www.datadoghq.com/).
33
// Copyright 2019-Present Datadog, Inc.
44

5+
56
//go:build goccy_gojson
67

78
package datadog
@@ -26,4 +27,4 @@ func NewEncoder(w io.Writer) *json.Encoder {
2627

2728
func NewDecoder(r io.Reader) *json.Decoder {
2829
return json.NewDecoder(r)
29-
}
30+
}

api/datadog/no_zstd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// This product includes software developed at Datadog (https://www.datadoghq.com/).
33
// Copyright 2019-Present Datadog, Inc.
44

5-
//go:build !cgo
65

6+
//go:build !cgo
77
package datadog
88

99
import (

api/datadog/utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// This product includes software developed at Datadog (https://www.datadoghq.com/).
33
// Copyright 2019-Present Datadog, Inc.
44

5+
56
package datadog
67

78
import (
@@ -11,7 +12,6 @@ import (
1112
"reflect"
1213
"strings"
1314
"time"
14-
"unicode/utf8"
1515
)
1616

1717
// PtrBool is a helper routine that returns a pointer to given boolean value.
@@ -40,7 +40,7 @@ func PtrTime(v time.Time) *time.Time { return &v }
4040

4141
// PaginationResult pagination item helper struct
4242
type PaginationResult[T any] struct {
43-
Item T
43+
Item T
4444
Error error
4545
}
4646

@@ -510,4 +510,4 @@ func copyRequest(r *http.Request, rawBody *[]byte) *http.Request {
510510
}
511511
newRequest.Body = io.NopCloser(bytes.NewBuffer(*rawBody))
512512
return &newRequest
513-
}
513+
}

0 commit comments

Comments
 (0)