From 7966dc80f5e354f6752cec13d5599af57c2ec580 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 23 Jan 2026 18:18:52 +0000 Subject: [PATCH] Regenerate client from commit 06d80d3 of spec repo --- .generator/schemas/v2/openapi.yaml | 767 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 189 +++++ .../CreateServiceNowTemplate.py | 39 + .../DeleteServiceNowTemplate.py | 15 + .../GetServiceNowTemplate.py | 17 + .../ListServiceNowAssignmentGroups.py | 17 + .../ListServiceNowBusinessServices.py | 17 + .../ListServiceNowInstances.py | 14 + .../ListServiceNowTemplates.py | 14 + .../ListServiceNowUsers.py | 17 + .../UpdateServiceNowTemplate.py | 41 + src/datadog_api_client/configuration.py | 9 + .../v2/api/service_now_integration_api.py | 370 +++++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + ...service_now_assignment_group_attributes.py | 46 ++ .../service_now_assignment_group_data.py | 59 ++ .../service_now_assignment_group_type.py | 35 + .../service_now_assignment_groups_response.py | 40 + ...service_now_business_service_attributes.py | 46 ++ .../service_now_business_service_data.py | 59 ++ .../service_now_business_service_type.py | 35 + .../service_now_business_services_response.py | 40 + .../model/service_now_instance_attributes.py | 33 + .../v2/model/service_now_instance_data.py | 55 ++ .../v2/model/service_now_instance_type.py | 35 + .../model/service_now_instances_response.py | 40 + .../model/service_now_template_attributes.py | 87 ++ .../service_now_template_create_request.py | 42 + ..._now_template_create_request_attributes.py | 87 ++ ...ervice_now_template_create_request_data.py | 52 ++ .../v2/model/service_now_template_data.py | 55 ++ .../v2/model/service_now_template_response.py | 40 + .../v2/model/service_now_template_type.py | 35 + .../service_now_template_update_request.py | 42 + ..._now_template_update_request_attributes.py | 87 ++ ...ervice_now_template_update_request_data.py | 52 ++ .../model/service_now_templates_response.py | 40 + .../v2/model/service_now_user_attributes.py | 70 ++ .../v2/model/service_now_user_data.py | 55 ++ .../v2/model/service_now_user_type.py | 35 + .../v2/model/service_now_users_response.py | 40 + src/datadog_api_client/v2/models/__init__.py | 58 ++ .../features/servicenow_integration.feature | 194 +++++ tests/v2/features/undo.json | 61 ++ 45 files changed, 3190 insertions(+) create mode 100644 examples/v2/servicenow-integration/CreateServiceNowTemplate.py create mode 100644 examples/v2/servicenow-integration/DeleteServiceNowTemplate.py create mode 100644 examples/v2/servicenow-integration/GetServiceNowTemplate.py create mode 100644 examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.py create mode 100644 examples/v2/servicenow-integration/ListServiceNowBusinessServices.py create mode 100644 examples/v2/servicenow-integration/ListServiceNowInstances.py create mode 100644 examples/v2/servicenow-integration/ListServiceNowTemplates.py create mode 100644 examples/v2/servicenow-integration/ListServiceNowUsers.py create mode 100644 examples/v2/servicenow-integration/UpdateServiceNowTemplate.py create mode 100644 src/datadog_api_client/v2/api/service_now_integration_api.py create mode 100644 src/datadog_api_client/v2/model/service_now_assignment_group_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_now_assignment_group_data.py create mode 100644 src/datadog_api_client/v2/model/service_now_assignment_group_type.py create mode 100644 src/datadog_api_client/v2/model/service_now_assignment_groups_response.py create mode 100644 src/datadog_api_client/v2/model/service_now_business_service_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_now_business_service_data.py create mode 100644 src/datadog_api_client/v2/model/service_now_business_service_type.py create mode 100644 src/datadog_api_client/v2/model/service_now_business_services_response.py create mode 100644 src/datadog_api_client/v2/model/service_now_instance_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_now_instance_data.py create mode 100644 src/datadog_api_client/v2/model/service_now_instance_type.py create mode 100644 src/datadog_api_client/v2/model/service_now_instances_response.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_create_request.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_create_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_create_request_data.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_data.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_response.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_type.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_update_request.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_update_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_now_template_update_request_data.py create mode 100644 src/datadog_api_client/v2/model/service_now_templates_response.py create mode 100644 src/datadog_api_client/v2/model/service_now_user_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_now_user_data.py create mode 100644 src/datadog_api_client/v2/model/service_now_user_type.py create mode 100644 src/datadog_api_client/v2/model/service_now_users_response.py create mode 100644 tests/v2/features/servicenow_integration.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5190081e02..7052372666 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -56094,6 +56094,65 @@ components: type: string x-enum-varnames: - SERVICES_LIST + ServiceNowAssignmentGroupAttributes: + description: Attributes of a ServiceNow assignment group + properties: + assignment_group_name: + description: The name of the assignment group + example: Network Team + type: string + assignment_group_sys_id: + description: The system ID of the assignment group in ServiceNow + example: abc123def456 + type: string + instance_id: + description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + required: + - instance_id + - assignment_group_name + - assignment_group_sys_id + type: object + ServiceNowAssignmentGroupData: + description: Data object for a ServiceNow assignment group + properties: + attributes: + $ref: '#/components/schemas/ServiceNowAssignmentGroupAttributes' + id: + description: Unique identifier for the ServiceNow assignment group + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + type: + $ref: '#/components/schemas/ServiceNowAssignmentGroupType' + required: + - id + - type + - attributes + type: object + ServiceNowAssignmentGroupType: + description: Type identifier for ServiceNow assignment group resources + enum: + - assignment_groups + example: assignment_groups + type: string + x-enum-varnames: + - ASSIGNMENT_GROUPS + ServiceNowAssignmentGroupsData: + description: Array of ServiceNow assignment group data objects + items: + $ref: '#/components/schemas/ServiceNowAssignmentGroupData' + type: array + ServiceNowAssignmentGroupsResponse: + description: Response containing ServiceNow assignment groups + properties: + data: + $ref: '#/components/schemas/ServiceNowAssignmentGroupsData' + required: + - data + type: object ServiceNowBasicAuth: description: The definition of the `ServiceNowBasicAuth` object. properties: @@ -56142,6 +56201,65 @@ components: required: - type type: object + ServiceNowBusinessServiceAttributes: + description: Attributes of a ServiceNow business service + properties: + instance_id: + description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + service_name: + description: The name of the business service + example: IT Support + type: string + service_sys_id: + description: The system ID of the business service in ServiceNow + example: abc123def456 + type: string + required: + - instance_id + - service_name + - service_sys_id + type: object + ServiceNowBusinessServiceData: + description: Data object for a ServiceNow business service + properties: + attributes: + $ref: '#/components/schemas/ServiceNowBusinessServiceAttributes' + id: + description: Unique identifier for the ServiceNow business service + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + type: + $ref: '#/components/schemas/ServiceNowBusinessServiceType' + required: + - id + - type + - attributes + type: object + ServiceNowBusinessServiceType: + description: Type identifier for ServiceNow business service resources + enum: + - business_services + example: business_services + type: string + x-enum-varnames: + - BUSINESS_SERVICES + ServiceNowBusinessServicesData: + description: Array of ServiceNow business service data objects + items: + $ref: '#/components/schemas/ServiceNowBusinessServiceData' + type: array + ServiceNowBusinessServicesResponse: + description: Response containing ServiceNow business services + properties: + data: + $ref: '#/components/schemas/ServiceNowBusinessServicesData' + required: + - data + type: object ServiceNowCredentials: description: The definition of the `ServiceNowCredentials` object. oneOf: @@ -56150,6 +56268,54 @@ components: description: The definition of the `ServiceNowCredentialsUpdate` object. oneOf: - $ref: '#/components/schemas/ServiceNowBasicAuthUpdate' + ServiceNowInstanceAttributes: + description: Attributes of a ServiceNow instance + properties: + instance_name: + description: The name of the ServiceNow instance + example: my-servicenow-instance + type: string + required: + - instance_name + type: object + ServiceNowInstanceData: + description: Data object for a ServiceNow instance + properties: + attributes: + $ref: '#/components/schemas/ServiceNowInstanceAttributes' + id: + description: Unique identifier for the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + type: + $ref: '#/components/schemas/ServiceNowInstanceType' + required: + - id + - type + - attributes + type: object + ServiceNowInstanceType: + description: Type identifier for ServiceNow instance resources + enum: + - instance + example: instance + type: string + x-enum-varnames: + - INSTANCE + ServiceNowInstancesData: + description: Array of ServiceNow instance data objects + items: + $ref: '#/components/schemas/ServiceNowInstanceData' + type: array + ServiceNowInstancesResponse: + description: Response containing ServiceNow instances + properties: + data: + $ref: '#/components/schemas/ServiceNowInstancesData' + required: + - data + type: object ServiceNowIntegration: description: The definition of the `ServiceNowIntegration` object. properties: @@ -56179,6 +56345,222 @@ components: required: - type type: object + ServiceNowTemplateAttributes: + description: Attributes of a ServiceNow template + properties: + assignment_group_id: + description: The ID of the assignment group + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + business_service_id: + description: The ID of the business service + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + fields_mapping: + additionalProperties: + type: string + description: Custom field mappings for the template + example: + category: software + priority: '1' + type: object + handle_name: + description: The handle name of the template + example: incident-template + type: string + instance_id: + description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + servicenow_tablename: + description: The name of the destination ServiceNow table + example: incident + type: string + user_id: + description: The ID of the user + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + required: + - instance_id + - handle_name + - servicenow_tablename + type: object + ServiceNowTemplateCreateRequest: + description: Request to create a ServiceNow template + properties: + data: + $ref: '#/components/schemas/ServiceNowTemplateCreateRequestData' + required: + - data + type: object + ServiceNowTemplateCreateRequestAttributes: + description: Attributes for creating a ServiceNow template + properties: + assignment_group_id: + description: The ID of the assignment group + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + business_service_id: + description: The ID of the business service + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + fields_mapping: + additionalProperties: + type: string + description: Custom field mappings for the template + example: + category: software + priority: '1' + type: object + handle_name: + description: The handle name of the template + example: incident-template + type: string + instance_id: + description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + servicenow_tablename: + description: The name of the destination ServiceNow table + example: incident + type: string + user_id: + description: The ID of the user + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + required: + - instance_id + - handle_name + - servicenow_tablename + type: object + ServiceNowTemplateCreateRequestData: + description: Data object for creating a ServiceNow template + properties: + attributes: + $ref: '#/components/schemas/ServiceNowTemplateCreateRequestAttributes' + type: + $ref: '#/components/schemas/ServiceNowTemplateType' + required: + - type + - attributes + type: object + ServiceNowTemplateData: + description: Data object for a ServiceNow template + properties: + attributes: + $ref: '#/components/schemas/ServiceNowTemplateAttributes' + id: + description: Unique identifier for the ServiceNow template + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + type: + $ref: '#/components/schemas/ServiceNowTemplateType' + required: + - id + - type + - attributes + type: object + ServiceNowTemplateResponse: + description: Response containing a single ServiceNow template + properties: + data: + $ref: '#/components/schemas/ServiceNowTemplateData' + required: + - data + type: object + ServiceNowTemplateType: + description: Type identifier for ServiceNow template resources + enum: + - servicenow_templates + example: servicenow_templates + type: string + x-enum-varnames: + - SERVICENOW_TEMPLATES + ServiceNowTemplateUpdateRequest: + description: Request to update a ServiceNow template + properties: + data: + $ref: '#/components/schemas/ServiceNowTemplateUpdateRequestData' + required: + - data + type: object + ServiceNowTemplateUpdateRequestAttributes: + description: Attributes for updating a ServiceNow template + properties: + assignment_group_id: + description: The ID of the assignment group + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + business_service_id: + description: The ID of the business service + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + fields_mapping: + additionalProperties: + type: string + description: Custom field mappings for the template + example: + category: hardware + priority: '2' + type: object + handle_name: + description: The handle name of the template + example: incident-template-updated + type: string + instance_id: + description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + servicenow_tablename: + description: The name of the destination ServiceNow table + example: incident + type: string + user_id: + description: The ID of the user + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + required: + - instance_id + - handle_name + - servicenow_tablename + type: object + ServiceNowTemplateUpdateRequestData: + description: Data object for updating a ServiceNow template + properties: + attributes: + $ref: '#/components/schemas/ServiceNowTemplateUpdateRequestAttributes' + type: + $ref: '#/components/schemas/ServiceNowTemplateType' + required: + - type + - attributes + type: object + ServiceNowTemplatesData: + description: Array of ServiceNow template data objects + items: + $ref: '#/components/schemas/ServiceNowTemplateData' + type: array + ServiceNowTemplatesResponse: + description: Response containing ServiceNow templates + properties: + data: + $ref: '#/components/schemas/ServiceNowTemplatesData' + required: + - data + type: object ServiceNowTicket: description: ServiceNow ticket attached to case nullable: true @@ -56196,6 +56578,74 @@ components: description: Link to the Incident created on ServiceNow type: string type: object + ServiceNowUserAttributes: + description: Attributes of a ServiceNow user + properties: + email: + description: The email address of the user + example: john.doe@example.com + type: string + full_name: + description: The full name of the user + example: John Doe + type: string + instance_id: + description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + user_name: + description: The username of the ServiceNow user + example: john.doe + type: string + user_sys_id: + description: The system ID of the user in ServiceNow + example: abc123def456 + type: string + required: + - instance_id + - user_name + - user_sys_id + - email + type: object + ServiceNowUserData: + description: Data object for a ServiceNow user + properties: + attributes: + $ref: '#/components/schemas/ServiceNowUserAttributes' + id: + description: Unique identifier for the ServiceNow user + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + type: + $ref: '#/components/schemas/ServiceNowUserType' + required: + - id + - type + - attributes + type: object + ServiceNowUserType: + description: Type identifier for ServiceNow user resources + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS + ServiceNowUsersData: + description: Array of ServiceNow user data objects + items: + $ref: '#/components/schemas/ServiceNowUserData' + type: array + ServiceNowUsersResponse: + description: Response containing ServiceNow users + properties: + data: + $ref: '#/components/schemas/ServiceNowUsersData' + required: + - data + type: object Shift: description: An on-call shift with its associated data and relationships. example: @@ -77664,6 +78114,320 @@ paths: operator: OR permissions: - manage_integrations + /api/v2/integration/servicenow/assignment_groups/{instance_id}: + get: + description: Get all assignment groups for a ServiceNow instance. + operationId: ListServiceNowAssignmentGroups + parameters: + - description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: instance_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowAssignmentGroupsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List ServiceNow assignment groups + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/servicenow/business_services/{instance_id}: + get: + description: Get all business services for a ServiceNow instance. + operationId: ListServiceNowBusinessServices + parameters: + - description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: instance_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowBusinessServicesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List ServiceNow business services + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/servicenow/handles: + get: + description: Get all ServiceNow templates for the organization. + operationId: ListServiceNowTemplates + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowTemplatesResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List ServiceNow templates + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new ServiceNow template. + operationId: CreateServiceNowTemplate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowTemplateCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowTemplateResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create ServiceNow template + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/servicenow/handles/{template_id}: + delete: + description: Delete a ServiceNow template by ID. + operationId: DeleteServiceNowTemplate + parameters: + - description: The ID of the ServiceNow template to delete + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: template_id + required: true + schema: + format: uuid + type: string + responses: + '200': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete ServiceNow template + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a ServiceNow template by ID. + operationId: GetServiceNowTemplate + parameters: + - description: The ID of the ServiceNow template to retrieve + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: template_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowTemplateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get ServiceNow template + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Update a ServiceNow template by ID. + operationId: UpdateServiceNowTemplate + parameters: + - description: The ID of the ServiceNow template to update + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: template_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowTemplateUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowTemplateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update ServiceNow template + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/servicenow/instances: + get: + description: Get all ServiceNow instances for the organization. + operationId: ListServiceNowInstances + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowInstancesResponse' + description: OK + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List ServiceNow instances + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/servicenow/users/{instance_id}: + get: + description: Get all users for a ServiceNow instance. + operationId: ListServiceNowUsers + parameters: + - description: The ID of the ServiceNow instance + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: instance_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowUsersResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List ServiceNow users + tags: + - ServiceNow Integration + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integrations/cloudflare/accounts: get: description: List Cloudflare accounts. @@ -98811,6 +99575,9 @@ tags: This feature is currently in BETA. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' name: Service Scorecards +- description: Manage your ServiceNow Integration. ServiceNow is a cloud-based platform + that helps organizations manage digital workflows for enterprise operations. + name: ServiceNow Integration - description: API to create, update, retrieve, and delete Software Catalog entities. externalDocs: url: https://docs.datadoghq.com/service_catalog/service_definitions#metadata-schema-v30-beta diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index f964676824..1bb879078c 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -543,6 +543,13 @@ datadog\_api\_client.v2.api.service\_level\_objectives\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.service\_now\_integration\_api module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.service_now_integration_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.service\_scorecards\_api module ----------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 4a28a990d9..69abe69668 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -24448,6 +24448,34 @@ datadog\_api\_client.v2.model.service\_list\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_now\_assignment\_group\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_assignment_group_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_assignment\_group\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_assignment_group_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_assignment\_group\_type module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_assignment_group_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_assignment\_groups\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_assignment_groups_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.service\_now\_basic\_auth module -------------------------------------------------------------- @@ -24469,6 +24497,34 @@ datadog\_api\_client.v2.model.service\_now\_basic\_auth\_update module :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_now\_business\_service\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_business_service_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_business\_service\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_business_service_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_business\_service\_type module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_business_service_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_business\_services\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_business_services_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.service\_now\_credentials module -------------------------------------------------------------- @@ -24483,6 +24539,34 @@ datadog\_api\_client.v2.model.service\_now\_credentials\_update module :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_now\_instance\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_instance_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_instance\_data module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_instance_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_instance\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_instance_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_instances\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_instances_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.service\_now\_integration module -------------------------------------------------------------- @@ -24504,6 +24588,83 @@ datadog\_api\_client.v2.model.service\_now\_integration\_update module :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_now\_template\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_create\_request module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_create\_request\_attributes module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_create_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_create\_request\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_create_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_data module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_update\_request module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_update\_request\_attributes module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_update_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_template\_update\_request\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_template_update_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_templates\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_templates_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.service\_now\_ticket module --------------------------------------------------------- @@ -24518,6 +24679,34 @@ datadog\_api\_client.v2.model.service\_now\_ticket\_result module :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_now\_user\_attributes module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_user_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_user\_data module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_user_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_user\_type module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_user_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_now\_users\_response module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.service_now_users_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.shift module ------------------------------------------ diff --git a/examples/v2/servicenow-integration/CreateServiceNowTemplate.py b/examples/v2/servicenow-integration/CreateServiceNowTemplate.py new file mode 100644 index 0000000000..181d0d01c9 --- /dev/null +++ b/examples/v2/servicenow-integration/CreateServiceNowTemplate.py @@ -0,0 +1,39 @@ +""" +Create ServiceNow template returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi +from datadog_api_client.v2.model.service_now_template_create_request import ServiceNowTemplateCreateRequest +from datadog_api_client.v2.model.service_now_template_create_request_attributes import ( + ServiceNowTemplateCreateRequestAttributes, +) +from datadog_api_client.v2.model.service_now_template_create_request_data import ServiceNowTemplateCreateRequestData +from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType +from uuid import UUID + +body = ServiceNowTemplateCreateRequest( + data=ServiceNowTemplateCreateRequestData( + attributes=ServiceNowTemplateCreateRequestAttributes( + assignment_group_id=UUID("65b3341b-0680-47f9-a6d4-134db45c603e"), + business_service_id=UUID("65b3341b-0680-47f9-a6d4-134db45c603e"), + fields_mapping=dict( + category="software", + priority="1", + ), + handle_name="incident-template", + instance_id=UUID("65b3341b-0680-47f9-a6d4-134db45c603e"), + servicenow_tablename="incident", + user_id=UUID("65b3341b-0680-47f9-a6d4-134db45c603e"), + ), + type=ServiceNowTemplateType.SERVICENOW_TEMPLATES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_service_now_template"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + response = api_instance.create_service_now_template(body=body) + + print(response) diff --git a/examples/v2/servicenow-integration/DeleteServiceNowTemplate.py b/examples/v2/servicenow-integration/DeleteServiceNowTemplate.py new file mode 100644 index 0000000000..3b85ca62e9 --- /dev/null +++ b/examples/v2/servicenow-integration/DeleteServiceNowTemplate.py @@ -0,0 +1,15 @@ +""" +Delete ServiceNow template returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["delete_service_now_template"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + api_instance.delete_service_now_template( + template_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) diff --git a/examples/v2/servicenow-integration/GetServiceNowTemplate.py b/examples/v2/servicenow-integration/GetServiceNowTemplate.py new file mode 100644 index 0000000000..3ec4122a31 --- /dev/null +++ b/examples/v2/servicenow-integration/GetServiceNowTemplate.py @@ -0,0 +1,17 @@ +""" +Get ServiceNow template returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["get_service_now_template"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + response = api_instance.get_service_now_template( + template_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.py b/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.py new file mode 100644 index 0000000000..b3f6d0a4fb --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.py @@ -0,0 +1,17 @@ +""" +List ServiceNow assignment groups returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["list_service_now_assignment_groups"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + response = api_instance.list_service_now_assignment_groups( + instance_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/servicenow-integration/ListServiceNowBusinessServices.py b/examples/v2/servicenow-integration/ListServiceNowBusinessServices.py new file mode 100644 index 0000000000..f819dd1825 --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowBusinessServices.py @@ -0,0 +1,17 @@ +""" +List ServiceNow business services returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["list_service_now_business_services"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + response = api_instance.list_service_now_business_services( + instance_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/servicenow-integration/ListServiceNowInstances.py b/examples/v2/servicenow-integration/ListServiceNowInstances.py new file mode 100644 index 0000000000..4aa0895835 --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowInstances.py @@ -0,0 +1,14 @@ +""" +List ServiceNow instances returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi + +configuration = Configuration() +configuration.unstable_operations["list_service_now_instances"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + response = api_instance.list_service_now_instances() + + print(response) diff --git a/examples/v2/servicenow-integration/ListServiceNowTemplates.py b/examples/v2/servicenow-integration/ListServiceNowTemplates.py new file mode 100644 index 0000000000..66e2ff860c --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowTemplates.py @@ -0,0 +1,14 @@ +""" +List ServiceNow templates returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi + +configuration = Configuration() +configuration.unstable_operations["list_service_now_templates"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + response = api_instance.list_service_now_templates() + + print(response) diff --git a/examples/v2/servicenow-integration/ListServiceNowUsers.py b/examples/v2/servicenow-integration/ListServiceNowUsers.py new file mode 100644 index 0000000000..5963f4352b --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowUsers.py @@ -0,0 +1,17 @@ +""" +List ServiceNow users returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["list_service_now_users"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + response = api_instance.list_service_now_users( + instance_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/servicenow-integration/UpdateServiceNowTemplate.py b/examples/v2/servicenow-integration/UpdateServiceNowTemplate.py new file mode 100644 index 0000000000..63673263af --- /dev/null +++ b/examples/v2/servicenow-integration/UpdateServiceNowTemplate.py @@ -0,0 +1,41 @@ +""" +Update ServiceNow template returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi +from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType +from datadog_api_client.v2.model.service_now_template_update_request import ServiceNowTemplateUpdateRequest +from datadog_api_client.v2.model.service_now_template_update_request_attributes import ( + ServiceNowTemplateUpdateRequestAttributes, +) +from datadog_api_client.v2.model.service_now_template_update_request_data import ServiceNowTemplateUpdateRequestData +from uuid import UUID + +body = ServiceNowTemplateUpdateRequest( + data=ServiceNowTemplateUpdateRequestData( + attributes=ServiceNowTemplateUpdateRequestAttributes( + assignment_group_id=UUID("65b3341b-0680-47f9-a6d4-134db45c603e"), + business_service_id=UUID("65b3341b-0680-47f9-a6d4-134db45c603e"), + fields_mapping=dict( + category="hardware", + priority="2", + ), + handle_name="incident-template-updated", + instance_id=UUID("65b3341b-0680-47f9-a6d4-134db45c603e"), + servicenow_tablename="incident", + user_id=UUID("65b3341b-0680-47f9-a6d4-134db45c603e"), + ), + type=ServiceNowTemplateType.SERVICENOW_TEMPLATES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_service_now_template"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceNowIntegrationApi(api_client) + response = api_instance.update_service_now_template( + template_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 6309158fac..cf63f54a1c 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -353,6 +353,15 @@ def __init__( "v2.list_jira_accounts": False, "v2.list_jira_issue_templates": False, "v2.update_jira_issue_template": False, + "v2.create_service_now_template": False, + "v2.delete_service_now_template": False, + "v2.get_service_now_template": False, + "v2.list_service_now_assignment_groups": False, + "v2.list_service_now_business_services": False, + "v2.list_service_now_instances": False, + "v2.list_service_now_templates": False, + "v2.list_service_now_users": False, + "v2.update_service_now_template": False, "v2.add_role_to_restriction_query": False, "v2.create_restriction_query": False, "v2.delete_restriction_query": False, diff --git a/src/datadog_api_client/v2/api/service_now_integration_api.py b/src/datadog_api_client/v2/api/service_now_integration_api.py new file mode 100644 index 0000000000..c017e225f6 --- /dev/null +++ b/src/datadog_api_client/v2/api/service_now_integration_api.py @@ -0,0 +1,370 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UUID, +) +from datadog_api_client.v2.model.service_now_assignment_groups_response import ServiceNowAssignmentGroupsResponse +from datadog_api_client.v2.model.service_now_business_services_response import ServiceNowBusinessServicesResponse +from datadog_api_client.v2.model.service_now_templates_response import ServiceNowTemplatesResponse +from datadog_api_client.v2.model.service_now_template_response import ServiceNowTemplateResponse +from datadog_api_client.v2.model.service_now_template_create_request import ServiceNowTemplateCreateRequest +from datadog_api_client.v2.model.service_now_template_update_request import ServiceNowTemplateUpdateRequest +from datadog_api_client.v2.model.service_now_instances_response import ServiceNowInstancesResponse +from datadog_api_client.v2.model.service_now_users_response import ServiceNowUsersResponse + + +class ServiceNowIntegrationApi: + """ + Manage your ServiceNow Integration. ServiceNow is a cloud-based platform that helps organizations manage digital workflows for enterprise operations. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_service_now_template_endpoint = _Endpoint( + settings={ + "response_type": (ServiceNowTemplateResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/handles", + "operation_id": "create_service_now_template", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ServiceNowTemplateCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_service_now_template_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/handles/{template_id}", + "operation_id": "delete_service_now_template", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "template_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "template_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_service_now_template_endpoint = _Endpoint( + settings={ + "response_type": (ServiceNowTemplateResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/handles/{template_id}", + "operation_id": "get_service_now_template", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "template_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "template_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_service_now_assignment_groups_endpoint = _Endpoint( + settings={ + "response_type": (ServiceNowAssignmentGroupsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/assignment_groups/{instance_id}", + "operation_id": "list_service_now_assignment_groups", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "instance_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "instance_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_service_now_business_services_endpoint = _Endpoint( + settings={ + "response_type": (ServiceNowBusinessServicesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/business_services/{instance_id}", + "operation_id": "list_service_now_business_services", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "instance_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "instance_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_service_now_instances_endpoint = _Endpoint( + settings={ + "response_type": (ServiceNowInstancesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/instances", + "operation_id": "list_service_now_instances", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_service_now_templates_endpoint = _Endpoint( + settings={ + "response_type": (ServiceNowTemplatesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/handles", + "operation_id": "list_service_now_templates", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_service_now_users_endpoint = _Endpoint( + settings={ + "response_type": (ServiceNowUsersResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/users/{instance_id}", + "operation_id": "list_service_now_users", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "instance_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "instance_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_service_now_template_endpoint = _Endpoint( + settings={ + "response_type": (ServiceNowTemplateResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/servicenow/handles/{template_id}", + "operation_id": "update_service_now_template", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "template_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "template_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ServiceNowTemplateUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_service_now_template( + self, + body: ServiceNowTemplateCreateRequest, + ) -> ServiceNowTemplateResponse: + """Create ServiceNow template. + + Create a new ServiceNow template. + + :type body: ServiceNowTemplateCreateRequest + :rtype: ServiceNowTemplateResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_service_now_template_endpoint.call_with_http_info(**kwargs) + + def delete_service_now_template( + self, + template_id: UUID, + ) -> None: + """Delete ServiceNow template. + + Delete a ServiceNow template by ID. + + :param template_id: The ID of the ServiceNow template to delete + :type template_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["template_id"] = template_id + + return self._delete_service_now_template_endpoint.call_with_http_info(**kwargs) + + def get_service_now_template( + self, + template_id: UUID, + ) -> ServiceNowTemplateResponse: + """Get ServiceNow template. + + Get a ServiceNow template by ID. + + :param template_id: The ID of the ServiceNow template to retrieve + :type template_id: UUID + :rtype: ServiceNowTemplateResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["template_id"] = template_id + + return self._get_service_now_template_endpoint.call_with_http_info(**kwargs) + + def list_service_now_assignment_groups( + self, + instance_id: UUID, + ) -> ServiceNowAssignmentGroupsResponse: + """List ServiceNow assignment groups. + + Get all assignment groups for a ServiceNow instance. + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + :rtype: ServiceNowAssignmentGroupsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["instance_id"] = instance_id + + return self._list_service_now_assignment_groups_endpoint.call_with_http_info(**kwargs) + + def list_service_now_business_services( + self, + instance_id: UUID, + ) -> ServiceNowBusinessServicesResponse: + """List ServiceNow business services. + + Get all business services for a ServiceNow instance. + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + :rtype: ServiceNowBusinessServicesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["instance_id"] = instance_id + + return self._list_service_now_business_services_endpoint.call_with_http_info(**kwargs) + + def list_service_now_instances( + self, + ) -> ServiceNowInstancesResponse: + """List ServiceNow instances. + + Get all ServiceNow instances for the organization. + + :rtype: ServiceNowInstancesResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_service_now_instances_endpoint.call_with_http_info(**kwargs) + + def list_service_now_templates( + self, + ) -> ServiceNowTemplatesResponse: + """List ServiceNow templates. + + Get all ServiceNow templates for the organization. + + :rtype: ServiceNowTemplatesResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_service_now_templates_endpoint.call_with_http_info(**kwargs) + + def list_service_now_users( + self, + instance_id: UUID, + ) -> ServiceNowUsersResponse: + """List ServiceNow users. + + Get all users for a ServiceNow instance. + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + :rtype: ServiceNowUsersResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["instance_id"] = instance_id + + return self._list_service_now_users_endpoint.call_with_http_info(**kwargs) + + def update_service_now_template( + self, + template_id: UUID, + body: ServiceNowTemplateUpdateRequest, + ) -> ServiceNowTemplateResponse: + """Update ServiceNow template. + + Update a ServiceNow template by ID. + + :param template_id: The ID of the ServiceNow template to update + :type template_id: UUID + :type body: ServiceNowTemplateUpdateRequest + :rtype: ServiceNowTemplateResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["template_id"] = template_id + + kwargs["body"] = body + + return self._update_service_now_template_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index a4bef17bc5..a1f0834a09 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -76,6 +76,7 @@ from datadog_api_client.v2.api.service_definition_api import ServiceDefinitionApi from datadog_api_client.v2.api.service_level_objectives_api import ServiceLevelObjectivesApi from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi +from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi from datadog_api_client.v2.api.spa_api import SpaApi from datadog_api_client.v2.api.spans_api import SpansApi @@ -169,6 +170,7 @@ "ServiceDefinitionApi", "ServiceLevelObjectivesApi", "ServiceScorecardsApi", + "ServiceNowIntegrationApi", "SoftwareCatalogApi", "SpaApi", "SpansApi", diff --git a/src/datadog_api_client/v2/model/service_now_assignment_group_attributes.py b/src/datadog_api_client/v2/model/service_now_assignment_group_attributes.py new file mode 100644 index 0000000000..fa5b0aafaa --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_assignment_group_attributes.py @@ -0,0 +1,46 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +class ServiceNowAssignmentGroupAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assignment_group_name": (str,), + "assignment_group_sys_id": (str,), + "instance_id": (UUID,), + } + + attribute_map = { + "assignment_group_name": "assignment_group_name", + "assignment_group_sys_id": "assignment_group_sys_id", + "instance_id": "instance_id", + } + + def __init__(self_, assignment_group_name: str, assignment_group_sys_id: str, instance_id: UUID, **kwargs): + """ + Attributes of a ServiceNow assignment group + + :param assignment_group_name: The name of the assignment group + :type assignment_group_name: str + + :param assignment_group_sys_id: The system ID of the assignment group in ServiceNow + :type assignment_group_sys_id: str + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + """ + super().__init__(kwargs) + + self_.assignment_group_name = assignment_group_name + self_.assignment_group_sys_id = assignment_group_sys_id + self_.instance_id = instance_id diff --git a/src/datadog_api_client/v2/model/service_now_assignment_group_data.py b/src/datadog_api_client/v2/model/service_now_assignment_group_data.py new file mode 100644 index 0000000000..8f18dfff06 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_assignment_group_data.py @@ -0,0 +1,59 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_assignment_group_attributes import ServiceNowAssignmentGroupAttributes + from datadog_api_client.v2.model.service_now_assignment_group_type import ServiceNowAssignmentGroupType + + +class ServiceNowAssignmentGroupData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_assignment_group_attributes import ( + ServiceNowAssignmentGroupAttributes, + ) + from datadog_api_client.v2.model.service_now_assignment_group_type import ServiceNowAssignmentGroupType + + return { + "attributes": (ServiceNowAssignmentGroupAttributes,), + "id": (UUID,), + "type": (ServiceNowAssignmentGroupType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: ServiceNowAssignmentGroupAttributes, id: UUID, type: ServiceNowAssignmentGroupType, **kwargs + ): + """ + Data object for a ServiceNow assignment group + + :param attributes: Attributes of a ServiceNow assignment group + :type attributes: ServiceNowAssignmentGroupAttributes + + :param id: Unique identifier for the ServiceNow assignment group + :type id: UUID + + :param type: Type identifier for ServiceNow assignment group resources + :type type: ServiceNowAssignmentGroupType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_now_assignment_group_type.py b/src/datadog_api_client/v2/model/service_now_assignment_group_type.py new file mode 100644 index 0000000000..32d25af2cd --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_assignment_group_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ServiceNowAssignmentGroupType(ModelSimple): + """ + Type identifier for ServiceNow assignment group resources + + :param value: If omitted defaults to "assignment_groups". Must be one of ["assignment_groups"]. + :type value: str + """ + + allowed_values = { + "assignment_groups", + } + ASSIGNMENT_GROUPS: ClassVar["ServiceNowAssignmentGroupType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ServiceNowAssignmentGroupType.ASSIGNMENT_GROUPS = ServiceNowAssignmentGroupType("assignment_groups") diff --git a/src/datadog_api_client/v2/model/service_now_assignment_groups_response.py b/src/datadog_api_client/v2/model/service_now_assignment_groups_response.py new file mode 100644 index 0000000000..7b2ad27385 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_assignment_groups_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_assignment_group_data import ServiceNowAssignmentGroupData + + +class ServiceNowAssignmentGroupsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_assignment_group_data import ServiceNowAssignmentGroupData + + return { + "data": ([ServiceNowAssignmentGroupData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ServiceNowAssignmentGroupData], **kwargs): + """ + Response containing ServiceNow assignment groups + + :param data: Array of ServiceNow assignment group data objects + :type data: [ServiceNowAssignmentGroupData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/service_now_business_service_attributes.py b/src/datadog_api_client/v2/model/service_now_business_service_attributes.py new file mode 100644 index 0000000000..b1ac613056 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_business_service_attributes.py @@ -0,0 +1,46 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +class ServiceNowBusinessServiceAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "instance_id": (UUID,), + "service_name": (str,), + "service_sys_id": (str,), + } + + attribute_map = { + "instance_id": "instance_id", + "service_name": "service_name", + "service_sys_id": "service_sys_id", + } + + def __init__(self_, instance_id: UUID, service_name: str, service_sys_id: str, **kwargs): + """ + Attributes of a ServiceNow business service + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + + :param service_name: The name of the business service + :type service_name: str + + :param service_sys_id: The system ID of the business service in ServiceNow + :type service_sys_id: str + """ + super().__init__(kwargs) + + self_.instance_id = instance_id + self_.service_name = service_name + self_.service_sys_id = service_sys_id diff --git a/src/datadog_api_client/v2/model/service_now_business_service_data.py b/src/datadog_api_client/v2/model/service_now_business_service_data.py new file mode 100644 index 0000000000..9eb5e8d954 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_business_service_data.py @@ -0,0 +1,59 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_business_service_attributes import ServiceNowBusinessServiceAttributes + from datadog_api_client.v2.model.service_now_business_service_type import ServiceNowBusinessServiceType + + +class ServiceNowBusinessServiceData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_business_service_attributes import ( + ServiceNowBusinessServiceAttributes, + ) + from datadog_api_client.v2.model.service_now_business_service_type import ServiceNowBusinessServiceType + + return { + "attributes": (ServiceNowBusinessServiceAttributes,), + "id": (UUID,), + "type": (ServiceNowBusinessServiceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: ServiceNowBusinessServiceAttributes, id: UUID, type: ServiceNowBusinessServiceType, **kwargs + ): + """ + Data object for a ServiceNow business service + + :param attributes: Attributes of a ServiceNow business service + :type attributes: ServiceNowBusinessServiceAttributes + + :param id: Unique identifier for the ServiceNow business service + :type id: UUID + + :param type: Type identifier for ServiceNow business service resources + :type type: ServiceNowBusinessServiceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_now_business_service_type.py b/src/datadog_api_client/v2/model/service_now_business_service_type.py new file mode 100644 index 0000000000..702fb2bbdd --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_business_service_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ServiceNowBusinessServiceType(ModelSimple): + """ + Type identifier for ServiceNow business service resources + + :param value: If omitted defaults to "business_services". Must be one of ["business_services"]. + :type value: str + """ + + allowed_values = { + "business_services", + } + BUSINESS_SERVICES: ClassVar["ServiceNowBusinessServiceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ServiceNowBusinessServiceType.BUSINESS_SERVICES = ServiceNowBusinessServiceType("business_services") diff --git a/src/datadog_api_client/v2/model/service_now_business_services_response.py b/src/datadog_api_client/v2/model/service_now_business_services_response.py new file mode 100644 index 0000000000..47c65fa28a --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_business_services_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_business_service_data import ServiceNowBusinessServiceData + + +class ServiceNowBusinessServicesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_business_service_data import ServiceNowBusinessServiceData + + return { + "data": ([ServiceNowBusinessServiceData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ServiceNowBusinessServiceData], **kwargs): + """ + Response containing ServiceNow business services + + :param data: Array of ServiceNow business service data objects + :type data: [ServiceNowBusinessServiceData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/service_now_instance_attributes.py b/src/datadog_api_client/v2/model/service_now_instance_attributes.py new file mode 100644 index 0000000000..29176bd4bc --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_instance_attributes.py @@ -0,0 +1,33 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ServiceNowInstanceAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "instance_name": (str,), + } + + attribute_map = { + "instance_name": "instance_name", + } + + def __init__(self_, instance_name: str, **kwargs): + """ + Attributes of a ServiceNow instance + + :param instance_name: The name of the ServiceNow instance + :type instance_name: str + """ + super().__init__(kwargs) + + self_.instance_name = instance_name diff --git a/src/datadog_api_client/v2/model/service_now_instance_data.py b/src/datadog_api_client/v2/model/service_now_instance_data.py new file mode 100644 index 0000000000..16574f8f85 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_instance_data.py @@ -0,0 +1,55 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_instance_attributes import ServiceNowInstanceAttributes + from datadog_api_client.v2.model.service_now_instance_type import ServiceNowInstanceType + + +class ServiceNowInstanceData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_instance_attributes import ServiceNowInstanceAttributes + from datadog_api_client.v2.model.service_now_instance_type import ServiceNowInstanceType + + return { + "attributes": (ServiceNowInstanceAttributes,), + "id": (UUID,), + "type": (ServiceNowInstanceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ServiceNowInstanceAttributes, id: UUID, type: ServiceNowInstanceType, **kwargs): + """ + Data object for a ServiceNow instance + + :param attributes: Attributes of a ServiceNow instance + :type attributes: ServiceNowInstanceAttributes + + :param id: Unique identifier for the ServiceNow instance + :type id: UUID + + :param type: Type identifier for ServiceNow instance resources + :type type: ServiceNowInstanceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_now_instance_type.py b/src/datadog_api_client/v2/model/service_now_instance_type.py new file mode 100644 index 0000000000..ec94dd93c5 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_instance_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ServiceNowInstanceType(ModelSimple): + """ + Type identifier for ServiceNow instance resources + + :param value: If omitted defaults to "instance". Must be one of ["instance"]. + :type value: str + """ + + allowed_values = { + "instance", + } + INSTANCE: ClassVar["ServiceNowInstanceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ServiceNowInstanceType.INSTANCE = ServiceNowInstanceType("instance") diff --git a/src/datadog_api_client/v2/model/service_now_instances_response.py b/src/datadog_api_client/v2/model/service_now_instances_response.py new file mode 100644 index 0000000000..21d39a36a8 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_instances_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_instance_data import ServiceNowInstanceData + + +class ServiceNowInstancesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_instance_data import ServiceNowInstanceData + + return { + "data": ([ServiceNowInstanceData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ServiceNowInstanceData], **kwargs): + """ + Response containing ServiceNow instances + + :param data: Array of ServiceNow instance data objects + :type data: [ServiceNowInstanceData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/service_now_template_attributes.py b/src/datadog_api_client/v2/model/service_now_template_attributes.py new file mode 100644 index 0000000000..7bd439e11b --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_attributes.py @@ -0,0 +1,87 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +class ServiceNowTemplateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assignment_group_id": (UUID,), + "business_service_id": (UUID,), + "fields_mapping": ({str: (str,)},), + "handle_name": (str,), + "instance_id": (UUID,), + "servicenow_tablename": (str,), + "user_id": (UUID,), + } + + attribute_map = { + "assignment_group_id": "assignment_group_id", + "business_service_id": "business_service_id", + "fields_mapping": "fields_mapping", + "handle_name": "handle_name", + "instance_id": "instance_id", + "servicenow_tablename": "servicenow_tablename", + "user_id": "user_id", + } + + def __init__( + self_, + handle_name: str, + instance_id: UUID, + servicenow_tablename: str, + assignment_group_id: Union[UUID, UnsetType] = unset, + business_service_id: Union[UUID, UnsetType] = unset, + fields_mapping: Union[Dict[str, str], UnsetType] = unset, + user_id: Union[UUID, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a ServiceNow template + + :param assignment_group_id: The ID of the assignment group + :type assignment_group_id: UUID, optional + + :param business_service_id: The ID of the business service + :type business_service_id: UUID, optional + + :param fields_mapping: Custom field mappings for the template + :type fields_mapping: {str: (str,)}, optional + + :param handle_name: The handle name of the template + :type handle_name: str + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + + :param servicenow_tablename: The name of the destination ServiceNow table + :type servicenow_tablename: str + + :param user_id: The ID of the user + :type user_id: UUID, optional + """ + if assignment_group_id is not unset: + kwargs["assignment_group_id"] = assignment_group_id + if business_service_id is not unset: + kwargs["business_service_id"] = business_service_id + if fields_mapping is not unset: + kwargs["fields_mapping"] = fields_mapping + if user_id is not unset: + kwargs["user_id"] = user_id + super().__init__(kwargs) + + self_.handle_name = handle_name + self_.instance_id = instance_id + self_.servicenow_tablename = servicenow_tablename diff --git a/src/datadog_api_client/v2/model/service_now_template_create_request.py b/src/datadog_api_client/v2/model/service_now_template_create_request.py new file mode 100644 index 0000000000..40a2b19002 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_create_request.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_template_create_request_data import ServiceNowTemplateCreateRequestData + + +class ServiceNowTemplateCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_template_create_request_data import ( + ServiceNowTemplateCreateRequestData, + ) + + return { + "data": (ServiceNowTemplateCreateRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ServiceNowTemplateCreateRequestData, **kwargs): + """ + Request to create a ServiceNow template + + :param data: Data object for creating a ServiceNow template + :type data: ServiceNowTemplateCreateRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/service_now_template_create_request_attributes.py b/src/datadog_api_client/v2/model/service_now_template_create_request_attributes.py new file mode 100644 index 0000000000..9208638c59 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_create_request_attributes.py @@ -0,0 +1,87 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +class ServiceNowTemplateCreateRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assignment_group_id": (UUID,), + "business_service_id": (UUID,), + "fields_mapping": ({str: (str,)},), + "handle_name": (str,), + "instance_id": (UUID,), + "servicenow_tablename": (str,), + "user_id": (UUID,), + } + + attribute_map = { + "assignment_group_id": "assignment_group_id", + "business_service_id": "business_service_id", + "fields_mapping": "fields_mapping", + "handle_name": "handle_name", + "instance_id": "instance_id", + "servicenow_tablename": "servicenow_tablename", + "user_id": "user_id", + } + + def __init__( + self_, + handle_name: str, + instance_id: UUID, + servicenow_tablename: str, + assignment_group_id: Union[UUID, UnsetType] = unset, + business_service_id: Union[UUID, UnsetType] = unset, + fields_mapping: Union[Dict[str, str], UnsetType] = unset, + user_id: Union[UUID, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating a ServiceNow template + + :param assignment_group_id: The ID of the assignment group + :type assignment_group_id: UUID, optional + + :param business_service_id: The ID of the business service + :type business_service_id: UUID, optional + + :param fields_mapping: Custom field mappings for the template + :type fields_mapping: {str: (str,)}, optional + + :param handle_name: The handle name of the template + :type handle_name: str + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + + :param servicenow_tablename: The name of the destination ServiceNow table + :type servicenow_tablename: str + + :param user_id: The ID of the user + :type user_id: UUID, optional + """ + if assignment_group_id is not unset: + kwargs["assignment_group_id"] = assignment_group_id + if business_service_id is not unset: + kwargs["business_service_id"] = business_service_id + if fields_mapping is not unset: + kwargs["fields_mapping"] = fields_mapping + if user_id is not unset: + kwargs["user_id"] = user_id + super().__init__(kwargs) + + self_.handle_name = handle_name + self_.instance_id = instance_id + self_.servicenow_tablename = servicenow_tablename diff --git a/src/datadog_api_client/v2/model/service_now_template_create_request_data.py b/src/datadog_api_client/v2/model/service_now_template_create_request_data.py new file mode 100644 index 0000000000..64836726e7 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_create_request_data.py @@ -0,0 +1,52 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_template_create_request_attributes import ( + ServiceNowTemplateCreateRequestAttributes, + ) + from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType + + +class ServiceNowTemplateCreateRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_template_create_request_attributes import ( + ServiceNowTemplateCreateRequestAttributes, + ) + from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType + + return { + "attributes": (ServiceNowTemplateCreateRequestAttributes,), + "type": (ServiceNowTemplateType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: ServiceNowTemplateCreateRequestAttributes, type: ServiceNowTemplateType, **kwargs): + """ + Data object for creating a ServiceNow template + + :param attributes: Attributes for creating a ServiceNow template + :type attributes: ServiceNowTemplateCreateRequestAttributes + + :param type: Type identifier for ServiceNow template resources + :type type: ServiceNowTemplateType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_now_template_data.py b/src/datadog_api_client/v2/model/service_now_template_data.py new file mode 100644 index 0000000000..4d334fea6e --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_data.py @@ -0,0 +1,55 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_template_attributes import ServiceNowTemplateAttributes + from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType + + +class ServiceNowTemplateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_template_attributes import ServiceNowTemplateAttributes + from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType + + return { + "attributes": (ServiceNowTemplateAttributes,), + "id": (UUID,), + "type": (ServiceNowTemplateType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ServiceNowTemplateAttributes, id: UUID, type: ServiceNowTemplateType, **kwargs): + """ + Data object for a ServiceNow template + + :param attributes: Attributes of a ServiceNow template + :type attributes: ServiceNowTemplateAttributes + + :param id: Unique identifier for the ServiceNow template + :type id: UUID + + :param type: Type identifier for ServiceNow template resources + :type type: ServiceNowTemplateType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_now_template_response.py b/src/datadog_api_client/v2/model/service_now_template_response.py new file mode 100644 index 0000000000..3bbb885fa2 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_template_data import ServiceNowTemplateData + + +class ServiceNowTemplateResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_template_data import ServiceNowTemplateData + + return { + "data": (ServiceNowTemplateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ServiceNowTemplateData, **kwargs): + """ + Response containing a single ServiceNow template + + :param data: Data object for a ServiceNow template + :type data: ServiceNowTemplateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/service_now_template_type.py b/src/datadog_api_client/v2/model/service_now_template_type.py new file mode 100644 index 0000000000..11f0848fc8 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ServiceNowTemplateType(ModelSimple): + """ + Type identifier for ServiceNow template resources + + :param value: If omitted defaults to "servicenow_templates". Must be one of ["servicenow_templates"]. + :type value: str + """ + + allowed_values = { + "servicenow_templates", + } + SERVICENOW_TEMPLATES: ClassVar["ServiceNowTemplateType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ServiceNowTemplateType.SERVICENOW_TEMPLATES = ServiceNowTemplateType("servicenow_templates") diff --git a/src/datadog_api_client/v2/model/service_now_template_update_request.py b/src/datadog_api_client/v2/model/service_now_template_update_request.py new file mode 100644 index 0000000000..72d64523e8 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_update_request.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_template_update_request_data import ServiceNowTemplateUpdateRequestData + + +class ServiceNowTemplateUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_template_update_request_data import ( + ServiceNowTemplateUpdateRequestData, + ) + + return { + "data": (ServiceNowTemplateUpdateRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ServiceNowTemplateUpdateRequestData, **kwargs): + """ + Request to update a ServiceNow template + + :param data: Data object for updating a ServiceNow template + :type data: ServiceNowTemplateUpdateRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/service_now_template_update_request_attributes.py b/src/datadog_api_client/v2/model/service_now_template_update_request_attributes.py new file mode 100644 index 0000000000..be914fe4d9 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_update_request_attributes.py @@ -0,0 +1,87 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +class ServiceNowTemplateUpdateRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assignment_group_id": (UUID,), + "business_service_id": (UUID,), + "fields_mapping": ({str: (str,)},), + "handle_name": (str,), + "instance_id": (UUID,), + "servicenow_tablename": (str,), + "user_id": (UUID,), + } + + attribute_map = { + "assignment_group_id": "assignment_group_id", + "business_service_id": "business_service_id", + "fields_mapping": "fields_mapping", + "handle_name": "handle_name", + "instance_id": "instance_id", + "servicenow_tablename": "servicenow_tablename", + "user_id": "user_id", + } + + def __init__( + self_, + handle_name: str, + instance_id: UUID, + servicenow_tablename: str, + assignment_group_id: Union[UUID, UnsetType] = unset, + business_service_id: Union[UUID, UnsetType] = unset, + fields_mapping: Union[Dict[str, str], UnsetType] = unset, + user_id: Union[UUID, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for updating a ServiceNow template + + :param assignment_group_id: The ID of the assignment group + :type assignment_group_id: UUID, optional + + :param business_service_id: The ID of the business service + :type business_service_id: UUID, optional + + :param fields_mapping: Custom field mappings for the template + :type fields_mapping: {str: (str,)}, optional + + :param handle_name: The handle name of the template + :type handle_name: str + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + + :param servicenow_tablename: The name of the destination ServiceNow table + :type servicenow_tablename: str + + :param user_id: The ID of the user + :type user_id: UUID, optional + """ + if assignment_group_id is not unset: + kwargs["assignment_group_id"] = assignment_group_id + if business_service_id is not unset: + kwargs["business_service_id"] = business_service_id + if fields_mapping is not unset: + kwargs["fields_mapping"] = fields_mapping + if user_id is not unset: + kwargs["user_id"] = user_id + super().__init__(kwargs) + + self_.handle_name = handle_name + self_.instance_id = instance_id + self_.servicenow_tablename = servicenow_tablename diff --git a/src/datadog_api_client/v2/model/service_now_template_update_request_data.py b/src/datadog_api_client/v2/model/service_now_template_update_request_data.py new file mode 100644 index 0000000000..a4367ea66c --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_template_update_request_data.py @@ -0,0 +1,52 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_template_update_request_attributes import ( + ServiceNowTemplateUpdateRequestAttributes, + ) + from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType + + +class ServiceNowTemplateUpdateRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_template_update_request_attributes import ( + ServiceNowTemplateUpdateRequestAttributes, + ) + from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType + + return { + "attributes": (ServiceNowTemplateUpdateRequestAttributes,), + "type": (ServiceNowTemplateType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: ServiceNowTemplateUpdateRequestAttributes, type: ServiceNowTemplateType, **kwargs): + """ + Data object for updating a ServiceNow template + + :param attributes: Attributes for updating a ServiceNow template + :type attributes: ServiceNowTemplateUpdateRequestAttributes + + :param type: Type identifier for ServiceNow template resources + :type type: ServiceNowTemplateType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_now_templates_response.py b/src/datadog_api_client/v2/model/service_now_templates_response.py new file mode 100644 index 0000000000..e6c74c5bc7 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_templates_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_template_data import ServiceNowTemplateData + + +class ServiceNowTemplatesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_template_data import ServiceNowTemplateData + + return { + "data": ([ServiceNowTemplateData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ServiceNowTemplateData], **kwargs): + """ + Response containing ServiceNow templates + + :param data: Array of ServiceNow template data objects + :type data: [ServiceNowTemplateData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/service_now_user_attributes.py b/src/datadog_api_client/v2/model/service_now_user_attributes.py new file mode 100644 index 0000000000..81dcaf6749 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_user_attributes.py @@ -0,0 +1,70 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +class ServiceNowUserAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "email": (str,), + "full_name": (str,), + "instance_id": (UUID,), + "user_name": (str,), + "user_sys_id": (str,), + } + + attribute_map = { + "email": "email", + "full_name": "full_name", + "instance_id": "instance_id", + "user_name": "user_name", + "user_sys_id": "user_sys_id", + } + + def __init__( + self_, + email: str, + instance_id: UUID, + user_name: str, + user_sys_id: str, + full_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a ServiceNow user + + :param email: The email address of the user + :type email: str + + :param full_name: The full name of the user + :type full_name: str, optional + + :param instance_id: The ID of the ServiceNow instance + :type instance_id: UUID + + :param user_name: The username of the ServiceNow user + :type user_name: str + + :param user_sys_id: The system ID of the user in ServiceNow + :type user_sys_id: str + """ + if full_name is not unset: + kwargs["full_name"] = full_name + super().__init__(kwargs) + + self_.email = email + self_.instance_id = instance_id + self_.user_name = user_name + self_.user_sys_id = user_sys_id diff --git a/src/datadog_api_client/v2/model/service_now_user_data.py b/src/datadog_api_client/v2/model/service_now_user_data.py new file mode 100644 index 0000000000..936ee0e3d3 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_user_data.py @@ -0,0 +1,55 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_user_attributes import ServiceNowUserAttributes + from datadog_api_client.v2.model.service_now_user_type import ServiceNowUserType + + +class ServiceNowUserData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_user_attributes import ServiceNowUserAttributes + from datadog_api_client.v2.model.service_now_user_type import ServiceNowUserType + + return { + "attributes": (ServiceNowUserAttributes,), + "id": (UUID,), + "type": (ServiceNowUserType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ServiceNowUserAttributes, id: UUID, type: ServiceNowUserType, **kwargs): + """ + Data object for a ServiceNow user + + :param attributes: Attributes of a ServiceNow user + :type attributes: ServiceNowUserAttributes + + :param id: Unique identifier for the ServiceNow user + :type id: UUID + + :param type: Type identifier for ServiceNow user resources + :type type: ServiceNowUserType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_now_user_type.py b/src/datadog_api_client/v2/model/service_now_user_type.py new file mode 100644 index 0000000000..5dd23f1b4a --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_user_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ServiceNowUserType(ModelSimple): + """ + Type identifier for ServiceNow user resources + + :param value: If omitted defaults to "users". Must be one of ["users"]. + :type value: str + """ + + allowed_values = { + "users", + } + USERS: ClassVar["ServiceNowUserType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ServiceNowUserType.USERS = ServiceNowUserType("users") diff --git a/src/datadog_api_client/v2/model/service_now_users_response.py b/src/datadog_api_client/v2/model/service_now_users_response.py new file mode 100644 index 0000000000..12422e9487 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_users_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_user_data import ServiceNowUserData + + +class ServiceNowUsersResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_user_data import ServiceNowUserData + + return { + "data": ([ServiceNowUserData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ServiceNowUserData], **kwargs): + """ + Response containing ServiceNow users + + :param data: Array of ServiceNow user data objects + :type data: [ServiceNowUserData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index cf367f97ad..e413caa873 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4993,16 +4993,47 @@ ServiceListDataAttributesMetadataItems, ) from datadog_api_client.v2.model.service_list_data_type import ServiceListDataType +from datadog_api_client.v2.model.service_now_assignment_group_attributes import ServiceNowAssignmentGroupAttributes +from datadog_api_client.v2.model.service_now_assignment_group_data import ServiceNowAssignmentGroupData +from datadog_api_client.v2.model.service_now_assignment_group_type import ServiceNowAssignmentGroupType +from datadog_api_client.v2.model.service_now_assignment_groups_response import ServiceNowAssignmentGroupsResponse from datadog_api_client.v2.model.service_now_basic_auth import ServiceNowBasicAuth from datadog_api_client.v2.model.service_now_basic_auth_type import ServiceNowBasicAuthType from datadog_api_client.v2.model.service_now_basic_auth_update import ServiceNowBasicAuthUpdate +from datadog_api_client.v2.model.service_now_business_service_attributes import ServiceNowBusinessServiceAttributes +from datadog_api_client.v2.model.service_now_business_service_data import ServiceNowBusinessServiceData +from datadog_api_client.v2.model.service_now_business_service_type import ServiceNowBusinessServiceType +from datadog_api_client.v2.model.service_now_business_services_response import ServiceNowBusinessServicesResponse from datadog_api_client.v2.model.service_now_credentials import ServiceNowCredentials from datadog_api_client.v2.model.service_now_credentials_update import ServiceNowCredentialsUpdate +from datadog_api_client.v2.model.service_now_instance_attributes import ServiceNowInstanceAttributes +from datadog_api_client.v2.model.service_now_instance_data import ServiceNowInstanceData +from datadog_api_client.v2.model.service_now_instance_type import ServiceNowInstanceType +from datadog_api_client.v2.model.service_now_instances_response import ServiceNowInstancesResponse from datadog_api_client.v2.model.service_now_integration import ServiceNowIntegration from datadog_api_client.v2.model.service_now_integration_type import ServiceNowIntegrationType from datadog_api_client.v2.model.service_now_integration_update import ServiceNowIntegrationUpdate +from datadog_api_client.v2.model.service_now_template_attributes import ServiceNowTemplateAttributes +from datadog_api_client.v2.model.service_now_template_create_request import ServiceNowTemplateCreateRequest +from datadog_api_client.v2.model.service_now_template_create_request_attributes import ( + ServiceNowTemplateCreateRequestAttributes, +) +from datadog_api_client.v2.model.service_now_template_create_request_data import ServiceNowTemplateCreateRequestData +from datadog_api_client.v2.model.service_now_template_data import ServiceNowTemplateData +from datadog_api_client.v2.model.service_now_template_response import ServiceNowTemplateResponse +from datadog_api_client.v2.model.service_now_template_type import ServiceNowTemplateType +from datadog_api_client.v2.model.service_now_template_update_request import ServiceNowTemplateUpdateRequest +from datadog_api_client.v2.model.service_now_template_update_request_attributes import ( + ServiceNowTemplateUpdateRequestAttributes, +) +from datadog_api_client.v2.model.service_now_template_update_request_data import ServiceNowTemplateUpdateRequestData +from datadog_api_client.v2.model.service_now_templates_response import ServiceNowTemplatesResponse from datadog_api_client.v2.model.service_now_ticket import ServiceNowTicket from datadog_api_client.v2.model.service_now_ticket_result import ServiceNowTicketResult +from datadog_api_client.v2.model.service_now_user_attributes import ServiceNowUserAttributes +from datadog_api_client.v2.model.service_now_user_data import ServiceNowUserData +from datadog_api_client.v2.model.service_now_user_type import ServiceNowUserType +from datadog_api_client.v2.model.service_now_users_response import ServiceNowUsersResponse from datadog_api_client.v2.model.shift import Shift from datadog_api_client.v2.model.shift_data import ShiftData from datadog_api_client.v2.model.shift_data_attributes import ShiftDataAttributes @@ -9259,16 +9290,43 @@ "ServiceListDataAttributes", "ServiceListDataAttributesMetadataItems", "ServiceListDataType", + "ServiceNowAssignmentGroupAttributes", + "ServiceNowAssignmentGroupData", + "ServiceNowAssignmentGroupType", + "ServiceNowAssignmentGroupsResponse", "ServiceNowBasicAuth", "ServiceNowBasicAuthType", "ServiceNowBasicAuthUpdate", + "ServiceNowBusinessServiceAttributes", + "ServiceNowBusinessServiceData", + "ServiceNowBusinessServiceType", + "ServiceNowBusinessServicesResponse", "ServiceNowCredentials", "ServiceNowCredentialsUpdate", + "ServiceNowInstanceAttributes", + "ServiceNowInstanceData", + "ServiceNowInstanceType", + "ServiceNowInstancesResponse", "ServiceNowIntegration", "ServiceNowIntegrationType", "ServiceNowIntegrationUpdate", + "ServiceNowTemplateAttributes", + "ServiceNowTemplateCreateRequest", + "ServiceNowTemplateCreateRequestAttributes", + "ServiceNowTemplateCreateRequestData", + "ServiceNowTemplateData", + "ServiceNowTemplateResponse", + "ServiceNowTemplateType", + "ServiceNowTemplateUpdateRequest", + "ServiceNowTemplateUpdateRequestAttributes", + "ServiceNowTemplateUpdateRequestData", + "ServiceNowTemplatesResponse", "ServiceNowTicket", "ServiceNowTicketResult", + "ServiceNowUserAttributes", + "ServiceNowUserData", + "ServiceNowUserType", + "ServiceNowUsersResponse", "Shift", "ShiftData", "ShiftDataAttributes", diff --git a/tests/v2/features/servicenow_integration.feature b/tests/v2/features/servicenow_integration.feature new file mode 100644 index 0000000000..24f9878c0d --- /dev/null +++ b/tests/v2/features/servicenow_integration.feature @@ -0,0 +1,194 @@ +@endpoint(servicenow-integration) @endpoint(servicenow-integration-v2) +Feature: ServiceNow Integration + Manage your ServiceNow Integration. ServiceNow is a cloud-based platform + that helps organizations manage digital workflows for enterprise + operations. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ServiceNowIntegration" API + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create ServiceNow template returns "Bad Request" response + Given operation "CreateServiceNowTemplate" enabled + And new "CreateServiceNowTemplate" request + And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "software", "priority": "1"}, "handle_name": "incident-template", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create ServiceNow template returns "Created" response + Given operation "CreateServiceNowTemplate" enabled + And new "CreateServiceNowTemplate" request + And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "software", "priority": "1"}, "handle_name": "incident-template", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete ServiceNow template returns "Bad Request" response + Given operation "DeleteServiceNowTemplate" enabled + And new "DeleteServiceNowTemplate" request + And request contains "template_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 ServiceNow template returns "Not Found" response + Given operation "DeleteServiceNowTemplate" enabled + And new "DeleteServiceNowTemplate" request + And request contains "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 ServiceNow template returns "OK" response + Given operation "DeleteServiceNowTemplate" enabled + And new "DeleteServiceNowTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get ServiceNow template returns "Bad Request" response + Given operation "GetServiceNowTemplate" enabled + And new "GetServiceNowTemplate" request + And request contains "template_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: Get ServiceNow template returns "Not Found" response + Given operation "GetServiceNowTemplate" enabled + And new "GetServiceNowTemplate" request + And request contains "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: Get ServiceNow template returns "OK" response + Given operation "GetServiceNowTemplate" enabled + And new "GetServiceNowTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List ServiceNow assignment groups returns "Bad Request" response + Given operation "ListServiceNowAssignmentGroups" enabled + And new "ListServiceNowAssignmentGroups" request + And request contains "instance_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: List ServiceNow assignment groups returns "Not Found" response + Given operation "ListServiceNowAssignmentGroups" enabled + And new "ListServiceNowAssignmentGroups" request + And request contains "instance_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: List ServiceNow assignment groups returns "OK" response + Given operation "ListServiceNowAssignmentGroups" enabled + And new "ListServiceNowAssignmentGroups" request + And request contains "instance_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List ServiceNow business services returns "Bad Request" response + Given operation "ListServiceNowBusinessServices" enabled + And new "ListServiceNowBusinessServices" request + And request contains "instance_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: List ServiceNow business services returns "Not Found" response + Given operation "ListServiceNowBusinessServices" enabled + And new "ListServiceNowBusinessServices" request + And request contains "instance_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: List ServiceNow business services returns "OK" response + Given operation "ListServiceNowBusinessServices" enabled + And new "ListServiceNowBusinessServices" request + And request contains "instance_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List ServiceNow instances returns "Not Found" response + Given operation "ListServiceNowInstances" enabled + And new "ListServiceNowInstances" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List ServiceNow instances returns "OK" response + Given operation "ListServiceNowInstances" enabled + And new "ListServiceNowInstances" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List ServiceNow templates returns "OK" response + Given operation "ListServiceNowTemplates" enabled + And new "ListServiceNowTemplates" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List ServiceNow users returns "Bad Request" response + Given operation "ListServiceNowUsers" enabled + And new "ListServiceNowUsers" request + And request contains "instance_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: List ServiceNow users returns "Not Found" response + Given operation "ListServiceNowUsers" enabled + And new "ListServiceNowUsers" request + And request contains "instance_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: List ServiceNow users returns "OK" response + Given operation "ListServiceNowUsers" enabled + And new "ListServiceNowUsers" request + And request contains "instance_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update ServiceNow template returns "Bad Request" response + Given operation "UpdateServiceNowTemplate" enabled + And new "UpdateServiceNowTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update ServiceNow template returns "Not Found" response + Given operation "UpdateServiceNowTemplate" enabled + And new "UpdateServiceNowTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update ServiceNow template returns "OK" response + Given operation "UpdateServiceNowTemplate" enabled + And new "UpdateServiceNowTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index b8d90f223a..5a347bddf1 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2231,6 +2231,67 @@ "type": "idempotent" } }, + "ListServiceNowAssignmentGroups": { + "tag": "ServiceNow Integration", + "undo": { + "type": "safe" + } + }, + "ListServiceNowBusinessServices": { + "tag": "ServiceNow Integration", + "undo": { + "type": "safe" + } + }, + "ListServiceNowTemplates": { + "tag": "ServiceNow Integration", + "undo": { + "type": "safe" + } + }, + "CreateServiceNowTemplate": { + "tag": "ServiceNow Integration", + "undo": { + "operationId": "DeleteServiceNowTemplate", + "parameters": [ + { + "name": "template_id", + "source": "" + } + ], + "type": "unsafe" + } + }, + "DeleteServiceNowTemplate": { + "tag": "ServiceNow Integration", + "undo": { + "type": "idempotent" + } + }, + "GetServiceNowTemplate": { + "tag": "ServiceNow Integration", + "undo": { + "type": "safe" + } + }, + "UpdateServiceNowTemplate": { + "tag": "ServiceNow Integration", + "undo": { + "type": "idempotent" + } + }, + "ListServiceNowInstances": { + "tag": "ServiceNow Integration", + "undo": { + "type": "safe" + } + }, + "ListServiceNowUsers": { + "tag": "ServiceNow Integration", + "undo": { + "type": "safe" + } + }, "ListCloudflareAccounts": { "tag": "Cloudflare Integration", "undo": {