From f800992ebf140558b95782c996a1d42f1176e115 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 2 Feb 2026 10:52:49 +0000 Subject: [PATCH] Regenerate client from commit 4458d0d of spec repo --- .generator/schemas/v2/openapi.yaml | 405 +++++++ .../AcceptRecommendedEntities.java | 99 ++ .../ConvertCatalogEntities.java | 94 ++ .../DeclineRecommendedEntities.java | 29 + .../software-catalog/GetIDPConfigValue.java | 25 + .../TriggerRecommendedEntities.java | 23 + .../UpsertIDPConfigValue.java | 42 + .../com/datadog/api/client/ApiClient.java | 6 + .../api/client/v2/api/SoftwareCatalogApi.java | 1019 ++++++++++++++++- .../AcceptRecommendedEntitiesResponse.java | 147 +++ .../client/v2/model/EntitySchemaVersion.java | 58 + .../client/v2/model/IDPConfigAttributes.java | 150 +++ .../api/client/v2/model/IDPConfigData.java | 209 ++++ .../api/client/v2/model/IDPConfigRequest.java | 145 +++ .../v2/model/IDPConfigRequestAttributes.java | 151 +++ .../client/v2/model/IDPConfigRequestData.java | 181 +++ .../client/v2/model/IDPConfigResponse.java | 145 +++ .../api/client/v2/model/IDPConfigType.java | 53 + .../client/v2/model/RecommendedEntityID.java | 142 +++ .../v2/model/RecommendedEntityWithSchema.java | 176 +++ .../client/v2/api/software_catalog.feature | 106 ++ .../com/datadog/api/client/v2/api/undo.json | 36 + 22 files changed, 3430 insertions(+), 11 deletions(-) create mode 100644 examples/v2/software-catalog/AcceptRecommendedEntities.java create mode 100644 examples/v2/software-catalog/ConvertCatalogEntities.java create mode 100644 examples/v2/software-catalog/DeclineRecommendedEntities.java create mode 100644 examples/v2/software-catalog/GetIDPConfigValue.java create mode 100644 examples/v2/software-catalog/TriggerRecommendedEntities.java create mode 100644 examples/v2/software-catalog/UpsertIDPConfigValue.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AcceptRecommendedEntitiesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EntitySchemaVersion.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IDPConfigAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IDPConfigData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IDPConfigRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IDPConfigRequestAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IDPConfigRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IDPConfigResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IDPConfigType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RecommendedEntityID.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RecommendedEntityWithSchema.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b58b6fe70e8..16329bae520 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2540,6 +2540,23 @@ components: xray_services: $ref: '#/components/schemas/XRayServicesList' type: object + AcceptRecommendedEntitiesRequest: + description: Request to accept recommended entities. + items: + $ref: '#/components/schemas/RecommendedEntityWithSchema' + type: array + AcceptRecommendedEntitiesResponse: + description: Response after accepting recommended entities. + properties: + data: + description: Array of accepted entity data. + items: + $ref: '#/components/schemas/AcceptRecommendedEntityItem' + type: array + type: object + AcceptRecommendedEntityItem: + description: Accepted entity item. + type: object AccountFilteringConfig: description: The account filtering configuration. properties: @@ -13075,6 +13092,10 @@ components: - IDENTITY - GZIP - DEFLATE + ConvertCatalogEntityResponse: + description: Response containing converted entities. + example: "apiVersion: v3\nkind: service\nmetadata:\n name: myservice" + type: string ConvertJobResultsToSignalsAttributes: description: Attributes for converting threat hunting job results to signals. properties: @@ -18696,6 +18717,11 @@ components: example: 1722439510282 format: int64 type: integer + DeclineRecommendedEntitiesRequest: + description: Request to decline recommended entities. + items: + $ref: '#/components/schemas/RecommendedEntityID' + type: array Degradation: properties: data: @@ -20877,6 +20903,20 @@ components: format: int64 type: integer type: object + EntitySchemaVersion: + description: Entity schema version for conversion. + enum: + - v2 + - v2.1 + - v2.2 + - v3 + example: v3 + type: string + x-enum-varnames: + - V2 + - V2_1 + - V2_2 + - V3 EntityToIncidents: description: Entity to incidents relationship. properties: @@ -27892,6 +27932,89 @@ components: description: The ID of a notification rule. example: aaa-bbb-ccc type: string + IDPConfigAttributes: + description: IDP configuration attributes. + properties: + value: + description: Configuration value (can be object, array, or primitive). + example: + - displayName: My Dashboard + id: dashboard-1 + items: + $ref: '#/components/schemas/IDPConfigValueItem' + type: array + required: + - value + type: object + IDPConfigData: + description: IDP configuration data. + properties: + attributes: + $ref: '#/components/schemas/IDPConfigAttributes' + id: + description: Configuration identifier. + example: idp_pinned_dashboards + type: string + type: + $ref: '#/components/schemas/IDPConfigType' + required: + - id + - type + - attributes + type: object + IDPConfigRequest: + description: Request to set IDP configuration value. + properties: + data: + $ref: '#/components/schemas/IDPConfigRequestData' + required: + - data + type: object + IDPConfigRequestAttributes: + description: IDP configuration request attributes. + properties: + value: + description: Configuration value to set (can be object, array, or primitive). + example: + - displayName: My Dashboard + id: dashboard-1 + items: + $ref: '#/components/schemas/IDPConfigValueItem' + type: array + required: + - value + type: object + IDPConfigRequestData: + description: IDP configuration request data. + properties: + attributes: + $ref: '#/components/schemas/IDPConfigRequestAttributes' + type: + $ref: '#/components/schemas/IDPConfigType' + required: + - type + - attributes + type: object + IDPConfigResponse: + description: Response containing IDP configuration value. + properties: + data: + $ref: '#/components/schemas/IDPConfigData' + required: + - data + type: object + IDPConfigType: + description: Resource type. + enum: + - idp_config + example: idp_config + type: string + x-enum-varnames: + - IDP_CONFIG + IDPConfigValueItem: + additionalProperties: {} + description: An item in the IDP configuration value array. + type: object IPAllowlistAttributes: description: Attributes of the IP allowlist. properties: @@ -46969,6 +47092,29 @@ components: type: string x-enum-varnames: - RECOMMENDATION + RecommendedEntityID: + description: A recommended entity identifier. + properties: + id: + description: Unique identifier for the recommended entity. + example: 123abcdef + type: string + required: + - id + type: object + RecommendedEntityWithSchema: + description: A recommended entity with its schema definition. + properties: + id: + description: Unique identifier for the recommended entity. + example: 123abc456def + type: string + schema: + $ref: '#/components/schemas/EntityV3' + required: + - id + - schema + type: object ReferenceTableCreateSourceType: description: The source type for creating reference table data. Only these source types can be created through this API. @@ -71332,6 +71478,53 @@ paths: tags: - Software Catalog x-codegen-request-body-name: body + /api/v2/catalog/entity/convert: + post: + description: Convert entities from one schema version to another in Software + Catalog. + operationId: ConvertCatalogEntities + parameters: + - description: The target schema version to convert entities to. + in: query + name: target_version + required: true + schema: + $ref: '#/components/schemas/EntitySchemaVersion' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpsertCatalogEntityRequest' + description: Entity YAML or JSON to convert. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConvertCatalogEntityResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: Convert entities between schema versions + tags: + - Software Catalog + 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/catalog/entity/preview: post: operationId: PreviewCatalogEntities @@ -71476,6 +71669,121 @@ paths: summary: Delete a single kind tags: - Software Catalog + /api/v2/catalog/recommended_entity/bulk_accept: + post: + description: Accept multiple recommended entities in Software Catalog in a single + request. + operationId: AcceptRecommendedEntities + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptRecommendedEntitiesRequest' + description: List of recommended entities to accept with their schemas. + required: true + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptRecommendedEntitiesResponse' + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Accept recommended entities in bulk + tags: + - Software Catalog + 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/catalog/recommended_entity/bulk_decline: + post: + description: Decline multiple recommended entities in Software Catalog in a + single request. + operationId: DeclineRecommendedEntities + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeclineRecommendedEntitiesRequest' + description: List of recommended entity IDs to decline. + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Decline recommended entities in bulk + tags: + - Software Catalog + 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/catalog/recommended_entity/trigger: + post: + description: Trigger the discovery of recommended entities in Software Catalog. + operationId: TriggerRecommendedEntities + requestBody: + content: + application/json: + schema: + type: object + description: Optional request body for triggering recommended entity discovery. + required: false + responses: + '202': + content: + application/json: + schema: + type: object + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Trigger recommended entity discovery + tags: + - Software Catalog + 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/catalog/relation: get: description: Get a list of entity relations from Software Catalog. @@ -76298,6 +76606,103 @@ paths: 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/idp/config/{config_name}: + get: + description: Get a configuration value for the Internal Developer Portal (IDP). + operationId: GetIDPConfigValue + parameters: + - description: The configuration key to retrieve. + in: path + name: config_name + required: true + schema: + example: idp_pinned_dashboards + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IDPConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: Get Internal Developer Portal configuration + tags: + - Software Catalog + 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 or update a configuration value for the Internal Developer + Portal (IDP). + operationId: UpsertIDPConfigValue + parameters: + - description: The configuration key to create or update. + in: path + name: config_name + required: true + schema: + example: idp_pinned_dashboards + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IDPConfigRequest' + description: Configuration value to set. + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Create or update IDP configuration + tags: + - Software Catalog + 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/incidents: get: description: Get all incidents for the user's organization. diff --git a/examples/v2/software-catalog/AcceptRecommendedEntities.java b/examples/v2/software-catalog/AcceptRecommendedEntities.java new file mode 100644 index 00000000000..35f3e168d1c --- /dev/null +++ b/examples/v2/software-catalog/AcceptRecommendedEntities.java @@ -0,0 +1,99 @@ +// Accept recommended entities in bulk returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SoftwareCatalogApi; +import com.datadog.api.client.v2.model.AcceptRecommendedEntitiesResponse; +import com.datadog.api.client.v2.model.EntityV3; +import com.datadog.api.client.v2.model.EntityV3APIVersion; +import com.datadog.api.client.v2.model.EntityV3DatadogCodeLocationItem; +import com.datadog.api.client.v2.model.EntityV3DatadogEventItem; +import com.datadog.api.client.v2.model.EntityV3DatadogIntegrationOpsgenie; +import com.datadog.api.client.v2.model.EntityV3DatadogIntegrationPagerduty; +import com.datadog.api.client.v2.model.EntityV3DatadogLogItem; +import com.datadog.api.client.v2.model.EntityV3DatadogPerformance; +import com.datadog.api.client.v2.model.EntityV3DatadogPipelines; +import com.datadog.api.client.v2.model.EntityV3Integrations; +import com.datadog.api.client.v2.model.EntityV3Metadata; +import com.datadog.api.client.v2.model.EntityV3MetadataAdditionalOwnersItems; +import com.datadog.api.client.v2.model.EntityV3MetadataContactsItems; +import com.datadog.api.client.v2.model.EntityV3MetadataLinksItems; +import com.datadog.api.client.v2.model.EntityV3Service; +import com.datadog.api.client.v2.model.EntityV3ServiceDatadog; +import com.datadog.api.client.v2.model.EntityV3ServiceKind; +import com.datadog.api.client.v2.model.EntityV3ServiceSpec; +import com.datadog.api.client.v2.model.RecommendedEntityWithSchema; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.acceptRecommendedEntities", true); + SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient); + + List body = + Collections.singletonList( + new RecommendedEntityWithSchema() + .id("123abc456def") + .schema( + new EntityV3( + new EntityV3Service() + .apiVersion(EntityV3APIVersion.V3) + .datadog( + new EntityV3ServiceDatadog() + .codeLocations( + Collections.singletonList( + new EntityV3DatadogCodeLocationItem())) + .events( + Collections.singletonList(new EntityV3DatadogEventItem())) + .logs(Collections.singletonList(new EntityV3DatadogLogItem())) + .performanceData(new EntityV3DatadogPerformance()) + .pipelines(new EntityV3DatadogPipelines())) + .integrations( + new EntityV3Integrations() + .opsgenie( + new EntityV3DatadogIntegrationOpsgenie() + .serviceUrl( + "https://www.opsgenie.com/service/shopping-cart")) + .pagerduty( + new EntityV3DatadogIntegrationPagerduty() + .serviceUrl( + "https://www.pagerduty.com/service-directory/Pshopping-cart"))) + .kind(EntityV3ServiceKind.SERVICE) + .metadata( + new EntityV3Metadata() + .additionalOwners( + Collections.singletonList( + new EntityV3MetadataAdditionalOwnersItems().name(""))) + .contacts( + Collections.singletonList( + new EntityV3MetadataContactsItems() + .contact("https://slack/") + .type("slack"))) + .id("4b163705-23c0-4573-b2fb-f6cea2163fcb") + .inheritFrom("application:default/myapp") + .links( + Collections.singletonList( + new EntityV3MetadataLinksItems() + .name("mylink") + .type("link") + .url("https://mylink"))) + .name("myService") + .namespace("default") + .tags(Arrays.asList("this:tag", "that:tag"))) + .spec(new EntityV3ServiceSpec())))); + + try { + AcceptRecommendedEntitiesResponse result = apiInstance.acceptRecommendedEntities(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SoftwareCatalogApi#acceptRecommendedEntities"); + 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/software-catalog/ConvertCatalogEntities.java b/examples/v2/software-catalog/ConvertCatalogEntities.java new file mode 100644 index 00000000000..8f7e6a9840c --- /dev/null +++ b/examples/v2/software-catalog/ConvertCatalogEntities.java @@ -0,0 +1,94 @@ +// Convert entities between schema versions returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SoftwareCatalogApi; +import com.datadog.api.client.v2.model.ConvertCatalogEntityResponse; +import com.datadog.api.client.v2.model.EntitySchemaVersion; +import com.datadog.api.client.v2.model.EntityV3; +import com.datadog.api.client.v2.model.EntityV3APIVersion; +import com.datadog.api.client.v2.model.EntityV3DatadogCodeLocationItem; +import com.datadog.api.client.v2.model.EntityV3DatadogEventItem; +import com.datadog.api.client.v2.model.EntityV3DatadogIntegrationOpsgenie; +import com.datadog.api.client.v2.model.EntityV3DatadogIntegrationPagerduty; +import com.datadog.api.client.v2.model.EntityV3DatadogLogItem; +import com.datadog.api.client.v2.model.EntityV3DatadogPerformance; +import com.datadog.api.client.v2.model.EntityV3DatadogPipelines; +import com.datadog.api.client.v2.model.EntityV3Integrations; +import com.datadog.api.client.v2.model.EntityV3Metadata; +import com.datadog.api.client.v2.model.EntityV3MetadataAdditionalOwnersItems; +import com.datadog.api.client.v2.model.EntityV3MetadataContactsItems; +import com.datadog.api.client.v2.model.EntityV3MetadataLinksItems; +import com.datadog.api.client.v2.model.EntityV3Service; +import com.datadog.api.client.v2.model.EntityV3ServiceDatadog; +import com.datadog.api.client.v2.model.EntityV3ServiceKind; +import com.datadog.api.client.v2.model.EntityV3ServiceSpec; +import com.datadog.api.client.v2.model.UpsertCatalogEntityRequest; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.convertCatalogEntities", true); + SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient); + + UpsertCatalogEntityRequest body = + new UpsertCatalogEntityRequest( + new EntityV3( + new EntityV3Service() + .apiVersion(EntityV3APIVersion.V3) + .datadog( + new EntityV3ServiceDatadog() + .codeLocations( + Collections.singletonList(new EntityV3DatadogCodeLocationItem())) + .events(Collections.singletonList(new EntityV3DatadogEventItem())) + .logs(Collections.singletonList(new EntityV3DatadogLogItem())) + .performanceData(new EntityV3DatadogPerformance()) + .pipelines(new EntityV3DatadogPipelines())) + .integrations( + new EntityV3Integrations() + .opsgenie( + new EntityV3DatadogIntegrationOpsgenie() + .serviceUrl("https://www.opsgenie.com/service/shopping-cart")) + .pagerduty( + new EntityV3DatadogIntegrationPagerduty() + .serviceUrl( + "https://www.pagerduty.com/service-directory/Pshopping-cart"))) + .kind(EntityV3ServiceKind.SERVICE) + .metadata( + new EntityV3Metadata() + .additionalOwners( + Collections.singletonList( + new EntityV3MetadataAdditionalOwnersItems().name(""))) + .contacts( + Collections.singletonList( + new EntityV3MetadataContactsItems() + .contact("https://slack/") + .type("slack"))) + .id("4b163705-23c0-4573-b2fb-f6cea2163fcb") + .inheritFrom("application:default/myapp") + .links( + Collections.singletonList( + new EntityV3MetadataLinksItems() + .name("mylink") + .type("link") + .url("https://mylink"))) + .name("myService") + .namespace("default") + .tags(Arrays.asList("this:tag", "that:tag"))) + .spec(new EntityV3ServiceSpec()))); + + try { + ConvertCatalogEntityResponse result = + apiInstance.convertCatalogEntities(EntitySchemaVersion.V3, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SoftwareCatalogApi#convertCatalogEntities"); + 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/software-catalog/DeclineRecommendedEntities.java b/examples/v2/software-catalog/DeclineRecommendedEntities.java new file mode 100644 index 00000000000..9c3eba1757b --- /dev/null +++ b/examples/v2/software-catalog/DeclineRecommendedEntities.java @@ -0,0 +1,29 @@ +// Decline recommended entities in bulk returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SoftwareCatalogApi; +import com.datadog.api.client.v2.model.RecommendedEntityID; +import java.util.Collections; +import java.util.List; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.declineRecommendedEntities", true); + SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient); + + List body = + Collections.singletonList(new RecommendedEntityID().id("123abcdef")); + + try { + apiInstance.declineRecommendedEntities(body); + } catch (ApiException e) { + System.err.println("Exception when calling SoftwareCatalogApi#declineRecommendedEntities"); + 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/software-catalog/GetIDPConfigValue.java b/examples/v2/software-catalog/GetIDPConfigValue.java new file mode 100644 index 00000000000..c1eb1adbb2c --- /dev/null +++ b/examples/v2/software-catalog/GetIDPConfigValue.java @@ -0,0 +1,25 @@ +// Get Internal Developer Portal configuration returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SoftwareCatalogApi; +import com.datadog.api.client.v2.model.IDPConfigResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getIDPConfigValue", true); + SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient); + + try { + IDPConfigResponse result = apiInstance.getIDPConfigValue("idp_pinned_dashboards"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SoftwareCatalogApi#getIDPConfigValue"); + 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/software-catalog/TriggerRecommendedEntities.java b/examples/v2/software-catalog/TriggerRecommendedEntities.java new file mode 100644 index 00000000000..5446e5e8760 --- /dev/null +++ b/examples/v2/software-catalog/TriggerRecommendedEntities.java @@ -0,0 +1,23 @@ +// Trigger recommended entity discovery returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SoftwareCatalogApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.triggerRecommendedEntities", true); + SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient); + + try { + apiInstance.triggerRecommendedEntities(); + } catch (ApiException e) { + System.err.println("Exception when calling SoftwareCatalogApi#triggerRecommendedEntities"); + 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/software-catalog/UpsertIDPConfigValue.java b/examples/v2/software-catalog/UpsertIDPConfigValue.java new file mode 100644 index 00000000000..f4e25208526 --- /dev/null +++ b/examples/v2/software-catalog/UpsertIDPConfigValue.java @@ -0,0 +1,42 @@ +// Create or update IDP configuration returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SoftwareCatalogApi; +import com.datadog.api.client.v2.model.IDPConfigRequest; +import com.datadog.api.client.v2.model.IDPConfigRequestAttributes; +import com.datadog.api.client.v2.model.IDPConfigRequestData; +import com.datadog.api.client.v2.model.IDPConfigType; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.upsertIDPConfigValue", true); + SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient); + + IDPConfigRequest body = + new IDPConfigRequest() + .data( + new IDPConfigRequestData() + .attributes( + new IDPConfigRequestAttributes() + .value( + Collections.singletonList( + Map.ofEntries( + Map.entry("displayName", "My Dashboard"), + Map.entry("id", "dashboard-1"))))) + .type(IDPConfigType.IDP_CONFIG)); + + try { + apiInstance.upsertIDPConfigValue("idp_pinned_dashboards", body); + } catch (ApiException e) { + System.err.println("Exception when calling SoftwareCatalogApi#upsertIDPConfigValue"); + 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 fcadf72e1e8..a1a80b01bd4 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -775,6 +775,12 @@ public class ApiClient { put("v2.getOpenAPI", false); put("v2.listAPIs", false); put("v2.updateOpenAPI", false); + put("v2.acceptRecommendedEntities", false); + put("v2.convertCatalogEntities", false); + put("v2.declineRecommendedEntities", false); + put("v2.getIDPConfigValue", false); + put("v2.triggerRecommendedEntities", false); + put("v2.upsertIDPConfigValue", false); put("v2.cancelThreatHuntingJob", false); put("v2.convertJobResultToSignal", false); put("v2.deleteThreatHuntingJob", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java b/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java index e8595724a63..003a3e5fcd1 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java @@ -5,13 +5,19 @@ import com.datadog.api.client.ApiResponse; import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.AcceptRecommendedEntitiesResponse; import com.datadog.api.client.v2.model.EntityData; import com.datadog.api.client.v2.model.EntityResponseArray; +import com.datadog.api.client.v2.model.EntitySchemaVersion; +import com.datadog.api.client.v2.model.IDPConfigRequest; +import com.datadog.api.client.v2.model.IDPConfigResponse; import com.datadog.api.client.v2.model.IncludeType; import com.datadog.api.client.v2.model.KindData; import com.datadog.api.client.v2.model.ListEntityCatalogResponse; import com.datadog.api.client.v2.model.ListKindCatalogResponse; import com.datadog.api.client.v2.model.ListRelationCatalogResponse; +import com.datadog.api.client.v2.model.RecommendedEntityID; +import com.datadog.api.client.v2.model.RecommendedEntityWithSchema; import com.datadog.api.client.v2.model.RelationIncludeType; import com.datadog.api.client.v2.model.RelationResponse; import com.datadog.api.client.v2.model.RelationType; @@ -59,6 +65,485 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * Accept recommended entities in bulk. + * + *

