From bd503cdcc8801710a977cd572535c2fc7853fd58 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 29 May 2026 14:20:23 +0000 Subject: [PATCH] Regenerate client from commit a4c8615 of spec repo --- .generator/schemas/v2/openapi.yaml | 532 ++++++++++++++++++ .../CreateIncidentTemplate.rb | 19 + .../DeleteIncidentTemplate.rb | 5 + .../DeleteSalesforceOrganization.rb | 5 + .../GetIncidentTemplates.rb | 5 + .../GetSalesforceOrganizations.rb | 5 + .../UpdateIncidentTemplate.rb | 20 + features/scenarios_model_mapping.rb | 13 + features/v2/given.json | 12 + features/v2/salesforce_integration.feature | 129 +++++ features/v2/undo.json | 43 ++ lib/datadog_api_client/inflector.rb | 17 + .../v2/api/salesforce_integration_api.rb | 419 ++++++++++++++ ...idents_organization_response_attributes.rb | 135 +++++ ...ce_incidents_organization_response_data.rb | 173 ++++++ .../salesforce_incidents_organization_type.rb | 26 + ...sforce_incidents_organizations_response.rb | 126 +++++ ...ce_incidents_template_create_attributes.rb | 260 +++++++++ ...lesforce_incidents_template_create_data.rb | 144 +++++ ...force_incidents_template_create_request.rb | 123 ++++ .../salesforce_incidents_template_priority.rb | 29 + .../salesforce_incidents_template_response.rb | 123 ++++ ..._incidents_template_response_attributes.rb | 155 +++++ ...sforce_incidents_template_response_data.rb | 173 ++++++ .../salesforce_incidents_template_type.rb | 26 + ...ce_incidents_template_update_attributes.rb | 222 ++++++++ ...lesforce_incidents_template_update_data.rb | 173 ++++++ ...force_incidents_template_update_request.rb | 123 ++++ ...salesforce_incidents_templates_response.rb | 125 ++++ 29 files changed, 3360 insertions(+) create mode 100644 examples/v2/salesforce-integration/CreateIncidentTemplate.rb create mode 100644 examples/v2/salesforce-integration/DeleteIncidentTemplate.rb create mode 100644 examples/v2/salesforce-integration/DeleteSalesforceOrganization.rb create mode 100644 examples/v2/salesforce-integration/GetIncidentTemplates.rb create mode 100644 examples/v2/salesforce-integration/GetSalesforceOrganizations.rb create mode 100644 examples/v2/salesforce-integration/UpdateIncidentTemplate.rb create mode 100644 features/v2/salesforce_integration.feature create mode 100644 lib/datadog_api_client/v2/api/salesforce_integration_api.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_organization_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_organization_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_organization_type.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_organizations_response.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_priority.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_response.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_type.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_template_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/salesforce_incidents_templates_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b2e0e022c91c..6eb197652c4e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1572,6 +1572,20 @@ components: required: true schema: type: string + SalesforceIncidentsOrganizationIDPathParameter: + description: The Datadog-assigned ID of the connected Salesforce organization. + in: path + name: salesforce_org_id + required: true + schema: + type: string + SalesforceIncidentsTemplateIDPathParameter: + description: The ID of the Salesforce incident template. + in: path + name: incident_template_id + required: true + schema: + type: string SampleLogGenerationContentPackID: description: The identifier of the Cloud SIEM content pack to operate on (for example, `aws-cloudtrail`). in: path @@ -72233,6 +72247,275 @@ components: example: "report_id" type: string type: object + SalesforceIncidentsOrganizationResponseAttributes: + description: Attributes of a Salesforce organization connected to the Datadog Salesforce integration. + properties: + instance_url: + description: The Salesforce instance URL used to call this organization's APIs. + example: "https://acme.my.salesforce.com" + type: string + name: + description: Human-readable name of the Salesforce organization. + example: "Acme Production Org" + type: string + sfdc_org_id: + description: The Salesforce organization identifier (15- or 18-character Salesforce org ID). + example: "00D000000000000" + type: string + sfdc_org_type: + description: The Salesforce organization type (for example, `Production` or `Sandbox`). + example: "Production" + type: string + type: object + SalesforceIncidentsOrganizationResponseData: + description: Salesforce organization data from a response. + properties: + attributes: + $ref: "#/components/schemas/SalesforceIncidentsOrganizationResponseAttributes" + id: + description: The Datadog-assigned ID of the connected Salesforce organization. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/SalesforceIncidentsOrganizationType" + required: + - id + - type + - attributes + type: object + SalesforceIncidentsOrganizationType: + default: salesforce-incidents-org + description: Salesforce organization resource type. + enum: + - salesforce-incidents-org + example: salesforce-incidents-org + type: string + x-enum-varnames: + - SALESFORCE_INCIDENTS_ORG + SalesforceIncidentsOrganizationsResponse: + description: |- + Response containing a list of Salesforce organizations connected to the + Datadog Salesforce integration. + properties: + data: + description: An array of Salesforce organizations. + items: + $ref: "#/components/schemas/SalesforceIncidentsOrganizationResponseData" + type: array + required: + - data + type: object + SalesforceIncidentsTemplateCreateAttributes: + description: Salesforce incident template attributes for a create request. + properties: + description: + description: Long-form description body for Salesforce incidents created from this template. + example: "An incident was detected by Datadog monitors." + maxLength: 2048 + minLength: 1 + type: string + name: + description: Human-readable name for this incident template. Must be unique within your organization. + example: "production-outage" + maxLength: 100 + minLength: 1 + type: string + owner_id: + description: The Salesforce user ID that owns incidents created from this template. + example: "005000000000000" + maxLength: 255 + minLength: 1 + type: string + priority: + $ref: "#/components/schemas/SalesforceIncidentsTemplatePriority" + salesforce_org_id: + description: The Datadog-assigned ID of the Salesforce organization this template belongs to. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + format: uuid + type: string + subject: + description: Subject line for Salesforce incidents created from this template. + example: "Datadog Incident: Production Outage" + maxLength: 255 + minLength: 1 + type: string + required: + - salesforce_org_id + - name + - subject + - description + - owner_id + - priority + type: object + SalesforceIncidentsTemplateCreateData: + description: Salesforce incident template data for a create request. + properties: + attributes: + $ref: "#/components/schemas/SalesforceIncidentsTemplateCreateAttributes" + type: + $ref: "#/components/schemas/SalesforceIncidentsTemplateType" + required: + - type + - attributes + type: object + SalesforceIncidentsTemplateCreateRequest: + description: Create request for a Salesforce incident template. + properties: + data: + $ref: "#/components/schemas/SalesforceIncidentsTemplateCreateData" + required: + - data + type: object + SalesforceIncidentsTemplatePriority: + description: Priority of the Salesforce incident created from this template. + enum: + - Critical + - High + - Moderate + - Low + example: "High" + type: string + x-enum-varnames: + - CRITICAL + - HIGH + - MODERATE + - LOW + SalesforceIncidentsTemplateResponse: + description: Response containing a Salesforce incident template. + properties: + data: + $ref: "#/components/schemas/SalesforceIncidentsTemplateResponseData" + required: + - data + type: object + SalesforceIncidentsTemplateResponseAttributes: + description: Salesforce incident template attributes returned by the API. + properties: + description: + description: Long-form description body for Salesforce incidents created from this template. + example: "An incident was detected by Datadog monitors." + type: string + name: + description: Human-readable name for this incident template. + example: "production-outage" + type: string + owner_id: + description: The Salesforce user ID that owns incidents created from this template. + example: "005000000000000" + type: string + priority: + $ref: "#/components/schemas/SalesforceIncidentsTemplatePriority" + salesforce_org_id: + description: The Datadog-assigned ID of the Salesforce organization this template belongs to. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + format: uuid + type: string + subject: + description: Subject line for Salesforce incidents created from this template. + example: "Datadog Incident: Production Outage" + type: string + type: object + SalesforceIncidentsTemplateResponseData: + description: Salesforce incident template data from a response. + properties: + attributes: + $ref: "#/components/schemas/SalesforceIncidentsTemplateResponseAttributes" + id: + description: The ID of the Salesforce incident template. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/SalesforceIncidentsTemplateType" + required: + - id + - type + - attributes + type: object + SalesforceIncidentsTemplateType: + default: salesforce-incidents-incident-template + description: Salesforce incident template resource type. + enum: + - salesforce-incidents-incident-template + example: salesforce-incidents-incident-template + type: string + x-enum-varnames: + - SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE + SalesforceIncidentsTemplateUpdateAttributes: + description: Salesforce incident template attributes for an update request. + properties: + description: + description: Long-form description body for Salesforce incidents created from this template. + example: "An incident was detected by Datadog monitors." + maxLength: 2048 + minLength: 1 + type: string + name: + description: Human-readable name for this incident template. + example: "production-outage" + maxLength: 100 + minLength: 1 + type: string + owner_id: + description: The Salesforce user ID that owns incidents created from this template. + example: "005000000000000" + maxLength: 255 + minLength: 1 + type: string + priority: + $ref: "#/components/schemas/SalesforceIncidentsTemplatePriority" + salesforce_org_id: + description: The Datadog-assigned ID of the Salesforce organization this template belongs to. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + format: uuid + type: string + subject: + description: Subject line for Salesforce incidents created from this template. + example: "Datadog Incident: Production Outage" + maxLength: 255 + minLength: 1 + type: string + type: object + SalesforceIncidentsTemplateUpdateData: + description: Salesforce incident template data for an update request. + properties: + attributes: + $ref: "#/components/schemas/SalesforceIncidentsTemplateUpdateAttributes" + id: + description: The ID of the Salesforce incident template being updated. Must match the path parameter. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/SalesforceIncidentsTemplateType" + required: + - id + - type + - attributes + type: object + SalesforceIncidentsTemplateUpdateRequest: + description: Update request for a Salesforce incident template. + properties: + data: + $ref: "#/components/schemas/SalesforceIncidentsTemplateUpdateData" + required: + - data + type: object + SalesforceIncidentsTemplatesResponse: + description: Response containing a list of Salesforce incident templates. + properties: + data: + description: An array of Salesforce incident templates. + items: + $ref: "#/components/schemas/SalesforceIncidentsTemplateResponseData" + type: array + required: + - data + type: object SampleLogGenerationBulkSubscriptionAttributes: description: The attributes for creating sample log generation subscriptions for multiple content packs. properties: @@ -125858,6 +126141,249 @@ paths: operator: OR permissions: - manage_integrations + /api/v2/integration/salesforce-incidents/incident-templates: + get: + description: Get all Salesforce incident templates configured for your organization. + operationId: GetIncidentTemplates + responses: + "200": + content: + application/json: + examples: + default: + 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: 00000000-0000-0000-0000-000000000001 + type: salesforce-incidents-incident-template + schema: + $ref: "#/components/schemas/SalesforceIncidentsTemplatesResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all Salesforce incident templates + tags: + - Salesforce Integration + "x-permission": + operator: OR + permissions: + - integrations_read + post: + description: |- + Create a new Salesforce incident template for your organization. Template + names must be unique within an organization. + operationId: CreateIncidentTemplate + requestBody: + content: + application/json: + examples: + default: + 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 + schema: + $ref: "#/components/schemas/SalesforceIncidentsTemplateCreateRequest" + description: Salesforce incident template payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + 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: 00000000-0000-0000-0000-000000000002 + type: salesforce-incidents-incident-template + schema: + $ref: "#/components/schemas/SalesforceIncidentsTemplateResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a Salesforce incident template + tags: + - Salesforce Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}: + delete: + description: Delete a single Salesforce incident template from your organization. + operationId: DeleteIncidentTemplate + parameters: + - $ref: "#/components/parameters/SalesforceIncidentsTemplateIDPathParameter" + responses: + "204": + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a Salesforce incident template + tags: + - Salesforce Integration + "x-permission": + operator: OR + permissions: + - manage_integrations + patch: + description: Update a single Salesforce incident template in your organization. + operationId: UpdateIncidentTemplate + parameters: + - $ref: "#/components/parameters/SalesforceIncidentsTemplateIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: production-outage-renamed + id: 596da4af-0563-4097-90ff-07230c3f9db3 + type: salesforce-incidents-incident-template + schema: + $ref: "#/components/schemas/SalesforceIncidentsTemplateUpdateRequest" + description: Salesforce incident template payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: An incident was detected by Datadog monitors. + name: production-outage-renamed + owner_id: "005000000000000" + priority: High + salesforce_org_id: 596da4af-0563-4097-90ff-07230c3f9db3 + subject: "Datadog Incident: Production Outage" + id: 00000000-0000-0000-0000-000000000003 + type: salesforce-incidents-incident-template + schema: + $ref: "#/components/schemas/SalesforceIncidentsTemplateResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a Salesforce incident template + tags: + - Salesforce Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/salesforce-incidents/organizations: + get: + description: |- + Get all Salesforce organizations connected to your Datadog organization + through the Salesforce integration. Salesforce organizations are connected + through the OAuth setup flow in the Datadog Salesforce integration page. + operationId: GetSalesforceOrganizations + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + instance_url: "https://acme.my.salesforce.com" + name: "Acme Production Org" + sfdc_org_id: "00D000000000000" + sfdc_org_type: "Production" + id: 00000000-0000-0000-0000-000000000001 + type: salesforce-incidents-org + schema: + $ref: "#/components/schemas/SalesforceIncidentsOrganizationsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all connected Salesforce organizations + tags: + - Salesforce Integration + "x-permission": + operator: OR + permissions: + - integrations_read + /api/v2/integration/salesforce-incidents/organizations/{salesforce_org_id}: + delete: + description: |- + Disconnect a Salesforce organization from your Datadog organization. + This also deletes any incident templates referencing the organization. + operationId: DeleteSalesforceOrganization + parameters: + - $ref: "#/components/parameters/SalesforceIncidentsOrganizationIDPathParameter" + responses: + "204": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a connected Salesforce organization + tags: + - Salesforce Integration + "x-permission": + operator: OR + permissions: + - manage_integrations /api/v2/integration/servicenow/assignment_groups/{instance_id}: get: description: |- @@ -171543,6 +172069,12 @@ tags: - description: |- Manage retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) of RUM for your organization. name: Rum Retention Filters + - description: |- + Configure your [Datadog Salesforce integration](https://docs.datadoghq.com/integrations/salesforce/) + directly through the Datadog API. + externalDocs: + url: https://docs.datadoghq.com/api/latest/salesforce-integration + name: Salesforce Integration - description: |- API to create and update scorecard rules and outcomes. See [Scorecards](https://docs.datadoghq.com/service_catalog/scorecards) for more information. name: Scorecards diff --git a/examples/v2/salesforce-integration/CreateIncidentTemplate.rb b/examples/v2/salesforce-integration/CreateIncidentTemplate.rb new file mode 100644 index 000000000000..fca6f278616d --- /dev/null +++ b/examples/v2/salesforce-integration/CreateIncidentTemplate.rb @@ -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) diff --git a/examples/v2/salesforce-integration/DeleteIncidentTemplate.rb b/examples/v2/salesforce-integration/DeleteIncidentTemplate.rb new file mode 100644 index 000000000000..e1b791a71075 --- /dev/null +++ b/examples/v2/salesforce-integration/DeleteIncidentTemplate.rb @@ -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") diff --git a/examples/v2/salesforce-integration/DeleteSalesforceOrganization.rb b/examples/v2/salesforce-integration/DeleteSalesforceOrganization.rb new file mode 100644 index 000000000000..53ceaa24b48d --- /dev/null +++ b/examples/v2/salesforce-integration/DeleteSalesforceOrganization.rb @@ -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") diff --git a/examples/v2/salesforce-integration/GetIncidentTemplates.rb b/examples/v2/salesforce-integration/GetIncidentTemplates.rb new file mode 100644 index 000000000000..e651cba18488 --- /dev/null +++ b/examples/v2/salesforce-integration/GetIncidentTemplates.rb @@ -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() diff --git a/examples/v2/salesforce-integration/GetSalesforceOrganizations.rb b/examples/v2/salesforce-integration/GetSalesforceOrganizations.rb new file mode 100644 index 000000000000..1682efba1eda --- /dev/null +++ b/examples/v2/salesforce-integration/GetSalesforceOrganizations.rb @@ -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() diff --git a/examples/v2/salesforce-integration/UpdateIncidentTemplate.rb b/examples/v2/salesforce-integration/UpdateIncidentTemplate.rb new file mode 100644 index 000000000000..def7d9e24346 --- /dev/null +++ b/examples/v2/salesforce-integration/UpdateIncidentTemplate.rb @@ -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) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 920e80f058e0..cae9c7c5fe33 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -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", }, diff --git a/features/v2/given.json b/features/v2/given.json index 24058ecf5e1d..519f2c620186 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -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": [ { diff --git a/features/v2/salesforce_integration.feature b/features/v2/salesforce_integration.feature new file mode 100644 index 000000000000..63b3c068dfdd --- /dev/null +++ b/features/v2/salesforce_integration.feature @@ -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 diff --git a/features/v2/undo.json b/features/v2/undo.json index f1a04b48a1aa..9587222f6740 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -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": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index bfa0086bf6f1..79b911412799 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -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", @@ -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", diff --git a/lib/datadog_api_client/v2/api/salesforce_integration_api.rb b/lib/datadog_api_client/v2/api/salesforce_integration_api.rb new file mode 100644 index 000000000000..9ed66dadfbda --- /dev/null +++ b/lib/datadog_api_client/v2/api/salesforce_integration_api.rb @@ -0,0 +1,419 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class SalesforceIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create a Salesforce incident template. + # + # @see #create_incident_template_with_http_info + def create_incident_template(body, opts = {}) + data, _status_code, _headers = create_incident_template_with_http_info(body, opts) + data + end + + # Create a Salesforce incident template. + # + # Create a new Salesforce incident template for your organization. Template + # names must be unique within an organization. + # + # @param body [SalesforceIncidentsTemplateCreateRequest] Salesforce incident template payload. + # @param opts [Hash] the optional parameters + # @return [Array<(SalesforceIncidentsTemplateResponse, Integer, Hash)>] SalesforceIncidentsTemplateResponse data, response status code and response headers + def create_incident_template_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.create_incident_template ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SalesforceIntegrationAPI.create_incident_template" + end + # resource path + local_var_path = '/api/v2/integration/salesforce-incidents/incident-templates' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SalesforceIncidentsTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_incident_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#create_incident_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a Salesforce incident template. + # + # @see #delete_incident_template_with_http_info + def delete_incident_template(incident_template_id, opts = {}) + delete_incident_template_with_http_info(incident_template_id, opts) + nil + end + + # Delete a Salesforce incident template. + # + # Delete a single Salesforce incident template from your organization. + # + # @param incident_template_id [String] The ID of the Salesforce incident template. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_template_with_http_info(incident_template_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.delete_incident_template ...' + end + # verify the required parameter 'incident_template_id' is set + if @api_client.config.client_side_validation && incident_template_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_template_id' when calling SalesforceIntegrationAPI.delete_incident_template" + end + # resource path + local_var_path = '/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}'.sub('{incident_template_id}', CGI.escape(incident_template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_incident_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#delete_incident_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a connected Salesforce organization. + # + # @see #delete_salesforce_organization_with_http_info + def delete_salesforce_organization(salesforce_org_id, opts = {}) + delete_salesforce_organization_with_http_info(salesforce_org_id, opts) + nil + end + + # Delete a connected Salesforce organization. + # + # Disconnect a Salesforce organization from your Datadog organization. + # This also deletes any incident templates referencing the organization. + # + # @param salesforce_org_id [String] The Datadog-assigned ID of the connected Salesforce organization. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_salesforce_organization_with_http_info(salesforce_org_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.delete_salesforce_organization ...' + end + # verify the required parameter 'salesforce_org_id' is set + if @api_client.config.client_side_validation && salesforce_org_id.nil? + fail ArgumentError, "Missing the required parameter 'salesforce_org_id' when calling SalesforceIntegrationAPI.delete_salesforce_organization" + end + # resource path + local_var_path = '/api/v2/integration/salesforce-incidents/organizations/{salesforce_org_id}'.sub('{salesforce_org_id}', CGI.escape(salesforce_org_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_salesforce_organization, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#delete_salesforce_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all Salesforce incident templates. + # + # @see #get_incident_templates_with_http_info + def get_incident_templates(opts = {}) + data, _status_code, _headers = get_incident_templates_with_http_info(opts) + data + end + + # Get all Salesforce incident templates. + # + # Get all Salesforce incident templates configured for your organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(SalesforceIncidentsTemplatesResponse, Integer, Hash)>] SalesforceIncidentsTemplatesResponse data, response status code and response headers + def get_incident_templates_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.get_incident_templates ...' + end + # resource path + local_var_path = '/api/v2/integration/salesforce-incidents/incident-templates' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SalesforceIncidentsTemplatesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_incident_templates, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#get_incident_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all connected Salesforce organizations. + # + # @see #get_salesforce_organizations_with_http_info + def get_salesforce_organizations(opts = {}) + data, _status_code, _headers = get_salesforce_organizations_with_http_info(opts) + data + end + + # Get all connected Salesforce organizations. + # + # Get all Salesforce organizations connected to your Datadog organization + # through the Salesforce integration. Salesforce organizations are connected + # through the OAuth setup flow in the Datadog Salesforce integration page. + # + # @param opts [Hash] the optional parameters + # @return [Array<(SalesforceIncidentsOrganizationsResponse, Integer, Hash)>] SalesforceIncidentsOrganizationsResponse data, response status code and response headers + def get_salesforce_organizations_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.get_salesforce_organizations ...' + end + # resource path + local_var_path = '/api/v2/integration/salesforce-incidents/organizations' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SalesforceIncidentsOrganizationsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_salesforce_organizations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#get_salesforce_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a Salesforce incident template. + # + # @see #update_incident_template_with_http_info + def update_incident_template(incident_template_id, body, opts = {}) + data, _status_code, _headers = update_incident_template_with_http_info(incident_template_id, body, opts) + data + end + + # Update a Salesforce incident template. + # + # Update a single Salesforce incident template in your organization. + # + # @param incident_template_id [String] The ID of the Salesforce incident template. + # @param body [SalesforceIncidentsTemplateUpdateRequest] Salesforce incident template payload. + # @param opts [Hash] the optional parameters + # @return [Array<(SalesforceIncidentsTemplateResponse, Integer, Hash)>] SalesforceIncidentsTemplateResponse data, response status code and response headers + def update_incident_template_with_http_info(incident_template_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.update_incident_template ...' + end + # verify the required parameter 'incident_template_id' is set + if @api_client.config.client_side_validation && incident_template_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_template_id' when calling SalesforceIntegrationAPI.update_incident_template" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SalesforceIntegrationAPI.update_incident_template" + end + # resource path + local_var_path = '/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}'.sub('{incident_template_id}', CGI.escape(incident_template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SalesforceIncidentsTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_incident_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#update_incident_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_organization_response_attributes.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_organization_response_attributes.rb new file mode 100644 index 000000000000..2883e6a8e0c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_organization_response_attributes.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a Salesforce organization connected to the Datadog Salesforce integration. + class SalesforceIncidentsOrganizationResponseAttributes + include BaseGenericModel + + # The Salesforce instance URL used to call this organization's APIs. + attr_accessor :instance_url + + # Human-readable name of the Salesforce organization. + attr_accessor :name + + # The Salesforce organization identifier (15- or 18-character Salesforce org ID). + attr_accessor :sfdc_org_id + + # The Salesforce organization type (for example, `Production` or `Sandbox`). + attr_accessor :sfdc_org_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'instance_url' => :'instance_url', + :'name' => :'name', + :'sfdc_org_id' => :'sfdc_org_id', + :'sfdc_org_type' => :'sfdc_org_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'instance_url' => :'String', + :'name' => :'String', + :'sfdc_org_id' => :'String', + :'sfdc_org_type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsOrganizationResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'instance_url') + self.instance_url = attributes[:'instance_url'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'sfdc_org_id') + self.sfdc_org_id = attributes[:'sfdc_org_id'] + end + + if attributes.key?(:'sfdc_org_type') + self.sfdc_org_type = attributes[:'sfdc_org_type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + instance_url == o.instance_url && + name == o.name && + sfdc_org_id == o.sfdc_org_id && + sfdc_org_type == o.sfdc_org_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [instance_url, name, sfdc_org_id, sfdc_org_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_organization_response_data.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_organization_response_data.rb new file mode 100644 index 000000000000..ac32665115d0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_organization_response_data.rb @@ -0,0 +1,173 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce organization data from a response. + class SalesforceIncidentsOrganizationResponseData + include BaseGenericModel + + # Attributes of a Salesforce organization connected to the Datadog Salesforce integration. + attr_reader :attributes + + # The Datadog-assigned ID of the connected Salesforce organization. + attr_reader :id + + # Salesforce organization resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SalesforceIncidentsOrganizationResponseAttributes', + :'id' => :'String', + :'type' => :'SalesforceIncidentsOrganizationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsOrganizationResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @id.to_s.length > 100 + return false if @id.to_s.length < 1 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_organization_type.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_organization_type.rb new file mode 100644 index 000000000000..7191648d2299 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_organization_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce organization resource type. + class SalesforceIncidentsOrganizationType + include BaseEnumModel + + SALESFORCE_INCIDENTS_ORG = "salesforce-incidents-org".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_organizations_response.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_organizations_response.rb new file mode 100644 index 000000000000..5be92ec31023 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_organizations_response.rb @@ -0,0 +1,126 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of Salesforce organizations connected to the + # Datadog Salesforce integration. + class SalesforceIncidentsOrganizationsResponse + include BaseGenericModel + + # An array of Salesforce organizations. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsOrganizationsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_attributes.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_attributes.rb new file mode 100644 index 000000000000..05246d105e81 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_attributes.rb @@ -0,0 +1,260 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce incident template attributes for a create request. + class SalesforceIncidentsTemplateCreateAttributes + include BaseGenericModel + + # Long-form description body for Salesforce incidents created from this template. + attr_reader :description + + # Human-readable name for this incident template. Must be unique within your organization. + attr_reader :name + + # The Salesforce user ID that owns incidents created from this template. + attr_reader :owner_id + + # Priority of the Salesforce incident created from this template. + attr_reader :priority + + # The Datadog-assigned ID of the Salesforce organization this template belongs to. + attr_reader :salesforce_org_id + + # Subject line for Salesforce incidents created from this template. + attr_reader :subject + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'owner_id' => :'owner_id', + :'priority' => :'priority', + :'salesforce_org_id' => :'salesforce_org_id', + :'subject' => :'subject' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'owner_id' => :'String', + :'priority' => :'SalesforceIncidentsTemplatePriority', + :'salesforce_org_id' => :'UUID', + :'subject' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'owner_id') + self.owner_id = attributes[:'owner_id'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'salesforce_org_id') + self.salesforce_org_id = attributes[:'salesforce_org_id'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + return false if @description.to_s.length > 2048 + return false if @description.to_s.length < 1 + return false if @name.nil? + return false if @name.to_s.length > 100 + return false if @name.to_s.length < 1 + return false if @owner_id.nil? + return false if @owner_id.to_s.length > 255 + return false if @owner_id.to_s.length < 1 + return false if @priority.nil? + return false if @salesforce_org_id.nil? + return false if @subject.nil? + return false if @subject.to_s.length > 255 + return false if @subject.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + if description.to_s.length > 2048 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 2048.' + end + if description.to_s.length < 1 + fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param owner_id [Object] Object to be assigned + # @!visibility private + def owner_id=(owner_id) + if owner_id.nil? + fail ArgumentError, 'invalid value for "owner_id", owner_id cannot be nil.' + end + if owner_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "owner_id", the character length must be smaller than or equal to 255.' + end + if owner_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "owner_id", the character length must be great than or equal to 1.' + end + @owner_id = owner_id + end + + # Custom attribute writer method with validation + # @param priority [Object] Object to be assigned + # @!visibility private + def priority=(priority) + if priority.nil? + fail ArgumentError, 'invalid value for "priority", priority cannot be nil.' + end + @priority = priority + end + + # Custom attribute writer method with validation + # @param salesforce_org_id [Object] Object to be assigned + # @!visibility private + def salesforce_org_id=(salesforce_org_id) + if salesforce_org_id.nil? + fail ArgumentError, 'invalid value for "salesforce_org_id", salesforce_org_id cannot be nil.' + end + @salesforce_org_id = salesforce_org_id + end + + # Custom attribute writer method with validation + # @param subject [Object] Object to be assigned + # @!visibility private + def subject=(subject) + if subject.nil? + fail ArgumentError, 'invalid value for "subject", subject cannot be nil.' + end + if subject.to_s.length > 255 + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 255.' + end + if subject.to_s.length < 1 + fail ArgumentError, 'invalid value for "subject", the character length must be great than or equal to 1.' + end + @subject = subject + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + owner_id == o.owner_id && + priority == o.priority && + salesforce_org_id == o.salesforce_org_id && + subject == o.subject && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, owner_id, priority, salesforce_org_id, subject, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_data.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_data.rb new file mode 100644 index 000000000000..e995bd9202e4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce incident template data for a create request. + class SalesforceIncidentsTemplateCreateData + include BaseGenericModel + + # Salesforce incident template attributes for a create request. + attr_reader :attributes + + # Salesforce incident template resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SalesforceIncidentsTemplateCreateAttributes', + :'type' => :'SalesforceIncidentsTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_request.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_request.rb new file mode 100644 index 000000000000..4d1a88c04307 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Create request for a Salesforce incident template. + class SalesforceIncidentsTemplateCreateRequest + include BaseGenericModel + + # Salesforce incident template data for a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SalesforceIncidentsTemplateCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_priority.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_priority.rb new file mode 100644 index 000000000000..651d73571dc7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_priority.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Priority of the Salesforce incident created from this template. + class SalesforceIncidentsTemplatePriority + include BaseEnumModel + + CRITICAL = "Critical".freeze + HIGH = "High".freeze + MODERATE = "Moderate".freeze + LOW = "Low".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_response.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_response.rb new file mode 100644 index 000000000000..8d7519f3fc58 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a Salesforce incident template. + class SalesforceIncidentsTemplateResponse + include BaseGenericModel + + # Salesforce incident template data from a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SalesforceIncidentsTemplateResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_response_attributes.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_response_attributes.rb new file mode 100644 index 000000000000..890a0b3645ce --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_response_attributes.rb @@ -0,0 +1,155 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce incident template attributes returned by the API. + class SalesforceIncidentsTemplateResponseAttributes + include BaseGenericModel + + # Long-form description body for Salesforce incidents created from this template. + attr_accessor :description + + # Human-readable name for this incident template. + attr_accessor :name + + # The Salesforce user ID that owns incidents created from this template. + attr_accessor :owner_id + + # Priority of the Salesforce incident created from this template. + attr_accessor :priority + + # The Datadog-assigned ID of the Salesforce organization this template belongs to. + attr_accessor :salesforce_org_id + + # Subject line for Salesforce incidents created from this template. + attr_accessor :subject + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'owner_id' => :'owner_id', + :'priority' => :'priority', + :'salesforce_org_id' => :'salesforce_org_id', + :'subject' => :'subject' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'owner_id' => :'String', + :'priority' => :'SalesforceIncidentsTemplatePriority', + :'salesforce_org_id' => :'UUID', + :'subject' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'owner_id') + self.owner_id = attributes[:'owner_id'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'salesforce_org_id') + self.salesforce_org_id = attributes[:'salesforce_org_id'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + owner_id == o.owner_id && + priority == o.priority && + salesforce_org_id == o.salesforce_org_id && + subject == o.subject && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, owner_id, priority, salesforce_org_id, subject, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_response_data.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_response_data.rb new file mode 100644 index 000000000000..41e5c5f9837f --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_response_data.rb @@ -0,0 +1,173 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce incident template data from a response. + class SalesforceIncidentsTemplateResponseData + include BaseGenericModel + + # Salesforce incident template attributes returned by the API. + attr_reader :attributes + + # The ID of the Salesforce incident template. + attr_reader :id + + # Salesforce incident template resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SalesforceIncidentsTemplateResponseAttributes', + :'id' => :'String', + :'type' => :'SalesforceIncidentsTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @id.to_s.length > 100 + return false if @id.to_s.length < 1 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_type.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_type.rb new file mode 100644 index 000000000000..b913ba88d932 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce incident template resource type. + class SalesforceIncidentsTemplateType + include BaseEnumModel + + SALESFORCE_INCIDENTS_INCIDENT_TEMPLATE = "salesforce-incidents-incident-template".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_attributes.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_attributes.rb new file mode 100644 index 000000000000..b7e3c73df720 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_attributes.rb @@ -0,0 +1,222 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce incident template attributes for an update request. + class SalesforceIncidentsTemplateUpdateAttributes + include BaseGenericModel + + # Long-form description body for Salesforce incidents created from this template. + attr_reader :description + + # Human-readable name for this incident template. + attr_reader :name + + # The Salesforce user ID that owns incidents created from this template. + attr_reader :owner_id + + # Priority of the Salesforce incident created from this template. + attr_accessor :priority + + # The Datadog-assigned ID of the Salesforce organization this template belongs to. + attr_accessor :salesforce_org_id + + # Subject line for Salesforce incidents created from this template. + attr_reader :subject + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'owner_id' => :'owner_id', + :'priority' => :'priority', + :'salesforce_org_id' => :'salesforce_org_id', + :'subject' => :'subject' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'owner_id' => :'String', + :'priority' => :'SalesforceIncidentsTemplatePriority', + :'salesforce_org_id' => :'UUID', + :'subject' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'owner_id') + self.owner_id = attributes[:'owner_id'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'salesforce_org_id') + self.salesforce_org_id = attributes[:'salesforce_org_id'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@description.nil? && @description.to_s.length > 2048 + return false if !@description.nil? && @description.to_s.length < 1 + return false if !@name.nil? && @name.to_s.length > 100 + return false if !@name.nil? && @name.to_s.length < 1 + return false if !@owner_id.nil? && @owner_id.to_s.length > 255 + return false if !@owner_id.nil? && @owner_id.to_s.length < 1 + return false if !@subject.nil? && @subject.to_s.length > 255 + return false if !@subject.nil? && @subject.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if !description.nil? && description.to_s.length > 2048 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 2048.' + end + if !description.nil? && description.to_s.length < 1 + fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if !name.nil? && name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + if !name.nil? && name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param owner_id [Object] Object to be assigned + # @!visibility private + def owner_id=(owner_id) + if !owner_id.nil? && owner_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "owner_id", the character length must be smaller than or equal to 255.' + end + if !owner_id.nil? && owner_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "owner_id", the character length must be great than or equal to 1.' + end + @owner_id = owner_id + end + + # Custom attribute writer method with validation + # @param subject [Object] Object to be assigned + # @!visibility private + def subject=(subject) + if !subject.nil? && subject.to_s.length > 255 + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 255.' + end + if !subject.nil? && subject.to_s.length < 1 + fail ArgumentError, 'invalid value for "subject", the character length must be great than or equal to 1.' + end + @subject = subject + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + owner_id == o.owner_id && + priority == o.priority && + salesforce_org_id == o.salesforce_org_id && + subject == o.subject && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, owner_id, priority, salesforce_org_id, subject, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_data.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_data.rb new file mode 100644 index 000000000000..33056f9e756f --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_data.rb @@ -0,0 +1,173 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Salesforce incident template data for an update request. + class SalesforceIncidentsTemplateUpdateData + include BaseGenericModel + + # Salesforce incident template attributes for an update request. + attr_reader :attributes + + # The ID of the Salesforce incident template being updated. Must match the path parameter. + attr_reader :id + + # Salesforce incident template resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SalesforceIncidentsTemplateUpdateAttributes', + :'id' => :'String', + :'type' => :'SalesforceIncidentsTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @id.to_s.length > 100 + return false if @id.to_s.length < 1 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_request.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_request.rb new file mode 100644 index 000000000000..4aa69b1353d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_template_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update request for a Salesforce incident template. + class SalesforceIncidentsTemplateUpdateRequest + include BaseGenericModel + + # Salesforce incident template data for an update request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SalesforceIncidentsTemplateUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplateUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/salesforce_incidents_templates_response.rb b/lib/datadog_api_client/v2/models/salesforce_incidents_templates_response.rb new file mode 100644 index 000000000000..a9fce3cb0d1b --- /dev/null +++ b/lib/datadog_api_client/v2/models/salesforce_incidents_templates_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of Salesforce incident templates. + class SalesforceIncidentsTemplatesResponse + include BaseGenericModel + + # An array of Salesforce incident templates. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SalesforceIncidentsTemplatesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end