diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e03bade2cfe..28dbae9628c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -36571,18 +36571,6 @@ components: items: type: string type: array - routes: - description: A list of routing rules that forward matching logs to Datadog - using dedicated API keys. - example: - - api_key_key: API_KEY_IDENTIFIER - include: service:api - route_id: datadog-logs-route-us1 - site: us1 - items: - $ref: '#/components/schemas/ObservabilityPipelineDatadogLogsDestinationRoute' - maxItems: 100 - type: array type: $ref: '#/components/schemas/ObservabilityPipelineDatadogLogsDestinationType' required: @@ -36592,29 +36580,6 @@ components: type: object x-pipeline-types: - logs - ObservabilityPipelineDatadogLogsDestinationRoute: - description: Defines how the `datadog_logs` destination routes matching logs - to a Datadog site using a specific API key. - properties: - api_key_key: - description: Name of the environment variable or secret that stores the - Datadog API key used by this route. - example: API_KEY_IDENTIFIER - type: string - include: - description: A Datadog search query that determines which logs are forwarded - using this route. - example: service:api - type: string - route_id: - description: Unique identifier for this route within the destination. - example: datadog-logs-route-us - type: string - site: - description: Datadog site where matching logs are sent (for example, `us1`). - example: us1 - type: string - type: object ObservabilityPipelineDatadogLogsDestinationType: default: datadog_logs description: The destination type. The value should always be `datadog_logs`. @@ -53787,6 +53752,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: @@ -53835,6 +53859,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: @@ -53843,6 +53926,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: @@ -53872,6 +54003,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 @@ -53889,6 +54236,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: @@ -73928,6 +74343,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. @@ -93420,6 +94149,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.java b/examples/v2/servicenow-integration/CreateServiceNowTemplate.java new file mode 100644 index 00000000000..f41cdcf7968 --- /dev/null +++ b/examples/v2/servicenow-integration/CreateServiceNowTemplate.java @@ -0,0 +1,51 @@ +// Create ServiceNow template returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import com.datadog.api.client.v2.model.ServiceNowTemplateCreateRequest; +import com.datadog.api.client.v2.model.ServiceNowTemplateCreateRequestAttributes; +import com.datadog.api.client.v2.model.ServiceNowTemplateCreateRequestData; +import com.datadog.api.client.v2.model.ServiceNowTemplateResponse; +import com.datadog.api.client.v2.model.ServiceNowTemplateType; +import java.util.Map; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createServiceNowTemplate", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + ServiceNowTemplateCreateRequest body = + new ServiceNowTemplateCreateRequest() + .data( + new ServiceNowTemplateCreateRequestData() + .attributes( + new ServiceNowTemplateCreateRequestAttributes() + .assignmentGroupId( + UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")) + .businessServiceId( + UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")) + .fieldsMapping( + Map.ofEntries( + Map.entry("category", "software"), Map.entry("priority", "1"))) + .handleName("incident-template") + .instanceId(UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")) + .servicenowTablename("incident") + .userId(UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e"))) + .type(ServiceNowTemplateType.SERVICENOW_TEMPLATES)); + + try { + ServiceNowTemplateResponse result = apiInstance.createServiceNowTemplate(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ServiceNowIntegrationApi#createServiceNowTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/servicenow-integration/DeleteServiceNowTemplate.java b/examples/v2/servicenow-integration/DeleteServiceNowTemplate.java new file mode 100644 index 00000000000..1dcbc0e13bf --- /dev/null +++ b/examples/v2/servicenow-integration/DeleteServiceNowTemplate.java @@ -0,0 +1,25 @@ +// Delete ServiceNow template returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteServiceNowTemplate", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + try { + apiInstance.deleteServiceNowTemplate(UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")); + } catch (ApiException e) { + System.err.println( + "Exception when calling ServiceNowIntegrationApi#deleteServiceNowTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/servicenow-integration/GetServiceNowTemplate.java b/examples/v2/servicenow-integration/GetServiceNowTemplate.java new file mode 100644 index 00000000000..83adff49ff0 --- /dev/null +++ b/examples/v2/servicenow-integration/GetServiceNowTemplate.java @@ -0,0 +1,28 @@ +// Get ServiceNow template returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import com.datadog.api.client.v2.model.ServiceNowTemplateResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getServiceNowTemplate", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + try { + ServiceNowTemplateResponse result = + apiInstance.getServiceNowTemplate( + UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceNowIntegrationApi#getServiceNowTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.java b/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.java new file mode 100644 index 00000000000..51fd6b57d89 --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowAssignmentGroups.java @@ -0,0 +1,29 @@ +// List ServiceNow assignment groups returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import com.datadog.api.client.v2.model.ServiceNowAssignmentGroupsResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listServiceNowAssignmentGroups", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + try { + ServiceNowAssignmentGroupsResponse result = + apiInstance.listServiceNowAssignmentGroups( + UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ServiceNowIntegrationApi#listServiceNowAssignmentGroups"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/servicenow-integration/ListServiceNowBusinessServices.java b/examples/v2/servicenow-integration/ListServiceNowBusinessServices.java new file mode 100644 index 00000000000..a277ff30bc0 --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowBusinessServices.java @@ -0,0 +1,29 @@ +// List ServiceNow business services returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import com.datadog.api.client.v2.model.ServiceNowBusinessServicesResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listServiceNowBusinessServices", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + try { + ServiceNowBusinessServicesResponse result = + apiInstance.listServiceNowBusinessServices( + UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ServiceNowIntegrationApi#listServiceNowBusinessServices"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/servicenow-integration/ListServiceNowInstances.java b/examples/v2/servicenow-integration/ListServiceNowInstances.java new file mode 100644 index 00000000000..da679f96288 --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowInstances.java @@ -0,0 +1,25 @@ +// List ServiceNow instances returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import com.datadog.api.client.v2.model.ServiceNowInstancesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listServiceNowInstances", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + try { + ServiceNowInstancesResponse result = apiInstance.listServiceNowInstances(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceNowIntegrationApi#listServiceNowInstances"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/servicenow-integration/ListServiceNowTemplates.java b/examples/v2/servicenow-integration/ListServiceNowTemplates.java new file mode 100644 index 00000000000..97deb9ae09b --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowTemplates.java @@ -0,0 +1,25 @@ +// List ServiceNow templates returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import com.datadog.api.client.v2.model.ServiceNowTemplatesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listServiceNowTemplates", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + try { + ServiceNowTemplatesResponse result = apiInstance.listServiceNowTemplates(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceNowIntegrationApi#listServiceNowTemplates"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/servicenow-integration/ListServiceNowUsers.java b/examples/v2/servicenow-integration/ListServiceNowUsers.java new file mode 100644 index 00000000000..68443ec8e9f --- /dev/null +++ b/examples/v2/servicenow-integration/ListServiceNowUsers.java @@ -0,0 +1,27 @@ +// List ServiceNow users returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import com.datadog.api.client.v2.model.ServiceNowUsersResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listServiceNowUsers", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + try { + ServiceNowUsersResponse result = + apiInstance.listServiceNowUsers(UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceNowIntegrationApi#listServiceNowUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/servicenow-integration/UpdateServiceNowTemplate.java b/examples/v2/servicenow-integration/UpdateServiceNowTemplate.java new file mode 100644 index 00000000000..a455f22a97d --- /dev/null +++ b/examples/v2/servicenow-integration/UpdateServiceNowTemplate.java @@ -0,0 +1,53 @@ +// Update ServiceNow template returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ServiceNowIntegrationApi; +import com.datadog.api.client.v2.model.ServiceNowTemplateResponse; +import com.datadog.api.client.v2.model.ServiceNowTemplateType; +import com.datadog.api.client.v2.model.ServiceNowTemplateUpdateRequest; +import com.datadog.api.client.v2.model.ServiceNowTemplateUpdateRequestAttributes; +import com.datadog.api.client.v2.model.ServiceNowTemplateUpdateRequestData; +import java.util.Map; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateServiceNowTemplate", true); + ServiceNowIntegrationApi apiInstance = new ServiceNowIntegrationApi(defaultClient); + + ServiceNowTemplateUpdateRequest body = + new ServiceNowTemplateUpdateRequest() + .data( + new ServiceNowTemplateUpdateRequestData() + .attributes( + new ServiceNowTemplateUpdateRequestAttributes() + .assignmentGroupId( + UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")) + .businessServiceId( + UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")) + .fieldsMapping( + Map.ofEntries( + Map.entry("category", "hardware"), Map.entry("priority", "2"))) + .handleName("incident-template-updated") + .instanceId(UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e")) + .servicenowTablename("incident") + .userId(UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e"))) + .type(ServiceNowTemplateType.SERVICENOW_TEMPLATES)); + + try { + ServiceNowTemplateResponse result = + apiInstance.updateServiceNowTemplate( + UUID.fromString("65b3341b-0680-47f9-a6d4-134db45c603e"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ServiceNowIntegrationApi#updateServiceNowTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 80129e2535b..61b7c721100 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -858,6 +858,15 @@ public class ApiClient { put("v2.listJiraAccounts", false); put("v2.listJiraIssueTemplates", false); put("v2.updateJiraIssueTemplate", false); + put("v2.createServiceNowTemplate", false); + put("v2.deleteServiceNowTemplate", false); + put("v2.getServiceNowTemplate", false); + put("v2.listServiceNowAssignmentGroups", false); + put("v2.listServiceNowBusinessServices", false); + put("v2.listServiceNowInstances", false); + put("v2.listServiceNowTemplates", false); + put("v2.listServiceNowUsers", false); + put("v2.updateServiceNowTemplate", false); put("v2.addRoleToRestrictionQuery", false); put("v2.createRestrictionQuery", false); put("v2.deleteRestrictionQuery", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/ServiceNowIntegrationApi.java b/src/main/java/com/datadog/api/client/v2/api/ServiceNowIntegrationApi.java new file mode 100644 index 00000000000..f6cf3bd28cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/ServiceNowIntegrationApi.java @@ -0,0 +1,1427 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.ServiceNowAssignmentGroupsResponse; +import com.datadog.api.client.v2.model.ServiceNowBusinessServicesResponse; +import com.datadog.api.client.v2.model.ServiceNowInstancesResponse; +import com.datadog.api.client.v2.model.ServiceNowTemplateCreateRequest; +import com.datadog.api.client.v2.model.ServiceNowTemplateResponse; +import com.datadog.api.client.v2.model.ServiceNowTemplateUpdateRequest; +import com.datadog.api.client.v2.model.ServiceNowTemplatesResponse; +import com.datadog.api.client.v2.model.ServiceNowUsersResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowIntegrationApi { + private ApiClient apiClient; + + public ServiceNowIntegrationApi() { + this(ApiClient.getDefaultApiClient()); + } + + public ServiceNowIntegrationApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create ServiceNow template. + * + *

