From 48bee587eb12418ddd33ea641acba118efa611fb Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 23 Jan 2026 18:18:35 +0000 Subject: [PATCH] Regenerate client from commit 06d80d3 of spec repo --- .generator/schemas/v2/openapi.yaml | 767 ++++++++++++++++++ .../CreateServiceNowTemplate.rb | 25 + .../DeleteServiceNowTemplate.rb | 8 + .../GetServiceNowTemplate.rb | 8 + .../ListServiceNowAssignmentGroups.rb | 8 + .../ListServiceNowBusinessServices.rb | 8 + .../ListServiceNowInstances.rb | 8 + .../ListServiceNowTemplates.rb | 8 + .../ListServiceNowUsers.rb | 8 + .../UpdateServiceNowTemplate.rb | 25 + features/scenarios_model_mapping.rb | 22 + features/v2/servicenow_integration.feature | 194 +++++ features/v2/undo.json | 61 ++ lib/datadog_api_client/configuration.rb | 9 + lib/datadog_api_client/inflector.rb | 28 + .../v2/api/service_now_integration_api.rb | 664 +++++++++++++++ ...service_now_assignment_group_attributes.rb | 165 ++++ .../service_now_assignment_group_data.rb | 165 ++++ .../service_now_assignment_group_type.rb | 26 + .../service_now_assignment_groups_response.rb | 125 +++ ...service_now_business_service_attributes.rb | 165 ++++ .../service_now_business_service_data.rb | 165 ++++ .../service_now_business_service_type.rb | 26 + .../service_now_business_services_response.rb | 125 +++ .../models/service_now_instance_attributes.rb | 123 +++ .../v2/models/service_now_instance_data.rb | 165 ++++ .../v2/models/service_now_instance_type.rb | 26 + .../models/service_now_instances_response.rb | 125 +++ .../models/service_now_template_attributes.rb | 205 +++++ .../service_now_template_create_request.rb | 123 +++ ..._now_template_create_request_attributes.rb | 205 +++++ ...ervice_now_template_create_request_data.rb | 144 ++++ .../v2/models/service_now_template_data.rb | 165 ++++ .../models/service_now_template_response.rb | 123 +++ .../v2/models/service_now_template_type.rb | 26 + .../service_now_template_update_request.rb | 123 +++ ..._now_template_update_request_attributes.rb | 205 +++++ ...ervice_now_template_update_request_data.rb | 144 ++++ .../models/service_now_templates_response.rb | 125 +++ .../v2/models/service_now_user_attributes.rb | 196 +++++ .../v2/models/service_now_user_data.rb | 165 ++++ .../v2/models/service_now_user_type.rb | 26 + .../v2/models/service_now_users_response.rb | 125 +++ 43 files changed, 5352 insertions(+) create mode 100644 examples/v2/servicenow-integration/CreateServiceNowTemplate.rb create mode 100644 examples/v2/servicenow-integration/DeleteServiceNowTemplate.rb create mode 100644 examples/v2/servicenow-integration/GetServiceNowTemplate.rb create mode 100644 examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.rb create mode 100644 examples/v2/servicenow-integration/ListServiceNowBusinessServices.rb create mode 100644 examples/v2/servicenow-integration/ListServiceNowInstances.rb create mode 100644 examples/v2/servicenow-integration/ListServiceNowTemplates.rb create mode 100644 examples/v2/servicenow-integration/ListServiceNowUsers.rb create mode 100644 examples/v2/servicenow-integration/UpdateServiceNowTemplate.rb create mode 100644 features/v2/servicenow_integration.feature create mode 100644 lib/datadog_api_client/v2/api/service_now_integration_api.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_assignment_group_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_assignment_group_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_assignment_group_type.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_assignment_groups_response.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_business_service_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_business_service_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_business_service_type.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_business_services_response.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_instance_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_instance_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_instance_type.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_instances_response.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_create_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_create_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_response.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_type.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_update_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_template_update_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_templates_response.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_user_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_user_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_user_type.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_users_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5190081e023..70523726660 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/examples/v2/servicenow-integration/CreateServiceNowTemplate.rb b/examples/v2/servicenow-integration/CreateServiceNowTemplate.rb new file mode 100644 index 00000000000..6ca86823e78 --- /dev/null +++ b/examples/v2/servicenow-integration/CreateServiceNowTemplate.rb @@ -0,0 +1,25 @@ +# Create ServiceNow template returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_service_now_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new + +body = DatadogAPIClient::V2::ServiceNowTemplateCreateRequest.new({ + data: DatadogAPIClient::V2::ServiceNowTemplateCreateRequestData.new({ + attributes: DatadogAPIClient::V2::ServiceNowTemplateCreateRequestAttributes.new({ + 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: DatadogAPIClient::V2::ServiceNowTemplateType::SERVICENOW_TEMPLATES, + }), +}) +p api_instance.create_service_now_template(body) diff --git a/examples/v2/servicenow-integration/DeleteServiceNowTemplate.rb b/examples/v2/servicenow-integration/DeleteServiceNowTemplate.rb new file mode 100644 index 00000000000..ab7ef109461 --- /dev/null +++ b/examples/v2/servicenow-integration/DeleteServiceNowTemplate.rb @@ -0,0 +1,8 @@ +# Delete ServiceNow template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_service_now_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new +p api_instance.delete_service_now_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/servicenow-integration/GetServiceNowTemplate.rb b/examples/v2/servicenow-integration/GetServiceNowTemplate.rb new file mode 100644 index 00000000000..73c62a72643 --- /dev/null +++ b/examples/v2/servicenow-integration/GetServiceNowTemplate.rb @@ -0,0 +1,8 @@ +# Get ServiceNow template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_service_now_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new +p api_instance.get_service_now_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.rb b/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.rb new file mode 100644 index 00000000000..5f3b08bb81a --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.rb @@ -0,0 +1,8 @@ +# List ServiceNow assignment groups returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_service_now_assignment_groups".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new +p api_instance.list_service_now_assignment_groups("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/servicenow-integration/ListServiceNowBusinessServices.rb b/examples/v2/servicenow-integration/ListServiceNowBusinessServices.rb new file mode 100644 index 00000000000..bfb6ece55a3 --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowBusinessServices.rb @@ -0,0 +1,8 @@ +# List ServiceNow business services returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_service_now_business_services".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new +p api_instance.list_service_now_business_services("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/servicenow-integration/ListServiceNowInstances.rb b/examples/v2/servicenow-integration/ListServiceNowInstances.rb new file mode 100644 index 00000000000..4311ec203f9 --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowInstances.rb @@ -0,0 +1,8 @@ +# List ServiceNow instances returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_service_now_instances".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new +p api_instance.list_service_now_instances() diff --git a/examples/v2/servicenow-integration/ListServiceNowTemplates.rb b/examples/v2/servicenow-integration/ListServiceNowTemplates.rb new file mode 100644 index 00000000000..58b0e0c77bf --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowTemplates.rb @@ -0,0 +1,8 @@ +# List ServiceNow templates returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_service_now_templates".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new +p api_instance.list_service_now_templates() diff --git a/examples/v2/servicenow-integration/ListServiceNowUsers.rb b/examples/v2/servicenow-integration/ListServiceNowUsers.rb new file mode 100644 index 00000000000..b975752391e --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowUsers.rb @@ -0,0 +1,8 @@ +# List ServiceNow users returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_service_now_users".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new +p api_instance.list_service_now_users("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/servicenow-integration/UpdateServiceNowTemplate.rb b/examples/v2/servicenow-integration/UpdateServiceNowTemplate.rb new file mode 100644 index 00000000000..8c68dc890c8 --- /dev/null +++ b/examples/v2/servicenow-integration/UpdateServiceNowTemplate.rb @@ -0,0 +1,25 @@ +# Update ServiceNow template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_service_now_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new + +body = DatadogAPIClient::V2::ServiceNowTemplateUpdateRequest.new({ + data: DatadogAPIClient::V2::ServiceNowTemplateUpdateRequestData.new({ + attributes: DatadogAPIClient::V2::ServiceNowTemplateUpdateRequestAttributes.new({ + 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: DatadogAPIClient::V2::ServiceNowTemplateType::SERVICENOW_TEMPLATES, + }), +}) +p api_instance.update_service_now_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 69988f3e6d5..6674c3b1a04 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2335,6 +2335,28 @@ "integration_service_id" => "String", "body" => "OpsgenieServiceUpdateRequest", }, + "v2.ListServiceNowAssignmentGroups" => { + "instance_id" => "UUID", + }, + "v2.ListServiceNowBusinessServices" => { + "instance_id" => "UUID", + }, + "v2.CreateServiceNowTemplate" => { + "body" => "ServiceNowTemplateCreateRequest", + }, + "v2.DeleteServiceNowTemplate" => { + "template_id" => "UUID", + }, + "v2.GetServiceNowTemplate" => { + "template_id" => "UUID", + }, + "v2.UpdateServiceNowTemplate" => { + "template_id" => "UUID", + "body" => "ServiceNowTemplateUpdateRequest", + }, + "v2.ListServiceNowUsers" => { + "instance_id" => "UUID", + }, "v2.CreateCloudflareAccount" => { "body" => "CloudflareAccountCreateRequest", }, diff --git a/features/v2/servicenow_integration.feature b/features/v2/servicenow_integration.feature new file mode 100644 index 00000000000..24f9878c0d8 --- /dev/null +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index b8d90f223ac..5a347bddf11 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 95e92ee6bde..7085b0efde5 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -295,6 +295,15 @@ def initialize "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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index a35cae3ee98..b3cd03dc3ae 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4455,16 +4455,43 @@ def overrides "v2.service_list_data_attributes" => "ServiceListDataAttributes", "v2.service_list_data_attributes_metadata_items" => "ServiceListDataAttributesMetadataItems", "v2.service_list_data_type" => "ServiceListDataType", + "v2.service_now_assignment_group_attributes" => "ServiceNowAssignmentGroupAttributes", + "v2.service_now_assignment_group_data" => "ServiceNowAssignmentGroupData", + "v2.service_now_assignment_groups_response" => "ServiceNowAssignmentGroupsResponse", + "v2.service_now_assignment_group_type" => "ServiceNowAssignmentGroupType", "v2.service_now_basic_auth" => "ServiceNowBasicAuth", "v2.service_now_basic_auth_type" => "ServiceNowBasicAuthType", "v2.service_now_basic_auth_update" => "ServiceNowBasicAuthUpdate", + "v2.service_now_business_service_attributes" => "ServiceNowBusinessServiceAttributes", + "v2.service_now_business_service_data" => "ServiceNowBusinessServiceData", + "v2.service_now_business_services_response" => "ServiceNowBusinessServicesResponse", + "v2.service_now_business_service_type" => "ServiceNowBusinessServiceType", "v2.service_now_credentials" => "ServiceNowCredentials", "v2.service_now_credentials_update" => "ServiceNowCredentialsUpdate", + "v2.service_now_instance_attributes" => "ServiceNowInstanceAttributes", + "v2.service_now_instance_data" => "ServiceNowInstanceData", + "v2.service_now_instances_response" => "ServiceNowInstancesResponse", + "v2.service_now_instance_type" => "ServiceNowInstanceType", "v2.service_now_integration" => "ServiceNowIntegration", "v2.service_now_integration_type" => "ServiceNowIntegrationType", "v2.service_now_integration_update" => "ServiceNowIntegrationUpdate", + "v2.service_now_template_attributes" => "ServiceNowTemplateAttributes", + "v2.service_now_template_create_request" => "ServiceNowTemplateCreateRequest", + "v2.service_now_template_create_request_attributes" => "ServiceNowTemplateCreateRequestAttributes", + "v2.service_now_template_create_request_data" => "ServiceNowTemplateCreateRequestData", + "v2.service_now_template_data" => "ServiceNowTemplateData", + "v2.service_now_template_response" => "ServiceNowTemplateResponse", + "v2.service_now_templates_response" => "ServiceNowTemplatesResponse", + "v2.service_now_template_type" => "ServiceNowTemplateType", + "v2.service_now_template_update_request" => "ServiceNowTemplateUpdateRequest", + "v2.service_now_template_update_request_attributes" => "ServiceNowTemplateUpdateRequestAttributes", + "v2.service_now_template_update_request_data" => "ServiceNowTemplateUpdateRequestData", "v2.service_now_ticket" => "ServiceNowTicket", "v2.service_now_ticket_result" => "ServiceNowTicketResult", + "v2.service_now_user_attributes" => "ServiceNowUserAttributes", + "v2.service_now_user_data" => "ServiceNowUserData", + "v2.service_now_users_response" => "ServiceNowUsersResponse", + "v2.service_now_user_type" => "ServiceNowUserType", "v2.shift" => "Shift", "v2.shift_data" => "ShiftData", "v2.shift_data_attributes" => "ShiftDataAttributes", @@ -5144,6 +5171,7 @@ def overrides "v2.service_definition_api" => "ServiceDefinitionAPI", "v2.service_level_objectives_api" => "ServiceLevelObjectivesAPI", "v2.service_scorecards_api" => "ServiceScorecardsAPI", + "v2.service_now_integration_api" => "ServiceNowIntegrationAPI", "v2.software_catalog_api" => "SoftwareCatalogAPI", "v2.spa_api" => "SpaAPI", "v2.spans_api" => "SpansAPI", diff --git a/lib/datadog_api_client/v2/api/service_now_integration_api.rb b/lib/datadog_api_client/v2/api/service_now_integration_api.rb new file mode 100644 index 00000000000..1121e5e9599 --- /dev/null +++ b/lib/datadog_api_client/v2/api/service_now_integration_api.rb @@ -0,0 +1,664 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class ServiceNowIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create ServiceNow template. + # + # @see #create_service_now_template_with_http_info + def create_service_now_template(body, opts = {}) + data, _status_code, _headers = create_service_now_template_with_http_info(body, opts) + data + end + + # Create ServiceNow template. + # + # Create a new ServiceNow template. + # + # @param body [ServiceNowTemplateCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceNowTemplateResponse, Integer, Hash)>] ServiceNowTemplateResponse data, response status code and response headers + def create_service_now_template_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_service_now_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_service_now_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_service_now_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.create_service_now_template ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceNowIntegrationAPI.create_service_now_template" + end + # resource path + local_var_path = '/api/v2/integration/servicenow/handles' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ServiceNowTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_service_now_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#create_service_now_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete ServiceNow template. + # + # @see #delete_service_now_template_with_http_info + def delete_service_now_template(template_id, opts = {}) + delete_service_now_template_with_http_info(template_id, opts) + nil + end + + # Delete ServiceNow template. + # + # Delete a ServiceNow template by ID. + # + # @param template_id [UUID] The ID of the ServiceNow template to delete + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_service_now_template_with_http_info(template_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_service_now_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_service_now_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_service_now_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.delete_service_now_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling ServiceNowIntegrationAPI.delete_service_now_template" + end + # resource path + local_var_path = '/api/v2/integration/servicenow/handles/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_service_now_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#delete_service_now_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get ServiceNow template. + # + # @see #get_service_now_template_with_http_info + def get_service_now_template(template_id, opts = {}) + data, _status_code, _headers = get_service_now_template_with_http_info(template_id, opts) + data + end + + # Get ServiceNow template. + # + # Get a ServiceNow template by ID. + # + # @param template_id [UUID] The ID of the ServiceNow template to retrieve + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceNowTemplateResponse, Integer, Hash)>] ServiceNowTemplateResponse data, response status code and response headers + def get_service_now_template_with_http_info(template_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_service_now_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_service_now_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_service_now_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.get_service_now_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling ServiceNowIntegrationAPI.get_service_now_template" + end + # resource path + local_var_path = '/api/v2/integration/servicenow/handles/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ServiceNowTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_service_now_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#get_service_now_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List ServiceNow assignment groups. + # + # @see #list_service_now_assignment_groups_with_http_info + def list_service_now_assignment_groups(instance_id, opts = {}) + data, _status_code, _headers = list_service_now_assignment_groups_with_http_info(instance_id, opts) + data + end + + # List ServiceNow assignment groups. + # + # Get all assignment groups for a ServiceNow instance. + # + # @param instance_id [UUID] The ID of the ServiceNow instance + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceNowAssignmentGroupsResponse, Integer, Hash)>] ServiceNowAssignmentGroupsResponse data, response status code and response headers + def list_service_now_assignment_groups_with_http_info(instance_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_service_now_assignment_groups".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_service_now_assignment_groups") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_service_now_assignment_groups")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.list_service_now_assignment_groups ...' + end + # verify the required parameter 'instance_id' is set + if @api_client.config.client_side_validation && instance_id.nil? + fail ArgumentError, "Missing the required parameter 'instance_id' when calling ServiceNowIntegrationAPI.list_service_now_assignment_groups" + end + # resource path + local_var_path = '/api/v2/integration/servicenow/assignment_groups/{instance_id}'.sub('{instance_id}', CGI.escape(instance_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ServiceNowAssignmentGroupsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_service_now_assignment_groups, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#list_service_now_assignment_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List ServiceNow business services. + # + # @see #list_service_now_business_services_with_http_info + def list_service_now_business_services(instance_id, opts = {}) + data, _status_code, _headers = list_service_now_business_services_with_http_info(instance_id, opts) + data + end + + # List ServiceNow business services. + # + # Get all business services for a ServiceNow instance. + # + # @param instance_id [UUID] The ID of the ServiceNow instance + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceNowBusinessServicesResponse, Integer, Hash)>] ServiceNowBusinessServicesResponse data, response status code and response headers + def list_service_now_business_services_with_http_info(instance_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_service_now_business_services".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_service_now_business_services") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_service_now_business_services")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.list_service_now_business_services ...' + end + # verify the required parameter 'instance_id' is set + if @api_client.config.client_side_validation && instance_id.nil? + fail ArgumentError, "Missing the required parameter 'instance_id' when calling ServiceNowIntegrationAPI.list_service_now_business_services" + end + # resource path + local_var_path = '/api/v2/integration/servicenow/business_services/{instance_id}'.sub('{instance_id}', CGI.escape(instance_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ServiceNowBusinessServicesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_service_now_business_services, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#list_service_now_business_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List ServiceNow instances. + # + # @see #list_service_now_instances_with_http_info + def list_service_now_instances(opts = {}) + data, _status_code, _headers = list_service_now_instances_with_http_info(opts) + data + end + + # List ServiceNow instances. + # + # Get all ServiceNow instances for the organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceNowInstancesResponse, Integer, Hash)>] ServiceNowInstancesResponse data, response status code and response headers + def list_service_now_instances_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_service_now_instances".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_service_now_instances") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_service_now_instances")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.list_service_now_instances ...' + end + # resource path + local_var_path = '/api/v2/integration/servicenow/instances' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ServiceNowInstancesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_service_now_instances, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#list_service_now_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List ServiceNow templates. + # + # @see #list_service_now_templates_with_http_info + def list_service_now_templates(opts = {}) + data, _status_code, _headers = list_service_now_templates_with_http_info(opts) + data + end + + # List ServiceNow templates. + # + # Get all ServiceNow templates for the organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceNowTemplatesResponse, Integer, Hash)>] ServiceNowTemplatesResponse data, response status code and response headers + def list_service_now_templates_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_service_now_templates".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_service_now_templates") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_service_now_templates")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.list_service_now_templates ...' + end + # resource path + local_var_path = '/api/v2/integration/servicenow/handles' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ServiceNowTemplatesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_service_now_templates, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#list_service_now_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List ServiceNow users. + # + # @see #list_service_now_users_with_http_info + def list_service_now_users(instance_id, opts = {}) + data, _status_code, _headers = list_service_now_users_with_http_info(instance_id, opts) + data + end + + # List ServiceNow users. + # + # Get all users for a ServiceNow instance. + # + # @param instance_id [UUID] The ID of the ServiceNow instance + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceNowUsersResponse, Integer, Hash)>] ServiceNowUsersResponse data, response status code and response headers + def list_service_now_users_with_http_info(instance_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_service_now_users".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_service_now_users") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_service_now_users")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.list_service_now_users ...' + end + # verify the required parameter 'instance_id' is set + if @api_client.config.client_side_validation && instance_id.nil? + fail ArgumentError, "Missing the required parameter 'instance_id' when calling ServiceNowIntegrationAPI.list_service_now_users" + end + # resource path + local_var_path = '/api/v2/integration/servicenow/users/{instance_id}'.sub('{instance_id}', CGI.escape(instance_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ServiceNowUsersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_service_now_users, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#list_service_now_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update ServiceNow template. + # + # @see #update_service_now_template_with_http_info + def update_service_now_template(template_id, body, opts = {}) + data, _status_code, _headers = update_service_now_template_with_http_info(template_id, body, opts) + data + end + + # Update ServiceNow template. + # + # Update a ServiceNow template by ID. + # + # @param template_id [UUID] The ID of the ServiceNow template to update + # @param body [ServiceNowTemplateUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceNowTemplateResponse, Integer, Hash)>] ServiceNowTemplateResponse data, response status code and response headers + def update_service_now_template_with_http_info(template_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_service_now_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_service_now_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_service_now_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceNowIntegrationAPI.update_service_now_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling ServiceNowIntegrationAPI.update_service_now_template" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceNowIntegrationAPI.update_service_now_template" + end + # resource path + local_var_path = '/api/v2/integration/servicenow/handles/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ServiceNowTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_service_now_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceNowIntegrationAPI#update_service_now_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_assignment_group_attributes.rb b/lib/datadog_api_client/v2/models/service_now_assignment_group_attributes.rb new file mode 100644 index 00000000000..548e40f484b --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_assignment_group_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a ServiceNow assignment group + class ServiceNowAssignmentGroupAttributes + include BaseGenericModel + + # The name of the assignment group + attr_reader :assignment_group_name + + # The system ID of the assignment group in ServiceNow + attr_reader :assignment_group_sys_id + + # The ID of the ServiceNow instance + attr_reader :instance_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignment_group_name' => :'assignment_group_name', + :'assignment_group_sys_id' => :'assignment_group_sys_id', + :'instance_id' => :'instance_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignment_group_name' => :'String', + :'assignment_group_sys_id' => :'String', + :'instance_id' => :'UUID' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowAssignmentGroupAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignment_group_name') + self.assignment_group_name = attributes[:'assignment_group_name'] + end + + if attributes.key?(:'assignment_group_sys_id') + self.assignment_group_sys_id = attributes[:'assignment_group_sys_id'] + end + + if attributes.key?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @assignment_group_name.nil? + return false if @assignment_group_sys_id.nil? + return false if @instance_id.nil? + true + end + + # Custom attribute writer method with validation + # @param assignment_group_name [Object] Object to be assigned + # @!visibility private + def assignment_group_name=(assignment_group_name) + if assignment_group_name.nil? + fail ArgumentError, 'invalid value for "assignment_group_name", assignment_group_name cannot be nil.' + end + @assignment_group_name = assignment_group_name + end + + # Custom attribute writer method with validation + # @param assignment_group_sys_id [Object] Object to be assigned + # @!visibility private + def assignment_group_sys_id=(assignment_group_sys_id) + if assignment_group_sys_id.nil? + fail ArgumentError, 'invalid value for "assignment_group_sys_id", assignment_group_sys_id cannot be nil.' + end + @assignment_group_sys_id = assignment_group_sys_id + end + + # Custom attribute writer method with validation + # @param instance_id [Object] Object to be assigned + # @!visibility private + def instance_id=(instance_id) + if instance_id.nil? + fail ArgumentError, 'invalid value for "instance_id", instance_id cannot be nil.' + end + @instance_id = instance_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignment_group_name == o.assignment_group_name && + assignment_group_sys_id == o.assignment_group_sys_id && + instance_id == o.instance_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignment_group_name, assignment_group_sys_id, instance_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_assignment_group_data.rb b/lib/datadog_api_client/v2/models/service_now_assignment_group_data.rb new file mode 100644 index 00000000000..21b2db137aa --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_assignment_group_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a ServiceNow assignment group + class ServiceNowAssignmentGroupData + include BaseGenericModel + + # Attributes of a ServiceNow assignment group + attr_reader :attributes + + # Unique identifier for the ServiceNow assignment group + attr_reader :id + + # Type identifier for ServiceNow assignment group resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceNowAssignmentGroupAttributes', + :'id' => :'UUID', + :'type' => :'ServiceNowAssignmentGroupType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowAssignmentGroupData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_assignment_group_type.rb b/lib/datadog_api_client/v2/models/service_now_assignment_group_type.rb new file mode 100644 index 00000000000..bc100c241c4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_assignment_group_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type identifier for ServiceNow assignment group resources + class ServiceNowAssignmentGroupType + include BaseEnumModel + + ASSIGNMENT_GROUPS = "assignment_groups".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_assignment_groups_response.rb b/lib/datadog_api_client/v2/models/service_now_assignment_groups_response.rb new file mode 100644 index 00000000000..e397ad4167e --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_assignment_groups_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing ServiceNow assignment groups + class ServiceNowAssignmentGroupsResponse + include BaseGenericModel + + # Array of ServiceNow assignment group data objects + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowAssignmentGroupsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_business_service_attributes.rb b/lib/datadog_api_client/v2/models/service_now_business_service_attributes.rb new file mode 100644 index 00000000000..d3159d4adfb --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_business_service_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a ServiceNow business service + class ServiceNowBusinessServiceAttributes + include BaseGenericModel + + # The ID of the ServiceNow instance + attr_reader :instance_id + + # The name of the business service + attr_reader :service_name + + # The system ID of the business service in ServiceNow + attr_reader :service_sys_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'instance_id' => :'instance_id', + :'service_name' => :'service_name', + :'service_sys_id' => :'service_sys_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'instance_id' => :'UUID', + :'service_name' => :'String', + :'service_sys_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowBusinessServiceAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + end + + if attributes.key?(:'service_name') + self.service_name = attributes[:'service_name'] + end + + if attributes.key?(:'service_sys_id') + self.service_sys_id = attributes[:'service_sys_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @instance_id.nil? + return false if @service_name.nil? + return false if @service_sys_id.nil? + true + end + + # Custom attribute writer method with validation + # @param instance_id [Object] Object to be assigned + # @!visibility private + def instance_id=(instance_id) + if instance_id.nil? + fail ArgumentError, 'invalid value for "instance_id", instance_id cannot be nil.' + end + @instance_id = instance_id + end + + # Custom attribute writer method with validation + # @param service_name [Object] Object to be assigned + # @!visibility private + def service_name=(service_name) + if service_name.nil? + fail ArgumentError, 'invalid value for "service_name", service_name cannot be nil.' + end + @service_name = service_name + end + + # Custom attribute writer method with validation + # @param service_sys_id [Object] Object to be assigned + # @!visibility private + def service_sys_id=(service_sys_id) + if service_sys_id.nil? + fail ArgumentError, 'invalid value for "service_sys_id", service_sys_id cannot be nil.' + end + @service_sys_id = service_sys_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + instance_id == o.instance_id && + service_name == o.service_name && + service_sys_id == o.service_sys_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [instance_id, service_name, service_sys_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_business_service_data.rb b/lib/datadog_api_client/v2/models/service_now_business_service_data.rb new file mode 100644 index 00000000000..b5a73e93cd3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_business_service_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a ServiceNow business service + class ServiceNowBusinessServiceData + include BaseGenericModel + + # Attributes of a ServiceNow business service + attr_reader :attributes + + # Unique identifier for the ServiceNow business service + attr_reader :id + + # Type identifier for ServiceNow business service resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceNowBusinessServiceAttributes', + :'id' => :'UUID', + :'type' => :'ServiceNowBusinessServiceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowBusinessServiceData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_business_service_type.rb b/lib/datadog_api_client/v2/models/service_now_business_service_type.rb new file mode 100644 index 00000000000..ec7d7e91765 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_business_service_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type identifier for ServiceNow business service resources + class ServiceNowBusinessServiceType + include BaseEnumModel + + BUSINESS_SERVICES = "business_services".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_business_services_response.rb b/lib/datadog_api_client/v2/models/service_now_business_services_response.rb new file mode 100644 index 00000000000..0c6e8c495ee --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_business_services_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing ServiceNow business services + class ServiceNowBusinessServicesResponse + include BaseGenericModel + + # Array of ServiceNow business service data objects + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowBusinessServicesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_instance_attributes.rb b/lib/datadog_api_client/v2/models/service_now_instance_attributes.rb new file mode 100644 index 00000000000..6e81a37dfcc --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_instance_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a ServiceNow instance + class ServiceNowInstanceAttributes + include BaseGenericModel + + # The name of the ServiceNow instance + attr_reader :instance_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'instance_name' => :'instance_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'instance_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowInstanceAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'instance_name') + self.instance_name = attributes[:'instance_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @instance_name.nil? + true + end + + # Custom attribute writer method with validation + # @param instance_name [Object] Object to be assigned + # @!visibility private + def instance_name=(instance_name) + if instance_name.nil? + fail ArgumentError, 'invalid value for "instance_name", instance_name cannot be nil.' + end + @instance_name = instance_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + instance_name == o.instance_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [instance_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_instance_data.rb b/lib/datadog_api_client/v2/models/service_now_instance_data.rb new file mode 100644 index 00000000000..db337d526e0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_instance_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a ServiceNow instance + class ServiceNowInstanceData + include BaseGenericModel + + # Attributes of a ServiceNow instance + attr_reader :attributes + + # Unique identifier for the ServiceNow instance + attr_reader :id + + # Type identifier for ServiceNow instance resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceNowInstanceAttributes', + :'id' => :'UUID', + :'type' => :'ServiceNowInstanceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowInstanceData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_instance_type.rb b/lib/datadog_api_client/v2/models/service_now_instance_type.rb new file mode 100644 index 00000000000..2b4e7a0a7e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_instance_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type identifier for ServiceNow instance resources + class ServiceNowInstanceType + include BaseEnumModel + + INSTANCE = "instance".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_instances_response.rb b/lib/datadog_api_client/v2/models/service_now_instances_response.rb new file mode 100644 index 00000000000..4d14b61bf79 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_instances_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing ServiceNow instances + class ServiceNowInstancesResponse + include BaseGenericModel + + # Array of ServiceNow instance data objects + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowInstancesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_attributes.rb b/lib/datadog_api_client/v2/models/service_now_template_attributes.rb new file mode 100644 index 00000000000..3fb952d9e75 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_attributes.rb @@ -0,0 +1,205 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a ServiceNow template + class ServiceNowTemplateAttributes + include BaseGenericModel + + # The ID of the assignment group + attr_accessor :assignment_group_id + + # The ID of the business service + attr_accessor :business_service_id + + # Custom field mappings for the template + attr_accessor :fields_mapping + + # The handle name of the template + attr_reader :handle_name + + # The ID of the ServiceNow instance + attr_reader :instance_id + + # The name of the destination ServiceNow table + attr_reader :servicenow_tablename + + # The ID of the user + attr_accessor :user_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignment_group_id' => :'UUID', + :'business_service_id' => :'UUID', + :'fields_mapping' => :'Hash', + :'handle_name' => :'String', + :'instance_id' => :'UUID', + :'servicenow_tablename' => :'String', + :'user_id' => :'UUID' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignment_group_id') + self.assignment_group_id = attributes[:'assignment_group_id'] + end + + if attributes.key?(:'business_service_id') + self.business_service_id = attributes[:'business_service_id'] + end + + if attributes.key?(:'fields_mapping') + self.fields_mapping = attributes[:'fields_mapping'] + end + + if attributes.key?(:'handle_name') + self.handle_name = attributes[:'handle_name'] + end + + if attributes.key?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + end + + if attributes.key?(:'servicenow_tablename') + self.servicenow_tablename = attributes[:'servicenow_tablename'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @handle_name.nil? + return false if @instance_id.nil? + return false if @servicenow_tablename.nil? + true + end + + # Custom attribute writer method with validation + # @param handle_name [Object] Object to be assigned + # @!visibility private + def handle_name=(handle_name) + if handle_name.nil? + fail ArgumentError, 'invalid value for "handle_name", handle_name cannot be nil.' + end + @handle_name = handle_name + end + + # Custom attribute writer method with validation + # @param instance_id [Object] Object to be assigned + # @!visibility private + def instance_id=(instance_id) + if instance_id.nil? + fail ArgumentError, 'invalid value for "instance_id", instance_id cannot be nil.' + end + @instance_id = instance_id + end + + # Custom attribute writer method with validation + # @param servicenow_tablename [Object] Object to be assigned + # @!visibility private + def servicenow_tablename=(servicenow_tablename) + if servicenow_tablename.nil? + fail ArgumentError, 'invalid value for "servicenow_tablename", servicenow_tablename cannot be nil.' + end + @servicenow_tablename = servicenow_tablename + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignment_group_id == o.assignment_group_id && + business_service_id == o.business_service_id && + fields_mapping == o.fields_mapping && + handle_name == o.handle_name && + instance_id == o.instance_id && + servicenow_tablename == o.servicenow_tablename && + user_id == o.user_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignment_group_id, business_service_id, fields_mapping, handle_name, instance_id, servicenow_tablename, user_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_create_request.rb b/lib/datadog_api_client/v2/models/service_now_template_create_request.rb new file mode 100644 index 00000000000..75738c62d9f --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a ServiceNow template + class ServiceNowTemplateCreateRequest + include BaseGenericModel + + # Data object for creating a ServiceNow template + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ServiceNowTemplateCreateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_create_request_attributes.rb b/lib/datadog_api_client/v2/models/service_now_template_create_request_attributes.rb new file mode 100644 index 00000000000..6a031771774 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_create_request_attributes.rb @@ -0,0 +1,205 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a ServiceNow template + class ServiceNowTemplateCreateRequestAttributes + include BaseGenericModel + + # The ID of the assignment group + attr_accessor :assignment_group_id + + # The ID of the business service + attr_accessor :business_service_id + + # Custom field mappings for the template + attr_accessor :fields_mapping + + # The handle name of the template + attr_reader :handle_name + + # The ID of the ServiceNow instance + attr_reader :instance_id + + # The name of the destination ServiceNow table + attr_reader :servicenow_tablename + + # The ID of the user + attr_accessor :user_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignment_group_id' => :'UUID', + :'business_service_id' => :'UUID', + :'fields_mapping' => :'Hash', + :'handle_name' => :'String', + :'instance_id' => :'UUID', + :'servicenow_tablename' => :'String', + :'user_id' => :'UUID' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateCreateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignment_group_id') + self.assignment_group_id = attributes[:'assignment_group_id'] + end + + if attributes.key?(:'business_service_id') + self.business_service_id = attributes[:'business_service_id'] + end + + if attributes.key?(:'fields_mapping') + self.fields_mapping = attributes[:'fields_mapping'] + end + + if attributes.key?(:'handle_name') + self.handle_name = attributes[:'handle_name'] + end + + if attributes.key?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + end + + if attributes.key?(:'servicenow_tablename') + self.servicenow_tablename = attributes[:'servicenow_tablename'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @handle_name.nil? + return false if @instance_id.nil? + return false if @servicenow_tablename.nil? + true + end + + # Custom attribute writer method with validation + # @param handle_name [Object] Object to be assigned + # @!visibility private + def handle_name=(handle_name) + if handle_name.nil? + fail ArgumentError, 'invalid value for "handle_name", handle_name cannot be nil.' + end + @handle_name = handle_name + end + + # Custom attribute writer method with validation + # @param instance_id [Object] Object to be assigned + # @!visibility private + def instance_id=(instance_id) + if instance_id.nil? + fail ArgumentError, 'invalid value for "instance_id", instance_id cannot be nil.' + end + @instance_id = instance_id + end + + # Custom attribute writer method with validation + # @param servicenow_tablename [Object] Object to be assigned + # @!visibility private + def servicenow_tablename=(servicenow_tablename) + if servicenow_tablename.nil? + fail ArgumentError, 'invalid value for "servicenow_tablename", servicenow_tablename cannot be nil.' + end + @servicenow_tablename = servicenow_tablename + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignment_group_id == o.assignment_group_id && + business_service_id == o.business_service_id && + fields_mapping == o.fields_mapping && + handle_name == o.handle_name && + instance_id == o.instance_id && + servicenow_tablename == o.servicenow_tablename && + user_id == o.user_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignment_group_id, business_service_id, fields_mapping, handle_name, instance_id, servicenow_tablename, user_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_create_request_data.rb b/lib/datadog_api_client/v2/models/service_now_template_create_request_data.rb new file mode 100644 index 00000000000..85a7b04a5fa --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_create_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for creating a ServiceNow template + class ServiceNowTemplateCreateRequestData + include BaseGenericModel + + # Attributes for creating a ServiceNow template + attr_reader :attributes + + # Type identifier for ServiceNow template resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceNowTemplateCreateRequestAttributes', + :'type' => :'ServiceNowTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateCreateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_data.rb b/lib/datadog_api_client/v2/models/service_now_template_data.rb new file mode 100644 index 00000000000..8cd6ba78e76 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a ServiceNow template + class ServiceNowTemplateData + include BaseGenericModel + + # Attributes of a ServiceNow template + attr_reader :attributes + + # Unique identifier for the ServiceNow template + attr_reader :id + + # Type identifier for ServiceNow template resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceNowTemplateAttributes', + :'id' => :'UUID', + :'type' => :'ServiceNowTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_response.rb b/lib/datadog_api_client/v2/models/service_now_template_response.rb new file mode 100644 index 00000000000..a19b41b1aa0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single ServiceNow template + class ServiceNowTemplateResponse + include BaseGenericModel + + # Data object for a ServiceNow template + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ServiceNowTemplateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_type.rb b/lib/datadog_api_client/v2/models/service_now_template_type.rb new file mode 100644 index 00000000000..bce9eebeb68 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type identifier for ServiceNow template resources + class ServiceNowTemplateType + include BaseEnumModel + + SERVICENOW_TEMPLATES = "servicenow_templates".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_update_request.rb b/lib/datadog_api_client/v2/models/service_now_template_update_request.rb new file mode 100644 index 00000000000..741372a66dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update a ServiceNow template + class ServiceNowTemplateUpdateRequest + include BaseGenericModel + + # Data object for updating a ServiceNow template + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ServiceNowTemplateUpdateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_update_request_attributes.rb b/lib/datadog_api_client/v2/models/service_now_template_update_request_attributes.rb new file mode 100644 index 00000000000..b5dc9daecf7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_update_request_attributes.rb @@ -0,0 +1,205 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating a ServiceNow template + class ServiceNowTemplateUpdateRequestAttributes + include BaseGenericModel + + # The ID of the assignment group + attr_accessor :assignment_group_id + + # The ID of the business service + attr_accessor :business_service_id + + # Custom field mappings for the template + attr_accessor :fields_mapping + + # The handle name of the template + attr_reader :handle_name + + # The ID of the ServiceNow instance + attr_reader :instance_id + + # The name of the destination ServiceNow table + attr_reader :servicenow_tablename + + # The ID of the user + attr_accessor :user_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignment_group_id' => :'UUID', + :'business_service_id' => :'UUID', + :'fields_mapping' => :'Hash', + :'handle_name' => :'String', + :'instance_id' => :'UUID', + :'servicenow_tablename' => :'String', + :'user_id' => :'UUID' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateUpdateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignment_group_id') + self.assignment_group_id = attributes[:'assignment_group_id'] + end + + if attributes.key?(:'business_service_id') + self.business_service_id = attributes[:'business_service_id'] + end + + if attributes.key?(:'fields_mapping') + self.fields_mapping = attributes[:'fields_mapping'] + end + + if attributes.key?(:'handle_name') + self.handle_name = attributes[:'handle_name'] + end + + if attributes.key?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + end + + if attributes.key?(:'servicenow_tablename') + self.servicenow_tablename = attributes[:'servicenow_tablename'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @handle_name.nil? + return false if @instance_id.nil? + return false if @servicenow_tablename.nil? + true + end + + # Custom attribute writer method with validation + # @param handle_name [Object] Object to be assigned + # @!visibility private + def handle_name=(handle_name) + if handle_name.nil? + fail ArgumentError, 'invalid value for "handle_name", handle_name cannot be nil.' + end + @handle_name = handle_name + end + + # Custom attribute writer method with validation + # @param instance_id [Object] Object to be assigned + # @!visibility private + def instance_id=(instance_id) + if instance_id.nil? + fail ArgumentError, 'invalid value for "instance_id", instance_id cannot be nil.' + end + @instance_id = instance_id + end + + # Custom attribute writer method with validation + # @param servicenow_tablename [Object] Object to be assigned + # @!visibility private + def servicenow_tablename=(servicenow_tablename) + if servicenow_tablename.nil? + fail ArgumentError, 'invalid value for "servicenow_tablename", servicenow_tablename cannot be nil.' + end + @servicenow_tablename = servicenow_tablename + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignment_group_id == o.assignment_group_id && + business_service_id == o.business_service_id && + fields_mapping == o.fields_mapping && + handle_name == o.handle_name && + instance_id == o.instance_id && + servicenow_tablename == o.servicenow_tablename && + user_id == o.user_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignment_group_id, business_service_id, fields_mapping, handle_name, instance_id, servicenow_tablename, user_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_template_update_request_data.rb b/lib/datadog_api_client/v2/models/service_now_template_update_request_data.rb new file mode 100644 index 00000000000..5bed8a5f6b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_template_update_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for updating a ServiceNow template + class ServiceNowTemplateUpdateRequestData + include BaseGenericModel + + # Attributes for updating a ServiceNow template + attr_reader :attributes + + # Type identifier for ServiceNow template resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceNowTemplateUpdateRequestAttributes', + :'type' => :'ServiceNowTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplateUpdateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_templates_response.rb b/lib/datadog_api_client/v2/models/service_now_templates_response.rb new file mode 100644 index 00000000000..1bab691d6ce --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_templates_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing ServiceNow templates + class ServiceNowTemplatesResponse + include BaseGenericModel + + # Array of ServiceNow template data objects + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTemplatesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_user_attributes.rb b/lib/datadog_api_client/v2/models/service_now_user_attributes.rb new file mode 100644 index 00000000000..01440a88507 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_user_attributes.rb @@ -0,0 +1,196 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a ServiceNow user + class ServiceNowUserAttributes + include BaseGenericModel + + # The email address of the user + attr_reader :email + + # The full name of the user + attr_accessor :full_name + + # The ID of the ServiceNow instance + attr_reader :instance_id + + # The username of the ServiceNow user + attr_reader :user_name + + # The system ID of the user in ServiceNow + attr_reader :user_sys_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'email' => :'email', + :'full_name' => :'full_name', + :'instance_id' => :'instance_id', + :'user_name' => :'user_name', + :'user_sys_id' => :'user_sys_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'email' => :'String', + :'full_name' => :'String', + :'instance_id' => :'UUID', + :'user_name' => :'String', + :'user_sys_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowUserAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'full_name') + self.full_name = attributes[:'full_name'] + end + + if attributes.key?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + end + + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] + end + + if attributes.key?(:'user_sys_id') + self.user_sys_id = attributes[:'user_sys_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @email.nil? + return false if @instance_id.nil? + return false if @user_name.nil? + return false if @user_sys_id.nil? + true + end + + # Custom attribute writer method with validation + # @param email [Object] Object to be assigned + # @!visibility private + def email=(email) + if email.nil? + fail ArgumentError, 'invalid value for "email", email cannot be nil.' + end + @email = email + end + + # Custom attribute writer method with validation + # @param instance_id [Object] Object to be assigned + # @!visibility private + def instance_id=(instance_id) + if instance_id.nil? + fail ArgumentError, 'invalid value for "instance_id", instance_id cannot be nil.' + end + @instance_id = instance_id + end + + # Custom attribute writer method with validation + # @param user_name [Object] Object to be assigned + # @!visibility private + def user_name=(user_name) + if user_name.nil? + fail ArgumentError, 'invalid value for "user_name", user_name cannot be nil.' + end + @user_name = user_name + end + + # Custom attribute writer method with validation + # @param user_sys_id [Object] Object to be assigned + # @!visibility private + def user_sys_id=(user_sys_id) + if user_sys_id.nil? + fail ArgumentError, 'invalid value for "user_sys_id", user_sys_id cannot be nil.' + end + @user_sys_id = user_sys_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + email == o.email && + full_name == o.full_name && + instance_id == o.instance_id && + user_name == o.user_name && + user_sys_id == o.user_sys_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [email, full_name, instance_id, user_name, user_sys_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_user_data.rb b/lib/datadog_api_client/v2/models/service_now_user_data.rb new file mode 100644 index 00000000000..a2ae6baef98 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_user_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a ServiceNow user + class ServiceNowUserData + include BaseGenericModel + + # Attributes of a ServiceNow user + attr_reader :attributes + + # Unique identifier for the ServiceNow user + attr_reader :id + + # Type identifier for ServiceNow user resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceNowUserAttributes', + :'id' => :'UUID', + :'type' => :'ServiceNowUserType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowUserData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_user_type.rb b/lib/datadog_api_client/v2/models/service_now_user_type.rb new file mode 100644 index 00000000000..91a94e5e654 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_user_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type identifier for ServiceNow user resources + class ServiceNowUserType + include BaseEnumModel + + USERS = "users".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_users_response.rb b/lib/datadog_api_client/v2/models/service_now_users_response.rb new file mode 100644 index 00000000000..63d5603b88e --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_users_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing ServiceNow users + class ServiceNowUsersResponse + include BaseGenericModel + + # Array of ServiceNow user data objects + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowUsersResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end