Skip to content

Commit 10d4158

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 83a9eaa of spec repo (DataDog#3410)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent c6d0f1d commit 10d4158

30 files changed

Lines changed: 3452 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 509 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Create an OAuth2 client credentials auth method returns "CREATED" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new
5+
6+
body = DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsCreateRequest.new({
7+
data: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsCreateData.new({
8+
attributes: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsCreateAttributes.new({
9+
access_token_url: "https://example.com/oauth/token",
10+
audience: "https://api.example.com",
11+
client_id: "my-client-id",
12+
client_secret: "my-client-secret",
13+
name: "my-oauth2-auth",
14+
scope: "read:webhooks write:webhooks",
15+
}),
16+
type: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsType::WEBHOOKS_AUTH_METHOD_OAUTH2_CLIENT_CREDENTIALS,
17+
}),
18+
})
19+
p api_instance.create_o_auth2_client_credentials(body)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Delete an OAuth2 client credentials auth method returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new
5+
api_instance.delete_o_auth2_client_credentials("auth_method_id")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Get all auth methods returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new
5+
p api_instance.get_all_auth_methods()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Get an OAuth2 client credentials auth method returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new
5+
p api_instance.get_o_auth2_client_credentials("auth_method_id")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Update an OAuth2 client credentials auth method returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new
5+
6+
body = DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsUpdateRequest.new({
7+
data: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsUpdateData.new({
8+
attributes: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsUpdateAttributes.new({
9+
access_token_url: "https://example.com/oauth/token",
10+
audience: "https://api.example.com",
11+
client_id: "my-client-id",
12+
client_secret: "my-client-secret",
13+
name: "my-oauth2-auth",
14+
scope: "read:webhooks write:webhooks",
15+
}),
16+
type: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsType::WEBHOOKS_AUTH_METHOD_OAUTH2_CLIENT_CREDENTIALS,
17+
}),
18+
})
19+
p api_instance.update_o_auth2_client_credentials("auth_method_id", body)

features/scenarios_model_mapping.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,6 +3529,22 @@
35293529
"statuspage_url_setting_id" => "String",
35303530
"body" => "StatuspageUrlSettingUpdateRequest",
35313531
},
3532+
"v2.GetAllAuthMethods" => {
3533+
"include" => "WebhooksAuthMethodProtocol",
3534+
},
3535+
"v2.CreateOAuth2ClientCredentials" => {
3536+
"body" => "WebhooksOAuth2ClientCredentialsCreateRequest",
3537+
},
3538+
"v2.DeleteOAuth2ClientCredentials" => {
3539+
"auth_method_id" => "String",
3540+
},
3541+
"v2.GetOAuth2ClientCredentials" => {
3542+
"auth_method_id" => "String",
3543+
},
3544+
"v2.UpdateOAuth2ClientCredentials" => {
3545+
"auth_method_id" => "String",
3546+
"body" => "WebhooksOAuth2ClientCredentialsUpdateRequest",
3547+
},
35323548
"v2.CreateCloudflareAccount" => {
35333549
"body" => "CloudflareAccountCreateRequest",
35343550
},