See {@link #createServiceNowTemplateWithHttpInfo}. + * + * @param body (required) + * @return ServiceNowTemplateResponse + * @throws ApiException if fails to make API call + */ + public ServiceNowTemplateResponse createServiceNowTemplate(ServiceNowTemplateCreateRequest body) + throws ApiException { + return createServiceNowTemplateWithHttpInfo(body).getData(); + } + + /** + * Create ServiceNow template. + * + *

See {@link #createServiceNowTemplateWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ServiceNowTemplateResponse> + */ + public CompletableFuture createServiceNowTemplateAsync( + ServiceNowTemplateCreateRequest body) { + return createServiceNowTemplateWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new ServiceNow template. + * + * @param body (required) + * @return ApiResponse<ServiceNowTemplateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse createServiceNowTemplateWithHttpInfo( + ServiceNowTemplateCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createServiceNowTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createServiceNowTemplate"); + } + // create path and map variables + String localVarPath = "/api/v2/integration/servicenow/handles"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.createServiceNowTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create ServiceNow template. + * + *

See {@link #createServiceNowTemplateWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ServiceNowTemplateResponse>> + */ + public CompletableFuture> + createServiceNowTemplateWithHttpInfoAsync(ServiceNowTemplateCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createServiceNowTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createServiceNowTemplate")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/integration/servicenow/handles"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.createServiceNowTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete ServiceNow template. + * + *

See {@link #deleteServiceNowTemplateWithHttpInfo}. + * + * @param templateId The ID of the ServiceNow template to delete (required) + * @throws ApiException if fails to make API call + */ + public void deleteServiceNowTemplate(UUID templateId) throws ApiException { + deleteServiceNowTemplateWithHttpInfo(templateId); + } + + /** + * Delete ServiceNow template. + * + *

See {@link #deleteServiceNowTemplateWithHttpInfoAsync}. + * + * @param templateId The ID of the ServiceNow template to delete (required) + * @return CompletableFuture + */ + public CompletableFuture deleteServiceNowTemplateAsync(UUID templateId) { + return deleteServiceNowTemplateWithHttpInfoAsync(templateId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a ServiceNow template by ID. + * + * @param templateId The ID of the ServiceNow template to delete (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteServiceNowTemplateWithHttpInfo(UUID templateId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteServiceNowTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'templateId' when calling deleteServiceNowTemplate"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/handles/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.deleteServiceNowTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete ServiceNow template. + * + *

See {@link #deleteServiceNowTemplateWithHttpInfo}. + * + * @param templateId The ID of the ServiceNow template to delete (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteServiceNowTemplateWithHttpInfoAsync( + UUID templateId) { + // Check if unstable operation is enabled + String operationId = "deleteServiceNowTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'templateId' when calling deleteServiceNowTemplate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/handles/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.deleteServiceNowTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get ServiceNow template. + * + *

See {@link #getServiceNowTemplateWithHttpInfo}. + * + * @param templateId The ID of the ServiceNow template to retrieve (required) + * @return ServiceNowTemplateResponse + * @throws ApiException if fails to make API call + */ + public ServiceNowTemplateResponse getServiceNowTemplate(UUID templateId) throws ApiException { + return getServiceNowTemplateWithHttpInfo(templateId).getData(); + } + + /** + * Get ServiceNow template. + * + *

See {@link #getServiceNowTemplateWithHttpInfoAsync}. + * + * @param templateId The ID of the ServiceNow template to retrieve (required) + * @return CompletableFuture<ServiceNowTemplateResponse> + */ + public CompletableFuture getServiceNowTemplateAsync(UUID templateId) { + return getServiceNowTemplateWithHttpInfoAsync(templateId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a ServiceNow template by ID. + * + * @param templateId The ID of the ServiceNow template to retrieve (required) + * @return ApiResponse<ServiceNowTemplateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getServiceNowTemplateWithHttpInfo(UUID templateId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getServiceNowTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'templateId' when calling getServiceNowTemplate"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/handles/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.getServiceNowTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get ServiceNow template. + * + *

See {@link #getServiceNowTemplateWithHttpInfo}. + * + * @param templateId The ID of the ServiceNow template to retrieve (required) + * @return CompletableFuture<ApiResponse<ServiceNowTemplateResponse>> + */ + public CompletableFuture> + getServiceNowTemplateWithHttpInfoAsync(UUID templateId) { + // Check if unstable operation is enabled + String operationId = "getServiceNowTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'templateId' when calling getServiceNowTemplate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/handles/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.getServiceNowTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow assignment groups. + * + *

See {@link #listServiceNowAssignmentGroupsWithHttpInfo}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return ServiceNowAssignmentGroupsResponse + * @throws ApiException if fails to make API call + */ + public ServiceNowAssignmentGroupsResponse listServiceNowAssignmentGroups(UUID instanceId) + throws ApiException { + return listServiceNowAssignmentGroupsWithHttpInfo(instanceId).getData(); + } + + /** + * List ServiceNow assignment groups. + * + *

See {@link #listServiceNowAssignmentGroupsWithHttpInfoAsync}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return CompletableFuture<ServiceNowAssignmentGroupsResponse> + */ + public CompletableFuture listServiceNowAssignmentGroupsAsync( + UUID instanceId) { + return listServiceNowAssignmentGroupsWithHttpInfoAsync(instanceId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all assignment groups for a ServiceNow instance. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return ApiResponse<ServiceNowAssignmentGroupsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listServiceNowAssignmentGroupsWithHttpInfo( + UUID instanceId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listServiceNowAssignmentGroups"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'instanceId' when calling" + + " listServiceNowAssignmentGroups"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/assignment_groups/{instance_id}" + .replaceAll( + "\\{" + "instance_id" + "\\}", apiClient.escapeString(instanceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowAssignmentGroups", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow assignment groups. + * + *

See {@link #listServiceNowAssignmentGroupsWithHttpInfo}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return CompletableFuture<ApiResponse<ServiceNowAssignmentGroupsResponse>> + */ + public CompletableFuture> + listServiceNowAssignmentGroupsWithHttpInfoAsync(UUID instanceId) { + // Check if unstable operation is enabled + String operationId = "listServiceNowAssignmentGroups"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'instanceId' when calling" + + " listServiceNowAssignmentGroups")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/assignment_groups/{instance_id}" + .replaceAll( + "\\{" + "instance_id" + "\\}", apiClient.escapeString(instanceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowAssignmentGroups", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow business services. + * + *

See {@link #listServiceNowBusinessServicesWithHttpInfo}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return ServiceNowBusinessServicesResponse + * @throws ApiException if fails to make API call + */ + public ServiceNowBusinessServicesResponse listServiceNowBusinessServices(UUID instanceId) + throws ApiException { + return listServiceNowBusinessServicesWithHttpInfo(instanceId).getData(); + } + + /** + * List ServiceNow business services. + * + *

See {@link #listServiceNowBusinessServicesWithHttpInfoAsync}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return CompletableFuture<ServiceNowBusinessServicesResponse> + */ + public CompletableFuture listServiceNowBusinessServicesAsync( + UUID instanceId) { + return listServiceNowBusinessServicesWithHttpInfoAsync(instanceId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all business services for a ServiceNow instance. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return ApiResponse<ServiceNowBusinessServicesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listServiceNowBusinessServicesWithHttpInfo( + UUID instanceId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listServiceNowBusinessServices"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'instanceId' when calling" + + " listServiceNowBusinessServices"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/business_services/{instance_id}" + .replaceAll( + "\\{" + "instance_id" + "\\}", apiClient.escapeString(instanceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowBusinessServices", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow business services. + * + *

See {@link #listServiceNowBusinessServicesWithHttpInfo}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return CompletableFuture<ApiResponse<ServiceNowBusinessServicesResponse>> + */ + public CompletableFuture> + listServiceNowBusinessServicesWithHttpInfoAsync(UUID instanceId) { + // Check if unstable operation is enabled + String operationId = "listServiceNowBusinessServices"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'instanceId' when calling" + + " listServiceNowBusinessServices")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/business_services/{instance_id}" + .replaceAll( + "\\{" + "instance_id" + "\\}", apiClient.escapeString(instanceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowBusinessServices", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow instances. + * + *

See {@link #listServiceNowInstancesWithHttpInfo}. + * + * @return ServiceNowInstancesResponse + * @throws ApiException if fails to make API call + */ + public ServiceNowInstancesResponse listServiceNowInstances() throws ApiException { + return listServiceNowInstancesWithHttpInfo().getData(); + } + + /** + * List ServiceNow instances. + * + *

See {@link #listServiceNowInstancesWithHttpInfoAsync}. + * + * @return CompletableFuture<ServiceNowInstancesResponse> + */ + public CompletableFuture listServiceNowInstancesAsync() { + return listServiceNowInstancesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all ServiceNow instances for the organization. + * + * @return ApiResponse<ServiceNowInstancesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listServiceNowInstancesWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listServiceNowInstances"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/servicenow/instances"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowInstances", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow instances. + * + *

See {@link #listServiceNowInstancesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<ServiceNowInstancesResponse>> + */ + public CompletableFuture> + listServiceNowInstancesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listServiceNowInstances"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/servicenow/instances"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowInstances", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow templates. + * + *

See {@link #listServiceNowTemplatesWithHttpInfo}. + * + * @return ServiceNowTemplatesResponse + * @throws ApiException if fails to make API call + */ + public ServiceNowTemplatesResponse listServiceNowTemplates() throws ApiException { + return listServiceNowTemplatesWithHttpInfo().getData(); + } + + /** + * List ServiceNow templates. + * + *

See {@link #listServiceNowTemplatesWithHttpInfoAsync}. + * + * @return CompletableFuture<ServiceNowTemplatesResponse> + */ + public CompletableFuture listServiceNowTemplatesAsync() { + return listServiceNowTemplatesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all ServiceNow templates for the organization. + * + * @return ApiResponse<ServiceNowTemplatesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse listServiceNowTemplatesWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listServiceNowTemplates"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/servicenow/handles"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowTemplates", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow templates. + * + *

See {@link #listServiceNowTemplatesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<ServiceNowTemplatesResponse>> + */ + public CompletableFuture> + listServiceNowTemplatesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listServiceNowTemplates"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/servicenow/handles"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowTemplates", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow users. + * + *

See {@link #listServiceNowUsersWithHttpInfo}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return ServiceNowUsersResponse + * @throws ApiException if fails to make API call + */ + public ServiceNowUsersResponse listServiceNowUsers(UUID instanceId) throws ApiException { + return listServiceNowUsersWithHttpInfo(instanceId).getData(); + } + + /** + * List ServiceNow users. + * + *

See {@link #listServiceNowUsersWithHttpInfoAsync}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return CompletableFuture<ServiceNowUsersResponse> + */ + public CompletableFuture listServiceNowUsersAsync(UUID instanceId) { + return listServiceNowUsersWithHttpInfoAsync(instanceId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all users for a ServiceNow instance. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return ApiResponse<ServiceNowUsersResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listServiceNowUsersWithHttpInfo(UUID instanceId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listServiceNowUsers"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + 400, "Missing the required parameter 'instanceId' when calling listServiceNowUsers"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/users/{instance_id}" + .replaceAll( + "\\{" + "instance_id" + "\\}", apiClient.escapeString(instanceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowUsers", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List ServiceNow users. + * + *

See {@link #listServiceNowUsersWithHttpInfo}. + * + * @param instanceId The ID of the ServiceNow instance (required) + * @return CompletableFuture<ApiResponse<ServiceNowUsersResponse>> + */ + public CompletableFuture> + listServiceNowUsersWithHttpInfoAsync(UUID instanceId) { + // Check if unstable operation is enabled + String operationId = "listServiceNowUsers"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'instanceId' when calling listServiceNowUsers")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/users/{instance_id}" + .replaceAll( + "\\{" + "instance_id" + "\\}", apiClient.escapeString(instanceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.listServiceNowUsers", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update ServiceNow template. + * + *

See {@link #updateServiceNowTemplateWithHttpInfo}. + * + * @param templateId The ID of the ServiceNow template to update (required) + * @param body (required) + * @return ServiceNowTemplateResponse + * @throws ApiException if fails to make API call + */ + public ServiceNowTemplateResponse updateServiceNowTemplate( + UUID templateId, ServiceNowTemplateUpdateRequest body) throws ApiException { + return updateServiceNowTemplateWithHttpInfo(templateId, body).getData(); + } + + /** + * Update ServiceNow template. + * + *

See {@link #updateServiceNowTemplateWithHttpInfoAsync}. + * + * @param templateId The ID of the ServiceNow template to update (required) + * @param body (required) + * @return CompletableFuture<ServiceNowTemplateResponse> + */ + public CompletableFuture updateServiceNowTemplateAsync( + UUID templateId, ServiceNowTemplateUpdateRequest body) { + return updateServiceNowTemplateWithHttpInfoAsync(templateId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a ServiceNow template by ID. + * + * @param templateId The ID of the ServiceNow template to update (required) + * @param body (required) + * @return ApiResponse<ServiceNowTemplateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateServiceNowTemplateWithHttpInfo( + UUID templateId, ServiceNowTemplateUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateServiceNowTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'templateId' when calling updateServiceNowTemplate"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateServiceNowTemplate"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/handles/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.updateServiceNowTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update ServiceNow template. + * + *

See {@link #updateServiceNowTemplateWithHttpInfo}. + * + * @param templateId The ID of the ServiceNow template to update (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<ServiceNowTemplateResponse>> + */ + public CompletableFuture> + updateServiceNowTemplateWithHttpInfoAsync( + UUID templateId, ServiceNowTemplateUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateServiceNowTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'templateId' is set + if (templateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'templateId' when calling updateServiceNowTemplate")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateServiceNowTemplate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/servicenow/handles/{template_id}" + .replaceAll( + "\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceNowIntegrationApi.updateServiceNowTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineDatadogLogsDestination.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineDatadogLogsDestination.java index 344e10d3f63..c8f06e398af 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineDatadogLogsDestination.java +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineDatadogLogsDestination.java @@ -27,7 +27,6 @@ @JsonPropertyOrder({ ObservabilityPipelineDatadogLogsDestination.JSON_PROPERTY_ID, ObservabilityPipelineDatadogLogsDestination.JSON_PROPERTY_INPUTS, - ObservabilityPipelineDatadogLogsDestination.JSON_PROPERTY_ROUTES, ObservabilityPipelineDatadogLogsDestination.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( @@ -40,9 +39,6 @@ public class ObservabilityPipelineDatadogLogsDestination { public static final String JSON_PROPERTY_INPUTS = "inputs"; private List inputs = new ArrayList<>(); - public static final String JSON_PROPERTY_ROUTES = "routes"; - private List routes = null; - public static final String JSON_PROPERTY_TYPE = "type"; private ObservabilityPipelineDatadogLogsDestinationType type = ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS; @@ -106,41 +102,6 @@ public void setInputs(List inputs) { this.inputs = inputs; } - public ObservabilityPipelineDatadogLogsDestination routes( - List routes) { - this.routes = routes; - for (ObservabilityPipelineDatadogLogsDestinationRoute item : routes) { - this.unparsed |= item.unparsed; - } - return this; - } - - public ObservabilityPipelineDatadogLogsDestination addRoutesItem( - ObservabilityPipelineDatadogLogsDestinationRoute routesItem) { - if (this.routes == null) { - this.routes = new ArrayList<>(); - } - this.routes.add(routesItem); - this.unparsed |= routesItem.unparsed; - return this; - } - - /** - * A list of routing rules that forward matching logs to Datadog using dedicated API keys. - * - * @return routes - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ROUTES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getRoutes() { - return routes; - } - - public void setRoutes(List routes) { - this.routes = routes; - } - public ObservabilityPipelineDatadogLogsDestination type( ObservabilityPipelineDatadogLogsDestinationType type) { this.type = type; @@ -226,7 +187,6 @@ public boolean equals(Object o) { (ObservabilityPipelineDatadogLogsDestination) o; return Objects.equals(this.id, observabilityPipelineDatadogLogsDestination.id) && Objects.equals(this.inputs, observabilityPipelineDatadogLogsDestination.inputs) - && Objects.equals(this.routes, observabilityPipelineDatadogLogsDestination.routes) && Objects.equals(this.type, observabilityPipelineDatadogLogsDestination.type) && Objects.equals( this.additionalProperties, @@ -235,7 +195,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, inputs, routes, type, additionalProperties); + return Objects.hash(id, inputs, type, additionalProperties); } @Override @@ -244,7 +204,6 @@ public String toString() { sb.append("class ObservabilityPipelineDatadogLogsDestination {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); - sb.append(" routes: ").append(toIndentedString(routes)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineDatadogLogsDestinationRoute.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineDatadogLogsDestinationRoute.java deleted file mode 100644 index 60fc848da45..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineDatadogLogsDestinationRoute.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** - * Defines how the datadog_logs destination routes matching logs to a Datadog site - * using a specific API key. - */ -@JsonPropertyOrder({ - ObservabilityPipelineDatadogLogsDestinationRoute.JSON_PROPERTY_API_KEY_KEY, - ObservabilityPipelineDatadogLogsDestinationRoute.JSON_PROPERTY_INCLUDE, - ObservabilityPipelineDatadogLogsDestinationRoute.JSON_PROPERTY_ROUTE_ID, - ObservabilityPipelineDatadogLogsDestinationRoute.JSON_PROPERTY_SITE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class ObservabilityPipelineDatadogLogsDestinationRoute { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_API_KEY_KEY = "api_key_key"; - private String apiKeyKey; - - public static final String JSON_PROPERTY_INCLUDE = "include"; - private String include; - - public static final String JSON_PROPERTY_ROUTE_ID = "route_id"; - private String routeId; - - public static final String JSON_PROPERTY_SITE = "site"; - private String site; - - public ObservabilityPipelineDatadogLogsDestinationRoute apiKeyKey(String apiKeyKey) { - this.apiKeyKey = apiKeyKey; - return this; - } - - /** - * Name of the environment variable or secret that stores the Datadog API key used by this route. - * - * @return apiKeyKey - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_API_KEY_KEY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getApiKeyKey() { - return apiKeyKey; - } - - public void setApiKeyKey(String apiKeyKey) { - this.apiKeyKey = apiKeyKey; - } - - public ObservabilityPipelineDatadogLogsDestinationRoute include(String include) { - this.include = include; - return this; - } - - /** - * A Datadog search query that determines which logs are forwarded using this route. - * - * @return include - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INCLUDE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getInclude() { - return include; - } - - public void setInclude(String include) { - this.include = include; - } - - public ObservabilityPipelineDatadogLogsDestinationRoute routeId(String routeId) { - this.routeId = routeId; - return this; - } - - /** - * Unique identifier for this route within the destination. - * - * @return routeId - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ROUTE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRouteId() { - return routeId; - } - - public void setRouteId(String routeId) { - this.routeId = routeId; - } - - public ObservabilityPipelineDatadogLogsDestinationRoute site(String site) { - this.site = site; - return this; - } - - /** - * Datadog site where matching logs are sent (for example, us1). - * - * @return site - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SITE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSite() { - return site; - } - - public void setSite(String site) { - this.site = site; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return ObservabilityPipelineDatadogLogsDestinationRoute - */ - @JsonAnySetter - public ObservabilityPipelineDatadogLogsDestinationRoute putAdditionalProperty( - String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this ObservabilityPipelineDatadogLogsDestinationRoute object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ObservabilityPipelineDatadogLogsDestinationRoute - observabilityPipelineDatadogLogsDestinationRoute = - (ObservabilityPipelineDatadogLogsDestinationRoute) o; - return Objects.equals( - this.apiKeyKey, observabilityPipelineDatadogLogsDestinationRoute.apiKeyKey) - && Objects.equals(this.include, observabilityPipelineDatadogLogsDestinationRoute.include) - && Objects.equals(this.routeId, observabilityPipelineDatadogLogsDestinationRoute.routeId) - && Objects.equals(this.site, observabilityPipelineDatadogLogsDestinationRoute.site) - && Objects.equals( - this.additionalProperties, - observabilityPipelineDatadogLogsDestinationRoute.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(apiKeyKey, include, routeId, site, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ObservabilityPipelineDatadogLogsDestinationRoute {\n"); - sb.append(" apiKeyKey: ").append(toIndentedString(apiKeyKey)).append("\n"); - sb.append(" include: ").append(toIndentedString(include)).append("\n"); - sb.append(" routeId: ").append(toIndentedString(routeId)).append("\n"); - sb.append(" site: ").append(toIndentedString(site)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupAttributes.java new file mode 100644 index 00000000000..dec5cebc914 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupAttributes.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes of a ServiceNow assignment group */ +@JsonPropertyOrder({ + ServiceNowAssignmentGroupAttributes.JSON_PROPERTY_ASSIGNMENT_GROUP_NAME, + ServiceNowAssignmentGroupAttributes.JSON_PROPERTY_ASSIGNMENT_GROUP_SYS_ID, + ServiceNowAssignmentGroupAttributes.JSON_PROPERTY_INSTANCE_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowAssignmentGroupAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNMENT_GROUP_NAME = "assignment_group_name"; + private String assignmentGroupName; + + public static final String JSON_PROPERTY_ASSIGNMENT_GROUP_SYS_ID = "assignment_group_sys_id"; + private String assignmentGroupSysId; + + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private UUID instanceId; + + public ServiceNowAssignmentGroupAttributes() {} + + @JsonCreator + public ServiceNowAssignmentGroupAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ASSIGNMENT_GROUP_NAME) + String assignmentGroupName, + @JsonProperty(required = true, value = JSON_PROPERTY_ASSIGNMENT_GROUP_SYS_ID) + String assignmentGroupSysId, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_ID) UUID instanceId) { + this.assignmentGroupName = assignmentGroupName; + this.assignmentGroupSysId = assignmentGroupSysId; + this.instanceId = instanceId; + } + + public ServiceNowAssignmentGroupAttributes assignmentGroupName(String assignmentGroupName) { + this.assignmentGroupName = assignmentGroupName; + return this; + } + + /** + * The name of the assignment group + * + * @return assignmentGroupName + */ + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_GROUP_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAssignmentGroupName() { + return assignmentGroupName; + } + + public void setAssignmentGroupName(String assignmentGroupName) { + this.assignmentGroupName = assignmentGroupName; + } + + public ServiceNowAssignmentGroupAttributes assignmentGroupSysId(String assignmentGroupSysId) { + this.assignmentGroupSysId = assignmentGroupSysId; + return this; + } + + /** + * The system ID of the assignment group in ServiceNow + * + * @return assignmentGroupSysId + */ + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_GROUP_SYS_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAssignmentGroupSysId() { + return assignmentGroupSysId; + } + + public void setAssignmentGroupSysId(String assignmentGroupSysId) { + this.assignmentGroupSysId = assignmentGroupSysId; + } + + public ServiceNowAssignmentGroupAttributes instanceId(UUID instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * The ID of the ServiceNow instance + * + * @return instanceId + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getInstanceId() { + return instanceId; + } + + public void setInstanceId(UUID instanceId) { + this.instanceId = instanceId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowAssignmentGroupAttributes + */ + @JsonAnySetter + public ServiceNowAssignmentGroupAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowAssignmentGroupAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowAssignmentGroupAttributes serviceNowAssignmentGroupAttributes = + (ServiceNowAssignmentGroupAttributes) o; + return Objects.equals( + this.assignmentGroupName, serviceNowAssignmentGroupAttributes.assignmentGroupName) + && Objects.equals( + this.assignmentGroupSysId, serviceNowAssignmentGroupAttributes.assignmentGroupSysId) + && Objects.equals(this.instanceId, serviceNowAssignmentGroupAttributes.instanceId) + && Objects.equals( + this.additionalProperties, serviceNowAssignmentGroupAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assignmentGroupName, assignmentGroupSysId, instanceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowAssignmentGroupAttributes {\n"); + sb.append(" assignmentGroupName: ") + .append(toIndentedString(assignmentGroupName)) + .append("\n"); + sb.append(" assignmentGroupSysId: ") + .append(toIndentedString(assignmentGroupSysId)) + .append("\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupData.java new file mode 100644 index 00000000000..d81fb216ac1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupData.java @@ -0,0 +1,212 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data object for a ServiceNow assignment group */ +@JsonPropertyOrder({ + ServiceNowAssignmentGroupData.JSON_PROPERTY_ATTRIBUTES, + ServiceNowAssignmentGroupData.JSON_PROPERTY_ID, + ServiceNowAssignmentGroupData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowAssignmentGroupData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceNowAssignmentGroupAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowAssignmentGroupType type; + + public ServiceNowAssignmentGroupData() {} + + @JsonCreator + public ServiceNowAssignmentGroupData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceNowAssignmentGroupAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ServiceNowAssignmentGroupType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceNowAssignmentGroupData attributes(ServiceNowAssignmentGroupAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a ServiceNow assignment group + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowAssignmentGroupAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceNowAssignmentGroupAttributes attributes) { + this.attributes = attributes; + } + + public ServiceNowAssignmentGroupData id(UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the ServiceNow assignment group + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ServiceNowAssignmentGroupData type(ServiceNowAssignmentGroupType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for ServiceNow assignment group resources + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowAssignmentGroupType getType() { + return type; + } + + public void setType(ServiceNowAssignmentGroupType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowAssignmentGroupData + */ + @JsonAnySetter + public ServiceNowAssignmentGroupData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowAssignmentGroupData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowAssignmentGroupData serviceNowAssignmentGroupData = (ServiceNowAssignmentGroupData) o; + return Objects.equals(this.attributes, serviceNowAssignmentGroupData.attributes) + && Objects.equals(this.id, serviceNowAssignmentGroupData.id) + && Objects.equals(this.type, serviceNowAssignmentGroupData.type) + && Objects.equals( + this.additionalProperties, serviceNowAssignmentGroupData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowAssignmentGroupData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupType.java new file mode 100644 index 00000000000..12742d2f31d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type identifier for ServiceNow assignment group resources */ +@JsonSerialize(using = ServiceNowAssignmentGroupType.ServiceNowAssignmentGroupTypeSerializer.class) +public class ServiceNowAssignmentGroupType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("assignment_groups")); + + public static final ServiceNowAssignmentGroupType ASSIGNMENT_GROUPS = + new ServiceNowAssignmentGroupType("assignment_groups"); + + ServiceNowAssignmentGroupType(String value) { + super(value, allowedValues); + } + + public static class ServiceNowAssignmentGroupTypeSerializer + extends StdSerializer { + public ServiceNowAssignmentGroupTypeSerializer(Class t) { + super(t); + } + + public ServiceNowAssignmentGroupTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ServiceNowAssignmentGroupType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceNowAssignmentGroupType fromValue(String value) { + return new ServiceNowAssignmentGroupType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupsResponse.java new file mode 100644 index 00000000000..ad6392aff7f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowAssignmentGroupsResponse.java @@ -0,0 +1,157 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing ServiceNow assignment groups */ +@JsonPropertyOrder({ServiceNowAssignmentGroupsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowAssignmentGroupsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ServiceNowAssignmentGroupsResponse() {} + + @JsonCreator + public ServiceNowAssignmentGroupsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public ServiceNowAssignmentGroupsResponse data(List data) { + this.data = data; + for (ServiceNowAssignmentGroupData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ServiceNowAssignmentGroupsResponse addDataItem(ServiceNowAssignmentGroupData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of ServiceNow assignment group data objects + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowAssignmentGroupsResponse + */ + @JsonAnySetter + public ServiceNowAssignmentGroupsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowAssignmentGroupsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowAssignmentGroupsResponse serviceNowAssignmentGroupsResponse = + (ServiceNowAssignmentGroupsResponse) o; + return Objects.equals(this.data, serviceNowAssignmentGroupsResponse.data) + && Objects.equals( + this.additionalProperties, serviceNowAssignmentGroupsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowAssignmentGroupsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceAttributes.java new file mode 100644 index 00000000000..39ce71fdd59 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceAttributes.java @@ -0,0 +1,204 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes of a ServiceNow business service */ +@JsonPropertyOrder({ + ServiceNowBusinessServiceAttributes.JSON_PROPERTY_INSTANCE_ID, + ServiceNowBusinessServiceAttributes.JSON_PROPERTY_SERVICE_NAME, + ServiceNowBusinessServiceAttributes.JSON_PROPERTY_SERVICE_SYS_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowBusinessServiceAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private UUID instanceId; + + public static final String JSON_PROPERTY_SERVICE_NAME = "service_name"; + private String serviceName; + + public static final String JSON_PROPERTY_SERVICE_SYS_ID = "service_sys_id"; + private String serviceSysId; + + public ServiceNowBusinessServiceAttributes() {} + + @JsonCreator + public ServiceNowBusinessServiceAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_ID) UUID instanceId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE_NAME) String serviceName, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE_SYS_ID) String serviceSysId) { + this.instanceId = instanceId; + this.serviceName = serviceName; + this.serviceSysId = serviceSysId; + } + + public ServiceNowBusinessServiceAttributes instanceId(UUID instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * The ID of the ServiceNow instance + * + * @return instanceId + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getInstanceId() { + return instanceId; + } + + public void setInstanceId(UUID instanceId) { + this.instanceId = instanceId; + } + + public ServiceNowBusinessServiceAttributes serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * The name of the business service + * + * @return serviceName + */ + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public ServiceNowBusinessServiceAttributes serviceSysId(String serviceSysId) { + this.serviceSysId = serviceSysId; + return this; + } + + /** + * The system ID of the business service in ServiceNow + * + * @return serviceSysId + */ + @JsonProperty(JSON_PROPERTY_SERVICE_SYS_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServiceSysId() { + return serviceSysId; + } + + public void setServiceSysId(String serviceSysId) { + this.serviceSysId = serviceSysId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowBusinessServiceAttributes + */ + @JsonAnySetter + public ServiceNowBusinessServiceAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowBusinessServiceAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowBusinessServiceAttributes serviceNowBusinessServiceAttributes = + (ServiceNowBusinessServiceAttributes) o; + return Objects.equals(this.instanceId, serviceNowBusinessServiceAttributes.instanceId) + && Objects.equals(this.serviceName, serviceNowBusinessServiceAttributes.serviceName) + && Objects.equals(this.serviceSysId, serviceNowBusinessServiceAttributes.serviceSysId) + && Objects.equals( + this.additionalProperties, serviceNowBusinessServiceAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(instanceId, serviceName, serviceSysId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowBusinessServiceAttributes {\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" serviceSysId: ").append(toIndentedString(serviceSysId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceData.java new file mode 100644 index 00000000000..ae4bd1df0d2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceData.java @@ -0,0 +1,212 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data object for a ServiceNow business service */ +@JsonPropertyOrder({ + ServiceNowBusinessServiceData.JSON_PROPERTY_ATTRIBUTES, + ServiceNowBusinessServiceData.JSON_PROPERTY_ID, + ServiceNowBusinessServiceData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowBusinessServiceData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceNowBusinessServiceAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowBusinessServiceType type; + + public ServiceNowBusinessServiceData() {} + + @JsonCreator + public ServiceNowBusinessServiceData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceNowBusinessServiceAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ServiceNowBusinessServiceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceNowBusinessServiceData attributes(ServiceNowBusinessServiceAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a ServiceNow business service + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowBusinessServiceAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceNowBusinessServiceAttributes attributes) { + this.attributes = attributes; + } + + public ServiceNowBusinessServiceData id(UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the ServiceNow business service + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ServiceNowBusinessServiceData type(ServiceNowBusinessServiceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for ServiceNow business service resources + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowBusinessServiceType getType() { + return type; + } + + public void setType(ServiceNowBusinessServiceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowBusinessServiceData + */ + @JsonAnySetter + public ServiceNowBusinessServiceData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowBusinessServiceData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowBusinessServiceData serviceNowBusinessServiceData = (ServiceNowBusinessServiceData) o; + return Objects.equals(this.attributes, serviceNowBusinessServiceData.attributes) + && Objects.equals(this.id, serviceNowBusinessServiceData.id) + && Objects.equals(this.type, serviceNowBusinessServiceData.type) + && Objects.equals( + this.additionalProperties, serviceNowBusinessServiceData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowBusinessServiceData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceType.java new file mode 100644 index 00000000000..6e19b4337a7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServiceType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type identifier for ServiceNow business service resources */ +@JsonSerialize(using = ServiceNowBusinessServiceType.ServiceNowBusinessServiceTypeSerializer.class) +public class ServiceNowBusinessServiceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("business_services")); + + public static final ServiceNowBusinessServiceType BUSINESS_SERVICES = + new ServiceNowBusinessServiceType("business_services"); + + ServiceNowBusinessServiceType(String value) { + super(value, allowedValues); + } + + public static class ServiceNowBusinessServiceTypeSerializer + extends StdSerializer { + public ServiceNowBusinessServiceTypeSerializer(Class t) { + super(t); + } + + public ServiceNowBusinessServiceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ServiceNowBusinessServiceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceNowBusinessServiceType fromValue(String value) { + return new ServiceNowBusinessServiceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServicesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServicesResponse.java new file mode 100644 index 00000000000..3685ccae89d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowBusinessServicesResponse.java @@ -0,0 +1,157 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing ServiceNow business services */ +@JsonPropertyOrder({ServiceNowBusinessServicesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowBusinessServicesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ServiceNowBusinessServicesResponse() {} + + @JsonCreator + public ServiceNowBusinessServicesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public ServiceNowBusinessServicesResponse data(List data) { + this.data = data; + for (ServiceNowBusinessServiceData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ServiceNowBusinessServicesResponse addDataItem(ServiceNowBusinessServiceData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of ServiceNow business service data objects + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowBusinessServicesResponse + */ + @JsonAnySetter + public ServiceNowBusinessServicesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowBusinessServicesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowBusinessServicesResponse serviceNowBusinessServicesResponse = + (ServiceNowBusinessServicesResponse) o; + return Objects.equals(this.data, serviceNowBusinessServicesResponse.data) + && Objects.equals( + this.additionalProperties, serviceNowBusinessServicesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowBusinessServicesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceAttributes.java new file mode 100644 index 00000000000..5c9c24d67b7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceAttributes.java @@ -0,0 +1,144 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a ServiceNow instance */ +@JsonPropertyOrder({ServiceNowInstanceAttributes.JSON_PROPERTY_INSTANCE_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowInstanceAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INSTANCE_NAME = "instance_name"; + private String instanceName; + + public ServiceNowInstanceAttributes() {} + + @JsonCreator + public ServiceNowInstanceAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_NAME) String instanceName) { + this.instanceName = instanceName; + } + + public ServiceNowInstanceAttributes instanceName(String instanceName) { + this.instanceName = instanceName; + return this; + } + + /** + * The name of the ServiceNow instance + * + * @return instanceName + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInstanceName() { + return instanceName; + } + + public void setInstanceName(String instanceName) { + this.instanceName = instanceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowInstanceAttributes + */ + @JsonAnySetter + public ServiceNowInstanceAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowInstanceAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowInstanceAttributes serviceNowInstanceAttributes = (ServiceNowInstanceAttributes) o; + return Objects.equals(this.instanceName, serviceNowInstanceAttributes.instanceName) + && Objects.equals( + this.additionalProperties, serviceNowInstanceAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(instanceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowInstanceAttributes {\n"); + sb.append(" instanceName: ").append(toIndentedString(instanceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceData.java new file mode 100644 index 00000000000..eefc518166a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data object for a ServiceNow instance */ +@JsonPropertyOrder({ + ServiceNowInstanceData.JSON_PROPERTY_ATTRIBUTES, + ServiceNowInstanceData.JSON_PROPERTY_ID, + ServiceNowInstanceData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowInstanceData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceNowInstanceAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowInstanceType type; + + public ServiceNowInstanceData() {} + + @JsonCreator + public ServiceNowInstanceData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceNowInstanceAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceNowInstanceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceNowInstanceData attributes(ServiceNowInstanceAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a ServiceNow instance + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowInstanceAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceNowInstanceAttributes attributes) { + this.attributes = attributes; + } + + public ServiceNowInstanceData id(UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the ServiceNow instance + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ServiceNowInstanceData type(ServiceNowInstanceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for ServiceNow instance resources + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowInstanceType getType() { + return type; + } + + public void setType(ServiceNowInstanceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowInstanceData + */ + @JsonAnySetter + public ServiceNowInstanceData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowInstanceData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowInstanceData serviceNowInstanceData = (ServiceNowInstanceData) o; + return Objects.equals(this.attributes, serviceNowInstanceData.attributes) + && Objects.equals(this.id, serviceNowInstanceData.id) + && Objects.equals(this.type, serviceNowInstanceData.type) + && Objects.equals(this.additionalProperties, serviceNowInstanceData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowInstanceData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceType.java new file mode 100644 index 00000000000..ccc5e7ce157 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstanceType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type identifier for ServiceNow instance resources */ +@JsonSerialize(using = ServiceNowInstanceType.ServiceNowInstanceTypeSerializer.class) +public class ServiceNowInstanceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("instance")); + + public static final ServiceNowInstanceType INSTANCE = new ServiceNowInstanceType("instance"); + + ServiceNowInstanceType(String value) { + super(value, allowedValues); + } + + public static class ServiceNowInstanceTypeSerializer + extends StdSerializer { + public ServiceNowInstanceTypeSerializer(Class t) { + super(t); + } + + public ServiceNowInstanceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ServiceNowInstanceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceNowInstanceType fromValue(String value) { + return new ServiceNowInstanceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstancesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstancesResponse.java new file mode 100644 index 00000000000..386f949e6d5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowInstancesResponse.java @@ -0,0 +1,156 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing ServiceNow instances */ +@JsonPropertyOrder({ServiceNowInstancesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowInstancesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ServiceNowInstancesResponse() {} + + @JsonCreator + public ServiceNowInstancesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public ServiceNowInstancesResponse data(List data) { + this.data = data; + for (ServiceNowInstanceData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ServiceNowInstancesResponse addDataItem(ServiceNowInstanceData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of ServiceNow instance data objects + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowInstancesResponse + */ + @JsonAnySetter + public ServiceNowInstancesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowInstancesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowInstancesResponse serviceNowInstancesResponse = (ServiceNowInstancesResponse) o; + return Objects.equals(this.data, serviceNowInstancesResponse.data) + && Objects.equals( + this.additionalProperties, serviceNowInstancesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowInstancesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateAttributes.java new file mode 100644 index 00000000000..fbee403a78c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateAttributes.java @@ -0,0 +1,331 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes of a ServiceNow template */ +@JsonPropertyOrder({ + ServiceNowTemplateAttributes.JSON_PROPERTY_ASSIGNMENT_GROUP_ID, + ServiceNowTemplateAttributes.JSON_PROPERTY_BUSINESS_SERVICE_ID, + ServiceNowTemplateAttributes.JSON_PROPERTY_FIELDS_MAPPING, + ServiceNowTemplateAttributes.JSON_PROPERTY_HANDLE_NAME, + ServiceNowTemplateAttributes.JSON_PROPERTY_INSTANCE_ID, + ServiceNowTemplateAttributes.JSON_PROPERTY_SERVICENOW_TABLENAME, + ServiceNowTemplateAttributes.JSON_PROPERTY_USER_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNMENT_GROUP_ID = "assignment_group_id"; + private UUID assignmentGroupId; + + public static final String JSON_PROPERTY_BUSINESS_SERVICE_ID = "business_service_id"; + private UUID businessServiceId; + + public static final String JSON_PROPERTY_FIELDS_MAPPING = "fields_mapping"; + private Map fieldsMapping = null; + + public static final String JSON_PROPERTY_HANDLE_NAME = "handle_name"; + private String handleName; + + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private UUID instanceId; + + public static final String JSON_PROPERTY_SERVICENOW_TABLENAME = "servicenow_tablename"; + private String servicenowTablename; + + public static final String JSON_PROPERTY_USER_ID = "user_id"; + private UUID userId; + + public ServiceNowTemplateAttributes() {} + + @JsonCreator + public ServiceNowTemplateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE_NAME) String handleName, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_ID) UUID instanceId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICENOW_TABLENAME) + String servicenowTablename) { + this.handleName = handleName; + this.instanceId = instanceId; + this.servicenowTablename = servicenowTablename; + } + + public ServiceNowTemplateAttributes assignmentGroupId(UUID assignmentGroupId) { + this.assignmentGroupId = assignmentGroupId; + return this; + } + + /** + * The ID of the assignment group + * + * @return assignmentGroupId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAssignmentGroupId() { + return assignmentGroupId; + } + + public void setAssignmentGroupId(UUID assignmentGroupId) { + this.assignmentGroupId = assignmentGroupId; + } + + public ServiceNowTemplateAttributes businessServiceId(UUID businessServiceId) { + this.businessServiceId = businessServiceId; + return this; + } + + /** + * The ID of the business service + * + * @return businessServiceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUSINESS_SERVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getBusinessServiceId() { + return businessServiceId; + } + + public void setBusinessServiceId(UUID businessServiceId) { + this.businessServiceId = businessServiceId; + } + + public ServiceNowTemplateAttributes fieldsMapping(Map fieldsMapping) { + this.fieldsMapping = fieldsMapping; + return this; + } + + public ServiceNowTemplateAttributes putFieldsMappingItem(String key, String fieldsMappingItem) { + if (this.fieldsMapping == null) { + this.fieldsMapping = new HashMap<>(); + } + this.fieldsMapping.put(key, fieldsMappingItem); + return this; + } + + /** + * Custom field mappings for the template + * + * @return fieldsMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS_MAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getFieldsMapping() { + return fieldsMapping; + } + + public void setFieldsMapping(Map fieldsMapping) { + this.fieldsMapping = fieldsMapping; + } + + public ServiceNowTemplateAttributes handleName(String handleName) { + this.handleName = handleName; + return this; + } + + /** + * The handle name of the template + * + * @return handleName + */ + @JsonProperty(JSON_PROPERTY_HANDLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandleName() { + return handleName; + } + + public void setHandleName(String handleName) { + this.handleName = handleName; + } + + public ServiceNowTemplateAttributes instanceId(UUID instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * The ID of the ServiceNow instance + * + * @return instanceId + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getInstanceId() { + return instanceId; + } + + public void setInstanceId(UUID instanceId) { + this.instanceId = instanceId; + } + + public ServiceNowTemplateAttributes servicenowTablename(String servicenowTablename) { + this.servicenowTablename = servicenowTablename; + return this; + } + + /** + * The name of the destination ServiceNow table + * + * @return servicenowTablename + */ + @JsonProperty(JSON_PROPERTY_SERVICENOW_TABLENAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServicenowTablename() { + return servicenowTablename; + } + + public void setServicenowTablename(String servicenowTablename) { + this.servicenowTablename = servicenowTablename; + } + + public ServiceNowTemplateAttributes userId(UUID userId) { + this.userId = userId; + return this; + } + + /** + * The ID of the user + * + * @return userId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + public void setUserId(UUID userId) { + this.userId = userId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateAttributes + */ + @JsonAnySetter + public ServiceNowTemplateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateAttributes serviceNowTemplateAttributes = (ServiceNowTemplateAttributes) o; + return Objects.equals(this.assignmentGroupId, serviceNowTemplateAttributes.assignmentGroupId) + && Objects.equals(this.businessServiceId, serviceNowTemplateAttributes.businessServiceId) + && Objects.equals(this.fieldsMapping, serviceNowTemplateAttributes.fieldsMapping) + && Objects.equals(this.handleName, serviceNowTemplateAttributes.handleName) + && Objects.equals(this.instanceId, serviceNowTemplateAttributes.instanceId) + && Objects.equals( + this.servicenowTablename, serviceNowTemplateAttributes.servicenowTablename) + && Objects.equals(this.userId, serviceNowTemplateAttributes.userId) + && Objects.equals( + this.additionalProperties, serviceNowTemplateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assignmentGroupId, + businessServiceId, + fieldsMapping, + handleName, + instanceId, + servicenowTablename, + userId, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateAttributes {\n"); + sb.append(" assignmentGroupId: ").append(toIndentedString(assignmentGroupId)).append("\n"); + sb.append(" businessServiceId: ").append(toIndentedString(businessServiceId)).append("\n"); + sb.append(" fieldsMapping: ").append(toIndentedString(fieldsMapping)).append("\n"); + sb.append(" handleName: ").append(toIndentedString(handleName)).append("\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" servicenowTablename: ") + .append(toIndentedString(servicenowTablename)) + .append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequest.java new file mode 100644 index 00000000000..63e7f45ddc7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to create a ServiceNow template */ +@JsonPropertyOrder({ServiceNowTemplateCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceNowTemplateCreateRequestData data; + + public ServiceNowTemplateCreateRequest() {} + + @JsonCreator + public ServiceNowTemplateCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ServiceNowTemplateCreateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ServiceNowTemplateCreateRequest data(ServiceNowTemplateCreateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for creating a ServiceNow template + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateCreateRequestData getData() { + return data; + } + + public void setData(ServiceNowTemplateCreateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateCreateRequest + */ + @JsonAnySetter + public ServiceNowTemplateCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateCreateRequest serviceNowTemplateCreateRequest = + (ServiceNowTemplateCreateRequest) o; + return Objects.equals(this.data, serviceNowTemplateCreateRequest.data) + && Objects.equals( + this.additionalProperties, serviceNowTemplateCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequestAttributes.java new file mode 100644 index 00000000000..ffe7decc735 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequestAttributes.java @@ -0,0 +1,338 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes for creating a ServiceNow template */ +@JsonPropertyOrder({ + ServiceNowTemplateCreateRequestAttributes.JSON_PROPERTY_ASSIGNMENT_GROUP_ID, + ServiceNowTemplateCreateRequestAttributes.JSON_PROPERTY_BUSINESS_SERVICE_ID, + ServiceNowTemplateCreateRequestAttributes.JSON_PROPERTY_FIELDS_MAPPING, + ServiceNowTemplateCreateRequestAttributes.JSON_PROPERTY_HANDLE_NAME, + ServiceNowTemplateCreateRequestAttributes.JSON_PROPERTY_INSTANCE_ID, + ServiceNowTemplateCreateRequestAttributes.JSON_PROPERTY_SERVICENOW_TABLENAME, + ServiceNowTemplateCreateRequestAttributes.JSON_PROPERTY_USER_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateCreateRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNMENT_GROUP_ID = "assignment_group_id"; + private UUID assignmentGroupId; + + public static final String JSON_PROPERTY_BUSINESS_SERVICE_ID = "business_service_id"; + private UUID businessServiceId; + + public static final String JSON_PROPERTY_FIELDS_MAPPING = "fields_mapping"; + private Map fieldsMapping = null; + + public static final String JSON_PROPERTY_HANDLE_NAME = "handle_name"; + private String handleName; + + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private UUID instanceId; + + public static final String JSON_PROPERTY_SERVICENOW_TABLENAME = "servicenow_tablename"; + private String servicenowTablename; + + public static final String JSON_PROPERTY_USER_ID = "user_id"; + private UUID userId; + + public ServiceNowTemplateCreateRequestAttributes() {} + + @JsonCreator + public ServiceNowTemplateCreateRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE_NAME) String handleName, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_ID) UUID instanceId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICENOW_TABLENAME) + String servicenowTablename) { + this.handleName = handleName; + this.instanceId = instanceId; + this.servicenowTablename = servicenowTablename; + } + + public ServiceNowTemplateCreateRequestAttributes assignmentGroupId(UUID assignmentGroupId) { + this.assignmentGroupId = assignmentGroupId; + return this; + } + + /** + * The ID of the assignment group + * + * @return assignmentGroupId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAssignmentGroupId() { + return assignmentGroupId; + } + + public void setAssignmentGroupId(UUID assignmentGroupId) { + this.assignmentGroupId = assignmentGroupId; + } + + public ServiceNowTemplateCreateRequestAttributes businessServiceId(UUID businessServiceId) { + this.businessServiceId = businessServiceId; + return this; + } + + /** + * The ID of the business service + * + * @return businessServiceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUSINESS_SERVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getBusinessServiceId() { + return businessServiceId; + } + + public void setBusinessServiceId(UUID businessServiceId) { + this.businessServiceId = businessServiceId; + } + + public ServiceNowTemplateCreateRequestAttributes fieldsMapping( + Map fieldsMapping) { + this.fieldsMapping = fieldsMapping; + return this; + } + + public ServiceNowTemplateCreateRequestAttributes putFieldsMappingItem( + String key, String fieldsMappingItem) { + if (this.fieldsMapping == null) { + this.fieldsMapping = new HashMap<>(); + } + this.fieldsMapping.put(key, fieldsMappingItem); + return this; + } + + /** + * Custom field mappings for the template + * + * @return fieldsMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS_MAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getFieldsMapping() { + return fieldsMapping; + } + + public void setFieldsMapping(Map fieldsMapping) { + this.fieldsMapping = fieldsMapping; + } + + public ServiceNowTemplateCreateRequestAttributes handleName(String handleName) { + this.handleName = handleName; + return this; + } + + /** + * The handle name of the template + * + * @return handleName + */ + @JsonProperty(JSON_PROPERTY_HANDLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandleName() { + return handleName; + } + + public void setHandleName(String handleName) { + this.handleName = handleName; + } + + public ServiceNowTemplateCreateRequestAttributes instanceId(UUID instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * The ID of the ServiceNow instance + * + * @return instanceId + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getInstanceId() { + return instanceId; + } + + public void setInstanceId(UUID instanceId) { + this.instanceId = instanceId; + } + + public ServiceNowTemplateCreateRequestAttributes servicenowTablename(String servicenowTablename) { + this.servicenowTablename = servicenowTablename; + return this; + } + + /** + * The name of the destination ServiceNow table + * + * @return servicenowTablename + */ + @JsonProperty(JSON_PROPERTY_SERVICENOW_TABLENAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServicenowTablename() { + return servicenowTablename; + } + + public void setServicenowTablename(String servicenowTablename) { + this.servicenowTablename = servicenowTablename; + } + + public ServiceNowTemplateCreateRequestAttributes userId(UUID userId) { + this.userId = userId; + return this; + } + + /** + * The ID of the user + * + * @return userId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + public void setUserId(UUID userId) { + this.userId = userId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateCreateRequestAttributes + */ + @JsonAnySetter + public ServiceNowTemplateCreateRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateCreateRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateCreateRequestAttributes serviceNowTemplateCreateRequestAttributes = + (ServiceNowTemplateCreateRequestAttributes) o; + return Objects.equals( + this.assignmentGroupId, serviceNowTemplateCreateRequestAttributes.assignmentGroupId) + && Objects.equals( + this.businessServiceId, serviceNowTemplateCreateRequestAttributes.businessServiceId) + && Objects.equals( + this.fieldsMapping, serviceNowTemplateCreateRequestAttributes.fieldsMapping) + && Objects.equals(this.handleName, serviceNowTemplateCreateRequestAttributes.handleName) + && Objects.equals(this.instanceId, serviceNowTemplateCreateRequestAttributes.instanceId) + && Objects.equals( + this.servicenowTablename, serviceNowTemplateCreateRequestAttributes.servicenowTablename) + && Objects.equals(this.userId, serviceNowTemplateCreateRequestAttributes.userId) + && Objects.equals( + this.additionalProperties, + serviceNowTemplateCreateRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assignmentGroupId, + businessServiceId, + fieldsMapping, + handleName, + instanceId, + servicenowTablename, + userId, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateCreateRequestAttributes {\n"); + sb.append(" assignmentGroupId: ").append(toIndentedString(assignmentGroupId)).append("\n"); + sb.append(" businessServiceId: ").append(toIndentedString(businessServiceId)).append("\n"); + sb.append(" fieldsMapping: ").append(toIndentedString(fieldsMapping)).append("\n"); + sb.append(" handleName: ").append(toIndentedString(handleName)).append("\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" servicenowTablename: ") + .append(toIndentedString(servicenowTablename)) + .append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequestData.java new file mode 100644 index 00000000000..d4634a10831 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateCreateRequestData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for creating a ServiceNow template */ +@JsonPropertyOrder({ + ServiceNowTemplateCreateRequestData.JSON_PROPERTY_ATTRIBUTES, + ServiceNowTemplateCreateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateCreateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceNowTemplateCreateRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowTemplateType type; + + public ServiceNowTemplateCreateRequestData() {} + + @JsonCreator + public ServiceNowTemplateCreateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceNowTemplateCreateRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceNowTemplateType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceNowTemplateCreateRequestData attributes( + ServiceNowTemplateCreateRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a ServiceNow template + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateCreateRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceNowTemplateCreateRequestAttributes attributes) { + this.attributes = attributes; + } + + public ServiceNowTemplateCreateRequestData type(ServiceNowTemplateType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for ServiceNow template resources + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateType getType() { + return type; + } + + public void setType(ServiceNowTemplateType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateCreateRequestData + */ + @JsonAnySetter + public ServiceNowTemplateCreateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateCreateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateCreateRequestData serviceNowTemplateCreateRequestData = + (ServiceNowTemplateCreateRequestData) o; + return Objects.equals(this.attributes, serviceNowTemplateCreateRequestData.attributes) + && Objects.equals(this.type, serviceNowTemplateCreateRequestData.type) + && Objects.equals( + this.additionalProperties, serviceNowTemplateCreateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateCreateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateData.java new file mode 100644 index 00000000000..a7f70a1e34d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data object for a ServiceNow template */ +@JsonPropertyOrder({ + ServiceNowTemplateData.JSON_PROPERTY_ATTRIBUTES, + ServiceNowTemplateData.JSON_PROPERTY_ID, + ServiceNowTemplateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceNowTemplateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowTemplateType type; + + public ServiceNowTemplateData() {} + + @JsonCreator + public ServiceNowTemplateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceNowTemplateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceNowTemplateType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceNowTemplateData attributes(ServiceNowTemplateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a ServiceNow template + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceNowTemplateAttributes attributes) { + this.attributes = attributes; + } + + public ServiceNowTemplateData id(UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the ServiceNow template + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ServiceNowTemplateData type(ServiceNowTemplateType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for ServiceNow template resources + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateType getType() { + return type; + } + + public void setType(ServiceNowTemplateType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateData + */ + @JsonAnySetter + public ServiceNowTemplateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateData serviceNowTemplateData = (ServiceNowTemplateData) o; + return Objects.equals(this.attributes, serviceNowTemplateData.attributes) + && Objects.equals(this.id, serviceNowTemplateData.id) + && Objects.equals(this.type, serviceNowTemplateData.type) + && Objects.equals(this.additionalProperties, serviceNowTemplateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateResponse.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateResponse.java new file mode 100644 index 00000000000..6745ef1342a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateResponse.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single ServiceNow template */ +@JsonPropertyOrder({ServiceNowTemplateResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceNowTemplateData data; + + public ServiceNowTemplateResponse() {} + + @JsonCreator + public ServiceNowTemplateResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ServiceNowTemplateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ServiceNowTemplateResponse data(ServiceNowTemplateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a ServiceNow template + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateData getData() { + return data; + } + + public void setData(ServiceNowTemplateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateResponse + */ + @JsonAnySetter + public ServiceNowTemplateResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateResponse serviceNowTemplateResponse = (ServiceNowTemplateResponse) o; + return Objects.equals(this.data, serviceNowTemplateResponse.data) + && Objects.equals( + this.additionalProperties, serviceNowTemplateResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateType.java new file mode 100644 index 00000000000..562e41a8227 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type identifier for ServiceNow template resources */ +@JsonSerialize(using = ServiceNowTemplateType.ServiceNowTemplateTypeSerializer.class) +public class ServiceNowTemplateType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("servicenow_templates")); + + public static final ServiceNowTemplateType SERVICENOW_TEMPLATES = + new ServiceNowTemplateType("servicenow_templates"); + + ServiceNowTemplateType(String value) { + super(value, allowedValues); + } + + public static class ServiceNowTemplateTypeSerializer + extends StdSerializer { + public ServiceNowTemplateTypeSerializer(Class t) { + super(t); + } + + public ServiceNowTemplateTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ServiceNowTemplateType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceNowTemplateType fromValue(String value) { + return new ServiceNowTemplateType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequest.java new file mode 100644 index 00000000000..62ec65fde57 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to update a ServiceNow template */ +@JsonPropertyOrder({ServiceNowTemplateUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceNowTemplateUpdateRequestData data; + + public ServiceNowTemplateUpdateRequest() {} + + @JsonCreator + public ServiceNowTemplateUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ServiceNowTemplateUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ServiceNowTemplateUpdateRequest data(ServiceNowTemplateUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating a ServiceNow template + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateUpdateRequestData getData() { + return data; + } + + public void setData(ServiceNowTemplateUpdateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateUpdateRequest + */ + @JsonAnySetter + public ServiceNowTemplateUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateUpdateRequest serviceNowTemplateUpdateRequest = + (ServiceNowTemplateUpdateRequest) o; + return Objects.equals(this.data, serviceNowTemplateUpdateRequest.data) + && Objects.equals( + this.additionalProperties, serviceNowTemplateUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequestAttributes.java new file mode 100644 index 00000000000..76a45c2c31b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequestAttributes.java @@ -0,0 +1,338 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes for updating a ServiceNow template */ +@JsonPropertyOrder({ + ServiceNowTemplateUpdateRequestAttributes.JSON_PROPERTY_ASSIGNMENT_GROUP_ID, + ServiceNowTemplateUpdateRequestAttributes.JSON_PROPERTY_BUSINESS_SERVICE_ID, + ServiceNowTemplateUpdateRequestAttributes.JSON_PROPERTY_FIELDS_MAPPING, + ServiceNowTemplateUpdateRequestAttributes.JSON_PROPERTY_HANDLE_NAME, + ServiceNowTemplateUpdateRequestAttributes.JSON_PROPERTY_INSTANCE_ID, + ServiceNowTemplateUpdateRequestAttributes.JSON_PROPERTY_SERVICENOW_TABLENAME, + ServiceNowTemplateUpdateRequestAttributes.JSON_PROPERTY_USER_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateUpdateRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNMENT_GROUP_ID = "assignment_group_id"; + private UUID assignmentGroupId; + + public static final String JSON_PROPERTY_BUSINESS_SERVICE_ID = "business_service_id"; + private UUID businessServiceId; + + public static final String JSON_PROPERTY_FIELDS_MAPPING = "fields_mapping"; + private Map fieldsMapping = null; + + public static final String JSON_PROPERTY_HANDLE_NAME = "handle_name"; + private String handleName; + + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private UUID instanceId; + + public static final String JSON_PROPERTY_SERVICENOW_TABLENAME = "servicenow_tablename"; + private String servicenowTablename; + + public static final String JSON_PROPERTY_USER_ID = "user_id"; + private UUID userId; + + public ServiceNowTemplateUpdateRequestAttributes() {} + + @JsonCreator + public ServiceNowTemplateUpdateRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE_NAME) String handleName, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_ID) UUID instanceId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICENOW_TABLENAME) + String servicenowTablename) { + this.handleName = handleName; + this.instanceId = instanceId; + this.servicenowTablename = servicenowTablename; + } + + public ServiceNowTemplateUpdateRequestAttributes assignmentGroupId(UUID assignmentGroupId) { + this.assignmentGroupId = assignmentGroupId; + return this; + } + + /** + * The ID of the assignment group + * + * @return assignmentGroupId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAssignmentGroupId() { + return assignmentGroupId; + } + + public void setAssignmentGroupId(UUID assignmentGroupId) { + this.assignmentGroupId = assignmentGroupId; + } + + public ServiceNowTemplateUpdateRequestAttributes businessServiceId(UUID businessServiceId) { + this.businessServiceId = businessServiceId; + return this; + } + + /** + * The ID of the business service + * + * @return businessServiceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUSINESS_SERVICE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getBusinessServiceId() { + return businessServiceId; + } + + public void setBusinessServiceId(UUID businessServiceId) { + this.businessServiceId = businessServiceId; + } + + public ServiceNowTemplateUpdateRequestAttributes fieldsMapping( + Map fieldsMapping) { + this.fieldsMapping = fieldsMapping; + return this; + } + + public ServiceNowTemplateUpdateRequestAttributes putFieldsMappingItem( + String key, String fieldsMappingItem) { + if (this.fieldsMapping == null) { + this.fieldsMapping = new HashMap<>(); + } + this.fieldsMapping.put(key, fieldsMappingItem); + return this; + } + + /** + * Custom field mappings for the template + * + * @return fieldsMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS_MAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getFieldsMapping() { + return fieldsMapping; + } + + public void setFieldsMapping(Map fieldsMapping) { + this.fieldsMapping = fieldsMapping; + } + + public ServiceNowTemplateUpdateRequestAttributes handleName(String handleName) { + this.handleName = handleName; + return this; + } + + /** + * The handle name of the template + * + * @return handleName + */ + @JsonProperty(JSON_PROPERTY_HANDLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandleName() { + return handleName; + } + + public void setHandleName(String handleName) { + this.handleName = handleName; + } + + public ServiceNowTemplateUpdateRequestAttributes instanceId(UUID instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * The ID of the ServiceNow instance + * + * @return instanceId + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getInstanceId() { + return instanceId; + } + + public void setInstanceId(UUID instanceId) { + this.instanceId = instanceId; + } + + public ServiceNowTemplateUpdateRequestAttributes servicenowTablename(String servicenowTablename) { + this.servicenowTablename = servicenowTablename; + return this; + } + + /** + * The name of the destination ServiceNow table + * + * @return servicenowTablename + */ + @JsonProperty(JSON_PROPERTY_SERVICENOW_TABLENAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServicenowTablename() { + return servicenowTablename; + } + + public void setServicenowTablename(String servicenowTablename) { + this.servicenowTablename = servicenowTablename; + } + + public ServiceNowTemplateUpdateRequestAttributes userId(UUID userId) { + this.userId = userId; + return this; + } + + /** + * The ID of the user + * + * @return userId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserId() { + return userId; + } + + public void setUserId(UUID userId) { + this.userId = userId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateUpdateRequestAttributes + */ + @JsonAnySetter + public ServiceNowTemplateUpdateRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateUpdateRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateUpdateRequestAttributes serviceNowTemplateUpdateRequestAttributes = + (ServiceNowTemplateUpdateRequestAttributes) o; + return Objects.equals( + this.assignmentGroupId, serviceNowTemplateUpdateRequestAttributes.assignmentGroupId) + && Objects.equals( + this.businessServiceId, serviceNowTemplateUpdateRequestAttributes.businessServiceId) + && Objects.equals( + this.fieldsMapping, serviceNowTemplateUpdateRequestAttributes.fieldsMapping) + && Objects.equals(this.handleName, serviceNowTemplateUpdateRequestAttributes.handleName) + && Objects.equals(this.instanceId, serviceNowTemplateUpdateRequestAttributes.instanceId) + && Objects.equals( + this.servicenowTablename, serviceNowTemplateUpdateRequestAttributes.servicenowTablename) + && Objects.equals(this.userId, serviceNowTemplateUpdateRequestAttributes.userId) + && Objects.equals( + this.additionalProperties, + serviceNowTemplateUpdateRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assignmentGroupId, + businessServiceId, + fieldsMapping, + handleName, + instanceId, + servicenowTablename, + userId, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateUpdateRequestAttributes {\n"); + sb.append(" assignmentGroupId: ").append(toIndentedString(assignmentGroupId)).append("\n"); + sb.append(" businessServiceId: ").append(toIndentedString(businessServiceId)).append("\n"); + sb.append(" fieldsMapping: ").append(toIndentedString(fieldsMapping)).append("\n"); + sb.append(" handleName: ").append(toIndentedString(handleName)).append("\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" servicenowTablename: ") + .append(toIndentedString(servicenowTablename)) + .append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequestData.java new file mode 100644 index 00000000000..3c73af0fdc8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplateUpdateRequestData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating a ServiceNow template */ +@JsonPropertyOrder({ + ServiceNowTemplateUpdateRequestData.JSON_PROPERTY_ATTRIBUTES, + ServiceNowTemplateUpdateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplateUpdateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceNowTemplateUpdateRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowTemplateType type; + + public ServiceNowTemplateUpdateRequestData() {} + + @JsonCreator + public ServiceNowTemplateUpdateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceNowTemplateUpdateRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceNowTemplateType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceNowTemplateUpdateRequestData attributes( + ServiceNowTemplateUpdateRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating a ServiceNow template + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateUpdateRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceNowTemplateUpdateRequestAttributes attributes) { + this.attributes = attributes; + } + + public ServiceNowTemplateUpdateRequestData type(ServiceNowTemplateType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for ServiceNow template resources + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTemplateType getType() { + return type; + } + + public void setType(ServiceNowTemplateType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplateUpdateRequestData + */ + @JsonAnySetter + public ServiceNowTemplateUpdateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplateUpdateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplateUpdateRequestData serviceNowTemplateUpdateRequestData = + (ServiceNowTemplateUpdateRequestData) o; + return Objects.equals(this.attributes, serviceNowTemplateUpdateRequestData.attributes) + && Objects.equals(this.type, serviceNowTemplateUpdateRequestData.type) + && Objects.equals( + this.additionalProperties, serviceNowTemplateUpdateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplateUpdateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplatesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplatesResponse.java new file mode 100644 index 00000000000..afc63879e98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTemplatesResponse.java @@ -0,0 +1,156 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing ServiceNow templates */ +@JsonPropertyOrder({ServiceNowTemplatesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTemplatesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ServiceNowTemplatesResponse() {} + + @JsonCreator + public ServiceNowTemplatesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public ServiceNowTemplatesResponse data(List data) { + this.data = data; + for (ServiceNowTemplateData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ServiceNowTemplatesResponse addDataItem(ServiceNowTemplateData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of ServiceNow template data objects + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTemplatesResponse + */ + @JsonAnySetter + public ServiceNowTemplatesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTemplatesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTemplatesResponse serviceNowTemplatesResponse = (ServiceNowTemplatesResponse) o; + return Objects.equals(this.data, serviceNowTemplatesResponse.data) + && Objects.equals( + this.additionalProperties, serviceNowTemplatesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTemplatesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserAttributes.java new file mode 100644 index 00000000000..12a303860a6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserAttributes.java @@ -0,0 +1,257 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes of a ServiceNow user */ +@JsonPropertyOrder({ + ServiceNowUserAttributes.JSON_PROPERTY_EMAIL, + ServiceNowUserAttributes.JSON_PROPERTY_FULL_NAME, + ServiceNowUserAttributes.JSON_PROPERTY_INSTANCE_ID, + ServiceNowUserAttributes.JSON_PROPERTY_USER_NAME, + ServiceNowUserAttributes.JSON_PROPERTY_USER_SYS_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowUserAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FULL_NAME = "full_name"; + private String fullName; + + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private UUID instanceId; + + public static final String JSON_PROPERTY_USER_NAME = "user_name"; + private String userName; + + public static final String JSON_PROPERTY_USER_SYS_ID = "user_sys_id"; + private String userSysId; + + public ServiceNowUserAttributes() {} + + @JsonCreator + public ServiceNowUserAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_EMAIL) String email, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_ID) UUID instanceId, + @JsonProperty(required = true, value = JSON_PROPERTY_USER_NAME) String userName, + @JsonProperty(required = true, value = JSON_PROPERTY_USER_SYS_ID) String userSysId) { + this.email = email; + this.instanceId = instanceId; + this.userName = userName; + this.userSysId = userSysId; + } + + public ServiceNowUserAttributes email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the user + * + * @return email + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public ServiceNowUserAttributes fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * The full name of the user + * + * @return fullName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public ServiceNowUserAttributes instanceId(UUID instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * The ID of the ServiceNow instance + * + * @return instanceId + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getInstanceId() { + return instanceId; + } + + public void setInstanceId(UUID instanceId) { + this.instanceId = instanceId; + } + + public ServiceNowUserAttributes userName(String userName) { + this.userName = userName; + return this; + } + + /** + * The username of the ServiceNow user + * + * @return userName + */ + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public ServiceNowUserAttributes userSysId(String userSysId) { + this.userSysId = userSysId; + return this; + } + + /** + * The system ID of the user in ServiceNow + * + * @return userSysId + */ + @JsonProperty(JSON_PROPERTY_USER_SYS_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUserSysId() { + return userSysId; + } + + public void setUserSysId(String userSysId) { + this.userSysId = userSysId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowUserAttributes + */ + @JsonAnySetter + public ServiceNowUserAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowUserAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowUserAttributes serviceNowUserAttributes = (ServiceNowUserAttributes) o; + return Objects.equals(this.email, serviceNowUserAttributes.email) + && Objects.equals(this.fullName, serviceNowUserAttributes.fullName) + && Objects.equals(this.instanceId, serviceNowUserAttributes.instanceId) + && Objects.equals(this.userName, serviceNowUserAttributes.userName) + && Objects.equals(this.userSysId, serviceNowUserAttributes.userSysId) + && Objects.equals(this.additionalProperties, serviceNowUserAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, fullName, instanceId, userName, userSysId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowUserAttributes {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" userSysId: ").append(toIndentedString(userSysId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserData.java new file mode 100644 index 00000000000..0f79d009600 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data object for a ServiceNow user */ +@JsonPropertyOrder({ + ServiceNowUserData.JSON_PROPERTY_ATTRIBUTES, + ServiceNowUserData.JSON_PROPERTY_ID, + ServiceNowUserData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowUserData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceNowUserAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowUserType type; + + public ServiceNowUserData() {} + + @JsonCreator + public ServiceNowUserData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceNowUserAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceNowUserType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceNowUserData attributes(ServiceNowUserAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a ServiceNow user + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowUserAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceNowUserAttributes attributes) { + this.attributes = attributes; + } + + public ServiceNowUserData id(UUID id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the ServiceNow user + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ServiceNowUserData type(ServiceNowUserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for ServiceNow user resources + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowUserType getType() { + return type; + } + + public void setType(ServiceNowUserType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowUserData + */ + @JsonAnySetter + public ServiceNowUserData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowUserData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowUserData serviceNowUserData = (ServiceNowUserData) o; + return Objects.equals(this.attributes, serviceNowUserData.attributes) + && Objects.equals(this.id, serviceNowUserData.id) + && Objects.equals(this.type, serviceNowUserData.type) + && Objects.equals(this.additionalProperties, serviceNowUserData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowUserData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserType.java new file mode 100644 index 00000000000..d78e36129f6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowUserType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type identifier for ServiceNow user resources */ +@JsonSerialize(using = ServiceNowUserType.ServiceNowUserTypeSerializer.class) +public class ServiceNowUserType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("users")); + + public static final ServiceNowUserType USERS = new ServiceNowUserType("users"); + + ServiceNowUserType(String value) { + super(value, allowedValues); + } + + public static class ServiceNowUserTypeSerializer extends StdSerializer { + public ServiceNowUserTypeSerializer(Class t) { + super(t); + } + + public ServiceNowUserTypeSerializer() { + this(null); + } + + @Override + public void serialize(ServiceNowUserType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceNowUserType fromValue(String value) { + return new ServiceNowUserType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowUsersResponse.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowUsersResponse.java new file mode 100644 index 00000000000..e6c32e86a1c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowUsersResponse.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing ServiceNow users */ +@JsonPropertyOrder({ServiceNowUsersResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowUsersResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ServiceNowUsersResponse() {} + + @JsonCreator + public ServiceNowUsersResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public ServiceNowUsersResponse data(List data) { + this.data = data; + for (ServiceNowUserData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ServiceNowUsersResponse addDataItem(ServiceNowUserData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of ServiceNow user data objects + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowUsersResponse + */ + @JsonAnySetter + public ServiceNowUsersResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowUsersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowUsersResponse serviceNowUsersResponse = (ServiceNowUsersResponse) o; + return Objects.equals(this.data, serviceNowUsersResponse.data) + && Objects.equals(this.additionalProperties, serviceNowUsersResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowUsersResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/servicenow_integration.feature b/src/test/resources/com/datadog/api/client/v2/api/servicenow_integration.feature new file mode 100644 index 00000000000..24f9878c0d8 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 1cd2195bba1..fce60a0329e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -2167,6 +2167,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": {