From 7a09a04f0c19b6964162edd2620571e69027b950 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 28 May 2026 15:05:43 +0000 Subject: [PATCH] Regenerate client from commit 0427008 of spec repo --- .generator/schemas/v2/openapi.yaml | 1224 +++++++++++++++++ .../GetEUDMDevice.java | 24 + .../GetEUDMDevices.java | 24 + .../GetEUDMGraph.java | 24 + .../GetEUDMIssues.java | 24 + .../GetEUDMOverview.java | 24 + .../DeleteScopesRestriction.java | 24 + .../GetScopesRestriction.java | 27 + .../RegisterOAuthClient.java | 47 + .../UpsertScopesRestriction.java | 44 + .../com/datadog/api/client/ApiClient.java | 4 + .../v2/api/EndUserDeviceMonitoringApi.java | 636 +++++++++ .../client/v2/api/OAuth2ClientPublicApi.java | 695 ++++++++++ .../api/client/v2/model/DeviceBaseArray.java | 154 +++ .../api/client/v2/model/DeviceBaseData.java | 206 +++ .../v2/model/DeviceBaseDataAttributes.java | 888 ++++++++++++ .../api/client/v2/model/DeviceDetails.java | 138 ++ .../client/v2/model/DeviceDetailsData.java | 207 +++ .../v2/model/DeviceDetailsDataAttributes.java | 1144 +++++++++++++++ .../v2/model/DeviceDetailsDataType.java | 54 + .../api/client/v2/model/GraphItemArray.java | 154 +++ .../api/client/v2/model/GraphItemData.java | 206 +++ .../v2/model/GraphItemDataAttributes.java | 178 +++ .../GraphItemDataAttributesCountsItems.java | 170 +++ .../client/v2/model/GraphItemDataType.java | 54 + .../client/v2/model/IssueDefinitionArray.java | 154 +++ .../client/v2/model/IssueDefinitionData.java | 207 +++ .../model/IssueDefinitionDataAttributes.java | 203 +++ .../v2/model/IssueDefinitionDataType.java | 57 + .../model/OAuthClientRegistrationError.java | 176 +++ .../OAuthClientRegistrationGrantType.java | 60 + .../model/OAuthClientRegistrationRequest.java | 465 +++++++ .../OAuthClientRegistrationResponse.java | 325 +++++ .../OAuthClientRegistrationResponseType.java | 58 + .../api/client/v2/model/OAuthOidcScope.java | 57 + .../v2/model/OAuthScopesRestriction.java | 188 +++ .../model/OAuthScopesRestrictionResponse.java | 148 ++ ...thScopesRestrictionResponseAttributes.java | 204 +++ .../OAuthScopesRestrictionResponseData.java | 213 +++ .../v2/model/OAuthScopesRestrictionType.java | 57 + .../client/v2/model/OverviewItemArray.java | 157 +++ .../api/client/v2/model/OverviewItemData.java | 206 +++ .../v2/model/OverviewItemDataAttributes.java | 165 +++ .../client/v2/model/OverviewItemDataType.java | 56 + .../UpsertOAuthScopesRestrictionData.java | 183 +++ ...tOAuthScopesRestrictionDataAttributes.java | 192 +++ .../UpsertOAuthScopesRestrictionRequest.java | 148 ++ .../UpsertOAuthScopesRestrictionType.java | 58 + ...a_device_returns_Not_Found_response.freeze | 1 + ...t_a_device_returns_Not_Found_response.json | 28 + ...sue_definitions_returns_OK_response.freeze | 1 + ...issue_definitions_returns_OK_response.json | 28 + ...Get_all_devices_returns_OK_response.freeze | 1 + .../Get_all_devices_returns_OK_response.json | 28 + ...ed_by_attribute_returns_OK_response.freeze | 1 + ...uped_by_attribute_returns_OK_response.json | 33 + ..._overview_tiles_returns_OK_response.freeze | 1 + ...et_overview_tiles_returns_OK_response.json | 28 + .../v2/api/end_user_device_monitoring.feature | 49 + .../datadog/api/client/v2/api/eudm.feature | 42 + .../v2/api/oauth2_client_public.feature | 100 ++ .../com/datadog/api/client/v2/api/undo.json | 54 + 62 files changed, 10506 insertions(+) create mode 100644 examples/v2/end-user-device-monitoring/GetEUDMDevice.java create mode 100644 examples/v2/end-user-device-monitoring/GetEUDMDevices.java create mode 100644 examples/v2/end-user-device-monitoring/GetEUDMGraph.java create mode 100644 examples/v2/end-user-device-monitoring/GetEUDMIssues.java create mode 100644 examples/v2/end-user-device-monitoring/GetEUDMOverview.java create mode 100644 examples/v2/oauth2-client-public/DeleteScopesRestriction.java create mode 100644 examples/v2/oauth2-client-public/GetScopesRestriction.java create mode 100644 examples/v2/oauth2-client-public/RegisterOAuthClient.java create mode 100644 examples/v2/oauth2-client-public/UpsertScopesRestriction.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/EndUserDeviceMonitoringApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeviceBaseArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeviceBaseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeviceBaseDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeviceDetails.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeviceDetailsData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeviceDetailsDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeviceDetailsDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GraphItemArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GraphItemData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GraphItemDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GraphItemDataAttributesCountsItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GraphItemDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IssueDefinitionArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IssueDefinitionData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IssueDefinitionDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IssueDefinitionDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationGrantType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponseType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OverviewItemArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OverviewItemData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OverviewItemDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OverviewItemDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.java create mode 100644 src/test/resources/cassettes/features/v2/Get_a_device_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_device_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_all_device_issue_definitions_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_all_device_issue_definitions_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_all_devices_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_all_devices_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_device_counts_grouped_by_attribute_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_device_counts_grouped_by_attribute_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_overview_tiles_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_overview_tiles_returns_OK_response.json create mode 100644 src/test/resources/com/datadog/api/client/v2/api/end_user_device_monitoring.feature create mode 100644 src/test/resources/com/datadog/api/client/v2/api/eudm.feature create mode 100644 src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index dede702aea7..a26fc1aec85 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1034,6 +1034,15 @@ components: required: true schema: type: string + OAuthClientUUIDPathParameter: + description: UUID of the OAuth2 client. + in: path + name: client_uuid + required: true + schema: + example: fafa8e1c-36a5-11f0-a83d-da7ad0900001 + format: uuid + type: string OnDemandTaskId: description: The UUID of the task. example: "6d09294c-9ad9-42fd-a759-a0c1599b4828" @@ -27850,6 +27859,304 @@ components: format: int64 type: integer type: object + DeviceBaseArray: + description: Response body for the list devices endpoint. + properties: + data: + description: List of devices matching the request. + items: + $ref: "#/components/schemas/DeviceBaseData" + type: array + required: + - data + type: object + DeviceBaseData: + description: A single device entry as returned by the list devices endpoint. + properties: + attributes: + $ref: "#/components/schemas/DeviceBaseDataAttributes" + id: + description: Unique identifier of the device. Matches the Datadog host identifier. + example: LAPTOP-DEMO-001 + type: string + type: + $ref: "#/components/schemas/DeviceDetailsDataType" + required: + - type + - id + type: object + DeviceBaseDataAttributes: + description: Common health and identity attributes shared by every End User Device Monitoring device record. + properties: + agent_key: + description: Public key of the Datadog Agent installed on the device. + type: string + agent_version: + description: Version of the Datadog Agent installed on the device. + type: string + battery_max_capacity_pct: + description: Maximum battery capacity expressed as a percentage of the device's design capacity. + format: int64 + type: integer + cpu_cores: + description: Number of physical CPU cores on the device. + format: int64 + type: integer + cpu_logical_processors: + description: Number of logical CPU processors (hardware threads) on the device. + format: int64 + type: integer + cpu_model: + description: Human-readable name of the device's CPU model. + type: string + cpu_usage: + description: Average CPU usage on the device, as a percentage between 0 and 100. + format: double + type: number + disk_usage: + description: Average disk usage on the device, as a percentage between 0 and 100. + format: double + type: number + ip_address: + description: Last observed IPv4 or IPv6 address of the device. + type: string + issues: + description: |- + List of issue identifiers currently affecting the device. + References entries returned by the issues endpoint. + items: + description: Identifier of a single issue currently affecting the device. + type: string + type: array + kernel_name: + description: Name of the operating system kernel running on the device. + type: string + last_seen: + description: Timestamp of the most recent telemetry received from the device, in RFC 3339 format. + type: string + manufacturer: + description: Manufacturer of the device. + type: string + mem_usage: + description: Average memory usage on the device, as a percentage between 0 and 100. + format: double + type: number + memory_total_kb: + description: Total amount of physical memory available on the device, in kilobytes. + format: int64 + type: integer + model_name: + description: Marketing or product name of the device model. + type: string + model_number: + description: Manufacturer-assigned model number of the device. + type: string + os: + description: Operating system family running on the device (for example, `mac`, `windows`, or `linux`). + type: string + os_version: + description: Operating system version running on the device. + type: string + resource_id: + description: Datadog resource identifier for the device. + type: string + serial_number: + description: Serial number assigned to the device by its manufacturer. + type: string + status: + description: Health status of the device computed from its issues and recent telemetry. + type: string + type: + description: Hardware type of the device (for example, `laptop`, `desktop`, or `mobile`). + type: string + uptime: + description: Time elapsed since the device last booted, in seconds. + format: double + type: number + wlan_bssid: + description: |- + BSSID (MAC address of the access point) of the wireless network the device is + currently connected to. + type: string + wlan_rssi: + description: Received signal strength indicator of the device's current wireless connection, in dBm. + format: double + type: number + wlan_ssid: + description: SSID of the wireless network the device is currently connected to. + type: string + type: object + DeviceDetails: + description: Response body for the get device endpoint, returning a single device with full attribute detail. + properties: + data: + $ref: "#/components/schemas/DeviceDetailsData" + type: object + DeviceDetailsData: + description: A single device entry with full attribute detail. + properties: + attributes: + $ref: "#/components/schemas/DeviceDetailsDataAttributes" + id: + description: Unique identifier of the device. Matches the Datadog host identifier. + example: LAPTOP-DEMO-001 + type: string + type: + $ref: "#/components/schemas/DeviceDetailsDataType" + required: + - type + - id + type: object + DeviceDetailsDataAttributes: + description: |- + Extended set of attributes for a single End User Device Monitoring device, + including detailed network and battery metrics. + properties: + agent_key: + description: Public key of the Datadog Agent installed on the device. + type: string + agent_version: + description: Version of the Datadog Agent installed on the device. + type: string + battery_charge_pct: + description: Current battery charge level as a percentage between 0 and 100. + format: int64 + type: integer + battery_charge_rate: + description: |- + Rate at which the battery is charging or discharging, in milliamperes. + Negative values indicate discharge. + format: int64 + type: integer + battery_cycle_count: + description: Number of full charge cycles the battery has gone through. + format: int64 + type: integer + battery_max_capacity_pct: + description: Maximum battery capacity expressed as a percentage of the device's design capacity. + format: int64 + type: integer + cpu_cores: + description: Number of physical CPU cores on the device. + format: int64 + type: integer + cpu_logical_processors: + description: Number of logical CPU processors (hardware threads) on the device. + format: int64 + type: integer + cpu_model: + description: Human-readable name of the device's CPU model. + type: string + cpu_usage: + description: Average CPU usage on the device, as a percentage between 0 and 100. + format: double + type: number + disk_usage: + description: Average disk usage on the device, as a percentage between 0 and 100. + format: double + type: number + ip_address: + description: Last observed IPv4 or IPv6 address of the device. + type: string + issues: + description: |- + List of issue identifiers currently affecting the device. + References entries returned by the issues endpoint. + items: + description: Identifier of a single issue currently affecting the device. + type: string + type: array + kernel_name: + description: Name of the operating system kernel running on the device. + type: string + last_seen: + description: Timestamp of the most recent telemetry received from the device, in RFC 3339 format. + type: string + manufacturer: + description: Manufacturer of the device. + type: string + mem_usage: + description: Average memory usage on the device, as a percentage between 0 and 100. + format: double + type: number + memory_total_kb: + description: Total amount of physical memory available on the device, in kilobytes. + format: int64 + type: integer + model_name: + description: Marketing or product name of the device model. + type: string + model_number: + description: Manufacturer-assigned model number of the device. + type: string + os: + description: Operating system family running on the device (for example, `mac`, `windows`, or `linux`). + type: string + os_version: + description: Operating system version running on the device. + type: string + packets_in_drop: + description: Average rate of dropped inbound network packets, in packets per second. + format: double + type: number + packets_in_error: + description: Average rate of inbound network packets received with errors, in packets per second. + format: double + type: number + packets_out_drop: + description: Average rate of dropped outbound network packets, in packets per second. + format: double + type: number + packets_out_error: + description: Average rate of outbound network packets sent with errors, in packets per second. + format: double + type: number + resource_id: + description: Datadog resource identifier for the device. + type: string + serial_number: + description: Serial number assigned to the device by its manufacturer. + type: string + status: + description: Health status of the device computed from its issues and recent telemetry. + type: string + tcp_out_segs: + description: Average rate of TCP segments sent by the device, in segments per second. + format: double + type: number + tcp_retrans_segs: + description: Average rate of TCP segments retransmitted by the device, in segments per second. + format: double + type: number + type: + description: Hardware type of the device (for example, `laptop`, `desktop`, or `mobile`). + type: string + uptime: + description: Time elapsed since the device last booted, in seconds. + format: double + type: number + wlan_bssid: + description: |- + BSSID (MAC address of the access point) of the wireless network the device is + currently connected to. + type: string + wlan_rssi: + description: Received signal strength indicator of the device's current wireless connection, in dBm. + format: double + type: number + wlan_ssid: + description: SSID of the wireless network the device is currently connected to. + type: string + type: object + DeviceDetailsDataType: + default: devices + description: Devices resource type. + enum: + - devices + example: devices + type: string + x-enum-varnames: + - DEVICES DevicesListData: description: The devices list data properties: @@ -36945,6 +37252,66 @@ components: - id - type type: object + GraphItemArray: + description: Response body for the graph endpoint, returning per-grouping device counts. + properties: + data: + description: List of grouping entries with their associated device counts. + items: + $ref: "#/components/schemas/GraphItemData" + type: array + required: + - data + type: object + GraphItemData: + description: A single grouping entry in the End User Device Monitoring graph response. + properties: + attributes: + $ref: "#/components/schemas/GraphItemDataAttributes" + id: + description: Unique identifier of the grouping, derived from the grouping column. + example: macOS + type: string + type: + $ref: "#/components/schemas/GraphItemDataType" + required: + - type + - id + type: object + GraphItemDataAttributes: + description: Attributes of a single grouping in the End User Device Monitoring graph response. + properties: + counts: + description: List of per-value counts for the grouping column. + items: + $ref: "#/components/schemas/GraphItemDataAttributesCountsItems" + type: array + type: + description: Identifier of the grouping column (for example, `os` or `type`). + type: string + type: object + GraphItemDataAttributesCountsItems: + description: Count of devices for a single value of the grouping column in the End User Device Monitoring graph. + properties: + columnName: + description: |- + Value of the grouping column for this bucket (for example, an operating system + name or a device type). + type: string + count: + description: Number of devices that fall into this bucket. + format: int64 + type: integer + type: object + GraphItemDataType: + default: graph_items + description: Graph items resource type. + enum: + - graph_items + example: graph_items + type: string + x-enum-varnames: + - GRAPH_ITEMS GreyNoiseAPIKey: description: The definition of the `GreyNoiseAPIKey` object. properties: @@ -42037,6 +42404,61 @@ components: type: string x-enum-varnames: - CASE + IssueDefinitionArray: + description: Response body for the issues endpoint, returning all available device issue definitions. + properties: + data: + description: List of available issue definitions. + items: + $ref: "#/components/schemas/IssueDefinitionData" + type: array + required: + - data + type: object + IssueDefinitionData: + description: A single issue definition entry returned by the issues endpoint. + properties: + attributes: + $ref: "#/components/schemas/IssueDefinitionDataAttributes" + id: + description: Stable identifier of the issue definition, used in the `issues` field of a device record. + example: low-battery-capacity + type: string + type: + $ref: "#/components/schemas/IssueDefinitionDataType" + required: + - type + - id + type: object + IssueDefinitionDataAttributes: + description: Attributes of a single End User Device Monitoring issue definition. + properties: + category: + description: Category of the issue (for example, `battery`, `network`, or `performance`). + example: battery + type: string + label: + description: Human-readable label describing the issue, suitable for display in the Datadog UI. + example: Battery health is below 80% + type: string + level: + description: Severity level of the issue (for example, `warning` or `critical`). + example: warning + type: string + required: + - category + - label + - level + type: object + IssueDefinitionDataType: + default: issue_definitions + description: Issue definitions resource type. + enum: + - issue_definitions + example: issue_definitions + type: string + x-enum-varnames: + - ISSUE_DEFINITIONS IssueIncluded: description: An array of related resources, returned when the `include` query parameter is used. oneOf: @@ -54649,6 +55071,256 @@ components: - id - type type: object + OAuthClientRegistrationError: + description: Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591. + properties: + error: + description: Single ASCII error code per RFC 7591, such as `invalid_request` or `invalid_client_metadata`. + example: invalid_client_metadata + type: string + error_description: + description: Human-readable description of the error. + example: redirect URI is not well-formed + type: string + required: + - error + - error_description + type: object + OAuthClientRegistrationGrantType: + description: OAuth 2.0 grant type that a registered client may use. + enum: + - authorization_code + - refresh_token + example: authorization_code + type: string + x-enum-varnames: + - AUTHORIZATION_CODE + - REFRESH_TOKEN + OAuthClientRegistrationRequest: + description: Request payload for OAuth2 dynamic client registration as defined by RFC 7591. + properties: + client_name: + description: Human-readable name of the client. Control characters are rejected. + example: Example MCP Client + maxLength: 1000 + type: string + client_uri: + description: URL of the home page of the client. + example: https://example.com + maxLength: 1000 + type: string + grant_types: + description: |- + OAuth 2.0 grant types the client may use. + Defaults to `authorization_code` and `refresh_token` when omitted. + example: + - authorization_code + - refresh_token + items: + $ref: "#/components/schemas/OAuthClientRegistrationGrantType" + type: array + jwks_uri: + description: URL referencing the client's JSON Web Key Set. + example: https://example.com/.well-known/jwks.json + maxLength: 1000 + type: string + logo_uri: + description: URL referencing a logo for the client. + example: https://example.com/logo.png + maxLength: 1000 + type: string + policy_uri: + description: URL pointing to the client's privacy policy. + example: https://example.com/privacy + maxLength: 1000 + type: string + redirect_uris: + description: Array of redirection URI strings used by the client in redirect-based flows. + example: + - https://example.com/oauth/callback + items: + description: Redirection URI registered for the client. + example: https://example.com/oauth/callback + maxLength: 1000 + type: string + type: array + response_types: + description: OAuth 2.0 response types the client may use. Only `code` is supported. + example: + - code + items: + $ref: "#/components/schemas/OAuthClientRegistrationResponseType" + type: array + scope: + description: Space-separated list of scope values the client may request. + example: openid profile + maxLength: 1000 + type: string + token_endpoint_auth_method: + description: Requested authentication method for the token endpoint. Only `none` is supported. + example: none + maxLength: 20 + type: string + tos_uri: + description: URL pointing to the client's terms of service. + example: https://example.com/tos + maxLength: 1000 + type: string + required: + - client_name + - redirect_uris + type: object + OAuthClientRegistrationResponse: + description: Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591. + properties: + client_id: + description: Unique identifier assigned to the registered client. + example: 72b68208-36a6-11f0-b21b-da7ad0900002 + format: uuid + type: string + client_name: + description: Human-readable name of the client. + example: Example MCP Client + type: string + grant_types: + description: OAuth 2.0 grant types registered for the client. + example: + - authorization_code + - refresh_token + items: + $ref: "#/components/schemas/OAuthClientRegistrationGrantType" + type: array + redirect_uris: + description: Redirection URIs registered for the client. + example: + - https://example.com/oauth/callback + items: + description: Redirection URI registered for the client. + example: https://example.com/oauth/callback + type: string + type: array + response_types: + description: OAuth 2.0 response types registered for the client. + example: + - code + items: + $ref: "#/components/schemas/OAuthClientRegistrationResponseType" + type: array + token_endpoint_auth_method: + description: Authentication method registered for the token endpoint. Always `none`. + example: none + type: string + required: + - client_id + - client_name + - redirect_uris + - token_endpoint_auth_method + - grant_types + - response_types + type: object + OAuthClientRegistrationResponseType: + description: OAuth 2.0 response type that a registered client may use. + enum: + - code + example: code + type: string + x-enum-varnames: + - CODE + OAuthOidcScope: + description: OIDC scope a client may be restricted to. + enum: + - openid + - profile + - email + - offline_access + example: openid + type: string + x-enum-varnames: + - OPENID + - PROFILE + - EMAIL + - OFFLINE_ACCESS + OAuthScopesRestriction: + description: Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + nullable: true + properties: + oidc_scopes: + description: OIDC scopes the client is restricted to. + example: + - openid + - email + items: + $ref: "#/components/schemas/OAuthOidcScope" + type: array + permission_scopes: + description: Datadog permission scopes the client is restricted to. + example: + - dashboards_read + - metrics_read + items: + description: Datadog permission scope name. + example: dashboards_read + type: string + type: array + required: + - oidc_scopes + - permission_scopes + type: object + OAuthScopesRestrictionResponse: + description: Response payload describing the scopes restriction of an OAuth2 client. + properties: + data: + $ref: "#/components/schemas/OAuthScopesRestrictionResponseData" + required: + - data + type: object + OAuthScopesRestrictionResponseAttributes: + description: Attributes of an OAuth2 client scopes restriction. + properties: + required_permission_scopes: + description: |- + Permission scopes automatically required for this client (for example, mobile-app permission scopes). + Returns `null` when no scopes are required. + example: + - mobile_app_access + items: + description: Datadog permission scope name. + example: mobile_app_access + type: string + nullable: true + type: array + scopes_restriction: + $ref: "#/components/schemas/OAuthScopesRestriction" + required: + - scopes_restriction + - required_permission_scopes + type: object + OAuthScopesRestrictionResponseData: + description: Data object of an OAuth2 client scopes restriction response. + properties: + attributes: + $ref: "#/components/schemas/OAuthScopesRestrictionResponseAttributes" + id: + description: UUID of the OAuth2 client this restriction applies to. + example: fafa8e1c-36a5-11f0-a83d-da7ad0900001 + format: uuid + type: string + type: + $ref: "#/components/schemas/OAuthScopesRestrictionType" + required: + - id + - type + - attributes + type: object + OAuthScopesRestrictionType: + default: scopes_restriction + description: JSON:API resource type for an OAuth2 client scopes restriction. + enum: + - scopes_restriction + example: scopes_restriction + type: string + x-enum-varnames: + - SCOPES_RESTRICTION OCIConfig: description: OCI config. properties: @@ -62639,6 +63311,54 @@ components: - ARRAY_NUMBER - ARRAY_BOOLEAN - ARRAY_OBJECT + OverviewItemArray: + description: |- + Response body for the overview endpoint, returning the tiles shown on the + End User Device Monitoring overview dashboard. + properties: + data: + description: List of overview tiles. + items: + $ref: "#/components/schemas/OverviewItemData" + type: array + required: + - data + type: object + OverviewItemData: + description: A single tile entry in the End User Device Monitoring overview response. + properties: + attributes: + $ref: "#/components/schemas/OverviewItemDataAttributes" + id: + description: Unique identifier of the overview tile. + example: total_devices + type: string + type: + $ref: "#/components/schemas/OverviewItemDataType" + required: + - type + - id + type: object + OverviewItemDataAttributes: + description: Attributes of a single tile in the End User Device Monitoring overview dashboard. + properties: + name: + description: Human-readable name of the overview tile. + type: string + value: + description: Numeric value displayed on the overview tile. + format: int64 + type: integer + type: object + OverviewItemDataType: + default: overview_items + description: Overview items resource type. + enum: + - overview_items + example: overview_items + type: string + x-enum-varnames: + - OVERVIEW_ITEMS OverwriteAllocationsRequest: description: Request to overwrite targeting rules (allocations) for a feature flag in an environment. properties: @@ -92269,6 +92989,57 @@ components: - id - attributes type: object + UpsertOAuthScopesRestrictionData: + description: Data object of an upsert OAuth2 scopes restriction request. + properties: + attributes: + $ref: "#/components/schemas/UpsertOAuthScopesRestrictionDataAttributes" + type: + $ref: "#/components/schemas/UpsertOAuthScopesRestrictionType" + required: + - type + type: object + UpsertOAuthScopesRestrictionDataAttributes: + description: Attributes of an upsert OAuth2 scopes restriction request. + properties: + oidc_scopes: + description: OIDC scopes the client is allowed to request. + example: + - openid + - email + items: + $ref: "#/components/schemas/OAuthOidcScope" + type: array + permission_scopes: + description: |- + Datadog permission scopes the client is allowed to request. + Each value must be a valid permission name. + example: + - dashboards_read + - metrics_read + items: + description: Datadog permission scope name. + example: dashboards_read + type: string + type: array + type: object + UpsertOAuthScopesRestrictionRequest: + description: Request payload for creating or updating the scopes restriction of an OAuth2 client. + properties: + data: + $ref: "#/components/schemas/UpsertOAuthScopesRestrictionData" + required: + - data + type: object + UpsertOAuthScopesRestrictionType: + default: upsert_scopes_restriction + description: JSON:API resource type for an upsert OAuth2 client scopes restriction request. + enum: + - upsert_scopes_restriction + example: upsert_scopes_restriction + type: string + x-enum-varnames: + - UPSERT_SCOPES_RESTRICTION Urgency: description: Specifies the level of urgency for a routing rule (low, high, or dynamic). enum: @@ -115654,6 +116425,234 @@ paths: summary: Update the state of an issue tags: - Error Tracking + /api/v2/eudm/devices: + get: + operationId: GetEUDMDevices + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cpu_usage: 12.4 + disk_usage: 38.2 + issues: [] + last_seen: "2026-05-20T10:15:30Z" + manufacturer: Apple + mem_usage: 47.1 + model_name: MacBook Pro + os: macOS + os_version: macOS 15.6.1 arm64 + status: healthy + id: LAPTOP-DEMO-001 + type: devices + schema: + $ref: "#/components/schemas/DeviceBaseArray" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - hosts_read + - metrics_read + summary: Get all devices + tags: + - End User Device Monitoring + /api/v2/eudm/devices/{device_id}: + get: + operationId: GetEUDMDevice + parameters: + - description: Unique identifier of the device to fetch. Matches the Datadog host identifier. + in: path + name: device_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + battery_charge_pct: 82 + battery_charge_rate: 1200 + battery_cycle_count: 134 + battery_max_capacity_pct: 96 + cpu_cores: 10 + cpu_logical_processors: 10 + cpu_model: Apple M1 Pro + cpu_usage: 12.4 + disk_usage: 38.2 + ip_address: 192.0.2.10 + issues: [] + kernel_name: Darwin + last_seen: "2026-05-20T10:15:30Z" + manufacturer: Apple + mem_usage: 47.1 + memory_total_kb: 16777216 + model_name: MacBook Pro + model_number: MacBookPro18,3 + os: macOS + os_version: macOS 15.6.1 arm64 + packets_in_drop: 0.0 + packets_in_error: 0.0 + packets_out_drop: 0.0 + packets_out_error: 0.0 + serial_number: TESTDEVICE001 + status: healthy + tcp_out_segs: 4321.0 + tcp_retrans_segs: 12.0 + uptime: 432000 + wlan_bssid: 00:00:5e:00:53:01 + wlan_rssi: -55.0 + wlan_ssid: corp-wifi + id: LAPTOP-DEMO-001 + type: devices + schema: + $ref: "#/components/schemas/DeviceDetails" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - hosts_read + - metrics_read + summary: Get a device + tags: + - End User Device Monitoring + /api/v2/eudm/graph: + get: + operationId: GetEUDMGraph + parameters: + - description: |- + Device attribute to group by (for example, `os` or `type`). + Determines which column the response counts are bucketed against. + in: query + name: by + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + counts: + - columnName: mac + count: 42 + - columnName: windows + count: 17 + - columnName: linux + count: 3 + type: os + id: os + type: graph_items + schema: + $ref: "#/components/schemas/GraphItemArray" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - hosts_read + - metrics_read + summary: Get device counts grouped by attribute + tags: + - End User Device Monitoring + /api/v2/eudm/issues: + get: + operationId: GetEUDMIssues + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + category: battery + label: Battery health is below 80% + level: warning + id: battery_low_health + type: issue_definitions + - attributes: + category: agent + label: Datadog Agent has not reported in over 24 hours + level: critical + id: agent_offline + type: issue_definitions + schema: + $ref: "#/components/schemas/IssueDefinitionArray" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - hosts_read + - metrics_read + summary: Get all device issue definitions + tags: + - End User Device Monitoring + /api/v2/eudm/overview: + get: + operationId: GetEUDMOverview + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + name: Total devices + value: 62 + id: total_devices + type: overview_items + - attributes: + name: Devices with issues + value: 4 + id: devices_with_issues + type: overview_items + schema: + $ref: "#/components/schemas/OverviewItemArray" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - hosts_read + - metrics_read + summary: Get overview tiles + tags: + - End User Device Monitoring /api/v2/events: get: description: |- @@ -134428,6 +135427,223 @@ paths: summary: Get all aggregated DNS traffic tags: - Cloud Network Monitoring + /api/v2/oauth2/clients/{client_uuid}/scopes_restriction: + delete: + description: Delete the scopes restriction configured for the OAuth2 client. + operationId: DeleteScopesRestriction + parameters: + - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an OAuth2 client scopes restriction + tags: + - OAuth2 Client Public + x-permission: + operator: OR + permissions: + - org_authorized_apps_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the scopes restriction configured for the OAuth2 client. + operationId: GetScopesRestriction + parameters: + - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + required_permission_scopes: + scopes_restriction: + oidc_scopes: + - openid + - email + permission_scopes: + - dashboards_read + - metrics_read + id: fafa8e1c-36a5-11f0-a83d-da7ad0900001 + type: scopes_restriction + schema: + $ref: "#/components/schemas/OAuthScopesRestrictionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an OAuth2 client scopes restriction + tags: + - OAuth2 Client Public + x-permission: + operator: OR + permissions: + - org_authorized_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create or update the scopes restriction configured for the OAuth2 client. + operationId: UpsertScopesRestriction + parameters: + - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + oidc_scopes: + - openid + - email + permission_scopes: + - dashboards_read + - metrics_read + type: upsert_scopes_restriction + schema: + $ref: "#/components/schemas/UpsertOAuthScopesRestrictionRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + required_permission_scopes: + scopes_restriction: + oidc_scopes: + - openid + - email + permission_scopes: + - dashboards_read + - metrics_read + id: fafa8e1c-36a5-11f0-a83d-da7ad0900001 + type: scopes_restriction + schema: + $ref: "#/components/schemas/OAuthScopesRestrictionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Upsert an OAuth2 client scopes restriction + tags: + - OAuth2 Client Public + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - org_authorized_apps_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/oauth2/register: + post: + description: Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591. + operationId: RegisterOAuthClient + requestBody: + content: + application/json: + examples: + default: + value: + client_name: Example MCP Client + grant_types: + - authorization_code + - refresh_token + redirect_uris: + - https://example.com/oauth/callback + response_types: + - code + token_endpoint_auth_method: none + schema: + $ref: "#/components/schemas/OAuthClientRegistrationRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + client_id: 72b68208-36a6-11f0-b21b-da7ad0900002 + client_name: Example MCP Client + grant_types: + - authorization_code + - refresh_token + redirect_uris: + - https://example.com/oauth/callback + response_types: + - code + token_endpoint_auth_method: none + schema: + $ref: "#/components/schemas/OAuthClientRegistrationResponse" + description: Created + "400": + content: + application/json: + examples: + default: + value: + error: invalid_client_metadata + error_description: redirect URI is not well-formed + schema: + $ref: "#/components/schemas/OAuthClientRegistrationError" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: [] + summary: Register an OAuth2 client + tags: + - OAuth2 Client Public + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/obs-pipelines/pipelines: get: description: Retrieve a list of pipelines. @@ -167676,6 +168892,10 @@ tags: scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags. name: Downtimes + - description: |- + Inspect devices reported by the Datadog Agent on end-user laptops, desktops, + and mobile devices, including their health, hardware, and connectivity attributes. + name: End User Device Monitoring - description: Manage per-integration configurations for the Internal Developer Portal (IDP). These configurations control which external resources (for example, GitHub repositories, Jira projects, or PagerDuty services) are synced as entities into the Software Catalog. name: Entity Integration Configs - description: Retrieves security risk scores for entities in your organization. @@ -167842,6 +169062,10 @@ tags: - description: |- The Network Device Monitoring API allows you to fetch devices and interfaces and their attributes. See the [Network Device Monitoring page](https://docs.datadoghq.com/network_monitoring/) for more information. name: Network Device Monitoring + - description: |- + Configure OAuth2 clients for Datadog. + Supports RFC 7591 Dynamic Client Registration and management of OAuth2 client scopes restrictions. + name: OAuth2 Client Public - description: Auto-generated tag OCI Integration name: OCI Integration - description: |- diff --git a/examples/v2/end-user-device-monitoring/GetEUDMDevice.java b/examples/v2/end-user-device-monitoring/GetEUDMDevice.java new file mode 100644 index 00000000000..8cf47608134 --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMDevice.java @@ -0,0 +1,24 @@ +// Get a device returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EndUserDeviceMonitoringApi; +import com.datadog.api.client.v2.model.DeviceDetails; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + EndUserDeviceMonitoringApi apiInstance = new EndUserDeviceMonitoringApi(defaultClient); + + try { + DeviceDetails result = apiInstance.getEUDMDevice("device_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EndUserDeviceMonitoringApi#getEUDMDevice"); + 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/end-user-device-monitoring/GetEUDMDevices.java b/examples/v2/end-user-device-monitoring/GetEUDMDevices.java new file mode 100644 index 00000000000..8e6f633c14d --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMDevices.java @@ -0,0 +1,24 @@ +// Get all devices returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EndUserDeviceMonitoringApi; +import com.datadog.api.client.v2.model.DeviceBaseArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + EndUserDeviceMonitoringApi apiInstance = new EndUserDeviceMonitoringApi(defaultClient); + + try { + DeviceBaseArray result = apiInstance.getEUDMDevices(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EndUserDeviceMonitoringApi#getEUDMDevices"); + 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/end-user-device-monitoring/GetEUDMGraph.java b/examples/v2/end-user-device-monitoring/GetEUDMGraph.java new file mode 100644 index 00000000000..8bccad80eb7 --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMGraph.java @@ -0,0 +1,24 @@ +// Get device counts grouped by attribute returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EndUserDeviceMonitoringApi; +import com.datadog.api.client.v2.model.GraphItemArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + EndUserDeviceMonitoringApi apiInstance = new EndUserDeviceMonitoringApi(defaultClient); + + try { + GraphItemArray result = apiInstance.getEUDMGraph("by"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EndUserDeviceMonitoringApi#getEUDMGraph"); + 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/end-user-device-monitoring/GetEUDMIssues.java b/examples/v2/end-user-device-monitoring/GetEUDMIssues.java new file mode 100644 index 00000000000..c1c45627c51 --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMIssues.java @@ -0,0 +1,24 @@ +// Get all device issue definitions returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EndUserDeviceMonitoringApi; +import com.datadog.api.client.v2.model.IssueDefinitionArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + EndUserDeviceMonitoringApi apiInstance = new EndUserDeviceMonitoringApi(defaultClient); + + try { + IssueDefinitionArray result = apiInstance.getEUDMIssues(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EndUserDeviceMonitoringApi#getEUDMIssues"); + 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/end-user-device-monitoring/GetEUDMOverview.java b/examples/v2/end-user-device-monitoring/GetEUDMOverview.java new file mode 100644 index 00000000000..bc7a9b13e4a --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMOverview.java @@ -0,0 +1,24 @@ +// Get overview tiles returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EndUserDeviceMonitoringApi; +import com.datadog.api.client.v2.model.OverviewItemArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + EndUserDeviceMonitoringApi apiInstance = new EndUserDeviceMonitoringApi(defaultClient); + + try { + OverviewItemArray result = apiInstance.getEUDMOverview(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EndUserDeviceMonitoringApi#getEUDMOverview"); + 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/oauth2-client-public/DeleteScopesRestriction.java b/examples/v2/oauth2-client-public/DeleteScopesRestriction.java new file mode 100644 index 00000000000..602fee9fd1f --- /dev/null +++ b/examples/v2/oauth2-client-public/DeleteScopesRestriction.java @@ -0,0 +1,24 @@ +// Delete an OAuth2 client scopes restriction returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OAuth2ClientPublicApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteScopesRestriction", true); + OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient); + + try { + apiInstance.deleteScopesRestriction(UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001")); + } catch (ApiException e) { + System.err.println("Exception when calling OAuth2ClientPublicApi#deleteScopesRestriction"); + 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/oauth2-client-public/GetScopesRestriction.java b/examples/v2/oauth2-client-public/GetScopesRestriction.java new file mode 100644 index 00000000000..b5292323a93 --- /dev/null +++ b/examples/v2/oauth2-client-public/GetScopesRestriction.java @@ -0,0 +1,27 @@ +// Get an OAuth2 client scopes restriction returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OAuth2ClientPublicApi; +import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getScopesRestriction", true); + OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient); + + try { + OAuthScopesRestrictionResponse result = + apiInstance.getScopesRestriction(UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OAuth2ClientPublicApi#getScopesRestriction"); + 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/oauth2-client-public/RegisterOAuthClient.java b/examples/v2/oauth2-client-public/RegisterOAuthClient.java new file mode 100644 index 00000000000..efb5b182175 --- /dev/null +++ b/examples/v2/oauth2-client-public/RegisterOAuthClient.java @@ -0,0 +1,47 @@ +// Register an OAuth2 client returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OAuth2ClientPublicApi; +import com.datadog.api.client.v2.model.OAuthClientRegistrationGrantType; +import com.datadog.api.client.v2.model.OAuthClientRegistrationRequest; +import com.datadog.api.client.v2.model.OAuthClientRegistrationResponse; +import com.datadog.api.client.v2.model.OAuthClientRegistrationResponseType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.registerOAuthClient", true); + OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient); + + OAuthClientRegistrationRequest body = + new OAuthClientRegistrationRequest() + .clientName("Example MCP Client") + .clientUri("https://example.com") + .grantTypes( + Arrays.asList( + OAuthClientRegistrationGrantType.AUTHORIZATION_CODE, + OAuthClientRegistrationGrantType.REFRESH_TOKEN)) + .jwksUri("https://example.com/.well-known/jwks.json") + .logoUri("https://example.com/logo.png") + .policyUri("https://example.com/privacy") + .redirectUris(Collections.singletonList("https://example.com/oauth/callback")) + .responseTypes(Collections.singletonList(OAuthClientRegistrationResponseType.CODE)) + .scope("openid profile") + .tokenEndpointAuthMethod("none") + .tosUri("https://example.com/tos"); + + try { + OAuthClientRegistrationResponse result = apiInstance.registerOAuthClient(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OAuth2ClientPublicApi#registerOAuthClient"); + 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/oauth2-client-public/UpsertScopesRestriction.java b/examples/v2/oauth2-client-public/UpsertScopesRestriction.java new file mode 100644 index 00000000000..7a94c0d1f16 --- /dev/null +++ b/examples/v2/oauth2-client-public/UpsertScopesRestriction.java @@ -0,0 +1,44 @@ +// Upsert an OAuth2 client scopes restriction returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OAuth2ClientPublicApi; +import com.datadog.api.client.v2.model.OAuthOidcScope; +import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse; +import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionData; +import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionDataAttributes; +import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionRequest; +import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionType; +import java.util.Arrays; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.upsertScopesRestriction", true); + OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient); + + UpsertOAuthScopesRestrictionRequest body = + new UpsertOAuthScopesRestrictionRequest() + .data( + new UpsertOAuthScopesRestrictionData() + .attributes( + new UpsertOAuthScopesRestrictionDataAttributes() + .oidcScopes(Arrays.asList(OAuthOidcScope.OPENID, OAuthOidcScope.EMAIL)) + .permissionScopes(Arrays.asList("dashboards_read", "metrics_read"))) + .type(UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION)); + + try { + OAuthScopesRestrictionResponse result = + apiInstance.upsertScopesRestriction( + UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OAuth2ClientPublicApi#upsertScopesRestriction"); + 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 7efc53e4b9b..98cec9dd248 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1086,6 +1086,10 @@ public class ApiClient { put("v2.updateMonitorUserTemplate", false); put("v2.validateExistingMonitorUserTemplate", false); put("v2.validateMonitorUserTemplate", false); + put("v2.deleteScopesRestriction", false); + put("v2.getScopesRestriction", false); + put("v2.registerOAuthClient", false); + put("v2.upsertScopesRestriction", false); put("v2.bulkUpdateOrgGroupMemberships", false); put("v2.createOrgGroup", false); put("v2.createOrgGroupPolicy", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/EndUserDeviceMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/EndUserDeviceMonitoringApi.java new file mode 100644 index 00000000000..891b2876a67 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/EndUserDeviceMonitoringApi.java @@ -0,0 +1,636 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.DeviceBaseArray; +import com.datadog.api.client.v2.model.DeviceDetails; +import com.datadog.api.client.v2.model.GraphItemArray; +import com.datadog.api.client.v2.model.IssueDefinitionArray; +import com.datadog.api.client.v2.model.OverviewItemArray; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EndUserDeviceMonitoringApi { + private ApiClient apiClient; + + public EndUserDeviceMonitoringApi() { + this(ApiClient.getDefaultApiClient()); + } + + public EndUserDeviceMonitoringApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get a device. + * + *