See {@link #acceptRecommendedEntitiesWithHttpInfo}. + * + * @param body List of recommended entities to accept with their schemas. (required) + * @return AcceptRecommendedEntitiesResponse + * @throws ApiException if fails to make API call + */ + public AcceptRecommendedEntitiesResponse acceptRecommendedEntities( + List body) throws ApiException { + return acceptRecommendedEntitiesWithHttpInfo(body).getData(); + } + + /** + * Accept recommended entities in bulk. + * + *

See {@link #acceptRecommendedEntitiesWithHttpInfoAsync}. + * + * @param body List of recommended entities to accept with their schemas. (required) + * @return CompletableFuture<AcceptRecommendedEntitiesResponse> + */ + public CompletableFuture acceptRecommendedEntitiesAsync( + List body) { + return acceptRecommendedEntitiesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Accept multiple recommended entities in Software Catalog in a single request. + * + * @param body List of recommended entities to accept with their schemas. (required) + * @return ApiResponse<AcceptRecommendedEntitiesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse acceptRecommendedEntitiesWithHttpInfo( + List body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "acceptRecommendedEntities"; + 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 acceptRecommendedEntities"); + } + // create path and map variables + String localVarPath = "/api/v2/catalog/recommended_entity/bulk_accept"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.acceptRecommendedEntities", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Accept recommended entities in bulk. + * + *

See {@link #acceptRecommendedEntitiesWithHttpInfo}. + * + * @param body List of recommended entities to accept with their schemas. (required) + * @return CompletableFuture<ApiResponse<AcceptRecommendedEntitiesResponse>> + */ + public CompletableFuture> + acceptRecommendedEntitiesWithHttpInfoAsync(List body) { + // Check if unstable operation is enabled + String operationId = "acceptRecommendedEntities"; + 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 acceptRecommendedEntities")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/catalog/recommended_entity/bulk_accept"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.acceptRecommendedEntities", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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() {}); + } + + /** + * Convert entities between schema versions. + * + *

See {@link #convertCatalogEntitiesWithHttpInfo}. + * + * @param targetVersion The target schema version to convert entities to. (required) + * @param body Entity YAML or JSON to convert. (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String convertCatalogEntities( + EntitySchemaVersion targetVersion, UpsertCatalogEntityRequest body) throws ApiException { + return convertCatalogEntitiesWithHttpInfo(targetVersion, body).getData(); + } + + /** + * Convert entities between schema versions. + * + *

See {@link #convertCatalogEntitiesWithHttpInfoAsync}. + * + * @param targetVersion The target schema version to convert entities to. (required) + * @param body Entity YAML or JSON to convert. (required) + * @return CompletableFuture<String> + */ + public CompletableFuture convertCatalogEntitiesAsync( + EntitySchemaVersion targetVersion, UpsertCatalogEntityRequest body) { + return convertCatalogEntitiesWithHttpInfoAsync(targetVersion, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Convert entities from one schema version to another in Software Catalog. + * + * @param targetVersion The target schema version to convert entities to. (required) + * @param body Entity YAML or JSON to convert. (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse convertCatalogEntitiesWithHttpInfo( + EntitySchemaVersion targetVersion, UpsertCatalogEntityRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "convertCatalogEntities"; + 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 'targetVersion' is set + if (targetVersion == null) { + throw new ApiException( + 400, + "Missing the required parameter 'targetVersion' when calling convertCatalogEntities"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling convertCatalogEntities"); + } + // create path and map variables + String localVarPath = "/api/v2/catalog/entity/convert"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "target_version", targetVersion)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.convertCatalogEntities", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Convert entities between schema versions. + * + *

See {@link #convertCatalogEntitiesWithHttpInfo}. + * + * @param targetVersion The target schema version to convert entities to. (required) + * @param body Entity YAML or JSON to convert. (required) + * @return CompletableFuture<ApiResponse<String>> + */ + public CompletableFuture> convertCatalogEntitiesWithHttpInfoAsync( + EntitySchemaVersion targetVersion, UpsertCatalogEntityRequest body) { + // Check if unstable operation is enabled + String operationId = "convertCatalogEntities"; + 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 'targetVersion' is set + if (targetVersion == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'targetVersion' when calling" + + " convertCatalogEntities")); + 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 convertCatalogEntities")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/catalog/entity/convert"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "target_version", targetVersion)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.convertCatalogEntities", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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() {}); + } + + /** + * Decline recommended entities in bulk. + * + *

See {@link #declineRecommendedEntitiesWithHttpInfo}. + * + * @param body List of recommended entity IDs to decline. (required) + * @throws ApiException if fails to make API call + */ + public void declineRecommendedEntities(List body) throws ApiException { + declineRecommendedEntitiesWithHttpInfo(body); + } + + /** + * Decline recommended entities in bulk. + * + *

See {@link #declineRecommendedEntitiesWithHttpInfoAsync}. + * + * @param body List of recommended entity IDs to decline. (required) + * @return CompletableFuture + */ + public CompletableFuture declineRecommendedEntitiesAsync(List body) { + return declineRecommendedEntitiesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Decline multiple recommended entities in Software Catalog in a single request. + * + * @param body List of recommended entity IDs to decline. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse declineRecommendedEntitiesWithHttpInfo(List body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "declineRecommendedEntities"; + 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 declineRecommendedEntities"); + } + // create path and map variables + String localVarPath = "/api/v2/catalog/recommended_entity/bulk_decline"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.declineRecommendedEntities", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Decline recommended entities in bulk. + * + *

See {@link #declineRecommendedEntitiesWithHttpInfo}. + * + * @param body List of recommended entity IDs to decline. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> declineRecommendedEntitiesWithHttpInfoAsync( + List body) { + // Check if unstable operation is enabled + String operationId = "declineRecommendedEntities"; + 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 declineRecommendedEntities")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/catalog/recommended_entity/bulk_decline"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.declineRecommendedEntities", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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, + null); + } + /** * Delete a single entity. * @@ -284,18 +769,174 @@ public ApiResponse deleteCatalogKindWithHttpInfo(String kindId) throws Api public CompletableFuture> deleteCatalogKindWithHttpInfoAsync(String kindId) { Object localVarPostBody = null; - // verify the required parameter 'kindId' is set - if (kindId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'kindId' is set + if (kindId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'kindId' when calling deleteCatalogKind")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/catalog/kind/{kind_id}" + .replaceAll("\\{" + "kind_id" + "\\}", apiClient.escapeString(kindId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.deleteCatalogKind", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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 Internal Developer Portal configuration. + * + *

See {@link #getIDPConfigValueWithHttpInfo}. + * + * @param configName The configuration key to retrieve. (required) + * @return IDPConfigResponse + * @throws ApiException if fails to make API call + */ + public IDPConfigResponse getIDPConfigValue(String configName) throws ApiException { + return getIDPConfigValueWithHttpInfo(configName).getData(); + } + + /** + * Get Internal Developer Portal configuration. + * + *

See {@link #getIDPConfigValueWithHttpInfoAsync}. + * + * @param configName The configuration key to retrieve. (required) + * @return CompletableFuture<IDPConfigResponse> + */ + public CompletableFuture getIDPConfigValueAsync(String configName) { + return getIDPConfigValueWithHttpInfoAsync(configName) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a configuration value for the Internal Developer Portal (IDP). + * + * @param configName The configuration key to retrieve. (required) + * @return ApiResponse<IDPConfigResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse getIDPConfigValueWithHttpInfo(String configName) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getIDPConfigValue"; + 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 'configName' is set + if (configName == null) { + throw new ApiException( + 400, "Missing the required parameter 'configName' when calling getIDPConfigValue"); + } + // create path and map variables + String localVarPath = + "/api/v2/idp/config/{config_name}" + .replaceAll( + "\\{" + "config_name" + "\\}", apiClient.escapeString(configName.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.getIDPConfigValue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get Internal Developer Portal configuration. + * + *

See {@link #getIDPConfigValueWithHttpInfo}. + * + * @param configName The configuration key to retrieve. (required) + * @return CompletableFuture<ApiResponse<IDPConfigResponse>> + */ + public CompletableFuture> getIDPConfigValueWithHttpInfoAsync( + String configName) { + // Check if unstable operation is enabled + String operationId = "getIDPConfigValue"; + 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 'configName' is set + if (configName == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'kindId' when calling deleteCatalogKind")); + 400, "Missing the required parameter 'configName' when calling getIDPConfigValue")); return result; } // create path and map variables String localVarPath = - "/api/v2/catalog/kind/{kind_id}" - .replaceAll("\\{" + "kind_id" + "\\}", apiClient.escapeString(kindId.toString())); + "/api/v2/idp/config/{config_name}" + .replaceAll( + "\\{" + "config_name" + "\\}", apiClient.escapeString(configName.toString())); Map localVarHeaderParams = new HashMap(); @@ -303,27 +944,27 @@ public CompletableFuture> deleteCatalogKindWithHttpInfoAsync(S try { builder = apiClient.createBuilder( - "v2.SoftwareCatalogApi.deleteCatalogKind", + "v2.SoftwareCatalogApi.getIDPConfigValue", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "GET", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** Manage optional parameters to listCatalogEntity. */ @@ -1414,6 +2055,187 @@ public ApiResponse previewCatalogEntitiesWithHttpInfo() thr new GenericType() {}); } + /** Manage optional parameters to triggerRecommendedEntities. */ + public static class TriggerRecommendedEntitiesOptionalParameters { + private Object body; + + /** + * Set body. + * + * @param body Optional request body for triggering recommended entity discovery. (optional) + * @return TriggerRecommendedEntitiesOptionalParameters + */ + public TriggerRecommendedEntitiesOptionalParameters body(Object body) { + this.body = body; + return this; + } + } + + /** + * Trigger recommended entity discovery. + * + *

See {@link #triggerRecommendedEntitiesWithHttpInfo}. + * + * @return Object + * @throws ApiException if fails to make API call + */ + public Object triggerRecommendedEntities() throws ApiException { + return triggerRecommendedEntitiesWithHttpInfo( + new TriggerRecommendedEntitiesOptionalParameters()) + .getData(); + } + + /** + * Trigger recommended entity discovery. + * + *

See {@link #triggerRecommendedEntitiesWithHttpInfoAsync}. + * + * @return CompletableFuture<Object> + */ + public CompletableFuture triggerRecommendedEntitiesAsync() { + return triggerRecommendedEntitiesWithHttpInfoAsync( + new TriggerRecommendedEntitiesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Trigger recommended entity discovery. + * + *

See {@link #triggerRecommendedEntitiesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return Object + * @throws ApiException if fails to make API call + */ + public Object triggerRecommendedEntities(TriggerRecommendedEntitiesOptionalParameters parameters) + throws ApiException { + return triggerRecommendedEntitiesWithHttpInfo(parameters).getData(); + } + + /** + * Trigger recommended entity discovery. + * + *

See {@link #triggerRecommendedEntitiesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<Object> + */ + public CompletableFuture triggerRecommendedEntitiesAsync( + TriggerRecommendedEntitiesOptionalParameters parameters) { + return triggerRecommendedEntitiesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Trigger the discovery of recommended entities in Software Catalog. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse triggerRecommendedEntitiesWithHttpInfo( + TriggerRecommendedEntitiesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "triggerRecommendedEntities"; + 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 = parameters.body; + // create path and map variables + String localVarPath = "/api/v2/catalog/recommended_entity/trigger"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.triggerRecommendedEntities", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Trigger recommended entity discovery. + * + *

See {@link #triggerRecommendedEntitiesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<Object>> + */ + public CompletableFuture> triggerRecommendedEntitiesWithHttpInfoAsync( + TriggerRecommendedEntitiesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "triggerRecommendedEntities"; + 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 = parameters.body; + // create path and map variables + String localVarPath = "/api/v2/catalog/recommended_entity/trigger"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.triggerRecommendedEntities", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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() {}); + } + /** * Create or update entities. * @@ -1681,4 +2503,179 @@ public ApiResponse upsertCatalogKindWithHttpInfo( false, new GenericType() {}); } + + /** + * Create or update IDP configuration. + * + *

See {@link #upsertIDPConfigValueWithHttpInfo}. + * + * @param configName The configuration key to create or update. (required) + * @param body Configuration value to set. (required) + * @throws ApiException if fails to make API call + */ + public void upsertIDPConfigValue(String configName, IDPConfigRequest body) throws ApiException { + upsertIDPConfigValueWithHttpInfo(configName, body); + } + + /** + * Create or update IDP configuration. + * + *

See {@link #upsertIDPConfigValueWithHttpInfoAsync}. + * + * @param configName The configuration key to create or update. (required) + * @param body Configuration value to set. (required) + * @return CompletableFuture + */ + public CompletableFuture upsertIDPConfigValueAsync( + String configName, IDPConfigRequest body) { + return upsertIDPConfigValueWithHttpInfoAsync(configName, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create or update a configuration value for the Internal Developer Portal (IDP). + * + * @param configName The configuration key to create or update. (required) + * @param body Configuration value to set. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse upsertIDPConfigValueWithHttpInfo( + String configName, IDPConfigRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "upsertIDPConfigValue"; + 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 'configName' is set + if (configName == null) { + throw new ApiException( + 400, "Missing the required parameter 'configName' when calling upsertIDPConfigValue"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling upsertIDPConfigValue"); + } + // create path and map variables + String localVarPath = + "/api/v2/idp/config/{config_name}" + .replaceAll( + "\\{" + "config_name" + "\\}", apiClient.escapeString(configName.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.upsertIDPConfigValue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Create or update IDP configuration. + * + *

See {@link #upsertIDPConfigValueWithHttpInfo}. + * + * @param configName The configuration key to create or update. (required) + * @param body Configuration value to set. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> upsertIDPConfigValueWithHttpInfoAsync( + String configName, IDPConfigRequest body) { + // Check if unstable operation is enabled + String operationId = "upsertIDPConfigValue"; + 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 'configName' is set + if (configName == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'configName' when calling upsertIDPConfigValue")); + 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 upsertIDPConfigValue")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/idp/config/{config_name}" + .replaceAll( + "\\{" + "config_name" + "\\}", apiClient.escapeString(configName.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SoftwareCatalogApi.upsertIDPConfigValue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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, + null); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/AcceptRecommendedEntitiesResponse.java b/src/main/java/com/datadog/api/client/v2/model/AcceptRecommendedEntitiesResponse.java new file mode 100644 index 00000000000..64c4c6da61a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AcceptRecommendedEntitiesResponse.java @@ -0,0 +1,147 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response after accepting recommended entities. */ +@JsonPropertyOrder({AcceptRecommendedEntitiesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AcceptRecommendedEntitiesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public AcceptRecommendedEntitiesResponse data(List data) { + this.data = data; + return this; + } + + public AcceptRecommendedEntitiesResponse addDataItem(AcceptRecommendedEntityItem dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Array of accepted entity data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 AcceptRecommendedEntitiesResponse + */ + @JsonAnySetter + public AcceptRecommendedEntitiesResponse 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 AcceptRecommendedEntitiesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AcceptRecommendedEntitiesResponse acceptRecommendedEntitiesResponse = + (AcceptRecommendedEntitiesResponse) o; + return Objects.equals(this.data, acceptRecommendedEntitiesResponse.data) + && Objects.equals( + this.additionalProperties, acceptRecommendedEntitiesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AcceptRecommendedEntitiesResponse {\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/EntitySchemaVersion.java b/src/main/java/com/datadog/api/client/v2/model/EntitySchemaVersion.java new file mode 100644 index 00000000000..b94b741b200 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntitySchemaVersion.java @@ -0,0 +1,58 @@ +/* + * 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; + +/** Entity schema version for conversion. */ +@JsonSerialize(using = EntitySchemaVersion.EntitySchemaVersionSerializer.class) +public class EntitySchemaVersion extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("v2", "v2.1", "v2.2", "v3")); + + public static final EntitySchemaVersion V2 = new EntitySchemaVersion("v2"); + public static final EntitySchemaVersion V2_1 = new EntitySchemaVersion("v2.1"); + public static final EntitySchemaVersion V2_2 = new EntitySchemaVersion("v2.2"); + public static final EntitySchemaVersion V3 = new EntitySchemaVersion("v3"); + + EntitySchemaVersion(String value) { + super(value, allowedValues); + } + + public static class EntitySchemaVersionSerializer extends StdSerializer { + public EntitySchemaVersionSerializer(Class t) { + super(t); + } + + public EntitySchemaVersionSerializer() { + this(null); + } + + @Override + public void serialize( + EntitySchemaVersion value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EntitySchemaVersion fromValue(String value) { + return new EntitySchemaVersion(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IDPConfigAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IDPConfigAttributes.java new file mode 100644 index 00000000000..bfb53d64b6c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IDPConfigAttributes.java @@ -0,0 +1,150 @@ +/* + * 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; + +/** IDP configuration attributes. */ +@JsonPropertyOrder({IDPConfigAttributes.JSON_PROPERTY_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IDPConfigAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VALUE = "value"; + private List> value = new ArrayList<>(); + + public IDPConfigAttributes() {} + + @JsonCreator + public IDPConfigAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) List> value) { + this.value = value; + } + + public IDPConfigAttributes value(List> value) { + this.value = value; + return this; + } + + public IDPConfigAttributes addValueItem(Map valueItem) { + this.value.add(valueItem); + return this; + } + + /** + * Configuration value (can be object, array, or primitive). + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List> getValue() { + return value; + } + + public void setValue(List> value) { + this.value = value; + } + + /** + * 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 IDPConfigAttributes + */ + @JsonAnySetter + public IDPConfigAttributes 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 IDPConfigAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IDPConfigAttributes idpConfigAttributes = (IDPConfigAttributes) o; + return Objects.equals(this.value, idpConfigAttributes.value) + && Objects.equals(this.additionalProperties, idpConfigAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IDPConfigAttributes {\n"); + sb.append(" value: ").append(toIndentedString(value)).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/IDPConfigData.java b/src/main/java/com/datadog/api/client/v2/model/IDPConfigData.java new file mode 100644 index 00000000000..589bccd20e6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IDPConfigData.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** IDP configuration data. */ +@JsonPropertyOrder({ + IDPConfigData.JSON_PROPERTY_ATTRIBUTES, + IDPConfigData.JSON_PROPERTY_ID, + IDPConfigData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IDPConfigData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IDPConfigAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IDPConfigType type; + + public IDPConfigData() {} + + @JsonCreator + public IDPConfigData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IDPConfigAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IDPConfigType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IDPConfigData attributes(IDPConfigAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * IDP configuration attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IDPConfigAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IDPConfigAttributes attributes) { + this.attributes = attributes; + } + + public IDPConfigData id(String id) { + this.id = id; + return this; + } + + /** + * Configuration identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IDPConfigData type(IDPConfigType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IDPConfigType getType() { + return type; + } + + public void setType(IDPConfigType 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 IDPConfigData + */ + @JsonAnySetter + public IDPConfigData 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 IDPConfigData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IDPConfigData idpConfigData = (IDPConfigData) o; + return Objects.equals(this.attributes, idpConfigData.attributes) + && Objects.equals(this.id, idpConfigData.id) + && Objects.equals(this.type, idpConfigData.type) + && Objects.equals(this.additionalProperties, idpConfigData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IDPConfigData {\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/IDPConfigRequest.java b/src/main/java/com/datadog/api/client/v2/model/IDPConfigRequest.java new file mode 100644 index 00000000000..4befb30b21c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IDPConfigRequest.java @@ -0,0 +1,145 @@ +/* + * 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 set IDP configuration value. */ +@JsonPropertyOrder({IDPConfigRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IDPConfigRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IDPConfigRequestData data; + + public IDPConfigRequest() {} + + @JsonCreator + public IDPConfigRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IDPConfigRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IDPConfigRequest data(IDPConfigRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * IDP configuration request data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IDPConfigRequestData getData() { + return data; + } + + public void setData(IDPConfigRequestData 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 IDPConfigRequest + */ + @JsonAnySetter + public IDPConfigRequest 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 IDPConfigRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IDPConfigRequest idpConfigRequest = (IDPConfigRequest) o; + return Objects.equals(this.data, idpConfigRequest.data) + && Objects.equals(this.additionalProperties, idpConfigRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IDPConfigRequest {\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/IDPConfigRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IDPConfigRequestAttributes.java new file mode 100644 index 00000000000..36ad6333490 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IDPConfigRequestAttributes.java @@ -0,0 +1,151 @@ +/* + * 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; + +/** IDP configuration request attributes. */ +@JsonPropertyOrder({IDPConfigRequestAttributes.JSON_PROPERTY_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IDPConfigRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VALUE = "value"; + private List> value = new ArrayList<>(); + + public IDPConfigRequestAttributes() {} + + @JsonCreator + public IDPConfigRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) List> value) { + this.value = value; + } + + public IDPConfigRequestAttributes value(List> value) { + this.value = value; + return this; + } + + public IDPConfigRequestAttributes addValueItem(Map valueItem) { + this.value.add(valueItem); + return this; + } + + /** + * Configuration value to set (can be object, array, or primitive). + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List> getValue() { + return value; + } + + public void setValue(List> value) { + this.value = value; + } + + /** + * 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 IDPConfigRequestAttributes + */ + @JsonAnySetter + public IDPConfigRequestAttributes 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 IDPConfigRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IDPConfigRequestAttributes idpConfigRequestAttributes = (IDPConfigRequestAttributes) o; + return Objects.equals(this.value, idpConfigRequestAttributes.value) + && Objects.equals( + this.additionalProperties, idpConfigRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IDPConfigRequestAttributes {\n"); + sb.append(" value: ").append(toIndentedString(value)).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/IDPConfigRequestData.java b/src/main/java/com/datadog/api/client/v2/model/IDPConfigRequestData.java new file mode 100644 index 00000000000..9cc30ab6112 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IDPConfigRequestData.java @@ -0,0 +1,181 @@ +/* + * 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; + +/** IDP configuration request data. */ +@JsonPropertyOrder({ + IDPConfigRequestData.JSON_PROPERTY_ATTRIBUTES, + IDPConfigRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IDPConfigRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IDPConfigRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IDPConfigType type; + + public IDPConfigRequestData() {} + + @JsonCreator + public IDPConfigRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IDPConfigRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IDPConfigType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IDPConfigRequestData attributes(IDPConfigRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * IDP configuration request attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IDPConfigRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IDPConfigRequestAttributes attributes) { + this.attributes = attributes; + } + + public IDPConfigRequestData type(IDPConfigType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IDPConfigType getType() { + return type; + } + + public void setType(IDPConfigType 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 IDPConfigRequestData + */ + @JsonAnySetter + public IDPConfigRequestData 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 IDPConfigRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IDPConfigRequestData idpConfigRequestData = (IDPConfigRequestData) o; + return Objects.equals(this.attributes, idpConfigRequestData.attributes) + && Objects.equals(this.type, idpConfigRequestData.type) + && Objects.equals(this.additionalProperties, idpConfigRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IDPConfigRequestData {\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/IDPConfigResponse.java b/src/main/java/com/datadog/api/client/v2/model/IDPConfigResponse.java new file mode 100644 index 00000000000..1b86d4edc73 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IDPConfigResponse.java @@ -0,0 +1,145 @@ +/* + * 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 IDP configuration value. */ +@JsonPropertyOrder({IDPConfigResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IDPConfigResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IDPConfigData data; + + public IDPConfigResponse() {} + + @JsonCreator + public IDPConfigResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IDPConfigData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IDPConfigResponse data(IDPConfigData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * IDP configuration data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IDPConfigData getData() { + return data; + } + + public void setData(IDPConfigData 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 IDPConfigResponse + */ + @JsonAnySetter + public IDPConfigResponse 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 IDPConfigResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IDPConfigResponse idpConfigResponse = (IDPConfigResponse) o; + return Objects.equals(this.data, idpConfigResponse.data) + && Objects.equals(this.additionalProperties, idpConfigResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IDPConfigResponse {\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/IDPConfigType.java b/src/main/java/com/datadog/api/client/v2/model/IDPConfigType.java new file mode 100644 index 00000000000..f943d16daa3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IDPConfigType.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; + +/** Resource type. */ +@JsonSerialize(using = IDPConfigType.IDPConfigTypeSerializer.class) +public class IDPConfigType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("idp_config")); + + public static final IDPConfigType IDP_CONFIG = new IDPConfigType("idp_config"); + + IDPConfigType(String value) { + super(value, allowedValues); + } + + public static class IDPConfigTypeSerializer extends StdSerializer { + public IDPConfigTypeSerializer(Class t) { + super(t); + } + + public IDPConfigTypeSerializer() { + this(null); + } + + @Override + public void serialize(IDPConfigType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IDPConfigType fromValue(String value) { + return new IDPConfigType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RecommendedEntityID.java b/src/main/java/com/datadog/api/client/v2/model/RecommendedEntityID.java new file mode 100644 index 00000000000..4b8cdd6d7d1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RecommendedEntityID.java @@ -0,0 +1,142 @@ +/* + * 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; + +/** A recommended entity identifier. */ +@JsonPropertyOrder({RecommendedEntityID.JSON_PROPERTY_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RecommendedEntityID { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public RecommendedEntityID() {} + + @JsonCreator + public RecommendedEntityID(@JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.id = id; + } + + public RecommendedEntityID id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the recommended entity. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * 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 RecommendedEntityID + */ + @JsonAnySetter + public RecommendedEntityID 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 RecommendedEntityID object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecommendedEntityID recommendedEntityId = (RecommendedEntityID) o; + return Objects.equals(this.id, recommendedEntityId.id) + && Objects.equals(this.additionalProperties, recommendedEntityId.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecommendedEntityID {\n"); + sb.append(" id: ").append(toIndentedString(id)).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/RecommendedEntityWithSchema.java b/src/main/java/com/datadog/api/client/v2/model/RecommendedEntityWithSchema.java new file mode 100644 index 00000000000..0ff4d30570e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RecommendedEntityWithSchema.java @@ -0,0 +1,176 @@ +/* + * 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; + +/** A recommended entity with its schema definition. */ +@JsonPropertyOrder({ + RecommendedEntityWithSchema.JSON_PROPERTY_ID, + RecommendedEntityWithSchema.JSON_PROPERTY_SCHEMA +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RecommendedEntityWithSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + private EntityV3 schema; + + public RecommendedEntityWithSchema() {} + + @JsonCreator + public RecommendedEntityWithSchema( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_SCHEMA) EntityV3 schema) { + this.id = id; + this.schema = schema; + this.unparsed |= schema.unparsed; + } + + public RecommendedEntityWithSchema id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the recommended entity. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RecommendedEntityWithSchema schema(EntityV3 schema) { + this.schema = schema; + this.unparsed |= schema.unparsed; + return this; + } + + /** + * Entity schema v3. + * + * @return schema + */ + @JsonProperty(JSON_PROPERTY_SCHEMA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EntityV3 getSchema() { + return schema; + } + + public void setSchema(EntityV3 schema) { + this.schema = schema; + } + + /** + * 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 RecommendedEntityWithSchema + */ + @JsonAnySetter + public RecommendedEntityWithSchema 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 RecommendedEntityWithSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecommendedEntityWithSchema recommendedEntityWithSchema = (RecommendedEntityWithSchema) o; + return Objects.equals(this.id, recommendedEntityWithSchema.id) + && Objects.equals(this.schema, recommendedEntityWithSchema.schema) + && Objects.equals( + this.additionalProperties, recommendedEntityWithSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, schema, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecommendedEntityWithSchema {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).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/software_catalog.feature b/src/test/resources/com/datadog/api/client/v2/api/software_catalog.feature index 34e9f95314d..91785e9a422 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/software_catalog.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/software_catalog.feature @@ -7,6 +7,58 @@ Feature: Software Catalog And a valid "appKeyAuth" key in the system And an instance of "SoftwareCatalog" API + @generated @skip @team:DataDog/service-catalog + Scenario: Accept recommended entities in bulk returns "Accepted" response + Given operation "AcceptRecommendedEntities" enabled + And new "AcceptRecommendedEntities" request + And body with value [{"id": "123abc456def", "schema": {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"componentOf": [], "dependsOn": [], "languages": []}}}] + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Accept recommended entities in bulk returns "Bad Request" response + Given operation "AcceptRecommendedEntities" enabled + And new "AcceptRecommendedEntities" request + And body with value [{"id": "123abc456def", "schema": {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"componentOf": [], "dependsOn": [], "languages": []}}}] + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Convert entities between schema versions returns "Bad Request" response + Given operation "ConvertCatalogEntities" enabled + And new "ConvertCatalogEntities" request + And request contains "target_version" parameter from "REPLACE.ME" + And body with value {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"componentOf": [], "dependsOn": [], "languages": []}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Convert entities between schema versions returns "OK" response + Given operation "ConvertCatalogEntities" enabled + And new "ConvertCatalogEntities" request + And request contains "target_version" parameter from "REPLACE.ME" + And body with value {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"componentOf": [], "dependsOn": [], "languages": []}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: Create or update IDP configuration returns "Bad Request" response + Given operation "UpsertIDPConfigValue" enabled + And new "UpsertIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"value": [{"displayName": "My Dashboard", "id": "dashboard-1"}]}, "type": "idp_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Create or update IDP configuration returns "No Content" response + Given operation "UpsertIDPConfigValue" enabled + And new "UpsertIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"value": [{"displayName": "My Dashboard", "id": "dashboard-1"}]}, "type": "idp_config"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/service-catalog Scenario: Create or update entities returns "ACCEPTED" response Given new "UpsertCatalogEntity" request @@ -52,6 +104,22 @@ Feature: Software Catalog And the response "data[0].attributes.kind" is equal to "service" And the response "data[0].attributes.name" is equal to "service-{{ unique_lower_alnum }}" + @generated @skip @team:DataDog/service-catalog + Scenario: Decline recommended entities in bulk returns "Bad Request" response + Given operation "DeclineRecommendedEntities" enabled + And new "DeclineRecommendedEntities" request + And body with value [{"id": "123abcdef"}] + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Decline recommended entities in bulk returns "No Content" response + Given operation "DeclineRecommendedEntities" enabled + And new "DeclineRecommendedEntities" request + And body with value [{"id": "123abcdef"}] + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/service-catalog Scenario: Delete a single entity returns "Bad Request" response Given new "DeleteCatalogEntity" request @@ -102,6 +170,30 @@ Feature: Software Catalog Then the response status is 404 Not Found And the response "errors[0]" is equal to "Not Found" + @generated @skip @team:DataDog/service-catalog + Scenario: Get Internal Developer Portal configuration returns "Bad Request" response + Given operation "GetIDPConfigValue" enabled + And new "GetIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Get Internal Developer Portal configuration returns "Not Found" response + Given operation "GetIDPConfigValue" enabled + And new "GetIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Get Internal Developer Portal configuration returns "OK" response + Given operation "GetIDPConfigValue" enabled + And new "GetIDPConfigValue" request + And request contains "config_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/service-catalog Scenario: Get a list of entities returns "OK" response Given new "ListCatalogEntity" request @@ -150,3 +242,17 @@ Feature: Software Catalog Given new "PreviewCatalogEntities" request When the request is sent Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Trigger recommended entity discovery returns "Accepted" response + Given operation "TriggerRecommendedEntities" enabled + And new "TriggerRecommendedEntities" request + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Trigger recommended entity discovery returns "Bad Request" response + Given operation "TriggerRecommendedEntities" enabled + And new "TriggerRecommendedEntities" request + When the request is sent + Then the response status is 400 Bad Request 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 c0ec7dbe41a..ab04e3867f8 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 @@ -879,6 +879,12 @@ "type": "unsafe" } }, + "ConvertCatalogEntities": { + "tag": "Software Catalog", + "undo": { + "type": "safe" + } + }, "PreviewCatalogEntities": { "tag": "Software Catalog", "undo": { @@ -916,6 +922,24 @@ "type": "idempotent" } }, + "AcceptRecommendedEntities": { + "tag": "Software Catalog", + "undo": { + "type": "unsafe" + } + }, + "DeclineRecommendedEntities": { + "tag": "Software Catalog", + "undo": { + "type": "unsafe" + } + }, + "TriggerRecommendedEntities": { + "tag": "Software Catalog", + "undo": { + "type": "safe" + } + }, "ListCatalogRelation": { "tag": "Software Catalog", "undo": { @@ -1630,6 +1654,18 @@ "type": "unsafe" } }, + "GetIDPConfigValue": { + "tag": "Software Catalog", + "undo": { + "type": "safe" + } + }, + "UpsertIDPConfigValue": { + "tag": "Software Catalog", + "undo": { + "type": "unsafe" + } + }, "ListIncidents": { "tag": "Incidents", "undo": {