Skip to content
Open
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
532 changes: 532 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions examples/v2/salesforce-integration/CreateIncidentTemplate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Create a Salesforce incident template returns "CREATED" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SalesforceIntegrationAPI.new

body = DatadogAPIClient::V2::SalesforceIncidentsTemplateCreateRequest.new({
data: DatadogAPIClient::V2::SalesforceIncidentsTemplateCreateData.new({
attributes: DatadogAPIClient::V2::SalesforceIncidentsTemplateCreateAttributes.new({
description: "An incident was detected by Datadog monitors.",
name: "production-outage",
owner_id: "005000000000000",
priority: DatadogAPIClient::V2::SalesforceIncidentsTemplatePriority::HIGH,
salesforce_org_id: "596da4af-0563-4097-90ff-07230c3f9db3",
subject: "Datadog Incident: Production Outage",
}),
type: DatadogAPIClient::V2::SalesforceIncidentsTemplateType::SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE,
}),
})
p api_instance.create_incident_template(body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete a Salesforce incident template returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SalesforceIntegrationAPI.new
api_instance.delete_incident_template("incident_template_id")
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete a connected Salesforce organization returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SalesforceIntegrationAPI.new
api_instance.delete_salesforce_organization("salesforce_org_id")
5 changes: 5 additions & 0 deletions examples/v2/salesforce-integration/GetIncidentTemplates.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get all Salesforce incident templates returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SalesforceIntegrationAPI.new
p api_instance.get_incident_templates()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get all connected Salesforce organizations returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SalesforceIntegrationAPI.new
p api_instance.get_salesforce_organizations()
20 changes: 20 additions & 0 deletions examples/v2/salesforce-integration/UpdateIncidentTemplate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Update a Salesforce incident template returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SalesforceIntegrationAPI.new

body = DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateRequest.new({
data: DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateData.new({
attributes: DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateAttributes.new({
description: "An incident was detected by Datadog monitors.",
name: "production-outage",
owner_id: "005000000000000",
priority: DatadogAPIClient::V2::SalesforceIncidentsTemplatePriority::HIGH,
salesforce_org_id: "596da4af-0563-4097-90ff-07230c3f9db3",
subject: "Datadog Incident: Production Outage",
}),
id: "596da4af-0563-4097-90ff-07230c3f9db3",
type: DatadogAPIClient::V2::SalesforceIncidentsTemplateType::SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE,
}),
})
p api_instance.update_incident_template("incident_template_id", body)
13 changes: 13 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3481,6 +3481,19 @@
"integration_service_id" => "String",
"body" => "OpsgenieServiceUpdateRequest",
},
"v2.CreateIncidentTemplate" => {
"body" => "SalesforceIncidentsTemplateCreateRequest",
},
"v2.DeleteIncidentTemplate" => {
"incident_template_id" => "String",
},
"v2.UpdateIncidentTemplate" => {
"incident_template_id" => "String",
"body" => "SalesforceIncidentsTemplateUpdateRequest",
},
"v2.DeleteSalesforceOrganization" => {
"salesforce_org_id" => "String",
},
"v2.ListServiceNowAssignmentGroups" => {
"instance_id" => "UUID",
},
Expand Down
12 changes: 12 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,18 @@
"tag": "Opsgenie Integration",
"operationId": "CreateOpsgenieService"
},
{
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"attributes\": {\n \"salesforce_org_id\": \"596da4af-0563-4097-90ff-07230c3f9db3\",\n \"name\": \"{{ unique }}\",\n \"subject\": \"Datadog Incident: Production Outage\",\n \"description\": \"An incident was detected by Datadog monitors.\",\n \"owner_id\": \"005000000000000\",\n \"priority\": \"High\"\n },\n \"type\": \"salesforce-incidents-incident-template\"\n }\n}"
}
],
"step": "there is a valid \"salesforce_incidents_template\" in the system",
"key": "salesforce_incidents_template",
"tag": "Salesforce Integration",
"operationId": "CreateIncidentTemplate"
},
{
"parameters": [
{
Expand Down
129 changes: 129 additions & 0 deletions features/v2/salesforce_integration.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
@endpoint(salesforce-integration) @endpoint(salesforce-integration-v2)
Feature: Salesforce Integration
Configure your [Datadog Salesforce
integration](https://docs.datadoghq.com/integrations/salesforce/) directly
through the Datadog API.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "SalesforceIntegration" API

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Create a Salesforce incident template returns "Bad Request" response
Given new "CreateIncidentTemplate" request
And body with value {"data": {"attributes": {"description": "An incident was detected by Datadog monitors.", "name": "production-outage", "owner_id": "005000000000000", "priority": "High", "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3", "subject": "Datadog Incident: Production Outage"}, "type": "salesforce-incidents-incident-template"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Create a Salesforce incident template returns "CREATED" response
Given new "CreateIncidentTemplate" request
And body with value {"data": {"attributes": {"description": "An incident was detected by Datadog monitors.", "name": "production-outage", "owner_id": "005000000000000", "priority": "High", "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3", "subject": "Datadog Incident: Production Outage"}, "type": "salesforce-incidents-incident-template"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Create a Salesforce incident template returns "Conflict" response
Given new "CreateIncidentTemplate" request
And body with value {"data": {"attributes": {"description": "An incident was detected by Datadog monitors.", "name": "production-outage", "owner_id": "005000000000000", "priority": "High", "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3", "subject": "Datadog Incident: Production Outage"}, "type": "salesforce-incidents-incident-template"}}
When the request is sent
Then the response status is 409 Conflict

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Create a Salesforce incident template returns "Not Found" response
Given new "CreateIncidentTemplate" request
And body with value {"data": {"attributes": {"description": "An incident was detected by Datadog monitors.", "name": "production-outage", "owner_id": "005000000000000", "priority": "High", "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3", "subject": "Datadog Incident: Production Outage"}, "type": "salesforce-incidents-incident-template"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Delete a Salesforce incident template returns "Not Found" response
Given new "DeleteIncidentTemplate" request
And request contains "incident_template_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Delete a Salesforce incident template returns "OK" response
Given new "DeleteIncidentTemplate" request
And request contains "incident_template_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Delete a connected Salesforce organization returns "Bad Request" response
Given new "DeleteSalesforceOrganization" request
And request contains "salesforce_org_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Delete a connected Salesforce organization returns "Not Found" response
Given new "DeleteSalesforceOrganization" request
And request contains "salesforce_org_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Delete a connected Salesforce organization returns "OK" response
Given new "DeleteSalesforceOrganization" request
And request contains "salesforce_org_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Get all Salesforce incident templates returns "OK" response
Given new "GetIncidentTemplates" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Get all connected Salesforce organizations returns "Bad Request" response
Given new "GetSalesforceOrganizations" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Get all connected Salesforce organizations returns "Not Found" response
Given new "GetSalesforceOrganizations" request
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Get all connected Salesforce organizations returns "OK" response
Given new "GetSalesforceOrganizations" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Update a Salesforce incident template returns "Bad Request" response
Given new "UpdateIncidentTemplate" request
And request contains "incident_template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "An incident was detected by Datadog monitors.", "name": "production-outage", "owner_id": "005000000000000", "priority": "High", "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3", "subject": "Datadog Incident: Production Outage"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "salesforce-incidents-incident-template"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Update a Salesforce incident template returns "Conflict" response
Given new "UpdateIncidentTemplate" request
And request contains "incident_template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "An incident was detected by Datadog monitors.", "name": "production-outage", "owner_id": "005000000000000", "priority": "High", "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3", "subject": "Datadog Incident: Production Outage"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "salesforce-incidents-incident-template"}}
When the request is sent
Then the response status is 409 Conflict

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Update a Salesforce incident template returns "Not Found" response
Given new "UpdateIncidentTemplate" request
And request contains "incident_template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "An incident was detected by Datadog monitors.", "name": "production-outage", "owner_id": "005000000000000", "priority": "High", "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3", "subject": "Datadog Incident: Production Outage"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "salesforce-incidents-incident-template"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Update a Salesforce incident template returns "OK" response
Given new "UpdateIncidentTemplate" request
And request contains "incident_template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "An incident was detected by Datadog monitors.", "name": "production-outage", "owner_id": "005000000000000", "priority": "High", "salesforce_org_id": "596da4af-0563-4097-90ff-07230c3f9db3", "subject": "Datadog Incident: Production Outage"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "salesforce-incidents-incident-template"}}
When the request is sent
Then the response status is 200 OK
43 changes: 43 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3493,6 +3493,49 @@
"type": "idempotent"
}
},
"GetIncidentTemplates": {
"tag": "Salesforce Integration",
"undo": {
"type": "safe"
}
},
"CreateIncidentTemplate": {
"tag": "Salesforce Integration",
"undo": {
"operationId": "DeleteIncidentTemplate",
"parameters": [
{
"name": "incident_template_id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"DeleteIncidentTemplate": {
"tag": "Salesforce Integration",
"undo": {
"type": "idempotent"
}
},
"UpdateIncidentTemplate": {
"tag": "Salesforce Integration",
"undo": {
"type": "idempotent"
}
},
"GetSalesforceOrganizations": {
"tag": "Salesforce Integration",
"undo": {
"type": "safe"
}
},
"DeleteSalesforceOrganization": {
"tag": "Salesforce Integration",
"undo": {
"type": "idempotent"
}
},
"ListServiceNowAssignmentGroups": {
"tag": "ServiceNow Integration",
"undo": {
Expand Down
17 changes: 17 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5573,6 +5573,22 @@ def overrides
"v2.run_historical_job_request_attributes" => "RunHistoricalJobRequestAttributes",
"v2.run_historical_job_request_data" => "RunHistoricalJobRequestData",
"v2.run_historical_job_request_data_type" => "RunHistoricalJobRequestDataType",
"v2.salesforce_incidents_organization_response_attributes" => "SalesforceIncidentsOrganizationResponseAttributes",
"v2.salesforce_incidents_organization_response_data" => "SalesforceIncidentsOrganizationResponseData",
"v2.salesforce_incidents_organizations_response" => "SalesforceIncidentsOrganizationsResponse",
"v2.salesforce_incidents_organization_type" => "SalesforceIncidentsOrganizationType",
"v2.salesforce_incidents_template_create_attributes" => "SalesforceIncidentsTemplateCreateAttributes",
"v2.salesforce_incidents_template_create_data" => "SalesforceIncidentsTemplateCreateData",
"v2.salesforce_incidents_template_create_request" => "SalesforceIncidentsTemplateCreateRequest",
"v2.salesforce_incidents_template_priority" => "SalesforceIncidentsTemplatePriority",
"v2.salesforce_incidents_template_response" => "SalesforceIncidentsTemplateResponse",
"v2.salesforce_incidents_template_response_attributes" => "SalesforceIncidentsTemplateResponseAttributes",
"v2.salesforce_incidents_template_response_data" => "SalesforceIncidentsTemplateResponseData",
"v2.salesforce_incidents_templates_response" => "SalesforceIncidentsTemplatesResponse",
"v2.salesforce_incidents_template_type" => "SalesforceIncidentsTemplateType",
"v2.salesforce_incidents_template_update_attributes" => "SalesforceIncidentsTemplateUpdateAttributes",
"v2.salesforce_incidents_template_update_data" => "SalesforceIncidentsTemplateUpdateData",
"v2.salesforce_incidents_template_update_request" => "SalesforceIncidentsTemplateUpdateRequest",
"v2.saml_assertion_attribute" => "SAMLAssertionAttribute",
"v2.saml_assertion_attribute_attributes" => "SAMLAssertionAttributeAttributes",
"v2.saml_assertion_attributes_type" => "SAMLAssertionAttributesType",
Expand Down Expand Up @@ -7236,6 +7252,7 @@ def overrides
"v2.rum_replay_sessions_api" => "RumReplaySessionsAPI",
"v2.rum_replay_viewership_api" => "RumReplayViewershipAPI",
"v2.rum_retention_filters_api" => "RumRetentionFiltersAPI",
"v2.salesforce_integration_api" => "SalesforceIntegrationAPI",
"v2.scorecards_api" => "ScorecardsAPI",
"v2.seats_api" => "SeatsAPI",
"v2.security_monitoring_api" => "SecurityMonitoringAPI",
Expand Down
Loading
Loading