See {@link #getEUDMDeviceWithHttpInfo}. + * + * @param deviceId Unique identifier of the device to fetch. Matches the Datadog host identifier. + * (required) + * @return DeviceDetails + * @throws ApiException if fails to make API call + */ + public DeviceDetails getEUDMDevice(String deviceId) throws ApiException { + return getEUDMDeviceWithHttpInfo(deviceId).getData(); + } + + /** + * Get a device. + * + *

See {@link #getEUDMDeviceWithHttpInfoAsync}. + * + * @param deviceId Unique identifier of the device to fetch. Matches the Datadog host identifier. + * (required) + * @return CompletableFuture<DeviceDetails> + */ + public CompletableFuture getEUDMDeviceAsync(String deviceId) { + return getEUDMDeviceWithHttpInfoAsync(deviceId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param deviceId Unique identifier of the device to fetch. Matches the Datadog host identifier. + * (required) + * @return ApiResponse<DeviceDetails> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getEUDMDeviceWithHttpInfo(String deviceId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'deviceId' is set + if (deviceId == null) { + throw new ApiException( + 400, "Missing the required parameter 'deviceId' when calling getEUDMDevice"); + } + // create path and map variables + String localVarPath = + "/api/v2/eudm/devices/{device_id}" + .replaceAll("\\{" + "device_id" + "\\}", apiClient.escapeString(deviceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMDevice", + 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 a device. + * + *

See {@link #getEUDMDeviceWithHttpInfo}. + * + * @param deviceId Unique identifier of the device to fetch. Matches the Datadog host identifier. + * (required) + * @return CompletableFuture<ApiResponse<DeviceDetails>> + */ + public CompletableFuture> getEUDMDeviceWithHttpInfoAsync( + String deviceId) { + Object localVarPostBody = null; + + // verify the required parameter 'deviceId' is set + if (deviceId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'deviceId' when calling getEUDMDevice")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/eudm/devices/{device_id}" + .replaceAll("\\{" + "device_id" + "\\}", apiClient.escapeString(deviceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMDevice", + 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( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all devices. + * + *

See {@link #getEUDMDevicesWithHttpInfo}. + * + * @return DeviceBaseArray + * @throws ApiException if fails to make API call + */ + public DeviceBaseArray getEUDMDevices() throws ApiException { + return getEUDMDevicesWithHttpInfo().getData(); + } + + /** + * Get all devices. + * + *

See {@link #getEUDMDevicesWithHttpInfoAsync}. + * + * @return CompletableFuture<DeviceBaseArray> + */ + public CompletableFuture getEUDMDevicesAsync() { + return getEUDMDevicesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @return ApiResponse<DeviceBaseArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getEUDMDevicesWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/eudm/devices"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMDevices", + 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 all devices. + * + *

See {@link #getEUDMDevicesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<DeviceBaseArray>> + */ + public CompletableFuture> getEUDMDevicesWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/eudm/devices"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMDevices", + 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( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get device counts grouped by attribute. + * + *

See {@link #getEUDMGraphWithHttpInfo}. + * + * @param by Device attribute to group by (for example, os or type). + * Determines which column the response counts are bucketed against. (required) + * @return GraphItemArray + * @throws ApiException if fails to make API call + */ + public GraphItemArray getEUDMGraph(String by) throws ApiException { + return getEUDMGraphWithHttpInfo(by).getData(); + } + + /** + * Get device counts grouped by attribute. + * + *

See {@link #getEUDMGraphWithHttpInfoAsync}. + * + * @param by Device attribute to group by (for example, os or type). + * Determines which column the response counts are bucketed against. (required) + * @return CompletableFuture<GraphItemArray> + */ + public CompletableFuture getEUDMGraphAsync(String by) { + return getEUDMGraphWithHttpInfoAsync(by) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param by Device attribute to group by (for example, os or type). + * Determines which column the response counts are bucketed against. (required) + * @return ApiResponse<GraphItemArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getEUDMGraphWithHttpInfo(String by) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'by' is set + if (by == null) { + throw new ApiException(400, "Missing the required parameter 'by' when calling getEUDMGraph"); + } + // create path and map variables + String localVarPath = "/api/v2/eudm/graph"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "by", by)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMGraph", + localVarPath, + localVarQueryParams, + 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 device counts grouped by attribute. + * + *

See {@link #getEUDMGraphWithHttpInfo}. + * + * @param by Device attribute to group by (for example, os or type). + * Determines which column the response counts are bucketed against. (required) + * @return CompletableFuture<ApiResponse<GraphItemArray>> + */ + public CompletableFuture> getEUDMGraphWithHttpInfoAsync(String by) { + Object localVarPostBody = null; + + // verify the required parameter 'by' is set + if (by == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'by' when calling getEUDMGraph")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/eudm/graph"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "by", by)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMGraph", + 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( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all device issue definitions. + * + *

See {@link #getEUDMIssuesWithHttpInfo}. + * + * @return IssueDefinitionArray + * @throws ApiException if fails to make API call + */ + public IssueDefinitionArray getEUDMIssues() throws ApiException { + return getEUDMIssuesWithHttpInfo().getData(); + } + + /** + * Get all device issue definitions. + * + *

See {@link #getEUDMIssuesWithHttpInfoAsync}. + * + * @return CompletableFuture<IssueDefinitionArray> + */ + public CompletableFuture getEUDMIssuesAsync() { + return getEUDMIssuesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @return ApiResponse<IssueDefinitionArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getEUDMIssuesWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/eudm/issues"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMIssues", + 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 all device issue definitions. + * + *

See {@link #getEUDMIssuesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<IssueDefinitionArray>> + */ + public CompletableFuture> getEUDMIssuesWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/eudm/issues"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMIssues", + 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( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get overview tiles. + * + *

See {@link #getEUDMOverviewWithHttpInfo}. + * + * @return OverviewItemArray + * @throws ApiException if fails to make API call + */ + public OverviewItemArray getEUDMOverview() throws ApiException { + return getEUDMOverviewWithHttpInfo().getData(); + } + + /** + * Get overview tiles. + * + *

See {@link #getEUDMOverviewWithHttpInfoAsync}. + * + * @return CompletableFuture<OverviewItemArray> + */ + public CompletableFuture getEUDMOverviewAsync() { + return getEUDMOverviewWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @return ApiResponse<OverviewItemArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getEUDMOverviewWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/eudm/overview"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMOverview", + 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 overview tiles. + * + *

See {@link #getEUDMOverviewWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<OverviewItemArray>> + */ + public CompletableFuture> getEUDMOverviewWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/eudm/overview"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMOverview", + 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( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java b/src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java new file mode 100644 index 00000000000..37c81a86c5c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java @@ -0,0 +1,695 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.OAuthClientRegistrationRequest; +import com.datadog.api.client.v2.model.OAuthClientRegistrationResponse; +import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse; +import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionRequest; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OAuth2ClientPublicApi { + private ApiClient apiClient; + + public OAuth2ClientPublicApi() { + this(ApiClient.getDefaultApiClient()); + } + + public OAuth2ClientPublicApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Delete an OAuth2 client scopes restriction. + * + *

See {@link #deleteScopesRestrictionWithHttpInfo}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @throws ApiException if fails to make API call + */ + public void deleteScopesRestriction(UUID clientUuid) throws ApiException { + deleteScopesRestrictionWithHttpInfo(clientUuid); + } + + /** + * Delete an OAuth2 client scopes restriction. + * + *

See {@link #deleteScopesRestrictionWithHttpInfoAsync}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteScopesRestrictionAsync(UUID clientUuid) { + return deleteScopesRestrictionWithHttpInfoAsync(clientUuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete the scopes restriction configured for the OAuth2 client. + * + * @param clientUuid UUID of the OAuth2 client. (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 -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteScopesRestrictionWithHttpInfo(UUID clientUuid) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteScopesRestriction"; + 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 'clientUuid' is set + if (clientUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'clientUuid' when calling deleteScopesRestriction"); + } + // create path and map variables + String localVarPath = + "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" + .replaceAll( + "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OAuth2ClientPublicApi.deleteScopesRestriction", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete an OAuth2 client scopes restriction. + * + *

See {@link #deleteScopesRestrictionWithHttpInfo}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteScopesRestrictionWithHttpInfoAsync( + UUID clientUuid) { + // Check if unstable operation is enabled + String operationId = "deleteScopesRestriction"; + 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 'clientUuid' is set + if (clientUuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'clientUuid' when calling deleteScopesRestriction")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" + .replaceAll( + "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OAuth2ClientPublicApi.deleteScopesRestriction", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get an OAuth2 client scopes restriction. + * + *

See {@link #getScopesRestrictionWithHttpInfo}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @return OAuthScopesRestrictionResponse + * @throws ApiException if fails to make API call + */ + public OAuthScopesRestrictionResponse getScopesRestriction(UUID clientUuid) throws ApiException { + return getScopesRestrictionWithHttpInfo(clientUuid).getData(); + } + + /** + * Get an OAuth2 client scopes restriction. + * + *

See {@link #getScopesRestrictionWithHttpInfoAsync}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @return CompletableFuture<OAuthScopesRestrictionResponse> + */ + public CompletableFuture getScopesRestrictionAsync( + UUID clientUuid) { + return getScopesRestrictionWithHttpInfoAsync(clientUuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the scopes restriction configured for the OAuth2 client. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @return ApiResponse<OAuthScopesRestrictionResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getScopesRestrictionWithHttpInfo( + UUID clientUuid) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getScopesRestriction"; + 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 'clientUuid' is set + if (clientUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'clientUuid' when calling getScopesRestriction"); + } + // create path and map variables + String localVarPath = + "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" + .replaceAll( + "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OAuth2ClientPublicApi.getScopesRestriction", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an OAuth2 client scopes restriction. + * + *

See {@link #getScopesRestrictionWithHttpInfo}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @return CompletableFuture<ApiResponse<OAuthScopesRestrictionResponse>> + */ + public CompletableFuture> + getScopesRestrictionWithHttpInfoAsync(UUID clientUuid) { + // Check if unstable operation is enabled + String operationId = "getScopesRestriction"; + 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 'clientUuid' is set + if (clientUuid == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'clientUuid' when calling getScopesRestriction")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" + .replaceAll( + "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OAuth2ClientPublicApi.getScopesRestriction", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Register an OAuth2 client. + * + *

See {@link #registerOAuthClientWithHttpInfo}. + * + * @param body (required) + * @return OAuthClientRegistrationResponse + * @throws ApiException if fails to make API call + */ + public OAuthClientRegistrationResponse registerOAuthClient(OAuthClientRegistrationRequest body) + throws ApiException { + return registerOAuthClientWithHttpInfo(body).getData(); + } + + /** + * Register an OAuth2 client. + * + *

See {@link #registerOAuthClientWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<OAuthClientRegistrationResponse> + */ + public CompletableFuture registerOAuthClientAsync( + OAuthClientRegistrationRequest body) { + return registerOAuthClientWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591. + * + * @param body (required) + * @return ApiResponse<OAuthClientRegistrationResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse registerOAuthClientWithHttpInfo( + OAuthClientRegistrationRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "registerOAuthClient"; + 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 registerOAuthClient"); + } + // create path and map variables + String localVarPath = "/api/v2/oauth2/register"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OAuth2ClientPublicApi.registerOAuthClient", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Register an OAuth2 client. + * + *

See {@link #registerOAuthClientWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<OAuthClientRegistrationResponse>> + */ + public CompletableFuture> + registerOAuthClientWithHttpInfoAsync(OAuthClientRegistrationRequest body) { + // Check if unstable operation is enabled + String operationId = "registerOAuthClient"; + 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 registerOAuthClient")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/oauth2/register"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OAuth2ClientPublicApi.registerOAuthClient", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {}); + } 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() {}); + } + + /** + * Upsert an OAuth2 client scopes restriction. + * + *

See {@link #upsertScopesRestrictionWithHttpInfo}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @param body (required) + * @return OAuthScopesRestrictionResponse + * @throws ApiException if fails to make API call + */ + public OAuthScopesRestrictionResponse upsertScopesRestriction( + UUID clientUuid, UpsertOAuthScopesRestrictionRequest body) throws ApiException { + return upsertScopesRestrictionWithHttpInfo(clientUuid, body).getData(); + } + + /** + * Upsert an OAuth2 client scopes restriction. + * + *

See {@link #upsertScopesRestrictionWithHttpInfoAsync}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @param body (required) + * @return CompletableFuture<OAuthScopesRestrictionResponse> + */ + public CompletableFuture upsertScopesRestrictionAsync( + UUID clientUuid, UpsertOAuthScopesRestrictionRequest body) { + return upsertScopesRestrictionWithHttpInfoAsync(clientUuid, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create or update the scopes restriction configured for the OAuth2 client. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @param body (required) + * @return ApiResponse<OAuthScopesRestrictionResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse upsertScopesRestrictionWithHttpInfo( + UUID clientUuid, UpsertOAuthScopesRestrictionRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "upsertScopesRestriction"; + 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 'clientUuid' is set + if (clientUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'clientUuid' when calling upsertScopesRestriction"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling upsertScopesRestriction"); + } + // create path and map variables + String localVarPath = + "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" + .replaceAll( + "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OAuth2ClientPublicApi.upsertScopesRestriction", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Upsert an OAuth2 client scopes restriction. + * + *

See {@link #upsertScopesRestrictionWithHttpInfo}. + * + * @param clientUuid UUID of the OAuth2 client. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<OAuthScopesRestrictionResponse>> + */ + public CompletableFuture> + upsertScopesRestrictionWithHttpInfoAsync( + UUID clientUuid, UpsertOAuthScopesRestrictionRequest body) { + // Check if unstable operation is enabled + String operationId = "upsertScopesRestriction"; + 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 'clientUuid' is set + if (clientUuid == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'clientUuid' when calling upsertScopesRestriction")); + 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 upsertScopesRestriction")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" + .replaceAll( + "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OAuth2ClientPublicApi.upsertScopesRestriction", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArray.java b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArray.java new file mode 100644 index 00000000000..2188d2ef03e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArray.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response body for the list devices endpoint. */ +@JsonPropertyOrder({DeviceBaseArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceBaseArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public DeviceBaseArray() {} + + @JsonCreator + public DeviceBaseArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public DeviceBaseArray data(List data) { + this.data = data; + for (DeviceBaseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DeviceBaseArray addDataItem(DeviceBaseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of devices matching the request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeviceBaseArray + */ + @JsonAnySetter + public DeviceBaseArray 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 DeviceBaseArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceBaseArray deviceBaseArray = (DeviceBaseArray) o; + return Objects.equals(this.data, deviceBaseArray.data) + && Objects.equals(this.additionalProperties, deviceBaseArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceBaseArray {\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/DeviceBaseData.java b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseData.java new file mode 100644 index 00000000000..56e3e54fd46 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseData.java @@ -0,0 +1,206 @@ +/* + * 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 single device entry as returned by the list devices endpoint. */ +@JsonPropertyOrder({ + DeviceBaseData.JSON_PROPERTY_ATTRIBUTES, + DeviceBaseData.JSON_PROPERTY_ID, + DeviceBaseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceBaseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeviceBaseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeviceDetailsDataType type = DeviceDetailsDataType.DEVICES; + + public DeviceBaseData() {} + + @JsonCreator + public DeviceBaseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeviceDetailsDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeviceBaseData attributes(DeviceBaseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Common health and identity attributes shared by every End User Device Monitoring device record. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceBaseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeviceBaseDataAttributes attributes) { + this.attributes = attributes; + } + + public DeviceBaseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the device. Matches the Datadog host 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 DeviceBaseData type(DeviceDetailsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Devices resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeviceDetailsDataType getType() { + return type; + } + + public void setType(DeviceDetailsDataType 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 DeviceBaseData + */ + @JsonAnySetter + public DeviceBaseData 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 DeviceBaseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceBaseData deviceBaseData = (DeviceBaseData) o; + return Objects.equals(this.attributes, deviceBaseData.attributes) + && Objects.equals(this.id, deviceBaseData.id) + && Objects.equals(this.type, deviceBaseData.type) + && Objects.equals(this.additionalProperties, deviceBaseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceBaseData {\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/DeviceBaseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseDataAttributes.java new file mode 100644 index 00000000000..ba467ebecad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseDataAttributes.java @@ -0,0 +1,888 @@ +/* + * 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; + +/** + * Common health and identity attributes shared by every End User Device Monitoring device record. + */ +@JsonPropertyOrder({ + DeviceBaseDataAttributes.JSON_PROPERTY_AGENT_KEY, + DeviceBaseDataAttributes.JSON_PROPERTY_AGENT_VERSION, + DeviceBaseDataAttributes.JSON_PROPERTY_BATTERY_MAX_CAPACITY_PCT, + DeviceBaseDataAttributes.JSON_PROPERTY_CPU_CORES, + DeviceBaseDataAttributes.JSON_PROPERTY_CPU_LOGICAL_PROCESSORS, + DeviceBaseDataAttributes.JSON_PROPERTY_CPU_MODEL, + DeviceBaseDataAttributes.JSON_PROPERTY_CPU_USAGE, + DeviceBaseDataAttributes.JSON_PROPERTY_DISK_USAGE, + DeviceBaseDataAttributes.JSON_PROPERTY_IP_ADDRESS, + DeviceBaseDataAttributes.JSON_PROPERTY_ISSUES, + DeviceBaseDataAttributes.JSON_PROPERTY_KERNEL_NAME, + DeviceBaseDataAttributes.JSON_PROPERTY_LAST_SEEN, + DeviceBaseDataAttributes.JSON_PROPERTY_MANUFACTURER, + DeviceBaseDataAttributes.JSON_PROPERTY_MEM_USAGE, + DeviceBaseDataAttributes.JSON_PROPERTY_MEMORY_TOTAL_KB, + DeviceBaseDataAttributes.JSON_PROPERTY_MODEL_NAME, + DeviceBaseDataAttributes.JSON_PROPERTY_MODEL_NUMBER, + DeviceBaseDataAttributes.JSON_PROPERTY_OS, + DeviceBaseDataAttributes.JSON_PROPERTY_OS_VERSION, + DeviceBaseDataAttributes.JSON_PROPERTY_RESOURCE_ID, + DeviceBaseDataAttributes.JSON_PROPERTY_SERIAL_NUMBER, + DeviceBaseDataAttributes.JSON_PROPERTY_STATUS, + DeviceBaseDataAttributes.JSON_PROPERTY_TYPE, + DeviceBaseDataAttributes.JSON_PROPERTY_UPTIME, + DeviceBaseDataAttributes.JSON_PROPERTY_WLAN_BSSID, + DeviceBaseDataAttributes.JSON_PROPERTY_WLAN_RSSI, + DeviceBaseDataAttributes.JSON_PROPERTY_WLAN_SSID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceBaseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGENT_KEY = "agent_key"; + private String agentKey; + + public static final String JSON_PROPERTY_AGENT_VERSION = "agent_version"; + private String agentVersion; + + public static final String JSON_PROPERTY_BATTERY_MAX_CAPACITY_PCT = "battery_max_capacity_pct"; + private Long batteryMaxCapacityPct; + + public static final String JSON_PROPERTY_CPU_CORES = "cpu_cores"; + private Long cpuCores; + + public static final String JSON_PROPERTY_CPU_LOGICAL_PROCESSORS = "cpu_logical_processors"; + private Long cpuLogicalProcessors; + + public static final String JSON_PROPERTY_CPU_MODEL = "cpu_model"; + private String cpuModel; + + public static final String JSON_PROPERTY_CPU_USAGE = "cpu_usage"; + private Double cpuUsage; + + public static final String JSON_PROPERTY_DISK_USAGE = "disk_usage"; + private Double diskUsage; + + public static final String JSON_PROPERTY_IP_ADDRESS = "ip_address"; + private String ipAddress; + + public static final String JSON_PROPERTY_ISSUES = "issues"; + private List issues = null; + + public static final String JSON_PROPERTY_KERNEL_NAME = "kernel_name"; + private String kernelName; + + public static final String JSON_PROPERTY_LAST_SEEN = "last_seen"; + private String lastSeen; + + public static final String JSON_PROPERTY_MANUFACTURER = "manufacturer"; + private String manufacturer; + + public static final String JSON_PROPERTY_MEM_USAGE = "mem_usage"; + private Double memUsage; + + public static final String JSON_PROPERTY_MEMORY_TOTAL_KB = "memory_total_kb"; + private Long memoryTotalKb; + + public static final String JSON_PROPERTY_MODEL_NAME = "model_name"; + private String modelName; + + public static final String JSON_PROPERTY_MODEL_NUMBER = "model_number"; + private String modelNumber; + + public static final String JSON_PROPERTY_OS = "os"; + private String os; + + public static final String JSON_PROPERTY_OS_VERSION = "os_version"; + private String osVersion; + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_SERIAL_NUMBER = "serial_number"; + private String serialNumber; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_UPTIME = "uptime"; + private Double uptime; + + public static final String JSON_PROPERTY_WLAN_BSSID = "wlan_bssid"; + private String wlanBssid; + + public static final String JSON_PROPERTY_WLAN_RSSI = "wlan_rssi"; + private Double wlanRssi; + + public static final String JSON_PROPERTY_WLAN_SSID = "wlan_ssid"; + private String wlanSsid; + + public DeviceBaseDataAttributes agentKey(String agentKey) { + this.agentKey = agentKey; + return this; + } + + /** + * Public key of the Datadog Agent installed on the device. + * + * @return agentKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGENT_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAgentKey() { + return agentKey; + } + + public void setAgentKey(String agentKey) { + this.agentKey = agentKey; + } + + public DeviceBaseDataAttributes agentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Version of the Datadog Agent installed on the device. + * + * @return agentVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGENT_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAgentVersion() { + return agentVersion; + } + + public void setAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + } + + public DeviceBaseDataAttributes batteryMaxCapacityPct(Long batteryMaxCapacityPct) { + this.batteryMaxCapacityPct = batteryMaxCapacityPct; + return this; + } + + /** + * Maximum battery capacity expressed as a percentage of the device's design capacity. + * + * @return batteryMaxCapacityPct + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATTERY_MAX_CAPACITY_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getBatteryMaxCapacityPct() { + return batteryMaxCapacityPct; + } + + public void setBatteryMaxCapacityPct(Long batteryMaxCapacityPct) { + this.batteryMaxCapacityPct = batteryMaxCapacityPct; + } + + public DeviceBaseDataAttributes cpuCores(Long cpuCores) { + this.cpuCores = cpuCores; + return this; + } + + /** + * Number of physical CPU cores on the device. + * + * @return cpuCores + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CPU_CORES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCpuCores() { + return cpuCores; + } + + public void setCpuCores(Long cpuCores) { + this.cpuCores = cpuCores; + } + + public DeviceBaseDataAttributes cpuLogicalProcessors(Long cpuLogicalProcessors) { + this.cpuLogicalProcessors = cpuLogicalProcessors; + return this; + } + + /** + * Number of logical CPU processors (hardware threads) on the device. + * + * @return cpuLogicalProcessors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CPU_LOGICAL_PROCESSORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCpuLogicalProcessors() { + return cpuLogicalProcessors; + } + + public void setCpuLogicalProcessors(Long cpuLogicalProcessors) { + this.cpuLogicalProcessors = cpuLogicalProcessors; + } + + public DeviceBaseDataAttributes cpuModel(String cpuModel) { + this.cpuModel = cpuModel; + return this; + } + + /** + * Human-readable name of the device's CPU model. + * + * @return cpuModel + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CPU_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCpuModel() { + return cpuModel; + } + + public void setCpuModel(String cpuModel) { + this.cpuModel = cpuModel; + } + + public DeviceBaseDataAttributes cpuUsage(Double cpuUsage) { + this.cpuUsage = cpuUsage; + return this; + } + + /** + * Average CPU usage on the device, as a percentage between 0 and 100. + * + * @return cpuUsage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CPU_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCpuUsage() { + return cpuUsage; + } + + public void setCpuUsage(Double cpuUsage) { + this.cpuUsage = cpuUsage; + } + + public DeviceBaseDataAttributes diskUsage(Double diskUsage) { + this.diskUsage = diskUsage; + return this; + } + + /** + * Average disk usage on the device, as a percentage between 0 and 100. + * + * @return diskUsage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISK_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDiskUsage() { + return diskUsage; + } + + public void setDiskUsage(Double diskUsage) { + this.diskUsage = diskUsage; + } + + public DeviceBaseDataAttributes ipAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Last observed IPv4 or IPv6 address of the device. + * + * @return ipAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIpAddress() { + return ipAddress; + } + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + public DeviceBaseDataAttributes issues(List issues) { + this.issues = issues; + return this; + } + + public DeviceBaseDataAttributes addIssuesItem(String issuesItem) { + if (this.issues == null) { + this.issues = new ArrayList<>(); + } + this.issues.add(issuesItem); + return this; + } + + /** + * List of issue identifiers currently affecting the device. References entries returned by the + * issues endpoint. + * + * @return issues + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIssues() { + return issues; + } + + public void setIssues(List issues) { + this.issues = issues; + } + + public DeviceBaseDataAttributes kernelName(String kernelName) { + this.kernelName = kernelName; + return this; + } + + /** + * Name of the operating system kernel running on the device. + * + * @return kernelName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KERNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKernelName() { + return kernelName; + } + + public void setKernelName(String kernelName) { + this.kernelName = kernelName; + } + + public DeviceBaseDataAttributes lastSeen(String lastSeen) { + this.lastSeen = lastSeen; + return this; + } + + /** + * Timestamp of the most recent telemetry received from the device, in RFC 3339 format. + * + * @return lastSeen + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_SEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastSeen() { + return lastSeen; + } + + public void setLastSeen(String lastSeen) { + this.lastSeen = lastSeen; + } + + public DeviceBaseDataAttributes manufacturer(String manufacturer) { + this.manufacturer = manufacturer; + return this; + } + + /** + * Manufacturer of the device. + * + * @return manufacturer + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MANUFACTURER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public DeviceBaseDataAttributes memUsage(Double memUsage) { + this.memUsage = memUsage; + return this; + } + + /** + * Average memory usage on the device, as a percentage between 0 and 100. + * + * @return memUsage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEM_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getMemUsage() { + return memUsage; + } + + public void setMemUsage(Double memUsage) { + this.memUsage = memUsage; + } + + public DeviceBaseDataAttributes memoryTotalKb(Long memoryTotalKb) { + this.memoryTotalKb = memoryTotalKb; + return this; + } + + /** + * Total amount of physical memory available on the device, in kilobytes. + * + * @return memoryTotalKb + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEMORY_TOTAL_KB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMemoryTotalKb() { + return memoryTotalKb; + } + + public void setMemoryTotalKb(Long memoryTotalKb) { + this.memoryTotalKb = memoryTotalKb; + } + + public DeviceBaseDataAttributes modelName(String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Marketing or product name of the device model. + * + * @return modelName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public DeviceBaseDataAttributes modelNumber(String modelNumber) { + this.modelNumber = modelNumber; + return this; + } + + /** + * Manufacturer-assigned model number of the device. + * + * @return modelNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelNumber() { + return modelNumber; + } + + public void setModelNumber(String modelNumber) { + this.modelNumber = modelNumber; + } + + public DeviceBaseDataAttributes os(String os) { + this.os = os; + return this; + } + + /** + * Operating system family running on the device (for example, mac, windows + * , or linux). + * + * @return os + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOs() { + return os; + } + + public void setOs(String os) { + this.os = os; + } + + public DeviceBaseDataAttributes osVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Operating system version running on the device. + * + * @return osVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + public DeviceBaseDataAttributes resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Datadog resource identifier for the device. + * + * @return resourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public DeviceBaseDataAttributes serialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Serial number assigned to the device by its manufacturer. + * + * @return serialNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public DeviceBaseDataAttributes status(String status) { + this.status = status; + return this; + } + + /** + * Health status of the device computed from its issues and recent telemetry. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public DeviceBaseDataAttributes type(String type) { + this.type = type; + return this; + } + + /** + * Hardware type of the device (for example, laptop, desktop, or + * mobile). + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public DeviceBaseDataAttributes uptime(Double uptime) { + this.uptime = uptime; + return this; + } + + /** + * Time elapsed since the device last booted, in seconds. + * + * @return uptime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPTIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUptime() { + return uptime; + } + + public void setUptime(Double uptime) { + this.uptime = uptime; + } + + public DeviceBaseDataAttributes wlanBssid(String wlanBssid) { + this.wlanBssid = wlanBssid; + return this; + } + + /** + * BSSID (MAC address of the access point) of the wireless network the device is currently + * connected to. + * + * @return wlanBssid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WLAN_BSSID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWlanBssid() { + return wlanBssid; + } + + public void setWlanBssid(String wlanBssid) { + this.wlanBssid = wlanBssid; + } + + public DeviceBaseDataAttributes wlanRssi(Double wlanRssi) { + this.wlanRssi = wlanRssi; + return this; + } + + /** + * Received signal strength indicator of the device's current wireless connection, in dBm. + * + * @return wlanRssi + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WLAN_RSSI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getWlanRssi() { + return wlanRssi; + } + + public void setWlanRssi(Double wlanRssi) { + this.wlanRssi = wlanRssi; + } + + public DeviceBaseDataAttributes wlanSsid(String wlanSsid) { + this.wlanSsid = wlanSsid; + return this; + } + + /** + * SSID of the wireless network the device is currently connected to. + * + * @return wlanSsid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WLAN_SSID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWlanSsid() { + return wlanSsid; + } + + public void setWlanSsid(String wlanSsid) { + this.wlanSsid = wlanSsid; + } + + /** + * 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 DeviceBaseDataAttributes + */ + @JsonAnySetter + public DeviceBaseDataAttributes 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 DeviceBaseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceBaseDataAttributes deviceBaseDataAttributes = (DeviceBaseDataAttributes) o; + return Objects.equals(this.agentKey, deviceBaseDataAttributes.agentKey) + && Objects.equals(this.agentVersion, deviceBaseDataAttributes.agentVersion) + && Objects.equals( + this.batteryMaxCapacityPct, deviceBaseDataAttributes.batteryMaxCapacityPct) + && Objects.equals(this.cpuCores, deviceBaseDataAttributes.cpuCores) + && Objects.equals(this.cpuLogicalProcessors, deviceBaseDataAttributes.cpuLogicalProcessors) + && Objects.equals(this.cpuModel, deviceBaseDataAttributes.cpuModel) + && Objects.equals(this.cpuUsage, deviceBaseDataAttributes.cpuUsage) + && Objects.equals(this.diskUsage, deviceBaseDataAttributes.diskUsage) + && Objects.equals(this.ipAddress, deviceBaseDataAttributes.ipAddress) + && Objects.equals(this.issues, deviceBaseDataAttributes.issues) + && Objects.equals(this.kernelName, deviceBaseDataAttributes.kernelName) + && Objects.equals(this.lastSeen, deviceBaseDataAttributes.lastSeen) + && Objects.equals(this.manufacturer, deviceBaseDataAttributes.manufacturer) + && Objects.equals(this.memUsage, deviceBaseDataAttributes.memUsage) + && Objects.equals(this.memoryTotalKb, deviceBaseDataAttributes.memoryTotalKb) + && Objects.equals(this.modelName, deviceBaseDataAttributes.modelName) + && Objects.equals(this.modelNumber, deviceBaseDataAttributes.modelNumber) + && Objects.equals(this.os, deviceBaseDataAttributes.os) + && Objects.equals(this.osVersion, deviceBaseDataAttributes.osVersion) + && Objects.equals(this.resourceId, deviceBaseDataAttributes.resourceId) + && Objects.equals(this.serialNumber, deviceBaseDataAttributes.serialNumber) + && Objects.equals(this.status, deviceBaseDataAttributes.status) + && Objects.equals(this.type, deviceBaseDataAttributes.type) + && Objects.equals(this.uptime, deviceBaseDataAttributes.uptime) + && Objects.equals(this.wlanBssid, deviceBaseDataAttributes.wlanBssid) + && Objects.equals(this.wlanRssi, deviceBaseDataAttributes.wlanRssi) + && Objects.equals(this.wlanSsid, deviceBaseDataAttributes.wlanSsid) + && Objects.equals(this.additionalProperties, deviceBaseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + agentKey, + agentVersion, + batteryMaxCapacityPct, + cpuCores, + cpuLogicalProcessors, + cpuModel, + cpuUsage, + diskUsage, + ipAddress, + issues, + kernelName, + lastSeen, + manufacturer, + memUsage, + memoryTotalKb, + modelName, + modelNumber, + os, + osVersion, + resourceId, + serialNumber, + status, + type, + uptime, + wlanBssid, + wlanRssi, + wlanSsid, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceBaseDataAttributes {\n"); + sb.append(" agentKey: ").append(toIndentedString(agentKey)).append("\n"); + sb.append(" agentVersion: ").append(toIndentedString(agentVersion)).append("\n"); + sb.append(" batteryMaxCapacityPct: ") + .append(toIndentedString(batteryMaxCapacityPct)) + .append("\n"); + sb.append(" cpuCores: ").append(toIndentedString(cpuCores)).append("\n"); + sb.append(" cpuLogicalProcessors: ") + .append(toIndentedString(cpuLogicalProcessors)) + .append("\n"); + sb.append(" cpuModel: ").append(toIndentedString(cpuModel)).append("\n"); + sb.append(" cpuUsage: ").append(toIndentedString(cpuUsage)).append("\n"); + sb.append(" diskUsage: ").append(toIndentedString(diskUsage)).append("\n"); + sb.append(" ipAddress: ").append(toIndentedString(ipAddress)).append("\n"); + sb.append(" issues: ").append(toIndentedString(issues)).append("\n"); + sb.append(" kernelName: ").append(toIndentedString(kernelName)).append("\n"); + sb.append(" lastSeen: ").append(toIndentedString(lastSeen)).append("\n"); + sb.append(" manufacturer: ").append(toIndentedString(manufacturer)).append("\n"); + sb.append(" memUsage: ").append(toIndentedString(memUsage)).append("\n"); + sb.append(" memoryTotalKb: ").append(toIndentedString(memoryTotalKb)).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + sb.append(" modelNumber: ").append(toIndentedString(modelNumber)).append("\n"); + sb.append(" os: ").append(toIndentedString(os)).append("\n"); + sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" uptime: ").append(toIndentedString(uptime)).append("\n"); + sb.append(" wlanBssid: ").append(toIndentedString(wlanBssid)).append("\n"); + sb.append(" wlanRssi: ").append(toIndentedString(wlanRssi)).append("\n"); + sb.append(" wlanSsid: ").append(toIndentedString(wlanSsid)).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/DeviceDetails.java b/src/main/java/com/datadog/api/client/v2/model/DeviceDetails.java new file mode 100644 index 00000000000..029ef205815 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceDetails.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Response body for the get device endpoint, returning a single device with full attribute detail. + */ +@JsonPropertyOrder({DeviceDetails.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceDetails { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeviceDetailsData data; + + public DeviceDetails data(DeviceDetailsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A single device entry with full attribute detail. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceDetailsData getData() { + return data; + } + + public void setData(DeviceDetailsData 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 DeviceDetails + */ + @JsonAnySetter + public DeviceDetails 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 DeviceDetails object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceDetails deviceDetails = (DeviceDetails) o; + return Objects.equals(this.data, deviceDetails.data) + && Objects.equals(this.additionalProperties, deviceDetails.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceDetails {\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/DeviceDetailsData.java b/src/main/java/com/datadog/api/client/v2/model/DeviceDetailsData.java new file mode 100644 index 00000000000..92fe0e1b57b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceDetailsData.java @@ -0,0 +1,207 @@ +/* + * 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 single device entry with full attribute detail. */ +@JsonPropertyOrder({ + DeviceDetailsData.JSON_PROPERTY_ATTRIBUTES, + DeviceDetailsData.JSON_PROPERTY_ID, + DeviceDetailsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceDetailsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeviceDetailsDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeviceDetailsDataType type = DeviceDetailsDataType.DEVICES; + + public DeviceDetailsData() {} + + @JsonCreator + public DeviceDetailsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeviceDetailsDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeviceDetailsData attributes(DeviceDetailsDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Extended set of attributes for a single End User Device Monitoring device, including detailed + * network and battery metrics. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceDetailsDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeviceDetailsDataAttributes attributes) { + this.attributes = attributes; + } + + public DeviceDetailsData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the device. Matches the Datadog host 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 DeviceDetailsData type(DeviceDetailsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Devices resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeviceDetailsDataType getType() { + return type; + } + + public void setType(DeviceDetailsDataType 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 DeviceDetailsData + */ + @JsonAnySetter + public DeviceDetailsData 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 DeviceDetailsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceDetailsData deviceDetailsData = (DeviceDetailsData) o; + return Objects.equals(this.attributes, deviceDetailsData.attributes) + && Objects.equals(this.id, deviceDetailsData.id) + && Objects.equals(this.type, deviceDetailsData.type) + && Objects.equals(this.additionalProperties, deviceDetailsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceDetailsData {\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/DeviceDetailsDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeviceDetailsDataAttributes.java new file mode 100644 index 00000000000..9e3448655fc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceDetailsDataAttributes.java @@ -0,0 +1,1144 @@ +/* + * 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; + +/** + * Extended set of attributes for a single End User Device Monitoring device, including detailed + * network and battery metrics. + */ +@JsonPropertyOrder({ + DeviceDetailsDataAttributes.JSON_PROPERTY_AGENT_KEY, + DeviceDetailsDataAttributes.JSON_PROPERTY_AGENT_VERSION, + DeviceDetailsDataAttributes.JSON_PROPERTY_BATTERY_CHARGE_PCT, + DeviceDetailsDataAttributes.JSON_PROPERTY_BATTERY_CHARGE_RATE, + DeviceDetailsDataAttributes.JSON_PROPERTY_BATTERY_CYCLE_COUNT, + DeviceDetailsDataAttributes.JSON_PROPERTY_BATTERY_MAX_CAPACITY_PCT, + DeviceDetailsDataAttributes.JSON_PROPERTY_CPU_CORES, + DeviceDetailsDataAttributes.JSON_PROPERTY_CPU_LOGICAL_PROCESSORS, + DeviceDetailsDataAttributes.JSON_PROPERTY_CPU_MODEL, + DeviceDetailsDataAttributes.JSON_PROPERTY_CPU_USAGE, + DeviceDetailsDataAttributes.JSON_PROPERTY_DISK_USAGE, + DeviceDetailsDataAttributes.JSON_PROPERTY_IP_ADDRESS, + DeviceDetailsDataAttributes.JSON_PROPERTY_ISSUES, + DeviceDetailsDataAttributes.JSON_PROPERTY_KERNEL_NAME, + DeviceDetailsDataAttributes.JSON_PROPERTY_LAST_SEEN, + DeviceDetailsDataAttributes.JSON_PROPERTY_MANUFACTURER, + DeviceDetailsDataAttributes.JSON_PROPERTY_MEM_USAGE, + DeviceDetailsDataAttributes.JSON_PROPERTY_MEMORY_TOTAL_KB, + DeviceDetailsDataAttributes.JSON_PROPERTY_MODEL_NAME, + DeviceDetailsDataAttributes.JSON_PROPERTY_MODEL_NUMBER, + DeviceDetailsDataAttributes.JSON_PROPERTY_OS, + DeviceDetailsDataAttributes.JSON_PROPERTY_OS_VERSION, + DeviceDetailsDataAttributes.JSON_PROPERTY_PACKETS_IN_DROP, + DeviceDetailsDataAttributes.JSON_PROPERTY_PACKETS_IN_ERROR, + DeviceDetailsDataAttributes.JSON_PROPERTY_PACKETS_OUT_DROP, + DeviceDetailsDataAttributes.JSON_PROPERTY_PACKETS_OUT_ERROR, + DeviceDetailsDataAttributes.JSON_PROPERTY_RESOURCE_ID, + DeviceDetailsDataAttributes.JSON_PROPERTY_SERIAL_NUMBER, + DeviceDetailsDataAttributes.JSON_PROPERTY_STATUS, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_OUT_SEGS, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_RETRANS_SEGS, + DeviceDetailsDataAttributes.JSON_PROPERTY_TYPE, + DeviceDetailsDataAttributes.JSON_PROPERTY_UPTIME, + DeviceDetailsDataAttributes.JSON_PROPERTY_WLAN_BSSID, + DeviceDetailsDataAttributes.JSON_PROPERTY_WLAN_RSSI, + DeviceDetailsDataAttributes.JSON_PROPERTY_WLAN_SSID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceDetailsDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGENT_KEY = "agent_key"; + private String agentKey; + + public static final String JSON_PROPERTY_AGENT_VERSION = "agent_version"; + private String agentVersion; + + public static final String JSON_PROPERTY_BATTERY_CHARGE_PCT = "battery_charge_pct"; + private Long batteryChargePct; + + public static final String JSON_PROPERTY_BATTERY_CHARGE_RATE = "battery_charge_rate"; + private Long batteryChargeRate; + + public static final String JSON_PROPERTY_BATTERY_CYCLE_COUNT = "battery_cycle_count"; + private Long batteryCycleCount; + + public static final String JSON_PROPERTY_BATTERY_MAX_CAPACITY_PCT = "battery_max_capacity_pct"; + private Long batteryMaxCapacityPct; + + public static final String JSON_PROPERTY_CPU_CORES = "cpu_cores"; + private Long cpuCores; + + public static final String JSON_PROPERTY_CPU_LOGICAL_PROCESSORS = "cpu_logical_processors"; + private Long cpuLogicalProcessors; + + public static final String JSON_PROPERTY_CPU_MODEL = "cpu_model"; + private String cpuModel; + + public static final String JSON_PROPERTY_CPU_USAGE = "cpu_usage"; + private Double cpuUsage; + + public static final String JSON_PROPERTY_DISK_USAGE = "disk_usage"; + private Double diskUsage; + + public static final String JSON_PROPERTY_IP_ADDRESS = "ip_address"; + private String ipAddress; + + public static final String JSON_PROPERTY_ISSUES = "issues"; + private List issues = null; + + public static final String JSON_PROPERTY_KERNEL_NAME = "kernel_name"; + private String kernelName; + + public static final String JSON_PROPERTY_LAST_SEEN = "last_seen"; + private String lastSeen; + + public static final String JSON_PROPERTY_MANUFACTURER = "manufacturer"; + private String manufacturer; + + public static final String JSON_PROPERTY_MEM_USAGE = "mem_usage"; + private Double memUsage; + + public static final String JSON_PROPERTY_MEMORY_TOTAL_KB = "memory_total_kb"; + private Long memoryTotalKb; + + public static final String JSON_PROPERTY_MODEL_NAME = "model_name"; + private String modelName; + + public static final String JSON_PROPERTY_MODEL_NUMBER = "model_number"; + private String modelNumber; + + public static final String JSON_PROPERTY_OS = "os"; + private String os; + + public static final String JSON_PROPERTY_OS_VERSION = "os_version"; + private String osVersion; + + public static final String JSON_PROPERTY_PACKETS_IN_DROP = "packets_in_drop"; + private Double packetsInDrop; + + public static final String JSON_PROPERTY_PACKETS_IN_ERROR = "packets_in_error"; + private Double packetsInError; + + public static final String JSON_PROPERTY_PACKETS_OUT_DROP = "packets_out_drop"; + private Double packetsOutDrop; + + public static final String JSON_PROPERTY_PACKETS_OUT_ERROR = "packets_out_error"; + private Double packetsOutError; + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_SERIAL_NUMBER = "serial_number"; + private String serialNumber; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TCP_OUT_SEGS = "tcp_out_segs"; + private Double tcpOutSegs; + + public static final String JSON_PROPERTY_TCP_RETRANS_SEGS = "tcp_retrans_segs"; + private Double tcpRetransSegs; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_UPTIME = "uptime"; + private Double uptime; + + public static final String JSON_PROPERTY_WLAN_BSSID = "wlan_bssid"; + private String wlanBssid; + + public static final String JSON_PROPERTY_WLAN_RSSI = "wlan_rssi"; + private Double wlanRssi; + + public static final String JSON_PROPERTY_WLAN_SSID = "wlan_ssid"; + private String wlanSsid; + + public DeviceDetailsDataAttributes agentKey(String agentKey) { + this.agentKey = agentKey; + return this; + } + + /** + * Public key of the Datadog Agent installed on the device. + * + * @return agentKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGENT_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAgentKey() { + return agentKey; + } + + public void setAgentKey(String agentKey) { + this.agentKey = agentKey; + } + + public DeviceDetailsDataAttributes agentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Version of the Datadog Agent installed on the device. + * + * @return agentVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGENT_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAgentVersion() { + return agentVersion; + } + + public void setAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + } + + public DeviceDetailsDataAttributes batteryChargePct(Long batteryChargePct) { + this.batteryChargePct = batteryChargePct; + return this; + } + + /** + * Current battery charge level as a percentage between 0 and 100. + * + * @return batteryChargePct + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATTERY_CHARGE_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getBatteryChargePct() { + return batteryChargePct; + } + + public void setBatteryChargePct(Long batteryChargePct) { + this.batteryChargePct = batteryChargePct; + } + + public DeviceDetailsDataAttributes batteryChargeRate(Long batteryChargeRate) { + this.batteryChargeRate = batteryChargeRate; + return this; + } + + /** + * Rate at which the battery is charging or discharging, in milliamperes. Negative values indicate + * discharge. + * + * @return batteryChargeRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATTERY_CHARGE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getBatteryChargeRate() { + return batteryChargeRate; + } + + public void setBatteryChargeRate(Long batteryChargeRate) { + this.batteryChargeRate = batteryChargeRate; + } + + public DeviceDetailsDataAttributes batteryCycleCount(Long batteryCycleCount) { + this.batteryCycleCount = batteryCycleCount; + return this; + } + + /** + * Number of full charge cycles the battery has gone through. + * + * @return batteryCycleCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATTERY_CYCLE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getBatteryCycleCount() { + return batteryCycleCount; + } + + public void setBatteryCycleCount(Long batteryCycleCount) { + this.batteryCycleCount = batteryCycleCount; + } + + public DeviceDetailsDataAttributes batteryMaxCapacityPct(Long batteryMaxCapacityPct) { + this.batteryMaxCapacityPct = batteryMaxCapacityPct; + return this; + } + + /** + * Maximum battery capacity expressed as a percentage of the device's design capacity. + * + * @return batteryMaxCapacityPct + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATTERY_MAX_CAPACITY_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getBatteryMaxCapacityPct() { + return batteryMaxCapacityPct; + } + + public void setBatteryMaxCapacityPct(Long batteryMaxCapacityPct) { + this.batteryMaxCapacityPct = batteryMaxCapacityPct; + } + + public DeviceDetailsDataAttributes cpuCores(Long cpuCores) { + this.cpuCores = cpuCores; + return this; + } + + /** + * Number of physical CPU cores on the device. + * + * @return cpuCores + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CPU_CORES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCpuCores() { + return cpuCores; + } + + public void setCpuCores(Long cpuCores) { + this.cpuCores = cpuCores; + } + + public DeviceDetailsDataAttributes cpuLogicalProcessors(Long cpuLogicalProcessors) { + this.cpuLogicalProcessors = cpuLogicalProcessors; + return this; + } + + /** + * Number of logical CPU processors (hardware threads) on the device. + * + * @return cpuLogicalProcessors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CPU_LOGICAL_PROCESSORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCpuLogicalProcessors() { + return cpuLogicalProcessors; + } + + public void setCpuLogicalProcessors(Long cpuLogicalProcessors) { + this.cpuLogicalProcessors = cpuLogicalProcessors; + } + + public DeviceDetailsDataAttributes cpuModel(String cpuModel) { + this.cpuModel = cpuModel; + return this; + } + + /** + * Human-readable name of the device's CPU model. + * + * @return cpuModel + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CPU_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCpuModel() { + return cpuModel; + } + + public void setCpuModel(String cpuModel) { + this.cpuModel = cpuModel; + } + + public DeviceDetailsDataAttributes cpuUsage(Double cpuUsage) { + this.cpuUsage = cpuUsage; + return this; + } + + /** + * Average CPU usage on the device, as a percentage between 0 and 100. + * + * @return cpuUsage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CPU_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCpuUsage() { + return cpuUsage; + } + + public void setCpuUsage(Double cpuUsage) { + this.cpuUsage = cpuUsage; + } + + public DeviceDetailsDataAttributes diskUsage(Double diskUsage) { + this.diskUsage = diskUsage; + return this; + } + + /** + * Average disk usage on the device, as a percentage between 0 and 100. + * + * @return diskUsage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISK_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDiskUsage() { + return diskUsage; + } + + public void setDiskUsage(Double diskUsage) { + this.diskUsage = diskUsage; + } + + public DeviceDetailsDataAttributes ipAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Last observed IPv4 or IPv6 address of the device. + * + * @return ipAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIpAddress() { + return ipAddress; + } + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + public DeviceDetailsDataAttributes issues(List issues) { + this.issues = issues; + return this; + } + + public DeviceDetailsDataAttributes addIssuesItem(String issuesItem) { + if (this.issues == null) { + this.issues = new ArrayList<>(); + } + this.issues.add(issuesItem); + return this; + } + + /** + * List of issue identifiers currently affecting the device. References entries returned by the + * issues endpoint. + * + * @return issues + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIssues() { + return issues; + } + + public void setIssues(List issues) { + this.issues = issues; + } + + public DeviceDetailsDataAttributes kernelName(String kernelName) { + this.kernelName = kernelName; + return this; + } + + /** + * Name of the operating system kernel running on the device. + * + * @return kernelName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KERNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKernelName() { + return kernelName; + } + + public void setKernelName(String kernelName) { + this.kernelName = kernelName; + } + + public DeviceDetailsDataAttributes lastSeen(String lastSeen) { + this.lastSeen = lastSeen; + return this; + } + + /** + * Timestamp of the most recent telemetry received from the device, in RFC 3339 format. + * + * @return lastSeen + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_SEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastSeen() { + return lastSeen; + } + + public void setLastSeen(String lastSeen) { + this.lastSeen = lastSeen; + } + + public DeviceDetailsDataAttributes manufacturer(String manufacturer) { + this.manufacturer = manufacturer; + return this; + } + + /** + * Manufacturer of the device. + * + * @return manufacturer + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MANUFACTURER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public DeviceDetailsDataAttributes memUsage(Double memUsage) { + this.memUsage = memUsage; + return this; + } + + /** + * Average memory usage on the device, as a percentage between 0 and 100. + * + * @return memUsage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEM_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getMemUsage() { + return memUsage; + } + + public void setMemUsage(Double memUsage) { + this.memUsage = memUsage; + } + + public DeviceDetailsDataAttributes memoryTotalKb(Long memoryTotalKb) { + this.memoryTotalKb = memoryTotalKb; + return this; + } + + /** + * Total amount of physical memory available on the device, in kilobytes. + * + * @return memoryTotalKb + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEMORY_TOTAL_KB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMemoryTotalKb() { + return memoryTotalKb; + } + + public void setMemoryTotalKb(Long memoryTotalKb) { + this.memoryTotalKb = memoryTotalKb; + } + + public DeviceDetailsDataAttributes modelName(String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Marketing or product name of the device model. + * + * @return modelName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public DeviceDetailsDataAttributes modelNumber(String modelNumber) { + this.modelNumber = modelNumber; + return this; + } + + /** + * Manufacturer-assigned model number of the device. + * + * @return modelNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODEL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModelNumber() { + return modelNumber; + } + + public void setModelNumber(String modelNumber) { + this.modelNumber = modelNumber; + } + + public DeviceDetailsDataAttributes os(String os) { + this.os = os; + return this; + } + + /** + * Operating system family running on the device (for example, mac, windows + * , or linux). + * + * @return os + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOs() { + return os; + } + + public void setOs(String os) { + this.os = os; + } + + public DeviceDetailsDataAttributes osVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Operating system version running on the device. + * + * @return osVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + public DeviceDetailsDataAttributes packetsInDrop(Double packetsInDrop) { + this.packetsInDrop = packetsInDrop; + return this; + } + + /** + * Average rate of dropped inbound network packets, in packets per second. + * + * @return packetsInDrop + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKETS_IN_DROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPacketsInDrop() { + return packetsInDrop; + } + + public void setPacketsInDrop(Double packetsInDrop) { + this.packetsInDrop = packetsInDrop; + } + + public DeviceDetailsDataAttributes packetsInError(Double packetsInError) { + this.packetsInError = packetsInError; + return this; + } + + /** + * Average rate of inbound network packets received with errors, in packets per second. + * + * @return packetsInError + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKETS_IN_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPacketsInError() { + return packetsInError; + } + + public void setPacketsInError(Double packetsInError) { + this.packetsInError = packetsInError; + } + + public DeviceDetailsDataAttributes packetsOutDrop(Double packetsOutDrop) { + this.packetsOutDrop = packetsOutDrop; + return this; + } + + /** + * Average rate of dropped outbound network packets, in packets per second. + * + * @return packetsOutDrop + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKETS_OUT_DROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPacketsOutDrop() { + return packetsOutDrop; + } + + public void setPacketsOutDrop(Double packetsOutDrop) { + this.packetsOutDrop = packetsOutDrop; + } + + public DeviceDetailsDataAttributes packetsOutError(Double packetsOutError) { + this.packetsOutError = packetsOutError; + return this; + } + + /** + * Average rate of outbound network packets sent with errors, in packets per second. + * + * @return packetsOutError + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKETS_OUT_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPacketsOutError() { + return packetsOutError; + } + + public void setPacketsOutError(Double packetsOutError) { + this.packetsOutError = packetsOutError; + } + + public DeviceDetailsDataAttributes resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Datadog resource identifier for the device. + * + * @return resourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public DeviceDetailsDataAttributes serialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Serial number assigned to the device by its manufacturer. + * + * @return serialNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public DeviceDetailsDataAttributes status(String status) { + this.status = status; + return this; + } + + /** + * Health status of the device computed from its issues and recent telemetry. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public DeviceDetailsDataAttributes tcpOutSegs(Double tcpOutSegs) { + this.tcpOutSegs = tcpOutSegs; + return this; + } + + /** + * Average rate of TCP segments sent by the device, in segments per second. + * + * @return tcpOutSegs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_OUT_SEGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpOutSegs() { + return tcpOutSegs; + } + + public void setTcpOutSegs(Double tcpOutSegs) { + this.tcpOutSegs = tcpOutSegs; + } + + public DeviceDetailsDataAttributes tcpRetransSegs(Double tcpRetransSegs) { + this.tcpRetransSegs = tcpRetransSegs; + return this; + } + + /** + * Average rate of TCP segments retransmitted by the device, in segments per second. + * + * @return tcpRetransSegs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_RETRANS_SEGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpRetransSegs() { + return tcpRetransSegs; + } + + public void setTcpRetransSegs(Double tcpRetransSegs) { + this.tcpRetransSegs = tcpRetransSegs; + } + + public DeviceDetailsDataAttributes type(String type) { + this.type = type; + return this; + } + + /** + * Hardware type of the device (for example, laptop, desktop, or + * mobile). + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public DeviceDetailsDataAttributes uptime(Double uptime) { + this.uptime = uptime; + return this; + } + + /** + * Time elapsed since the device last booted, in seconds. + * + * @return uptime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPTIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUptime() { + return uptime; + } + + public void setUptime(Double uptime) { + this.uptime = uptime; + } + + public DeviceDetailsDataAttributes wlanBssid(String wlanBssid) { + this.wlanBssid = wlanBssid; + return this; + } + + /** + * BSSID (MAC address of the access point) of the wireless network the device is currently + * connected to. + * + * @return wlanBssid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WLAN_BSSID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWlanBssid() { + return wlanBssid; + } + + public void setWlanBssid(String wlanBssid) { + this.wlanBssid = wlanBssid; + } + + public DeviceDetailsDataAttributes wlanRssi(Double wlanRssi) { + this.wlanRssi = wlanRssi; + return this; + } + + /** + * Received signal strength indicator of the device's current wireless connection, in dBm. + * + * @return wlanRssi + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WLAN_RSSI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getWlanRssi() { + return wlanRssi; + } + + public void setWlanRssi(Double wlanRssi) { + this.wlanRssi = wlanRssi; + } + + public DeviceDetailsDataAttributes wlanSsid(String wlanSsid) { + this.wlanSsid = wlanSsid; + return this; + } + + /** + * SSID of the wireless network the device is currently connected to. + * + * @return wlanSsid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WLAN_SSID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWlanSsid() { + return wlanSsid; + } + + public void setWlanSsid(String wlanSsid) { + this.wlanSsid = wlanSsid; + } + + /** + * 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 DeviceDetailsDataAttributes + */ + @JsonAnySetter + public DeviceDetailsDataAttributes 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 DeviceDetailsDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceDetailsDataAttributes deviceDetailsDataAttributes = (DeviceDetailsDataAttributes) o; + return Objects.equals(this.agentKey, deviceDetailsDataAttributes.agentKey) + && Objects.equals(this.agentVersion, deviceDetailsDataAttributes.agentVersion) + && Objects.equals(this.batteryChargePct, deviceDetailsDataAttributes.batteryChargePct) + && Objects.equals(this.batteryChargeRate, deviceDetailsDataAttributes.batteryChargeRate) + && Objects.equals(this.batteryCycleCount, deviceDetailsDataAttributes.batteryCycleCount) + && Objects.equals( + this.batteryMaxCapacityPct, deviceDetailsDataAttributes.batteryMaxCapacityPct) + && Objects.equals(this.cpuCores, deviceDetailsDataAttributes.cpuCores) + && Objects.equals( + this.cpuLogicalProcessors, deviceDetailsDataAttributes.cpuLogicalProcessors) + && Objects.equals(this.cpuModel, deviceDetailsDataAttributes.cpuModel) + && Objects.equals(this.cpuUsage, deviceDetailsDataAttributes.cpuUsage) + && Objects.equals(this.diskUsage, deviceDetailsDataAttributes.diskUsage) + && Objects.equals(this.ipAddress, deviceDetailsDataAttributes.ipAddress) + && Objects.equals(this.issues, deviceDetailsDataAttributes.issues) + && Objects.equals(this.kernelName, deviceDetailsDataAttributes.kernelName) + && Objects.equals(this.lastSeen, deviceDetailsDataAttributes.lastSeen) + && Objects.equals(this.manufacturer, deviceDetailsDataAttributes.manufacturer) + && Objects.equals(this.memUsage, deviceDetailsDataAttributes.memUsage) + && Objects.equals(this.memoryTotalKb, deviceDetailsDataAttributes.memoryTotalKb) + && Objects.equals(this.modelName, deviceDetailsDataAttributes.modelName) + && Objects.equals(this.modelNumber, deviceDetailsDataAttributes.modelNumber) + && Objects.equals(this.os, deviceDetailsDataAttributes.os) + && Objects.equals(this.osVersion, deviceDetailsDataAttributes.osVersion) + && Objects.equals(this.packetsInDrop, deviceDetailsDataAttributes.packetsInDrop) + && Objects.equals(this.packetsInError, deviceDetailsDataAttributes.packetsInError) + && Objects.equals(this.packetsOutDrop, deviceDetailsDataAttributes.packetsOutDrop) + && Objects.equals(this.packetsOutError, deviceDetailsDataAttributes.packetsOutError) + && Objects.equals(this.resourceId, deviceDetailsDataAttributes.resourceId) + && Objects.equals(this.serialNumber, deviceDetailsDataAttributes.serialNumber) + && Objects.equals(this.status, deviceDetailsDataAttributes.status) + && Objects.equals(this.tcpOutSegs, deviceDetailsDataAttributes.tcpOutSegs) + && Objects.equals(this.tcpRetransSegs, deviceDetailsDataAttributes.tcpRetransSegs) + && Objects.equals(this.type, deviceDetailsDataAttributes.type) + && Objects.equals(this.uptime, deviceDetailsDataAttributes.uptime) + && Objects.equals(this.wlanBssid, deviceDetailsDataAttributes.wlanBssid) + && Objects.equals(this.wlanRssi, deviceDetailsDataAttributes.wlanRssi) + && Objects.equals(this.wlanSsid, deviceDetailsDataAttributes.wlanSsid) + && Objects.equals( + this.additionalProperties, deviceDetailsDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + agentKey, + agentVersion, + batteryChargePct, + batteryChargeRate, + batteryCycleCount, + batteryMaxCapacityPct, + cpuCores, + cpuLogicalProcessors, + cpuModel, + cpuUsage, + diskUsage, + ipAddress, + issues, + kernelName, + lastSeen, + manufacturer, + memUsage, + memoryTotalKb, + modelName, + modelNumber, + os, + osVersion, + packetsInDrop, + packetsInError, + packetsOutDrop, + packetsOutError, + resourceId, + serialNumber, + status, + tcpOutSegs, + tcpRetransSegs, + type, + uptime, + wlanBssid, + wlanRssi, + wlanSsid, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceDetailsDataAttributes {\n"); + sb.append(" agentKey: ").append(toIndentedString(agentKey)).append("\n"); + sb.append(" agentVersion: ").append(toIndentedString(agentVersion)).append("\n"); + sb.append(" batteryChargePct: ").append(toIndentedString(batteryChargePct)).append("\n"); + sb.append(" batteryChargeRate: ").append(toIndentedString(batteryChargeRate)).append("\n"); + sb.append(" batteryCycleCount: ").append(toIndentedString(batteryCycleCount)).append("\n"); + sb.append(" batteryMaxCapacityPct: ") + .append(toIndentedString(batteryMaxCapacityPct)) + .append("\n"); + sb.append(" cpuCores: ").append(toIndentedString(cpuCores)).append("\n"); + sb.append(" cpuLogicalProcessors: ") + .append(toIndentedString(cpuLogicalProcessors)) + .append("\n"); + sb.append(" cpuModel: ").append(toIndentedString(cpuModel)).append("\n"); + sb.append(" cpuUsage: ").append(toIndentedString(cpuUsage)).append("\n"); + sb.append(" diskUsage: ").append(toIndentedString(diskUsage)).append("\n"); + sb.append(" ipAddress: ").append(toIndentedString(ipAddress)).append("\n"); + sb.append(" issues: ").append(toIndentedString(issues)).append("\n"); + sb.append(" kernelName: ").append(toIndentedString(kernelName)).append("\n"); + sb.append(" lastSeen: ").append(toIndentedString(lastSeen)).append("\n"); + sb.append(" manufacturer: ").append(toIndentedString(manufacturer)).append("\n"); + sb.append(" memUsage: ").append(toIndentedString(memUsage)).append("\n"); + sb.append(" memoryTotalKb: ").append(toIndentedString(memoryTotalKb)).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + sb.append(" modelNumber: ").append(toIndentedString(modelNumber)).append("\n"); + sb.append(" os: ").append(toIndentedString(os)).append("\n"); + sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); + sb.append(" packetsInDrop: ").append(toIndentedString(packetsInDrop)).append("\n"); + sb.append(" packetsInError: ").append(toIndentedString(packetsInError)).append("\n"); + sb.append(" packetsOutDrop: ").append(toIndentedString(packetsOutDrop)).append("\n"); + sb.append(" packetsOutError: ").append(toIndentedString(packetsOutError)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tcpOutSegs: ").append(toIndentedString(tcpOutSegs)).append("\n"); + sb.append(" tcpRetransSegs: ").append(toIndentedString(tcpRetransSegs)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" uptime: ").append(toIndentedString(uptime)).append("\n"); + sb.append(" wlanBssid: ").append(toIndentedString(wlanBssid)).append("\n"); + sb.append(" wlanRssi: ").append(toIndentedString(wlanRssi)).append("\n"); + sb.append(" wlanSsid: ").append(toIndentedString(wlanSsid)).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/DeviceDetailsDataType.java b/src/main/java/com/datadog/api/client/v2/model/DeviceDetailsDataType.java new file mode 100644 index 00000000000..1e464e804a0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceDetailsDataType.java @@ -0,0 +1,54 @@ +/* + * 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; + +/** Devices resource type. */ +@JsonSerialize(using = DeviceDetailsDataType.DeviceDetailsDataTypeSerializer.class) +public class DeviceDetailsDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("devices")); + + public static final DeviceDetailsDataType DEVICES = new DeviceDetailsDataType("devices"); + + DeviceDetailsDataType(String value) { + super(value, allowedValues); + } + + public static class DeviceDetailsDataTypeSerializer extends StdSerializer { + public DeviceDetailsDataTypeSerializer(Class t) { + super(t); + } + + public DeviceDetailsDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeviceDetailsDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeviceDetailsDataType fromValue(String value) { + return new DeviceDetailsDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GraphItemArray.java b/src/main/java/com/datadog/api/client/v2/model/GraphItemArray.java new file mode 100644 index 00000000000..978429664cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GraphItemArray.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response body for the graph endpoint, returning per-grouping device counts. */ +@JsonPropertyOrder({GraphItemArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GraphItemArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public GraphItemArray() {} + + @JsonCreator + public GraphItemArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public GraphItemArray data(List data) { + this.data = data; + for (GraphItemData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GraphItemArray addDataItem(GraphItemData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of grouping entries with their associated device counts. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GraphItemArray + */ + @JsonAnySetter + public GraphItemArray 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 GraphItemArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GraphItemArray graphItemArray = (GraphItemArray) o; + return Objects.equals(this.data, graphItemArray.data) + && Objects.equals(this.additionalProperties, graphItemArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GraphItemArray {\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/GraphItemData.java b/src/main/java/com/datadog/api/client/v2/model/GraphItemData.java new file mode 100644 index 00000000000..c020b3854d3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GraphItemData.java @@ -0,0 +1,206 @@ +/* + * 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 single grouping entry in the End User Device Monitoring graph response. */ +@JsonPropertyOrder({ + GraphItemData.JSON_PROPERTY_ATTRIBUTES, + GraphItemData.JSON_PROPERTY_ID, + GraphItemData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GraphItemData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GraphItemDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GraphItemDataType type = GraphItemDataType.GRAPH_ITEMS; + + public GraphItemData() {} + + @JsonCreator + public GraphItemData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) GraphItemDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GraphItemData attributes(GraphItemDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a single grouping in the End User Device Monitoring graph response. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GraphItemDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GraphItemDataAttributes attributes) { + this.attributes = attributes; + } + + public GraphItemData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the grouping, derived from the grouping column. + * + * @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 GraphItemData type(GraphItemDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Graph items resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GraphItemDataType getType() { + return type; + } + + public void setType(GraphItemDataType 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 GraphItemData + */ + @JsonAnySetter + public GraphItemData 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 GraphItemData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GraphItemData graphItemData = (GraphItemData) o; + return Objects.equals(this.attributes, graphItemData.attributes) + && Objects.equals(this.id, graphItemData.id) + && Objects.equals(this.type, graphItemData.type) + && Objects.equals(this.additionalProperties, graphItemData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GraphItemData {\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/GraphItemDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GraphItemDataAttributes.java new file mode 100644 index 00000000000..1d1bdaf901a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GraphItemDataAttributes.java @@ -0,0 +1,178 @@ +/* + * 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; + +/** Attributes of a single grouping in the End User Device Monitoring graph response. */ +@JsonPropertyOrder({ + GraphItemDataAttributes.JSON_PROPERTY_COUNTS, + GraphItemDataAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GraphItemDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNTS = "counts"; + private List counts = null; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public GraphItemDataAttributes counts(List counts) { + this.counts = counts; + for (GraphItemDataAttributesCountsItems item : counts) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GraphItemDataAttributes addCountsItem(GraphItemDataAttributesCountsItems countsItem) { + if (this.counts == null) { + this.counts = new ArrayList<>(); + } + this.counts.add(countsItem); + this.unparsed |= countsItem.unparsed; + return this; + } + + /** + * List of per-value counts for the grouping column. + * + * @return counts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCounts() { + return counts; + } + + public void setCounts(List counts) { + this.counts = counts; + } + + public GraphItemDataAttributes type(String type) { + this.type = type; + return this; + } + + /** + * Identifier of the grouping column (for example, os or type). + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 GraphItemDataAttributes + */ + @JsonAnySetter + public GraphItemDataAttributes 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 GraphItemDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GraphItemDataAttributes graphItemDataAttributes = (GraphItemDataAttributes) o; + return Objects.equals(this.counts, graphItemDataAttributes.counts) + && Objects.equals(this.type, graphItemDataAttributes.type) + && Objects.equals(this.additionalProperties, graphItemDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(counts, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GraphItemDataAttributes {\n"); + sb.append(" counts: ").append(toIndentedString(counts)).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/GraphItemDataAttributesCountsItems.java b/src/main/java/com/datadog/api/client/v2/model/GraphItemDataAttributesCountsItems.java new file mode 100644 index 00000000000..8a379f010a0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GraphItemDataAttributesCountsItems.java @@ -0,0 +1,170 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Count of devices for a single value of the grouping column in the End User Device Monitoring + * graph. + */ +@JsonPropertyOrder({ + GraphItemDataAttributesCountsItems.JSON_PROPERTY_COLUMN_NAME, + GraphItemDataAttributesCountsItems.JSON_PROPERTY_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GraphItemDataAttributesCountsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMN_NAME = "columnName"; + private String columnName; + + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public GraphItemDataAttributesCountsItems columnName(String columnName) { + this.columnName = columnName; + return this; + } + + /** + * Value of the grouping column for this bucket (for example, an operating system name or a device + * type). + * + * @return columnName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColumnName() { + return columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public GraphItemDataAttributesCountsItems count(Long count) { + this.count = count; + return this; + } + + /** + * Number of devices that fall into this bucket. + * + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + /** + * 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 GraphItemDataAttributesCountsItems + */ + @JsonAnySetter + public GraphItemDataAttributesCountsItems 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 GraphItemDataAttributesCountsItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GraphItemDataAttributesCountsItems graphItemDataAttributesCountsItems = + (GraphItemDataAttributesCountsItems) o; + return Objects.equals(this.columnName, graphItemDataAttributesCountsItems.columnName) + && Objects.equals(this.count, graphItemDataAttributesCountsItems.count) + && Objects.equals( + this.additionalProperties, graphItemDataAttributesCountsItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columnName, count, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GraphItemDataAttributesCountsItems {\n"); + sb.append(" columnName: ").append(toIndentedString(columnName)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).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/GraphItemDataType.java b/src/main/java/com/datadog/api/client/v2/model/GraphItemDataType.java new file mode 100644 index 00000000000..edeaed7650f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GraphItemDataType.java @@ -0,0 +1,54 @@ +/* + * 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; + +/** Graph items resource type. */ +@JsonSerialize(using = GraphItemDataType.GraphItemDataTypeSerializer.class) +public class GraphItemDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("graph_items")); + + public static final GraphItemDataType GRAPH_ITEMS = new GraphItemDataType("graph_items"); + + GraphItemDataType(String value) { + super(value, allowedValues); + } + + public static class GraphItemDataTypeSerializer extends StdSerializer { + public GraphItemDataTypeSerializer(Class t) { + super(t); + } + + public GraphItemDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(GraphItemDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GraphItemDataType fromValue(String value) { + return new GraphItemDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionArray.java b/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionArray.java new file mode 100644 index 00000000000..81347c9b18f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionArray.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response body for the issues endpoint, returning all available device issue definitions. */ +@JsonPropertyOrder({IssueDefinitionArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueDefinitionArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public IssueDefinitionArray() {} + + @JsonCreator + public IssueDefinitionArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public IssueDefinitionArray data(List data) { + this.data = data; + for (IssueDefinitionData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IssueDefinitionArray addDataItem(IssueDefinitionData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of available issue definitions. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueDefinitionArray + */ + @JsonAnySetter + public IssueDefinitionArray 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 IssueDefinitionArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueDefinitionArray issueDefinitionArray = (IssueDefinitionArray) o; + return Objects.equals(this.data, issueDefinitionArray.data) + && Objects.equals(this.additionalProperties, issueDefinitionArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueDefinitionArray {\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/IssueDefinitionData.java b/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionData.java new file mode 100644 index 00000000000..c6d4ab076e4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionData.java @@ -0,0 +1,207 @@ +/* + * 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 single issue definition entry returned by the issues endpoint. */ +@JsonPropertyOrder({ + IssueDefinitionData.JSON_PROPERTY_ATTRIBUTES, + IssueDefinitionData.JSON_PROPERTY_ID, + IssueDefinitionData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueDefinitionData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IssueDefinitionDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueDefinitionDataType type = IssueDefinitionDataType.ISSUE_DEFINITIONS; + + public IssueDefinitionData() {} + + @JsonCreator + public IssueDefinitionData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueDefinitionDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueDefinitionData attributes(IssueDefinitionDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a single End User Device Monitoring issue definition. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueDefinitionDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IssueDefinitionDataAttributes attributes) { + this.attributes = attributes; + } + + public IssueDefinitionData id(String id) { + this.id = id; + return this; + } + + /** + * Stable identifier of the issue definition, used in the issues field of a device + * record. + * + * @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 IssueDefinitionData type(IssueDefinitionDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Issue definitions resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueDefinitionDataType getType() { + return type; + } + + public void setType(IssueDefinitionDataType 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 IssueDefinitionData + */ + @JsonAnySetter + public IssueDefinitionData 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 IssueDefinitionData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueDefinitionData issueDefinitionData = (IssueDefinitionData) o; + return Objects.equals(this.attributes, issueDefinitionData.attributes) + && Objects.equals(this.id, issueDefinitionData.id) + && Objects.equals(this.type, issueDefinitionData.type) + && Objects.equals(this.additionalProperties, issueDefinitionData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueDefinitionData {\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/IssueDefinitionDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionDataAttributes.java new file mode 100644 index 00000000000..a1aa698f5ac --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionDataAttributes.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a single End User Device Monitoring issue definition. */ +@JsonPropertyOrder({ + IssueDefinitionDataAttributes.JSON_PROPERTY_CATEGORY, + IssueDefinitionDataAttributes.JSON_PROPERTY_LABEL, + IssueDefinitionDataAttributes.JSON_PROPERTY_LEVEL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueDefinitionDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_LEVEL = "level"; + private String level; + + public IssueDefinitionDataAttributes() {} + + @JsonCreator + public IssueDefinitionDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) String category, + @JsonProperty(required = true, value = JSON_PROPERTY_LABEL) String label, + @JsonProperty(required = true, value = JSON_PROPERTY_LEVEL) String level) { + this.category = category; + this.label = label; + this.level = level; + } + + public IssueDefinitionDataAttributes category(String category) { + this.category = category; + return this; + } + + /** + * Category of the issue (for example, battery, network, or + * performance). + * + * @return category + */ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public IssueDefinitionDataAttributes label(String label) { + this.label = label; + return this; + } + + /** + * Human-readable label describing the issue, suitable for display in the Datadog UI. + * + * @return label + */ + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public IssueDefinitionDataAttributes level(String level) { + this.level = level; + return this; + } + + /** + * Severity level of the issue (for example, warning or critical). + * + * @return level + */ + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + /** + * 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 IssueDefinitionDataAttributes + */ + @JsonAnySetter + public IssueDefinitionDataAttributes 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 IssueDefinitionDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueDefinitionDataAttributes issueDefinitionDataAttributes = (IssueDefinitionDataAttributes) o; + return Objects.equals(this.category, issueDefinitionDataAttributes.category) + && Objects.equals(this.label, issueDefinitionDataAttributes.label) + && Objects.equals(this.level, issueDefinitionDataAttributes.level) + && Objects.equals( + this.additionalProperties, issueDefinitionDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(category, label, level, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueDefinitionDataAttributes {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).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/IssueDefinitionDataType.java b/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionDataType.java new file mode 100644 index 00000000000..669a9f82963 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueDefinitionDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Issue definitions resource type. */ +@JsonSerialize(using = IssueDefinitionDataType.IssueDefinitionDataTypeSerializer.class) +public class IssueDefinitionDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("issue_definitions")); + + public static final IssueDefinitionDataType ISSUE_DEFINITIONS = + new IssueDefinitionDataType("issue_definitions"); + + IssueDefinitionDataType(String value) { + super(value, allowedValues); + } + + public static class IssueDefinitionDataTypeSerializer + extends StdSerializer { + public IssueDefinitionDataTypeSerializer(Class t) { + super(t); + } + + public IssueDefinitionDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IssueDefinitionDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueDefinitionDataType fromValue(String value) { + return new IssueDefinitionDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.java new file mode 100644 index 00000000000..f2c50db5d17 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.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; + +/** Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591. */ +@JsonPropertyOrder({ + OAuthClientRegistrationError.JSON_PROPERTY_ERROR, + OAuthClientRegistrationError.JSON_PROPERTY_ERROR_DESCRIPTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OAuthClientRegistrationError { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; + + public static final String JSON_PROPERTY_ERROR_DESCRIPTION = "error_description"; + private String errorDescription; + + public OAuthClientRegistrationError() {} + + @JsonCreator + public OAuthClientRegistrationError( + @JsonProperty(required = true, value = JSON_PROPERTY_ERROR) String error, + @JsonProperty(required = true, value = JSON_PROPERTY_ERROR_DESCRIPTION) + String errorDescription) { + this.error = error; + this.errorDescription = errorDescription; + } + + public OAuthClientRegistrationError error(String error) { + this.error = error; + return this; + } + + /** + * Single ASCII error code per RFC 7591, such as invalid_request or + * invalid_client_metadata. + * + * @return error + */ + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + + public OAuthClientRegistrationError errorDescription(String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + /** + * Human-readable description of the error. + * + * @return errorDescription + */ + @JsonProperty(JSON_PROPERTY_ERROR_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getErrorDescription() { + return errorDescription; + } + + public void setErrorDescription(String errorDescription) { + this.errorDescription = errorDescription; + } + + /** + * 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 OAuthClientRegistrationError + */ + @JsonAnySetter + public OAuthClientRegistrationError 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 OAuthClientRegistrationError object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRegistrationError oAuthClientRegistrationError = (OAuthClientRegistrationError) o; + return Objects.equals(this.error, oAuthClientRegistrationError.error) + && Objects.equals(this.errorDescription, oAuthClientRegistrationError.errorDescription) + && Objects.equals( + this.additionalProperties, oAuthClientRegistrationError.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(error, errorDescription, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRegistrationError {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" errorDescription: ").append(toIndentedString(errorDescription)).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/OAuthClientRegistrationGrantType.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationGrantType.java new file mode 100644 index 00000000000..2a29ed6a981 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationGrantType.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** OAuth 2.0 grant type that a registered client may use. */ +@JsonSerialize( + using = OAuthClientRegistrationGrantType.OAuthClientRegistrationGrantTypeSerializer.class) +public class OAuthClientRegistrationGrantType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("authorization_code", "refresh_token")); + + public static final OAuthClientRegistrationGrantType AUTHORIZATION_CODE = + new OAuthClientRegistrationGrantType("authorization_code"); + public static final OAuthClientRegistrationGrantType REFRESH_TOKEN = + new OAuthClientRegistrationGrantType("refresh_token"); + + OAuthClientRegistrationGrantType(String value) { + super(value, allowedValues); + } + + public static class OAuthClientRegistrationGrantTypeSerializer + extends StdSerializer { + public OAuthClientRegistrationGrantTypeSerializer(Class t) { + super(t); + } + + public OAuthClientRegistrationGrantTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OAuthClientRegistrationGrantType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OAuthClientRegistrationGrantType fromValue(String value) { + return new OAuthClientRegistrationGrantType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java new file mode 100644 index 00000000000..f3930a72c81 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java @@ -0,0 +1,465 @@ +/* + * 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; + +/** Request payload for OAuth2 dynamic client registration as defined by RFC 7591. */ +@JsonPropertyOrder({ + OAuthClientRegistrationRequest.JSON_PROPERTY_CLIENT_NAME, + OAuthClientRegistrationRequest.JSON_PROPERTY_CLIENT_URI, + OAuthClientRegistrationRequest.JSON_PROPERTY_GRANT_TYPES, + OAuthClientRegistrationRequest.JSON_PROPERTY_JWKS_URI, + OAuthClientRegistrationRequest.JSON_PROPERTY_LOGO_URI, + OAuthClientRegistrationRequest.JSON_PROPERTY_POLICY_URI, + OAuthClientRegistrationRequest.JSON_PROPERTY_REDIRECT_URIS, + OAuthClientRegistrationRequest.JSON_PROPERTY_RESPONSE_TYPES, + OAuthClientRegistrationRequest.JSON_PROPERTY_SCOPE, + OAuthClientRegistrationRequest.JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD, + OAuthClientRegistrationRequest.JSON_PROPERTY_TOS_URI +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OAuthClientRegistrationRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLIENT_NAME = "client_name"; + private String clientName; + + public static final String JSON_PROPERTY_CLIENT_URI = "client_uri"; + private String clientUri; + + public static final String JSON_PROPERTY_GRANT_TYPES = "grant_types"; + private List grantTypes = null; + + public static final String JSON_PROPERTY_JWKS_URI = "jwks_uri"; + private String jwksUri; + + public static final String JSON_PROPERTY_LOGO_URI = "logo_uri"; + private String logoUri; + + public static final String JSON_PROPERTY_POLICY_URI = "policy_uri"; + private String policyUri; + + public static final String JSON_PROPERTY_REDIRECT_URIS = "redirect_uris"; + private List redirectUris = new ArrayList<>(); + + public static final String JSON_PROPERTY_RESPONSE_TYPES = "response_types"; + private List responseTypes = null; + + public static final String JSON_PROPERTY_SCOPE = "scope"; + private String scope; + + public static final String JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD = + "token_endpoint_auth_method"; + private String tokenEndpointAuthMethod; + + public static final String JSON_PROPERTY_TOS_URI = "tos_uri"; + private String tosUri; + + public OAuthClientRegistrationRequest() {} + + @JsonCreator + public OAuthClientRegistrationRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_CLIENT_NAME) String clientName, + @JsonProperty(required = true, value = JSON_PROPERTY_REDIRECT_URIS) + List redirectUris) { + this.clientName = clientName; + this.redirectUris = redirectUris; + } + + public OAuthClientRegistrationRequest clientName(String clientName) { + this.clientName = clientName; + return this; + } + + /** + * Human-readable name of the client. Control characters are rejected. + * + * @return clientName + */ + @JsonProperty(JSON_PROPERTY_CLIENT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientName() { + return clientName; + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + public OAuthClientRegistrationRequest clientUri(String clientUri) { + this.clientUri = clientUri; + return this; + } + + /** + * URL of the home page of the client. + * + * @return clientUri + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientUri() { + return clientUri; + } + + public void setClientUri(String clientUri) { + this.clientUri = clientUri; + } + + public OAuthClientRegistrationRequest grantTypes( + List grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public OAuthClientRegistrationRequest addGrantTypesItem( + OAuthClientRegistrationGrantType grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + this.unparsed |= !grantTypesItem.isValid(); + return this; + } + + /** + * OAuth 2.0 grant types the client may use. Defaults to authorization_code and + * refresh_token when omitted. + * + * @return grantTypes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GRANT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(List grantTypes) { + this.grantTypes = grantTypes; + } + + public OAuthClientRegistrationRequest jwksUri(String jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + /** + * URL referencing the client's JSON Web Key Set. + * + * @return jwksUri + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JWKS_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getJwksUri() { + return jwksUri; + } + + public void setJwksUri(String jwksUri) { + this.jwksUri = jwksUri; + } + + public OAuthClientRegistrationRequest logoUri(String logoUri) { + this.logoUri = logoUri; + return this; + } + + /** + * URL referencing a logo for the client. + * + * @return logoUri + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOGO_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogoUri() { + return logoUri; + } + + public void setLogoUri(String logoUri) { + this.logoUri = logoUri; + } + + public OAuthClientRegistrationRequest policyUri(String policyUri) { + this.policyUri = policyUri; + return this; + } + + /** + * URL pointing to the client's privacy policy. + * + * @return policyUri + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POLICY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPolicyUri() { + return policyUri; + } + + public void setPolicyUri(String policyUri) { + this.policyUri = policyUri; + } + + public OAuthClientRegistrationRequest redirectUris(List redirectUris) { + this.redirectUris = redirectUris; + return this; + } + + public OAuthClientRegistrationRequest addRedirectUrisItem(String redirectUrisItem) { + this.redirectUris.add(redirectUrisItem); + return this; + } + + /** + * Array of redirection URI strings used by the client in redirect-based flows. + * + * @return redirectUris + */ + @JsonProperty(JSON_PROPERTY_REDIRECT_URIS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRedirectUris() { + return redirectUris; + } + + public void setRedirectUris(List redirectUris) { + this.redirectUris = redirectUris; + } + + public OAuthClientRegistrationRequest responseTypes( + List responseTypes) { + this.responseTypes = responseTypes; + return this; + } + + public OAuthClientRegistrationRequest addResponseTypesItem( + OAuthClientRegistrationResponseType responseTypesItem) { + if (this.responseTypes == null) { + this.responseTypes = new ArrayList<>(); + } + this.responseTypes.add(responseTypesItem); + this.unparsed |= !responseTypesItem.isValid(); + return this; + } + + /** + * OAuth 2.0 response types the client may use. Only code is supported. + * + * @return responseTypes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESPONSE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getResponseTypes() { + return responseTypes; + } + + public void setResponseTypes(List responseTypes) { + this.responseTypes = responseTypes; + } + + public OAuthClientRegistrationRequest scope(String scope) { + this.scope = scope; + return this; + } + + /** + * Space-separated list of scope values the client may request. + * + * @return scope + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + + public OAuthClientRegistrationRequest tokenEndpointAuthMethod(String tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + /** + * Requested authentication method for the token endpoint. Only none is supported. + * + * @return tokenEndpointAuthMethod + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + } + + public OAuthClientRegistrationRequest tosUri(String tosUri) { + this.tosUri = tosUri; + return this; + } + + /** + * URL pointing to the client's terms of service. + * + * @return tosUri + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOS_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTosUri() { + return tosUri; + } + + public void setTosUri(String tosUri) { + this.tosUri = tosUri; + } + + /** + * 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 OAuthClientRegistrationRequest + */ + @JsonAnySetter + public OAuthClientRegistrationRequest 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 OAuthClientRegistrationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRegistrationRequest oAuthClientRegistrationRequest = + (OAuthClientRegistrationRequest) o; + return Objects.equals(this.clientName, oAuthClientRegistrationRequest.clientName) + && Objects.equals(this.clientUri, oAuthClientRegistrationRequest.clientUri) + && Objects.equals(this.grantTypes, oAuthClientRegistrationRequest.grantTypes) + && Objects.equals(this.jwksUri, oAuthClientRegistrationRequest.jwksUri) + && Objects.equals(this.logoUri, oAuthClientRegistrationRequest.logoUri) + && Objects.equals(this.policyUri, oAuthClientRegistrationRequest.policyUri) + && Objects.equals(this.redirectUris, oAuthClientRegistrationRequest.redirectUris) + && Objects.equals(this.responseTypes, oAuthClientRegistrationRequest.responseTypes) + && Objects.equals(this.scope, oAuthClientRegistrationRequest.scope) + && Objects.equals( + this.tokenEndpointAuthMethod, oAuthClientRegistrationRequest.tokenEndpointAuthMethod) + && Objects.equals(this.tosUri, oAuthClientRegistrationRequest.tosUri) + && Objects.equals( + this.additionalProperties, oAuthClientRegistrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + clientName, + clientUri, + grantTypes, + jwksUri, + logoUri, + policyUri, + redirectUris, + responseTypes, + scope, + tokenEndpointAuthMethod, + tosUri, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRegistrationRequest {\n"); + sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); + sb.append(" clientUri: ").append(toIndentedString(clientUri)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" jwksUri: ").append(toIndentedString(jwksUri)).append("\n"); + sb.append(" logoUri: ").append(toIndentedString(logoUri)).append("\n"); + sb.append(" policyUri: ").append(toIndentedString(policyUri)).append("\n"); + sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); + sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" tokenEndpointAuthMethod: ") + .append(toIndentedString(tokenEndpointAuthMethod)) + .append("\n"); + sb.append(" tosUri: ").append(toIndentedString(tosUri)).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/OAuthClientRegistrationResponse.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponse.java new file mode 100644 index 00000000000..c94ae40ce70 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponse.java @@ -0,0 +1,325 @@ +/* + * 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; +import java.util.UUID; + +/** Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591. */ +@JsonPropertyOrder({ + OAuthClientRegistrationResponse.JSON_PROPERTY_CLIENT_ID, + OAuthClientRegistrationResponse.JSON_PROPERTY_CLIENT_NAME, + OAuthClientRegistrationResponse.JSON_PROPERTY_GRANT_TYPES, + OAuthClientRegistrationResponse.JSON_PROPERTY_REDIRECT_URIS, + OAuthClientRegistrationResponse.JSON_PROPERTY_RESPONSE_TYPES, + OAuthClientRegistrationResponse.JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OAuthClientRegistrationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private UUID clientId; + + public static final String JSON_PROPERTY_CLIENT_NAME = "client_name"; + private String clientName; + + public static final String JSON_PROPERTY_GRANT_TYPES = "grant_types"; + private List grantTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_REDIRECT_URIS = "redirect_uris"; + private List redirectUris = new ArrayList<>(); + + public static final String JSON_PROPERTY_RESPONSE_TYPES = "response_types"; + private List responseTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD = + "token_endpoint_auth_method"; + private String tokenEndpointAuthMethod; + + public OAuthClientRegistrationResponse() {} + + @JsonCreator + public OAuthClientRegistrationResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_CLIENT_ID) UUID clientId, + @JsonProperty(required = true, value = JSON_PROPERTY_CLIENT_NAME) String clientName, + @JsonProperty(required = true, value = JSON_PROPERTY_GRANT_TYPES) + List grantTypes, + @JsonProperty(required = true, value = JSON_PROPERTY_REDIRECT_URIS) List redirectUris, + @JsonProperty(required = true, value = JSON_PROPERTY_RESPONSE_TYPES) + List responseTypes, + @JsonProperty(required = true, value = JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD) + String tokenEndpointAuthMethod) { + this.clientId = clientId; + this.clientName = clientName; + this.grantTypes = grantTypes; + this.redirectUris = redirectUris; + this.responseTypes = responseTypes; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + } + + public OAuthClientRegistrationResponse clientId(UUID clientId) { + this.clientId = clientId; + return this; + } + + /** + * Unique identifier assigned to the registered client. + * + * @return clientId + */ + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getClientId() { + return clientId; + } + + public void setClientId(UUID clientId) { + this.clientId = clientId; + } + + public OAuthClientRegistrationResponse clientName(String clientName) { + this.clientName = clientName; + return this; + } + + /** + * Human-readable name of the client. + * + * @return clientName + */ + @JsonProperty(JSON_PROPERTY_CLIENT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientName() { + return clientName; + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + public OAuthClientRegistrationResponse grantTypes( + List grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public OAuthClientRegistrationResponse addGrantTypesItem( + OAuthClientRegistrationGrantType grantTypesItem) { + this.grantTypes.add(grantTypesItem); + this.unparsed |= !grantTypesItem.isValid(); + return this; + } + + /** + * OAuth 2.0 grant types registered for the client. + * + * @return grantTypes + */ + @JsonProperty(JSON_PROPERTY_GRANT_TYPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(List grantTypes) { + this.grantTypes = grantTypes; + } + + public OAuthClientRegistrationResponse redirectUris(List redirectUris) { + this.redirectUris = redirectUris; + return this; + } + + public OAuthClientRegistrationResponse addRedirectUrisItem(String redirectUrisItem) { + this.redirectUris.add(redirectUrisItem); + return this; + } + + /** + * Redirection URIs registered for the client. + * + * @return redirectUris + */ + @JsonProperty(JSON_PROPERTY_REDIRECT_URIS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRedirectUris() { + return redirectUris; + } + + public void setRedirectUris(List redirectUris) { + this.redirectUris = redirectUris; + } + + public OAuthClientRegistrationResponse responseTypes( + List responseTypes) { + this.responseTypes = responseTypes; + return this; + } + + public OAuthClientRegistrationResponse addResponseTypesItem( + OAuthClientRegistrationResponseType responseTypesItem) { + this.responseTypes.add(responseTypesItem); + this.unparsed |= !responseTypesItem.isValid(); + return this; + } + + /** + * OAuth 2.0 response types registered for the client. + * + * @return responseTypes + */ + @JsonProperty(JSON_PROPERTY_RESPONSE_TYPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getResponseTypes() { + return responseTypes; + } + + public void setResponseTypes(List responseTypes) { + this.responseTypes = responseTypes; + } + + public OAuthClientRegistrationResponse tokenEndpointAuthMethod(String tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + /** + * Authentication method registered for the token endpoint. Always none. + * + * @return tokenEndpointAuthMethod + */ + @JsonProperty(JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + } + + /** + * 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 OAuthClientRegistrationResponse + */ + @JsonAnySetter + public OAuthClientRegistrationResponse 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 OAuthClientRegistrationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRegistrationResponse oAuthClientRegistrationResponse = + (OAuthClientRegistrationResponse) o; + return Objects.equals(this.clientId, oAuthClientRegistrationResponse.clientId) + && Objects.equals(this.clientName, oAuthClientRegistrationResponse.clientName) + && Objects.equals(this.grantTypes, oAuthClientRegistrationResponse.grantTypes) + && Objects.equals(this.redirectUris, oAuthClientRegistrationResponse.redirectUris) + && Objects.equals(this.responseTypes, oAuthClientRegistrationResponse.responseTypes) + && Objects.equals( + this.tokenEndpointAuthMethod, oAuthClientRegistrationResponse.tokenEndpointAuthMethod) + && Objects.equals( + this.additionalProperties, oAuthClientRegistrationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + clientId, + clientName, + grantTypes, + redirectUris, + responseTypes, + tokenEndpointAuthMethod, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRegistrationResponse {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); + sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); + sb.append(" tokenEndpointAuthMethod: ") + .append(toIndentedString(tokenEndpointAuthMethod)) + .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/OAuthClientRegistrationResponseType.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponseType.java new file mode 100644 index 00000000000..88dcd37fa6a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponseType.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; + +/** OAuth 2.0 response type that a registered client may use. */ +@JsonSerialize( + using = OAuthClientRegistrationResponseType.OAuthClientRegistrationResponseTypeSerializer.class) +public class OAuthClientRegistrationResponseType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("code")); + + public static final OAuthClientRegistrationResponseType CODE = + new OAuthClientRegistrationResponseType("code"); + + OAuthClientRegistrationResponseType(String value) { + super(value, allowedValues); + } + + public static class OAuthClientRegistrationResponseTypeSerializer + extends StdSerializer { + public OAuthClientRegistrationResponseTypeSerializer( + Class t) { + super(t); + } + + public OAuthClientRegistrationResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OAuthClientRegistrationResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OAuthClientRegistrationResponseType fromValue(String value) { + return new OAuthClientRegistrationResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java b/src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java new file mode 100644 index 00000000000..b6e806250ed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** OIDC scope a client may be restricted to. */ +@JsonSerialize(using = OAuthOidcScope.OAuthOidcScopeSerializer.class) +public class OAuthOidcScope extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("openid", "profile", "email", "offline_access")); + + public static final OAuthOidcScope OPENID = new OAuthOidcScope("openid"); + public static final OAuthOidcScope PROFILE = new OAuthOidcScope("profile"); + public static final OAuthOidcScope EMAIL = new OAuthOidcScope("email"); + public static final OAuthOidcScope OFFLINE_ACCESS = new OAuthOidcScope("offline_access"); + + OAuthOidcScope(String value) { + super(value, allowedValues); + } + + public static class OAuthOidcScopeSerializer extends StdSerializer { + public OAuthOidcScopeSerializer(Class t) { + super(t); + } + + public OAuthOidcScopeSerializer() { + this(null); + } + + @Override + public void serialize(OAuthOidcScope value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OAuthOidcScope fromValue(String value) { + return new OAuthOidcScope(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java new file mode 100644 index 00000000000..6aba1109382 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java @@ -0,0 +1,188 @@ +/* + * 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; + +/** Allowlist of OIDC and permission scopes enforced for the OAuth2 client. */ +@JsonPropertyOrder({ + OAuthScopesRestriction.JSON_PROPERTY_OIDC_SCOPES, + OAuthScopesRestriction.JSON_PROPERTY_PERMISSION_SCOPES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OAuthScopesRestriction { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OIDC_SCOPES = "oidc_scopes"; + private List oidcScopes = new ArrayList<>(); + + public static final String JSON_PROPERTY_PERMISSION_SCOPES = "permission_scopes"; + private List permissionScopes = new ArrayList<>(); + + public OAuthScopesRestriction() {} + + @JsonCreator + public OAuthScopesRestriction( + @JsonProperty(required = true, value = JSON_PROPERTY_OIDC_SCOPES) + List oidcScopes, + @JsonProperty(required = true, value = JSON_PROPERTY_PERMISSION_SCOPES) + List permissionScopes) { + this.oidcScopes = oidcScopes; + this.permissionScopes = permissionScopes; + } + + public OAuthScopesRestriction oidcScopes(List oidcScopes) { + this.oidcScopes = oidcScopes; + return this; + } + + public OAuthScopesRestriction addOidcScopesItem(OAuthOidcScope oidcScopesItem) { + this.oidcScopes.add(oidcScopesItem); + this.unparsed |= !oidcScopesItem.isValid(); + return this; + } + + /** + * OIDC scopes the client is restricted to. + * + * @return oidcScopes + */ + @JsonProperty(JSON_PROPERTY_OIDC_SCOPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getOidcScopes() { + return oidcScopes; + } + + public void setOidcScopes(List oidcScopes) { + this.oidcScopes = oidcScopes; + } + + public OAuthScopesRestriction permissionScopes(List permissionScopes) { + this.permissionScopes = permissionScopes; + return this; + } + + public OAuthScopesRestriction addPermissionScopesItem(String permissionScopesItem) { + this.permissionScopes.add(permissionScopesItem); + return this; + } + + /** + * Datadog permission scopes the client is restricted to. + * + * @return permissionScopes + */ + @JsonProperty(JSON_PROPERTY_PERMISSION_SCOPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPermissionScopes() { + return permissionScopes; + } + + public void setPermissionScopes(List permissionScopes) { + this.permissionScopes = permissionScopes; + } + + /** + * 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 OAuthScopesRestriction + */ + @JsonAnySetter + public OAuthScopesRestriction 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 OAuthScopesRestriction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthScopesRestriction oAuthScopesRestriction = (OAuthScopesRestriction) o; + return Objects.equals(this.oidcScopes, oAuthScopesRestriction.oidcScopes) + && Objects.equals(this.permissionScopes, oAuthScopesRestriction.permissionScopes) + && Objects.equals(this.additionalProperties, oAuthScopesRestriction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(oidcScopes, permissionScopes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthScopesRestriction {\n"); + sb.append(" oidcScopes: ").append(toIndentedString(oidcScopes)).append("\n"); + sb.append(" permissionScopes: ").append(toIndentedString(permissionScopes)).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/OAuthScopesRestrictionResponse.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponse.java new file mode 100644 index 00000000000..db5c5756cd6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponse.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response payload describing the scopes restriction of an OAuth2 client. */ +@JsonPropertyOrder({OAuthScopesRestrictionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OAuthScopesRestrictionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private OAuthScopesRestrictionResponseData data; + + public OAuthScopesRestrictionResponse() {} + + @JsonCreator + public OAuthScopesRestrictionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + OAuthScopesRestrictionResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public OAuthScopesRestrictionResponse data(OAuthScopesRestrictionResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object of an OAuth2 client scopes restriction response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OAuthScopesRestrictionResponseData getData() { + return data; + } + + public void setData(OAuthScopesRestrictionResponseData 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 OAuthScopesRestrictionResponse + */ + @JsonAnySetter + public OAuthScopesRestrictionResponse 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 OAuthScopesRestrictionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthScopesRestrictionResponse oAuthScopesRestrictionResponse = + (OAuthScopesRestrictionResponse) o; + return Objects.equals(this.data, oAuthScopesRestrictionResponse.data) + && Objects.equals( + this.additionalProperties, oAuthScopesRestrictionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthScopesRestrictionResponse {\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/OAuthScopesRestrictionResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseAttributes.java new file mode 100644 index 00000000000..19e3469cce1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseAttributes.java @@ -0,0 +1,204 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an OAuth2 client scopes restriction. */ +@JsonPropertyOrder({ + OAuthScopesRestrictionResponseAttributes.JSON_PROPERTY_REQUIRED_PERMISSION_SCOPES, + OAuthScopesRestrictionResponseAttributes.JSON_PROPERTY_SCOPES_RESTRICTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OAuthScopesRestrictionResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REQUIRED_PERMISSION_SCOPES = + "required_permission_scopes"; + private List requiredPermissionScopes = new ArrayList<>(); + + public static final String JSON_PROPERTY_SCOPES_RESTRICTION = "scopes_restriction"; + private OAuthScopesRestriction scopesRestriction; + + public OAuthScopesRestrictionResponseAttributes() {} + + @JsonCreator + public OAuthScopesRestrictionResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_REQUIRED_PERMISSION_SCOPES) + List requiredPermissionScopes, + @JsonProperty(required = true, value = JSON_PROPERTY_SCOPES_RESTRICTION) + OAuthScopesRestriction scopesRestriction) { + this.requiredPermissionScopes = requiredPermissionScopes; + if (requiredPermissionScopes != null) {} + this.scopesRestriction = scopesRestriction; + if (scopesRestriction != null) { + this.unparsed |= scopesRestriction.unparsed; + } + } + + public OAuthScopesRestrictionResponseAttributes requiredPermissionScopes( + List requiredPermissionScopes) { + this.requiredPermissionScopes = requiredPermissionScopes; + return this; + } + + public OAuthScopesRestrictionResponseAttributes addRequiredPermissionScopesItem( + String requiredPermissionScopesItem) { + this.requiredPermissionScopes.add(requiredPermissionScopesItem); + return this; + } + + /** + * Permission scopes automatically required for this client (for example, mobile-app permission + * scopes). Returns null when no scopes are required. + * + * @return requiredPermissionScopes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED_PERMISSION_SCOPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRequiredPermissionScopes() { + return requiredPermissionScopes; + } + + public void setRequiredPermissionScopes(List requiredPermissionScopes) { + this.requiredPermissionScopes = requiredPermissionScopes; + } + + public OAuthScopesRestrictionResponseAttributes scopesRestriction( + OAuthScopesRestriction scopesRestriction) { + this.scopesRestriction = scopesRestriction; + if (scopesRestriction != null) { + this.unparsed |= scopesRestriction.unparsed; + } + return this; + } + + /** + * Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + * + * @return scopesRestriction + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPES_RESTRICTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OAuthScopesRestriction getScopesRestriction() { + return scopesRestriction; + } + + public void setScopesRestriction(OAuthScopesRestriction scopesRestriction) { + this.scopesRestriction = scopesRestriction; + } + + /** + * 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 OAuthScopesRestrictionResponseAttributes + */ + @JsonAnySetter + public OAuthScopesRestrictionResponseAttributes 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 OAuthScopesRestrictionResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthScopesRestrictionResponseAttributes oAuthScopesRestrictionResponseAttributes = + (OAuthScopesRestrictionResponseAttributes) o; + return Objects.equals( + this.requiredPermissionScopes, + oAuthScopesRestrictionResponseAttributes.requiredPermissionScopes) + && Objects.equals( + this.scopesRestriction, oAuthScopesRestrictionResponseAttributes.scopesRestriction) + && Objects.equals( + this.additionalProperties, + oAuthScopesRestrictionResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(requiredPermissionScopes, scopesRestriction, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthScopesRestrictionResponseAttributes {\n"); + sb.append(" requiredPermissionScopes: ") + .append(toIndentedString(requiredPermissionScopes)) + .append("\n"); + sb.append(" scopesRestriction: ").append(toIndentedString(scopesRestriction)).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/OAuthScopesRestrictionResponseData.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseData.java new file mode 100644 index 00000000000..a9b84072a20 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseData.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data object of an OAuth2 client scopes restriction response. */ +@JsonPropertyOrder({ + OAuthScopesRestrictionResponseData.JSON_PROPERTY_ATTRIBUTES, + OAuthScopesRestrictionResponseData.JSON_PROPERTY_ID, + OAuthScopesRestrictionResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OAuthScopesRestrictionResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OAuthScopesRestrictionResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OAuthScopesRestrictionType type = OAuthScopesRestrictionType.SCOPES_RESTRICTION; + + public OAuthScopesRestrictionResponseData() {} + + @JsonCreator + public OAuthScopesRestrictionResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + OAuthScopesRestrictionResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OAuthScopesRestrictionType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OAuthScopesRestrictionResponseData attributes( + OAuthScopesRestrictionResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an OAuth2 client scopes restriction. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OAuthScopesRestrictionResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OAuthScopesRestrictionResponseAttributes attributes) { + this.attributes = attributes; + } + + public OAuthScopesRestrictionResponseData id(UUID id) { + this.id = id; + return this; + } + + /** + * UUID of the OAuth2 client this restriction applies to. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public OAuthScopesRestrictionResponseData type(OAuthScopesRestrictionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for an OAuth2 client scopes restriction. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OAuthScopesRestrictionType getType() { + return type; + } + + public void setType(OAuthScopesRestrictionType 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 OAuthScopesRestrictionResponseData + */ + @JsonAnySetter + public OAuthScopesRestrictionResponseData 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 OAuthScopesRestrictionResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthScopesRestrictionResponseData oAuthScopesRestrictionResponseData = + (OAuthScopesRestrictionResponseData) o; + return Objects.equals(this.attributes, oAuthScopesRestrictionResponseData.attributes) + && Objects.equals(this.id, oAuthScopesRestrictionResponseData.id) + && Objects.equals(this.type, oAuthScopesRestrictionResponseData.type) + && Objects.equals( + this.additionalProperties, oAuthScopesRestrictionResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthScopesRestrictionResponseData {\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/OAuthScopesRestrictionType.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionType.java new file mode 100644 index 00000000000..508de8c3c98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for an OAuth2 client scopes restriction. */ +@JsonSerialize(using = OAuthScopesRestrictionType.OAuthScopesRestrictionTypeSerializer.class) +public class OAuthScopesRestrictionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("scopes_restriction")); + + public static final OAuthScopesRestrictionType SCOPES_RESTRICTION = + new OAuthScopesRestrictionType("scopes_restriction"); + + OAuthScopesRestrictionType(String value) { + super(value, allowedValues); + } + + public static class OAuthScopesRestrictionTypeSerializer + extends StdSerializer { + public OAuthScopesRestrictionTypeSerializer(Class t) { + super(t); + } + + public OAuthScopesRestrictionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OAuthScopesRestrictionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OAuthScopesRestrictionType fromValue(String value) { + return new OAuthScopesRestrictionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OverviewItemArray.java b/src/main/java/com/datadog/api/client/v2/model/OverviewItemArray.java new file mode 100644 index 00000000000..6d5107b143e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OverviewItemArray.java @@ -0,0 +1,157 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Response body for the overview endpoint, returning the tiles shown on the End User Device + * Monitoring overview dashboard. + */ +@JsonPropertyOrder({OverviewItemArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OverviewItemArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public OverviewItemArray() {} + + @JsonCreator + public OverviewItemArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public OverviewItemArray data(List data) { + this.data = data; + for (OverviewItemData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public OverviewItemArray addDataItem(OverviewItemData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of overview tiles. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OverviewItemArray + */ + @JsonAnySetter + public OverviewItemArray 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 OverviewItemArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OverviewItemArray overviewItemArray = (OverviewItemArray) o; + return Objects.equals(this.data, overviewItemArray.data) + && Objects.equals(this.additionalProperties, overviewItemArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OverviewItemArray {\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/OverviewItemData.java b/src/main/java/com/datadog/api/client/v2/model/OverviewItemData.java new file mode 100644 index 00000000000..0478865314b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OverviewItemData.java @@ -0,0 +1,206 @@ +/* + * 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 single tile entry in the End User Device Monitoring overview response. */ +@JsonPropertyOrder({ + OverviewItemData.JSON_PROPERTY_ATTRIBUTES, + OverviewItemData.JSON_PROPERTY_ID, + OverviewItemData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OverviewItemData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OverviewItemDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OverviewItemDataType type = OverviewItemDataType.OVERVIEW_ITEMS; + + public OverviewItemData() {} + + @JsonCreator + public OverviewItemData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OverviewItemDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OverviewItemData attributes(OverviewItemDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a single tile in the End User Device Monitoring overview dashboard. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OverviewItemDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OverviewItemDataAttributes attributes) { + this.attributes = attributes; + } + + public OverviewItemData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the overview tile. + * + * @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 OverviewItemData type(OverviewItemDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Overview items resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OverviewItemDataType getType() { + return type; + } + + public void setType(OverviewItemDataType 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 OverviewItemData + */ + @JsonAnySetter + public OverviewItemData 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 OverviewItemData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OverviewItemData overviewItemData = (OverviewItemData) o; + return Objects.equals(this.attributes, overviewItemData.attributes) + && Objects.equals(this.id, overviewItemData.id) + && Objects.equals(this.type, overviewItemData.type) + && Objects.equals(this.additionalProperties, overviewItemData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OverviewItemData {\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/OverviewItemDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OverviewItemDataAttributes.java new file mode 100644 index 00000000000..a23b79d8516 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OverviewItemDataAttributes.java @@ -0,0 +1,165 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a single tile in the End User Device Monitoring overview dashboard. */ +@JsonPropertyOrder({ + OverviewItemDataAttributes.JSON_PROPERTY_NAME, + OverviewItemDataAttributes.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OverviewItemDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public OverviewItemDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Human-readable name of the overview tile. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public OverviewItemDataAttributes value(Long value) { + this.value = value; + return this; + } + + /** + * Numeric value displayed on the overview tile. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + public void setValue(Long 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 OverviewItemDataAttributes + */ + @JsonAnySetter + public OverviewItemDataAttributes 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 OverviewItemDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OverviewItemDataAttributes overviewItemDataAttributes = (OverviewItemDataAttributes) o; + return Objects.equals(this.name, overviewItemDataAttributes.name) + && Objects.equals(this.value, overviewItemDataAttributes.value) + && Objects.equals( + this.additionalProperties, overviewItemDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OverviewItemDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\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/OverviewItemDataType.java b/src/main/java/com/datadog/api/client/v2/model/OverviewItemDataType.java new file mode 100644 index 00000000000..6dd7c3c970f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OverviewItemDataType.java @@ -0,0 +1,56 @@ +/* + * 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; + +/** Overview items resource type. */ +@JsonSerialize(using = OverviewItemDataType.OverviewItemDataTypeSerializer.class) +public class OverviewItemDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("overview_items")); + + public static final OverviewItemDataType OVERVIEW_ITEMS = + new OverviewItemDataType("overview_items"); + + OverviewItemDataType(String value) { + super(value, allowedValues); + } + + public static class OverviewItemDataTypeSerializer extends StdSerializer { + public OverviewItemDataTypeSerializer(Class t) { + super(t); + } + + public OverviewItemDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OverviewItemDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OverviewItemDataType fromValue(String value) { + return new OverviewItemDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java new file mode 100644 index 00000000000..e776f317ec0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object of an upsert OAuth2 scopes restriction request. */ +@JsonPropertyOrder({ + UpsertOAuthScopesRestrictionData.JSON_PROPERTY_ATTRIBUTES, + UpsertOAuthScopesRestrictionData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpsertOAuthScopesRestrictionData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpsertOAuthScopesRestrictionDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UpsertOAuthScopesRestrictionType type = + UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION; + + public UpsertOAuthScopesRestrictionData() {} + + @JsonCreator + public UpsertOAuthScopesRestrictionData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + UpsertOAuthScopesRestrictionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpsertOAuthScopesRestrictionData attributes( + UpsertOAuthScopesRestrictionDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an upsert OAuth2 scopes restriction request. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpsertOAuthScopesRestrictionDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpsertOAuthScopesRestrictionDataAttributes attributes) { + this.attributes = attributes; + } + + public UpsertOAuthScopesRestrictionData type(UpsertOAuthScopesRestrictionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for an upsert OAuth2 client scopes restriction request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpsertOAuthScopesRestrictionType getType() { + return type; + } + + public void setType(UpsertOAuthScopesRestrictionType 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 UpsertOAuthScopesRestrictionData + */ + @JsonAnySetter + public UpsertOAuthScopesRestrictionData 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 UpsertOAuthScopesRestrictionData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertOAuthScopesRestrictionData upsertOAuthScopesRestrictionData = + (UpsertOAuthScopesRestrictionData) o; + return Objects.equals(this.attributes, upsertOAuthScopesRestrictionData.attributes) + && Objects.equals(this.type, upsertOAuthScopesRestrictionData.type) + && Objects.equals( + this.additionalProperties, upsertOAuthScopesRestrictionData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertOAuthScopesRestrictionData {\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/UpsertOAuthScopesRestrictionDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java new file mode 100644 index 00000000000..fe96f0090b6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java @@ -0,0 +1,192 @@ +/* + * 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; + +/** Attributes of an upsert OAuth2 scopes restriction request. */ +@JsonPropertyOrder({ + UpsertOAuthScopesRestrictionDataAttributes.JSON_PROPERTY_OIDC_SCOPES, + UpsertOAuthScopesRestrictionDataAttributes.JSON_PROPERTY_PERMISSION_SCOPES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpsertOAuthScopesRestrictionDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OIDC_SCOPES = "oidc_scopes"; + private List oidcScopes = null; + + public static final String JSON_PROPERTY_PERMISSION_SCOPES = "permission_scopes"; + private List permissionScopes = null; + + public UpsertOAuthScopesRestrictionDataAttributes oidcScopes(List oidcScopes) { + this.oidcScopes = oidcScopes; + return this; + } + + public UpsertOAuthScopesRestrictionDataAttributes addOidcScopesItem( + OAuthOidcScope oidcScopesItem) { + if (this.oidcScopes == null) { + this.oidcScopes = new ArrayList<>(); + } + this.oidcScopes.add(oidcScopesItem); + this.unparsed |= !oidcScopesItem.isValid(); + return this; + } + + /** + * OIDC scopes the client is allowed to request. + * + * @return oidcScopes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OIDC_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOidcScopes() { + return oidcScopes; + } + + public void setOidcScopes(List oidcScopes) { + this.oidcScopes = oidcScopes; + } + + public UpsertOAuthScopesRestrictionDataAttributes permissionScopes( + List permissionScopes) { + this.permissionScopes = permissionScopes; + return this; + } + + public UpsertOAuthScopesRestrictionDataAttributes addPermissionScopesItem( + String permissionScopesItem) { + if (this.permissionScopes == null) { + this.permissionScopes = new ArrayList<>(); + } + this.permissionScopes.add(permissionScopesItem); + return this; + } + + /** + * Datadog permission scopes the client is allowed to request. Each value must be a valid + * permission name. + * + * @return permissionScopes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERMISSION_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPermissionScopes() { + return permissionScopes; + } + + public void setPermissionScopes(List permissionScopes) { + this.permissionScopes = permissionScopes; + } + + /** + * 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 UpsertOAuthScopesRestrictionDataAttributes + */ + @JsonAnySetter + public UpsertOAuthScopesRestrictionDataAttributes 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 UpsertOAuthScopesRestrictionDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertOAuthScopesRestrictionDataAttributes upsertOAuthScopesRestrictionDataAttributes = + (UpsertOAuthScopesRestrictionDataAttributes) o; + return Objects.equals(this.oidcScopes, upsertOAuthScopesRestrictionDataAttributes.oidcScopes) + && Objects.equals( + this.permissionScopes, upsertOAuthScopesRestrictionDataAttributes.permissionScopes) + && Objects.equals( + this.additionalProperties, + upsertOAuthScopesRestrictionDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(oidcScopes, permissionScopes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertOAuthScopesRestrictionDataAttributes {\n"); + sb.append(" oidcScopes: ").append(toIndentedString(oidcScopes)).append("\n"); + sb.append(" permissionScopes: ").append(toIndentedString(permissionScopes)).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/UpsertOAuthScopesRestrictionRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionRequest.java new file mode 100644 index 00000000000..0708a864f4f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for creating or updating the scopes restriction of an OAuth2 client. */ +@JsonPropertyOrder({UpsertOAuthScopesRestrictionRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpsertOAuthScopesRestrictionRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpsertOAuthScopesRestrictionData data; + + public UpsertOAuthScopesRestrictionRequest() {} + + @JsonCreator + public UpsertOAuthScopesRestrictionRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + UpsertOAuthScopesRestrictionData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpsertOAuthScopesRestrictionRequest data(UpsertOAuthScopesRestrictionData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object of an upsert OAuth2 scopes restriction request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpsertOAuthScopesRestrictionData getData() { + return data; + } + + public void setData(UpsertOAuthScopesRestrictionData 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 UpsertOAuthScopesRestrictionRequest + */ + @JsonAnySetter + public UpsertOAuthScopesRestrictionRequest 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 UpsertOAuthScopesRestrictionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertOAuthScopesRestrictionRequest upsertOAuthScopesRestrictionRequest = + (UpsertOAuthScopesRestrictionRequest) o; + return Objects.equals(this.data, upsertOAuthScopesRestrictionRequest.data) + && Objects.equals( + this.additionalProperties, upsertOAuthScopesRestrictionRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertOAuthScopesRestrictionRequest {\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/UpsertOAuthScopesRestrictionType.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.java new file mode 100644 index 00000000000..496c21c8947 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.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; + +/** JSON:API resource type for an upsert OAuth2 client scopes restriction request. */ +@JsonSerialize( + using = UpsertOAuthScopesRestrictionType.UpsertOAuthScopesRestrictionTypeSerializer.class) +public class UpsertOAuthScopesRestrictionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("upsert_scopes_restriction")); + + public static final UpsertOAuthScopesRestrictionType UPSERT_SCOPES_RESTRICTION = + new UpsertOAuthScopesRestrictionType("upsert_scopes_restriction"); + + UpsertOAuthScopesRestrictionType(String value) { + super(value, allowedValues); + } + + public static class UpsertOAuthScopesRestrictionTypeSerializer + extends StdSerializer { + public UpsertOAuthScopesRestrictionTypeSerializer(Class t) { + super(t); + } + + public UpsertOAuthScopesRestrictionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + UpsertOAuthScopesRestrictionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static UpsertOAuthScopesRestrictionType fromValue(String value) { + return new UpsertOAuthScopesRestrictionType(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Get_a_device_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_device_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..94c48fa6008 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_device_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-26T22:33:26.244Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_device_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_a_device_returns_Not_Found_response.json new file mode 100644 index 00000000000..758ea507195 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_device_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/eudm/devices/not_found", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b5ba4e08-8ae6-04dd-a7cb-18cd1877b8b7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_device_issue_definitions_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_device_issue_definitions_returns_OK_response.freeze new file mode 100644 index 00000000000..c79fc24e614 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_device_issue_definitions_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-26T22:33:27.655Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_device_issue_definitions_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_device_issue_definitions_returns_OK_response.json new file mode 100644 index 00000000000..7c042ebfb2d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_device_issue_definitions_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/eudm/issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"high-cpu\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"cpu\",\"label\":\"CPU Usage above 70%\",\"level\":\"warning\"}},{\"id\":\"critical-cpu\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"cpu\",\"label\":\"CPU Usage above 90%\",\"level\":\"critical\"}},{\"id\":\"high-memory\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"memory\",\"label\":\"Memory Usage above 75%\",\"level\":\"warning\"}},{\"id\":\"critical-memory\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"memory\",\"label\":\"Memory Usage above 90%\",\"level\":\"critical\"}},{\"id\":\"high-disk\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"disk\",\"label\":\"Disk Usage above 80%\",\"level\":\"warning\"}},{\"id\":\"critical-disk\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"disk\",\"label\":\"Disk Usage above 95%\",\"level\":\"critical\"}},{\"id\":\"low-battery-capacity\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"battery\",\"label\":\"Battery Capacity below 80%\",\"level\":\"warning\"}},{\"id\":\"critical-battery-capacity\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"battery\",\"label\":\"Battery Capacity below 70%\",\"level\":\"critical\"}},{\"id\":\"weak-wifi\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"wifi\",\"label\":\"Poor WiFi Connectivity\",\"level\":\"warning\"}},{\"id\":\"recent-restart\",\"type\":\"issue_definitions\",\"attributes\":{\"category\":\"notable_events\",\"label\":\"Recent System Restart\",\"level\":\"info\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ba77caad-6da6-39c8-1de2-c031d65083bb" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_devices_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_devices_returns_OK_response.freeze new file mode 100644 index 00000000000..408385be9a5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_devices_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-26T22:33:27.236Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_devices_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_devices_returns_OK_response.json new file mode 100644 index 00000000000..2be97340914 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_devices_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/eudm/devices", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"LAPTOP-DEMO-001\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"cpu_model\":\"Apple M1 Pro\",\"cpu_cores\":10,\"cpu_logical_processors\":10,\"cpu_usage\":11.4,\"mem_usage\":47.1,\"memory_total_kb\":16777216,\"disk_usage\":38.2,\"ip_address\":\"192.0.2.10\",\"issues\":[],\"kernel_name\":\"Darwin\",\"last_seen\":\"2026-05-26T22:49:00Z\",\"manufacturer\":\"Apple\",\"model_name\":\"MacBook Pro\",\"model_number\":\"MacBookPro18,3\",\"os\":\"macOS\",\"os_version\":\"macOS 15.6.1 arm64\",\"resource_id\":\"10000000000001\",\"serial_number\":\"TESTDEVICE001\",\"status\":\"healthy\",\"type\":\"laptop\",\"uptime\":432000.0,\"wlan_bssid\":\"00:00:5e:00:53:01\",\"wlan_rssi\":-55.0,\"wlan_ssid\":\"corp-wifi\"}},{\"id\":\"LAPTOP-DEMO-002\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"cpu_model\":\"Intel(R) Core(TM) i7-1185G7\",\"cpu_cores\":4,\"cpu_logical_processors\":8,\"cpu_usage\":76.2,\"mem_usage\":81.5,\"memory_total_kb\":16777216,\"disk_usage\":62.4,\"ip_address\":\"192.0.2.11\",\"issues\":[\"high-cpu\",\"high-memory\"],\"kernel_name\":\"WindowsNT\",\"last_seen\":\"2026-05-26T22:48:30Z\",\"manufacturer\":\"Dell Inc.\",\"model_name\":\"Latitude 5420\",\"model_number\":\"Latitude 5420\",\"os\":\"Windows\",\"os_version\":\"Windows 11 Pro 10.0 Build 22631\",\"resource_id\":\"10000000000002\",\"serial_number\":\"TESTDEVICE002\",\"status\":\"degraded\",\"type\":\"laptop\",\"uptime\":86400.0,\"wlan_bssid\":\"00:00:5e:00:53:02\",\"wlan_rssi\":-72.5,\"wlan_ssid\":\"corp-wifi\"}},{\"id\":\"LAPTOP-DEMO-003\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.71.0\",\"cpu_model\":\"Intel(R) Core(TM) i5-1135G7\",\"cpu_cores\":4,\"cpu_logical_processors\":8,\"cpu_usage\":92.8,\"mem_usage\":95.2,\"memory_total_kb\":8388608,\"disk_usage\":96.5,\"ip_address\":\"198.51.100.10\",\"issues\":[\"critical-cpu\",\"critical-memory\",\"critical-disk\"],\"kernel_name\":\"WindowsNT\",\"last_seen\":\"2026-05-26T22:47:00Z\",\"manufacturer\":\"Lenovo\",\"model_name\":\"ThinkPad X1 Carbon\",\"model_number\":\"20XW\",\"os\":\"Windows\",\"os_version\":\"Windows 10 Pro 10.0 Build 19045\",\"resource_id\":\"10000000000003\",\"serial_number\":\"TESTDEVICE003\",\"status\":\"critical\",\"type\":\"laptop\",\"uptime\":7200.0,\"wlan_bssid\":\"00:00:5e:00:53:03\",\"wlan_rssi\":-81.0,\"wlan_ssid\":\"guest-network\"}},{\"id\":\"DESKTOP-DEMO-001\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"cpu_model\":\"AMD Ryzen 7 5800X\",\"cpu_cores\":8,\"cpu_logical_processors\":16,\"cpu_usage\":8.3,\"mem_usage\":32.0,\"memory_total_kb\":33554432,\"disk_usage\":41.7,\"ip_address\":\"192.0.2.20\",\"issues\":[],\"kernel_name\":\"WindowsNT\",\"last_seen\":\"2026-05-26T22:49:00Z\",\"manufacturer\":\"Custom\",\"model_name\":\"Workstation\",\"model_number\":\"\",\"os\":\"Windows\",\"os_version\":\"Windows 11 Pro 10.0 Build 26100\",\"resource_id\":\"10000000000004\",\"serial_number\":\"TESTDEVICE004\",\"status\":\"healthy\",\"type\":\"desktop\",\"uptime\":1209600.0,\"wlan_bssid\":\"\",\"wlan_ssid\":\"\"}},{\"id\":\"LAPTOP-DEMO-004\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"battery_max_capacity_pct\":73,\"cpu_model\":\"Apple M2\",\"cpu_cores\":8,\"cpu_logical_processors\":8,\"cpu_usage\":22.1,\"mem_usage\":55.0,\"memory_total_kb\":16777216,\"disk_usage\":51.0,\"ip_address\":\"192.0.2.21\",\"issues\":[\"low-battery-capacity\"],\"kernel_name\":\"Darwin\",\"last_seen\":\"2026-05-26T22:49:00Z\",\"manufacturer\":\"Apple\",\"model_name\":\"MacBook Air\",\"model_number\":\"Mac14,2\",\"os\":\"macOS\",\"os_version\":\"macOS 26.4.1 arm64\",\"resource_id\":\"10000000000005\",\"serial_number\":\"TESTDEVICE005\",\"status\":\"degraded\",\"type\":\"laptop\",\"uptime\":14400.0,\"wlan_bssid\":\"00:00:5e:00:53:05\",\"wlan_rssi\":-62.0,\"wlan_ssid\":\"home-network\"}},{\"id\":\"LAPTOP-DEMO-005\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.70.0\",\"ip_address\":\"203.0.113.10\",\"issues\":[],\"kernel_name\":\"WindowsNT\",\"last_seen\":\"2026-05-20T08:15:00Z\",\"manufacturer\":\"HP\",\"model_name\":\"EliteBook 840\",\"model_number\":\"G9\",\"os\":\"Windows\",\"os_version\":\"Windows 11 Pro 10.0 Build 22621\",\"resource_id\":\"10000000000006\",\"serial_number\":\"TESTDEVICE006\",\"status\":\"inactive\",\"type\":\"laptop\",\"wlan_ssid\":\"\",\"wlan_bssid\":\"\"}},{\"id\":\"DESKTOP-DEMO-002\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"cpu_cores\":16,\"cpu_logical_processors\":32,\"cpu_model\":\"AMD Ryzen 9 7950X\",\"cpu_usage\":14.6,\"mem_usage\":28.4,\"memory_total_kb\":67108864,\"disk_usage\":22.1,\"ip_address\":\"198.51.100.20\",\"issues\":[],\"kernel_name\":\"Linux\",\"last_seen\":\"2026-05-26T22:49:00Z\",\"manufacturer\":\"Custom\",\"model_name\":\"Workstation\",\"model_number\":\"\",\"os\":\"linux\",\"os_version\":\"Ubuntu 24.04 LTS\",\"resource_id\":\"10000000000007\",\"serial_number\":\"TESTDEVICE007\",\"status\":\"healthy\",\"type\":\"desktop\",\"uptime\":2592000.0}},{\"id\":\"DEVICE-DEMO-UNKNOWN\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.65.0\",\"ip_address\":\"203.0.113.20\",\"issues\":[\"recent-restart\"],\"last_seen\":\"2026-05-26T22:35:00Z\",\"os\":\"\",\"os_version\":\"\",\"resource_id\":\"10000000000008\",\"status\":\"healthy\",\"type\":\"unknown\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9c9aec07-7a92-303c-4e5a-e6b2f5b99f54" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_device_counts_grouped_by_attribute_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_device_counts_grouped_by_attribute_returns_OK_response.freeze new file mode 100644 index 00000000000..a51815e9e18 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_device_counts_grouped_by_attribute_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-26T22:33:27.588Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_device_counts_grouped_by_attribute_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_device_counts_grouped_by_attribute_returns_OK_response.json new file mode 100644 index 00000000000..920f0f94e98 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_device_counts_grouped_by_attribute_returns_OK_response.json @@ -0,0 +1,33 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/eudm/graph", + "queryStringParameters": { + "by": [ + "os" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"macOS\",\"type\":\"graph_items\",\"attributes\":{\"type\":\"macOS\",\"counts\":[{\"columnName\":\"total\",\"count\":18},{\"columnName\":\"healthy\",\"count\":9},{\"columnName\":\"degraded\",\"count\":4},{\"columnName\":\"critical\",\"count\":1},{\"columnName\":\"inactive\",\"count\":4}]}},{\"id\":\"Windows\",\"type\":\"graph_items\",\"attributes\":{\"type\":\"Windows\",\"counts\":[{\"columnName\":\"total\",\"count\":112},{\"columnName\":\"healthy\",\"count\":48},{\"columnName\":\"degraded\",\"count\":17},{\"columnName\":\"critical\",\"count\":5},{\"columnName\":\"inactive\",\"count\":42}]}},{\"id\":\"linux\",\"type\":\"graph_items\",\"attributes\":{\"type\":\"linux\",\"counts\":[{\"columnName\":\"total\",\"count\":7},{\"columnName\":\"healthy\",\"count\":6},{\"columnName\":\"degraded\",\"count\":0},{\"columnName\":\"critical\",\"count\":0},{\"columnName\":\"inactive\",\"count\":1}]}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d8169dcd-e737-7609-0e00-40763385627b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_overview_tiles_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_overview_tiles_returns_OK_response.freeze new file mode 100644 index 00000000000..0185521c559 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_overview_tiles_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-26T22:33:27.698Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_overview_tiles_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_overview_tiles_returns_OK_response.json new file mode 100644 index 00000000000..59653fdfa29 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_overview_tiles_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/eudm/overview", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"total\",\"type\":\"overview_items\",\"attributes\":{\"name\":\"total\",\"value\":0}},{\"id\":\"healthy\",\"type\":\"overview_items\",\"attributes\":{\"name\":\"healthy\",\"value\":0}},{\"id\":\"degraded\",\"type\":\"overview_items\",\"attributes\":{\"name\":\"degraded\",\"value\":0}},{\"id\":\"critical\",\"type\":\"overview_items\",\"attributes\":{\"name\":\"critical\",\"value\":0}},{\"id\":\"inactive\",\"type\":\"overview_items\",\"attributes\":{\"name\":\"inactive\",\"value\":0}},{\"id\":\"high-cpu\",\"type\":\"overview_items\",\"attributes\":{\"name\":\"high-cpu\",\"value\":0}},{\"id\":\"weak-wifi\",\"type\":\"overview_items\",\"attributes\":{\"name\":\"weak-wifi\",\"value\":0}},{\"id\":\"recent-restart\",\"type\":\"overview_items\",\"attributes\":{\"name\":\"recent-restart\",\"value\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f6539e1f-ddc9-d726-dec9-a5892eca1322" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/end_user_device_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/end_user_device_monitoring.feature new file mode 100644 index 00000000000..00e5433bd70 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/end_user_device_monitoring.feature @@ -0,0 +1,49 @@ +@endpoint(end-user-device-monitoring) @endpoint(end-user-device-monitoring-v2) +Feature: End User Device Monitoring + Inspect devices reported by the Datadog Agent on end-user laptops, + desktops, and mobile devices, including their health, hardware, and + connectivity attributes. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "EndUserDeviceMonitoring" API + + @generated @skip @team:DataDog/windows-products + Scenario: Get a device returns "Not Found" response + Given new "GetEUDMDevice" request + And request contains "device_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/windows-products + Scenario: Get a device returns "OK" response + Given new "GetEUDMDevice" request + And request contains "device_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/windows-products + Scenario: Get all device issue definitions returns "OK" response + Given new "GetEUDMIssues" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/windows-products + Scenario: Get all devices returns "OK" response + Given new "GetEUDMDevices" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/windows-products + Scenario: Get device counts grouped by attribute returns "OK" response + Given new "GetEUDMGraph" request + And request contains "by" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/windows-products + Scenario: Get overview tiles returns "OK" response + Given new "GetEUDMOverview" request + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/eudm.feature b/src/test/resources/com/datadog/api/client/v2/api/eudm.feature new file mode 100644 index 00000000000..6c929e77a99 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/eudm.feature @@ -0,0 +1,42 @@ +@endpoint(eudm) @endpoint(eudm-v2) +Feature: End User Device Monitoring + Inspect devices reported by the Datadog Agent on end-user laptops, desktops, + and mobile devices, including their health, hardware, and connectivity + attributes. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "EndUserDeviceMonitoring" API + + @team:DataDog/windows-products + Scenario: Get a device returns "Not Found" response + Given new "GetEUDMDevice" request + And request contains "device_id" parameter with value "not_found" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/windows-products + Scenario: Get all devices returns "OK" response + Given new "GetEUDMDevices" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/windows-products + Scenario: Get device counts grouped by attribute returns "OK" response + Given new "GetEUDMGraph" request + And request contains "by" parameter with value "os" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/windows-products + Scenario: Get all device issue definitions returns "OK" response + Given new "GetEUDMIssues" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/windows-products + Scenario: Get overview tiles returns "OK" response + Given new "GetEUDMOverview" request + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature b/src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature new file mode 100644 index 00000000000..a5c7d195efa --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature @@ -0,0 +1,100 @@ +@endpoint(oauth2-client-public) @endpoint(oauth2-client-public-v2) +Feature: OAuth2 Client Public + Configure OAuth2 clients for Datadog. Supports RFC 7591 Dynamic Client + Registration and management of OAuth2 client scopes restrictions. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "OAuth2ClientPublic" API + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete an OAuth2 client scopes restriction returns "Bad Request" response + Given operation "DeleteScopesRestriction" enabled + And new "DeleteScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete an OAuth2 client scopes restriction returns "No Content" response + Given operation "DeleteScopesRestriction" enabled + And new "DeleteScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete an OAuth2 client scopes restriction returns "Not Found" response + Given operation "DeleteScopesRestriction" enabled + And new "DeleteScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get an OAuth2 client scopes restriction returns "Bad Request" response + Given operation "GetScopesRestriction" enabled + And new "GetScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get an OAuth2 client scopes restriction returns "Not Found" response + Given operation "GetScopesRestriction" enabled + And new "GetScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get an OAuth2 client scopes restriction returns "OK" response + Given operation "GetScopesRestriction" enabled + And new "GetScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Register an OAuth2 client returns "Bad Request" response + Given operation "RegisterOAuthClient" enabled + And new "RegisterOAuthClient" request + And body with value {"client_name": "Example MCP Client", "client_uri": "https://example.com", "grant_types": ["authorization_code", "refresh_token"], "jwks_uri": "https://example.com/.well-known/jwks.json", "logo_uri": "https://example.com/logo.png", "policy_uri": "https://example.com/privacy", "redirect_uris": ["https://example.com/oauth/callback"], "response_types": ["code"], "scope": "openid profile", "token_endpoint_auth_method": "none", "tos_uri": "https://example.com/tos"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Register an OAuth2 client returns "Created" response + Given operation "RegisterOAuthClient" enabled + And new "RegisterOAuthClient" request + And body with value {"client_name": "Example MCP Client", "client_uri": "https://example.com", "grant_types": ["authorization_code", "refresh_token"], "jwks_uri": "https://example.com/.well-known/jwks.json", "logo_uri": "https://example.com/logo.png", "policy_uri": "https://example.com/privacy", "redirect_uris": ["https://example.com/oauth/callback"], "response_types": ["code"], "scope": "openid profile", "token_endpoint_auth_method": "none", "tos_uri": "https://example.com/tos"} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Upsert an OAuth2 client scopes restriction returns "Bad Request" response + Given operation "UpsertScopesRestriction" enabled + And new "UpsertScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Upsert an OAuth2 client scopes restriction returns "Not Found" response + Given operation "UpsertScopesRestriction" enabled + And new "UpsertScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Upsert an OAuth2 client scopes restriction returns "OK" response + Given operation "UpsertScopesRestriction" enabled + And new "UpsertScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 0878797ffd8..05798ab7d63 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 @@ -2382,6 +2382,36 @@ "type": "idempotent" } }, + "GetEUDMDevices": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, + "GetEUDMDevice": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, + "GetEUDMGraph": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, + "GetEUDMIssues": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, + "GetEUDMOverview": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, "ListEvents": { "tag": "Events", "undo": { @@ -4678,6 +4708,30 @@ "type": "safe" } }, + "DeleteScopesRestriction": { + "tag": "OAuth2 Client Public", + "undo": { + "type": "idempotent" + } + }, + "GetScopesRestriction": { + "tag": "OAuth2 Client Public", + "undo": { + "type": "safe" + } + }, + "UpsertScopesRestriction": { + "tag": "OAuth2 Client Public", + "undo": { + "type": "idempotent" + } + }, + "RegisterOAuthClient": { + "tag": "OAuth2 Client Public", + "undo": { + "type": "idempotent" + } + }, "ListPipelines": { "tag": "Observability Pipelines", "undo": {