features/v2/given.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,18 @@
722722
"tag": "Statuspage Integration",
723723
"operationId": "CreateStatuspageUrlSetting"
724724
},
725+
{
726+
"parameters": [
727+
{
728+
"name": "body",
729+
"value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"access_token_url\": \"https://example.com/oauth/token\",\n \"client_id\": \"my-client-id\",\n \"client_secret\": \"my-client-secret\"\n },\n \"type\": \"webhooks-auth-method-oauth2-client-credentials\"\n }\n}"
730+
}
731+
],
732+
"step": "there is a valid \"webhooks_oauth2_client_credentials\" in the system",
733+
"key": "webhooks_oauth2_client_credentials",
734+
"tag": "Webhooks Integration",
735+
"operationId": "CreateOAuth2ClientCredentials"
736+
},
725737
{
726738
"parameters": [
727739
{

features/v2/undo.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3641,6 +3641,43 @@
36413641
"type": "idempotent"
36423642
}
36433643
},
3644+
"GetAllAuthMethods": {
3645+
"tag": "Webhooks Integration",
3646+
"undo": {
3647+
"type": "safe"
3648+
}
3649+
},
3650+
"CreateOAuth2ClientCredentials": {
3651+
"tag": "Webhooks Integration",
3652+
"undo": {
3653+
"operationId": "DeleteOAuth2ClientCredentials",
3654+
"parameters": [
3655+
{
3656+
"name": "auth_method_id",
3657+
"source": "data.id"
3658+
}
3659+
],
3660+
"type": "unsafe"
3661+
}
3662+
},
3663+
"DeleteOAuth2ClientCredentials": {
3664+
"tag": "Webhooks Integration",
3665+
"undo": {
3666+
"type": "idempotent"
3667+
}
3668+
},
3669+
"GetOAuth2ClientCredentials": {
3670+
"tag": "Webhooks Integration",
3671+
"undo": {
3672+
"type": "safe"
3673+
}
3674+
},
3675+
"UpdateOAuth2ClientCredentials": {
3676+
"tag": "Webhooks Integration",
3677+
"undo": {
3678+
"type": "idempotent"
3679+
}
3680+
},
36443681
"ListIntegrations": {
36453682
"tag": "Integrations",
36463683
"undo": {
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
@endpoint(webhooks-integration) @endpoint(webhooks-integration-v2)
2+
Feature: Webhooks Integration
3+
Configure your [Datadog Webhooks
4+
integration](https://docs.datadoghq.com/integrations/webhooks/) directly
5+
through the Datadog API.
6+
7+
Background:
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "WebhooksIntegration" API
11+
12+
@generated @skip @team:Datadog/collaboration-integrations
13+
Scenario: Create an OAuth2 client credentials auth method returns "Bad Request" response
14+
Given new "CreateOAuth2ClientCredentials" request
15+
And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}}
16+
When the request is sent
17+
Then the response status is 400 Bad Request
18+
19+
@generated @skip @team:Datadog/collaboration-integrations
20+
Scenario: Create an OAuth2 client credentials auth method returns "CREATED" response
21+
Given new "CreateOAuth2ClientCredentials" request
22+
And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}}
23+
When the request is sent
24+
Then the response status is 201 CREATED
25+
26+
@generated @skip @team:Datadog/collaboration-integrations
27+
Scenario: Create an OAuth2 client credentials auth method returns "Conflict" response
28+
Given new "CreateOAuth2ClientCredentials" request
29+
And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}}
30+
When the request is sent
31+
Then the response status is 409 Conflict
32+
33+
@generated @skip @team:Datadog/collaboration-integrations
34+
Scenario: Delete an OAuth2 client credentials auth method returns "Not Found" response
35+
Given new "DeleteOAuth2ClientCredentials" request
36+
And request contains "auth_method_id" parameter from "REPLACE.ME"
37+
When the request is sent
38+
Then the response status is 404 Not Found
39+
40+
@generated @skip @team:Datadog/collaboration-integrations
41+
Scenario: Delete an OAuth2 client credentials auth method returns "OK" response
42+
Given new "DeleteOAuth2ClientCredentials" request
43+
And request contains "auth_method_id" parameter from "REPLACE.ME"
44+
When the request is sent
45+
Then the response status is 204 OK
46+
47+
@generated @skip @team:Datadog/collaboration-integrations
48+
Scenario: Get all auth methods returns "OK" response
49+
Given new "GetAllAuthMethods" request
50+
When the request is sent
51+
Then the response status is 200 OK
52+
53+
@generated @skip @team:Datadog/collaboration-integrations
54+
Scenario: Get an OAuth2 client credentials auth method returns "Not Found" response
55+
Given new "GetOAuth2ClientCredentials" request
56+
And request contains "auth_method_id" parameter from "REPLACE.ME"
57+
When the request is sent
58+
Then the response status is 404 Not Found
59+
60+
@generated @skip @team:Datadog/collaboration-integrations
61+
Scenario: Get an OAuth2 client credentials auth method returns "OK" response
62+
Given new "GetOAuth2ClientCredentials" request
63+
And request contains "auth_method_id" parameter from "REPLACE.ME"
64+
When the request is sent
65+
Then the response status is 200 OK
66+
67+
@generated @skip @team:Datadog/collaboration-integrations
68+
Scenario: Update an OAuth2 client credentials auth method returns "Bad Request" response
69+
Given new "UpdateOAuth2ClientCredentials" request
70+
And request contains "auth_method_id" parameter from "REPLACE.ME"
71+
And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}}
72+
When the request is sent
73+
Then the response status is 400 Bad Request
74+
75+
@generated @skip @team:Datadog/collaboration-integrations
76+
Scenario: Update an OAuth2 client credentials auth method returns "Conflict" response
77+
Given new "UpdateOAuth2ClientCredentials" request
78+
And request contains "auth_method_id" parameter from "REPLACE.ME"
79+
And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}}
80+
When the request is sent
81+
Then the response status is 409 Conflict
82+
83+
@generated @skip @team:Datadog/collaboration-integrations
84+
Scenario: Update an OAuth2 client credentials auth method returns "Not Found" response
85+
Given new "UpdateOAuth2ClientCredentials" request
86+
And request contains "auth_method_id" parameter from "REPLACE.ME"
87+
And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}}
88+
When the request is sent
89+
Then the response status is 404 Not Found
90+
91+
@generated @skip @team:Datadog/collaboration-integrations
92+
Scenario: Update an OAuth2 client credentials auth method returns "OK" response
93+
Given new "UpdateOAuth2ClientCredentials" request
94+
And request contains "auth_method_id" parameter from "REPLACE.ME"
95+
And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}}
96+
When the request is sent
97+
Then the response status is 200 OK

0 commit comments

Comments
 (0)