@@ -179,6 +179,106 @@ func (s *ServicesService) DeleteCustomIssueTrackerService(pid interface{}, optio
179
179
return s .client .Do (req , nil )
180
180
}
181
181
182
+ // DataDogService represents DataDog service settings.
183
+ //
184
+ // GitLab API docs:
185
+ // https://docs.gitlab.com/ee/api/services.html#datadog
186
+ type DataDogService struct {
187
+ Service
188
+ Properties * DataDogServiceProperties `json:"properties"`
189
+ }
190
+
191
+ // DataDogServiceProperties represents DataDog specific properties.
192
+ //
193
+ // GitLab API docs:
194
+ // https://docs.gitlab.com/ee/api/services.html#datadog
195
+ type DataDogServiceProperties struct {
196
+ APIURL string `url:"api_url,omitempty" json:"api_url,omitempty"`
197
+ ArchiveTraceEvents bool `url:"archive_trace_events,omitempty" json:"archive_trace_events,omitempty"`
198
+ DataDogEnv string `url:"datadog_env,omitempty" json:"datadog_env,omitempty"`
199
+ DataDogService string `url:"datadog_service,omitempty" json:"datadog_service,omitempty"`
200
+ DataDogSite string `url:"datadog_site,omitempty" json:"datadog_site,omitempty"`
201
+ DataDogTags string `url:"datadog_tags,omitempty" json:"datadog_tags,omitempty"`
202
+ }
203
+
204
+ // GetDataDogService gets DataDog service settings for a project.
205
+ //
206
+ // GitLab API docs:
207
+ // https://docs.gitlab.com/ee/api/services.html#get-datadog-integration-settings
208
+ func (s * ServicesService ) GetDataDogService (pid interface {}, options ... RequestOptionFunc ) (* DataDogService , * Response , error ) {
209
+ project , err := parseID (pid )
210
+ if err != nil {
211
+ return nil , nil , err
212
+ }
213
+ u := fmt .Sprintf ("projects/%s/services/datadog" , PathEscape (project ))
214
+
215
+ req , err := s .client .NewRequest (http .MethodGet , u , nil , options )
216
+ if err != nil {
217
+ return nil , nil , err
218
+ }
219
+
220
+ svc := new (DataDogService )
221
+ resp , err := s .client .Do (req , svc )
222
+ if err != nil {
223
+ return nil , resp , err
224
+ }
225
+
226
+ return svc , resp , nil
227
+ }
228
+
229
+ // SetDataDogServiceOptions represents the available SetDataDogService()
230
+ // options.
231
+ //
232
+ // GitLab API docs:
233
+ // https://docs.gitlab.com/ee/api/services.html#createedit-datadog-integration
234
+ type SetDataDogServiceOptions struct {
235
+ APIKey * string `url:"api_key,omitempty" json:"api_key,omitempty"`
236
+ APIURL * string `url:"api_url,omitempty" json:"api_url,omitempty"`
237
+ ArchiveTraceEvents * bool `url:"archive_trace_events,omitempty" json:"archive_trace_events,omitempty"`
238
+ DataDogEnv * string `url:"datadog_env,omitempty" json:"datadog_env,omitempty"`
239
+ DataDogService * string `url:"datadog_service,omitempty" json:"datadog_service,omitempty"`
240
+ DataDogSite * string `url:"datadog_site,omitempty" json:"datadog_site,omitempty"`
241
+ DataDogTags * string `url:"datadog_tags,omitempty" json:"datadog_tags,omitempty"`
242
+ }
243
+
244
+ // SetDataDogService sets DataDog service settings for a project.
245
+ //
246
+ // GitLab API docs:
247
+ // https://docs.gitlab.com/ee/api/services.html#createedit-datadog-integration
248
+ func (s * ServicesService ) SetDataDogService (pid interface {}, opt * SetDataDogServiceOptions , options ... RequestOptionFunc ) (* Response , error ) {
249
+ project , err := parseID (pid )
250
+ if err != nil {
251
+ return nil , err
252
+ }
253
+ u := fmt .Sprintf ("projects/%s/services/datadog" , PathEscape (project ))
254
+
255
+ req , err := s .client .NewRequest (http .MethodPut , u , opt , options )
256
+ if err != nil {
257
+ return nil , err
258
+ }
259
+
260
+ return s .client .Do (req , nil )
261
+ }
262
+
263
+ // DeleteDataDogService deletes the DataDog service settings for a project.
264
+ //
265
+ // GitLab API docs:
266
+ // https://docs.gitlab.com/ee/api/services.html#disable-datadog-integration
267
+ func (s * ServicesService ) DeleteDataDogService (pid interface {}, options ... RequestOptionFunc ) (* Response , error ) {
268
+ project , err := parseID (pid )
269
+ if err != nil {
270
+ return nil , err
271
+ }
272
+ u := fmt .Sprintf ("projects/%s/services/datadog" , PathEscape (project ))
273
+
274
+ req , err := s .client .NewRequest (http .MethodDelete , u , nil , options )
275
+ if err != nil {
276
+ return nil , err
277
+ }
278
+
279
+ return s .client .Do (req , nil )
280
+ }
281
+
182
282
// DiscordService represents Discord service settings.
183
283
//
184
284
// GitLab API docs:
0 commit comments