diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7991818c67f..2206c1d70b4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -43191,6 +43191,455 @@ 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 + links: + $ref: "#/components/schemas/DeviceBaseArrayLinks" + meta: + $ref: "#/components/schemas/DeviceBaseArrayMeta" + required: + - data + type: object + DeviceBaseArrayLinks: + description: Links related to the current page of devices. + properties: + next: + description: URL of the next page of devices. Present only when more devices remain. + example: /api/v2/eudm/devices?page%5Bcursor%5D=TEFQVE9QLURFTU8tMDAx&page%5Blimit%5D=1 + type: string + self: + description: URL of the current request. + example: /api/v2/eudm/devices?page%5Blimit%5D=1 + type: string + type: object + DeviceBaseArrayMeta: + description: Metadata about the list devices response. + properties: + page: + $ref: "#/components/schemas/DeviceBaseArrayMetaPage" + type: object + DeviceBaseArrayMetaPage: + description: Pagination information for the list devices response. + properties: + after: + description: |- + Cursor to pass as `page[cursor]` to get the next page. + Present only when more devices remain. + example: TEFQVE9QLURFTU8tMDAx + type: string + 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_critical: + description: Whether the device's battery health has degraded to a critical level. + type: boolean + 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 + employee: + $ref: "#/components/schemas/DeviceEmployee" + geo_ip: + $ref: "#/components/schemas/DeviceGeoIP" + ip_address: + description: Last observed IPv4 or IPv6 address of the device. + type: string + issues: + description: |- + List of issue identifiers currently affecting the device. + 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_reboot: + description: Timestamp of the most recent device reboot, in RFC 3339 format. + 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, as reported by the Datadog Agent + (for example, `macOS`, `Windows`, or `linux`). Empty when unknown. + 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: + $ref: "#/components/schemas/DeviceStatus" + type: + description: Hardware type of the device (for example, `laptop` or `desktop`). `unknown` when the type cannot be determined. + 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 Cloud Network Monitoring 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_critical: + description: Whether the device's battery health has degraded to a critical level. + type: boolean + 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 + cnm_enabled: + description: Whether Cloud Network Monitoring is enabled on the device. + type: boolean + 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 + employee: + $ref: "#/components/schemas/DeviceEmployee" + geo_ip: + $ref: "#/components/schemas/DeviceGeoIP" + ip_address: + description: Last observed IPv4 or IPv6 address of the device. + type: string + issues: + description: |- + List of issue identifiers currently affecting the device. + 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_reboot: + description: Timestamp of the most recent device reboot, in RFC 3339 format. + 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, as reported by the Datadog Agent + (for example, `macOS`, `Windows`, or `linux`). Empty when unknown. + type: string + os_version: + description: Operating system version running on the device. + type: string + packet_sent: + description: |- + Number of TCP packets sent by the device over the query window, + as reported by Cloud Network Monitoring. + format: double + type: number + resource_id: + description: Datadog resource identifier for the device. + type: string + retransmit: + description: Number of TCP packets retransmitted by the device over the query window. + format: double + type: number + retransmit_pct: + description: Percentage of sent TCP packets that were retransmitted, between 0 and 100. + format: double + type: number + serial_number: + description: Serial number assigned to the device by its manufacturer. + type: string + status: + $ref: "#/components/schemas/DeviceStatus" + tcp_canceled: + description: Number of TCP connection attempts canceled by the device over the query window. + format: double + type: number + tcp_established: + description: Number of TCP connections established by the device over the query window. + format: double + type: number + tcp_establishment_failure_pct: + description: Percentage of TCP connection attempts that failed, between 0 and 100. + format: double + type: number + tcp_establishment_failures: + description: Number of TCP connection attempts that failed over the query window. + format: double + type: number + tcp_host_unreachable: + description: Number of TCP connection attempts that failed because the host was unreachable. + format: double + type: number + tcp_network_unreachable: + description: Number of TCP connection attempts that failed because the network was unreachable. + format: double + type: number + tcp_refusals: + description: Number of TCP connection attempts refused by the remote host over the query window. + format: double + type: number + tcp_timeouts: + description: Number of TCP connection attempts that timed out over the query window. + format: double + type: number + type: + description: Hardware type of the device (for example, `laptop` or `desktop`). `unknown` when the type cannot be determined. + 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 + DeviceEmployee: + description: |- + Directory information about the employee associated with the device, + sourced from a customer reference table. + Absent when no reference table is configured or the device has no match. + properties: + city: + description: City where the employee is based. + type: string + country: + description: Country where the employee is based. + type: string + department: + description: Department the employee belongs to. + type: string + email: + description: Email address of the employee. + type: string + name: + description: Full name of the employee. + type: string + office: + description: Office the employee is assigned to. + type: string + team: + description: Team the employee belongs to. + type: string + type: object + DeviceGeoIP: + description: |- + Location derived from the device's public IP address. + Absent when no location data is available. + properties: + geo_city: + description: City resolved from the device's public IP address. + type: string + geo_country_iso_code: + description: ISO 3166-1 alpha-2 country code resolved from the device's public IP address. + type: string + geo_latitude: + description: Latitude resolved from the device's public IP address. + format: double + type: number + geo_longitude: + description: Longitude resolved from the device's public IP address. + format: double + type: number + geo_subdivision_iso_code: + description: |- + ISO 3166-2 subdivision code (for example, a state or province) + resolved from the device's public IP address. + type: string + public_ip_address: + description: Public IPv4 or IPv6 address of the device. + type: string + type: object + DeviceStatus: + description: |- + Health status of the device, computed from its issues and recent telemetry. + `inactive` means the device stopped reporting. `unknown` means no telemetry is available yet. + enum: + - healthy + - degraded + - critical + - inactive + - unknown + example: healthy + type: string + x-enum-varnames: + - HEALTHY + - DEGRADED + - CRITICAL + - INACTIVE + - UNKNOWN DeviceTagsBySource: description: Tags associated with a device from a specific source. properties: @@ -179710,6 +180159,183 @@ paths: summary: Update the state of an issue tags: - Error Tracking + /api/v2/eudm/devices: + get: + operationId: GetEUDMDevices + parameters: + - description: |- + Filter devices to those currently associated with any of the given BSSID values. + Each value must be a MAC-48 address; repeat the parameter to pass several values. + explode: true + in: query + name: bssid + required: false + schema: + items: + example: 00:00:5e:00:53:01 + pattern: "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$" + type: string + type: array + style: form + - description: |- + Maximum number of devices to return in one page. Must be a positive integer. + If not set, the response contains all matching devices. + in: query + name: page[limit] + required: false + schema: + example: 100 + format: int64 + minimum: 1 + type: integer + - description: |- + Opaque cursor that selects the next page. Use the `meta.page.after` value + of the previous response. Devices are ordered by ID. + in: query + name: page[cursor] + required: false + schema: + type: string + 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 + links: + next: /api/v2/eudm/devices?page%5Bcursor%5D=TEFQVE9QLURFTU8tMDAx&page%5Blimit%5D=1 + self: /api/v2/eudm/devices?page%5Blimit%5D=1 + meta: + page: + after: TEFQVE9QLURFTU8tMDAx + schema: + $ref: "#/components/schemas/DeviceBaseArray" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all devices + tags: + - End User Device Monitoring + x-permission: + operator: OR + permissions: + - end_user_devices_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/). + /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 + cnm_enabled: true + 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 + packet_sent: 98213.0 + retransmit: 112.0 + retransmit_pct: 0.11 + serial_number: TESTDEVICE001 + status: healthy + tcp_canceled: 1.0 + tcp_established: 1482.0 + tcp_establishment_failure_pct: 0.6 + tcp_establishment_failures: 9.0 + tcp_host_unreachable: 1.0 + tcp_network_unreachable: 0.0 + tcp_refusals: 3.0 + tcp_timeouts: 4.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 + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a device + tags: + - End User Device Monitoring + x-permission: + operator: OR + permissions: + - end_user_devices_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/). /api/v2/events: get: description: |- @@ -271993,6 +272619,10 @@ tags: description: Elastic Cloud integration. url: https://docs.datadoghq.com/integrations/elastic-cloud/ name: Elastic Cloud Integration + - 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. 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..0c9dcf9a58f --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMDevice.java @@ -0,0 +1,25 @@ +// 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(); + defaultClient.setUnstableOperationEnabled("v2.getEUDMDevice", true); + 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..5873a008fdb --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMDevices.java @@ -0,0 +1,25 @@ +// 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(); + defaultClient.setUnstableOperationEnabled("v2.getEUDMDevices", true); + 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/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index cecb6ec63ab..a37a420f029 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1406,6 +1406,8 @@ public class ApiClient { put("v2.triggerDeploymentGatesEvaluation", false); put("v2.updateDeploymentGate", false); put("v2.updateDeploymentRule", false); + put("v2.getEUDMDevice", false); + put("v2.getEUDMDevices", false); put("v2.cloneForm", false); put("v2.createAndPublishForm", false); put("v2.createForm", 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..e41bc922107 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/EndUserDeviceMonitoringApi.java @@ -0,0 +1,419 @@ +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 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 -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getEUDMDeviceWithHttpInfo(String deviceId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getEUDMDevice"; + 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 '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"}); + 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) { + // Check if unstable operation is enabled + String operationId = "getEUDMDevice"; + 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 '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"}); + } 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() {}); + } + + /** Manage optional parameters to getEUDMDevices. */ + public static class GetEUDMDevicesOptionalParameters { + private List bssid; + private Long pageLimit; + private String pageCursor; + + /** + * Set bssid. + * + * @param bssid Filter devices to those currently associated with any of the given BSSID values. + * Each value must be a MAC-48 address; repeat the parameter to pass several values. + * (optional) + * @return GetEUDMDevicesOptionalParameters + */ + public GetEUDMDevicesOptionalParameters bssid(List bssid) { + this.bssid = bssid; + return this; + } + + /** + * Set pageLimit. + * + * @param pageLimit Maximum number of devices to return in one page. Must be a positive integer. + * If not set, the response contains all matching devices. (optional) + * @return GetEUDMDevicesOptionalParameters + */ + public GetEUDMDevicesOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set pageCursor. + * + * @param pageCursor Opaque cursor that selects the next page. Use the meta.page.after + * value of the previous response. Devices are ordered by ID. (optional) + * @return GetEUDMDevicesOptionalParameters + */ + public GetEUDMDevicesOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; + return this; + } + } + + /** + * Get all devices. + * + *

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

See {@link #getEUDMDevicesWithHttpInfoAsync}. + * + * @return CompletableFuture<DeviceBaseArray> + */ + public CompletableFuture getEUDMDevicesAsync() { + return getEUDMDevicesWithHttpInfoAsync(new GetEUDMDevicesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all devices. + * + *

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

See {@link #getEUDMDevicesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<DeviceBaseArray> + */ + public CompletableFuture getEUDMDevicesAsync( + GetEUDMDevicesOptionalParameters parameters) { + return getEUDMDevicesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param parameters Optional parameters for the request. + * @return ApiResponse<DeviceBaseArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse getEUDMDevicesWithHttpInfo( + GetEUDMDevicesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getEUDMDevices"; + 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; + List bssid = parameters.bssid; + Long pageLimit = parameters.pageLimit; + String pageCursor = parameters.pageCursor; + // create path and map variables + String localVarPath = "/api/v2/eudm/devices"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "bssid", bssid)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMDevices", + localVarPath, + localVarQueryParams, + 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 all devices. + * + *

See {@link #getEUDMDevicesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<DeviceBaseArray>> + */ + public CompletableFuture> getEUDMDevicesWithHttpInfoAsync( + GetEUDMDevicesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getEUDMDevices"; + 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; + List bssid = parameters.bssid; + Long pageLimit = parameters.pageLimit; + String pageCursor = parameters.pageCursor; + // create path and map variables + String localVarPath = "/api/v2/eudm/devices"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "bssid", bssid)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EndUserDeviceMonitoringApi.getEUDMDevices", + localVarPath, + localVarQueryParams, + 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() {}); + } +} 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..dc4ec120adc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArray.java @@ -0,0 +1,226 @@ +/* + * 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, + DeviceBaseArray.JSON_PROPERTY_LINKS, + DeviceBaseArray.JSON_PROPERTY_META +}) +@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 static final String JSON_PROPERTY_LINKS = "links"; + private DeviceBaseArrayLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private DeviceBaseArrayMeta meta; + + public DeviceBaseArray() {} + + @JsonCreator + public DeviceBaseArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + for (DeviceBaseData item : data) { + this.unparsed |= item.unparsed; + } + } + + 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; + if (data != null) { + for (DeviceBaseData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + public DeviceBaseArray links(DeviceBaseArrayLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Links related to the current page of devices. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceBaseArrayLinks getLinks() { + return links; + } + + public void setLinks(DeviceBaseArrayLinks links) { + this.links = links; + if (links != null) { + this.unparsed |= links.unparsed; + } + } + + public DeviceBaseArray meta(DeviceBaseArrayMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata about the list devices response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceBaseArrayMeta getMeta() { + return meta; + } + + public void setMeta(DeviceBaseArrayMeta meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + /** + * 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.links, deviceBaseArray.links) + && Objects.equals(this.meta, deviceBaseArray.meta) + && Objects.equals(this.additionalProperties, deviceBaseArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceBaseArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/DeviceBaseArrayLinks.java b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArrayLinks.java new file mode 100644 index 00000000000..157ba6eb15d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArrayLinks.java @@ -0,0 +1,164 @@ +/* + * 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; + +/** Links related to the current page of devices. */ +@JsonPropertyOrder({ + DeviceBaseArrayLinks.JSON_PROPERTY_NEXT, + DeviceBaseArrayLinks.JSON_PROPERTY_SELF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceBaseArrayLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NEXT = "next"; + private String next; + + public static final String JSON_PROPERTY_SELF = "self"; + private String self; + + public DeviceBaseArrayLinks next(String next) { + this.next = next; + return this; + } + + /** + * URL of the next page of devices. Present only when more devices remain. + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + public DeviceBaseArrayLinks self(String self) { + this.self = self; + return this; + } + + /** + * URL of the current request. + * + * @return self + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSelf() { + return self; + } + + public void setSelf(String self) { + this.self = self; + } + + /** + * 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 DeviceBaseArrayLinks + */ + @JsonAnySetter + public DeviceBaseArrayLinks 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 DeviceBaseArrayLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceBaseArrayLinks deviceBaseArrayLinks = (DeviceBaseArrayLinks) o; + return Objects.equals(this.next, deviceBaseArrayLinks.next) + && Objects.equals(this.self, deviceBaseArrayLinks.self) + && Objects.equals(this.additionalProperties, deviceBaseArrayLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(next, self, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceBaseArrayLinks {\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).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/DeviceBaseArrayMeta.java b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArrayMeta.java new file mode 100644 index 00000000000..8f6d45ba831 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArrayMeta.java @@ -0,0 +1,139 @@ +/* + * 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; + +/** Metadata about the list devices response. */ +@JsonPropertyOrder({DeviceBaseArrayMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceBaseArrayMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private DeviceBaseArrayMetaPage page; + + public DeviceBaseArrayMeta page(DeviceBaseArrayMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination information for the list devices response. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceBaseArrayMetaPage getPage() { + return page; + } + + public void setPage(DeviceBaseArrayMetaPage page) { + this.page = page; + if (page != null) { + this.unparsed |= page.unparsed; + } + } + + /** + * 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 DeviceBaseArrayMeta + */ + @JsonAnySetter + public DeviceBaseArrayMeta 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 DeviceBaseArrayMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceBaseArrayMeta deviceBaseArrayMeta = (DeviceBaseArrayMeta) o; + return Objects.equals(this.page, deviceBaseArrayMeta.page) + && Objects.equals(this.additionalProperties, deviceBaseArrayMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceBaseArrayMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/DeviceBaseArrayMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArrayMetaPage.java new file mode 100644 index 00000000000..e97a7ad6557 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseArrayMetaPage.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** Pagination information for the list devices response. */ +@JsonPropertyOrder({DeviceBaseArrayMetaPage.JSON_PROPERTY_AFTER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceBaseArrayMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AFTER = "after"; + private String after; + + public DeviceBaseArrayMetaPage after(String after) { + this.after = after; + return this; + } + + /** + * Cursor to pass as page[cursor] to get the next page. Present only when more + * devices remain. + * + * @return after + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AFTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAfter() { + return after; + } + + public void setAfter(String after) { + this.after = after; + } + + /** + * 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 DeviceBaseArrayMetaPage + */ + @JsonAnySetter + public DeviceBaseArrayMetaPage 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 DeviceBaseArrayMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceBaseArrayMetaPage deviceBaseArrayMetaPage = (DeviceBaseArrayMetaPage) o; + return Objects.equals(this.after, deviceBaseArrayMetaPage.after) + && Objects.equals(this.additionalProperties, deviceBaseArrayMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(after, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceBaseArrayMetaPage {\n"); + sb.append(" after: ").append(toIndentedString(after)).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..9b712fb8a45 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** 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; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + 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..937014adc66 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceBaseDataAttributes.java @@ -0,0 +1,1015 @@ +/* + * 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_CRITICAL, + 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_EMPLOYEE, + DeviceBaseDataAttributes.JSON_PROPERTY_GEO_IP, + DeviceBaseDataAttributes.JSON_PROPERTY_IP_ADDRESS, + DeviceBaseDataAttributes.JSON_PROPERTY_ISSUES, + DeviceBaseDataAttributes.JSON_PROPERTY_KERNEL_NAME, + DeviceBaseDataAttributes.JSON_PROPERTY_LAST_REBOOT, + 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_CRITICAL = "battery_critical"; + private Boolean batteryCritical; + + 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_EMPLOYEE = "employee"; + private DeviceEmployee employee; + + public static final String JSON_PROPERTY_GEO_IP = "geo_ip"; + private DeviceGeoIP geoIp; + + 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_REBOOT = "last_reboot"; + private String lastReboot; + + 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 DeviceStatus 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 batteryCritical(Boolean batteryCritical) { + this.batteryCritical = batteryCritical; + return this; + } + + /** + * Whether the device's battery health has degraded to a critical level. + * + * @return batteryCritical + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATTERY_CRITICAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBatteryCritical() { + return batteryCritical; + } + + public void setBatteryCritical(Boolean batteryCritical) { + this.batteryCritical = batteryCritical; + } + + 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 employee(DeviceEmployee employee) { + this.employee = employee; + this.unparsed |= employee.unparsed; + return this; + } + + /** + * Directory information about the employee associated with the device, sourced from a customer + * reference table. Absent when no reference table is configured or the device has no match. + * + * @return employee + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMPLOYEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceEmployee getEmployee() { + return employee; + } + + public void setEmployee(DeviceEmployee employee) { + this.employee = employee; + if (employee != null) { + this.unparsed |= employee.unparsed; + } + } + + public DeviceBaseDataAttributes geoIp(DeviceGeoIP geoIp) { + this.geoIp = geoIp; + this.unparsed |= geoIp.unparsed; + return this; + } + + /** + * Location derived from the device's public IP address. Absent when no location data is + * available. + * + * @return geoIp + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEO_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceGeoIP getGeoIp() { + return geoIp; + } + + public void setGeoIp(DeviceGeoIP geoIp) { + this.geoIp = geoIp; + if (geoIp != null) { + this.unparsed |= geoIp.unparsed; + } + } + + 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. + * + * @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 lastReboot(String lastReboot) { + this.lastReboot = lastReboot; + return this; + } + + /** + * Timestamp of the most recent device reboot, in RFC 3339 format. + * + * @return lastReboot + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_REBOOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastReboot() { + return lastReboot; + } + + public void setLastReboot(String lastReboot) { + this.lastReboot = lastReboot; + } + + 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, as reported by the Datadog Agent (for example, + * macOS, Windows, or linux). Empty when unknown. + * + * @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(DeviceStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Health status of the device, computed from its issues and recent telemetry. inactive + * means the device stopped reporting. unknown means no telemetry is + * available yet. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceStatus getStatus() { + return status; + } + + public void setStatus(DeviceStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public DeviceBaseDataAttributes type(String type) { + this.type = type; + return this; + } + + /** + * Hardware type of the device (for example, laptop or desktop). + * unknown when the type cannot be determined. + * + * @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.batteryCritical, deviceBaseDataAttributes.batteryCritical) + && 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.employee, deviceBaseDataAttributes.employee) + && Objects.equals(this.geoIp, deviceBaseDataAttributes.geoIp) + && Objects.equals(this.ipAddress, deviceBaseDataAttributes.ipAddress) + && Objects.equals(this.issues, deviceBaseDataAttributes.issues) + && Objects.equals(this.kernelName, deviceBaseDataAttributes.kernelName) + && Objects.equals(this.lastReboot, deviceBaseDataAttributes.lastReboot) + && 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, + batteryCritical, + batteryMaxCapacityPct, + cpuCores, + cpuLogicalProcessors, + cpuModel, + cpuUsage, + diskUsage, + employee, + geoIp, + ipAddress, + issues, + kernelName, + lastReboot, + 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(" batteryCritical: ").append(toIndentedString(batteryCritical)).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(" employee: ").append(toIndentedString(employee)).append("\n"); + sb.append(" geoIp: ").append(toIndentedString(geoIp)).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(" lastReboot: ").append(toIndentedString(lastReboot)).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..e08b927c177 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceDetails.java @@ -0,0 +1,141 @@ +/* + * 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; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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..09357d721d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceDetailsData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** 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 Cloud + * Network Monitoring 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; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + 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..061e7a9d89b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceDetailsDataAttributes.java @@ -0,0 +1,1451 @@ +/* + * 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 Cloud + * Network Monitoring 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_CRITICAL, + DeviceDetailsDataAttributes.JSON_PROPERTY_BATTERY_CYCLE_COUNT, + DeviceDetailsDataAttributes.JSON_PROPERTY_BATTERY_MAX_CAPACITY_PCT, + DeviceDetailsDataAttributes.JSON_PROPERTY_CNM_ENABLED, + 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_EMPLOYEE, + DeviceDetailsDataAttributes.JSON_PROPERTY_GEO_IP, + DeviceDetailsDataAttributes.JSON_PROPERTY_IP_ADDRESS, + DeviceDetailsDataAttributes.JSON_PROPERTY_ISSUES, + DeviceDetailsDataAttributes.JSON_PROPERTY_KERNEL_NAME, + DeviceDetailsDataAttributes.JSON_PROPERTY_LAST_REBOOT, + 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_PACKET_SENT, + DeviceDetailsDataAttributes.JSON_PROPERTY_RESOURCE_ID, + DeviceDetailsDataAttributes.JSON_PROPERTY_RETRANSMIT, + DeviceDetailsDataAttributes.JSON_PROPERTY_RETRANSMIT_PCT, + DeviceDetailsDataAttributes.JSON_PROPERTY_SERIAL_NUMBER, + DeviceDetailsDataAttributes.JSON_PROPERTY_STATUS, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_CANCELED, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_ESTABLISHED, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_ESTABLISHMENT_FAILURE_PCT, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_ESTABLISHMENT_FAILURES, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_HOST_UNREACHABLE, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_NETWORK_UNREACHABLE, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_REFUSALS, + DeviceDetailsDataAttributes.JSON_PROPERTY_TCP_TIMEOUTS, + 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_CRITICAL = "battery_critical"; + private Boolean batteryCritical; + + 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_CNM_ENABLED = "cnm_enabled"; + private Boolean cnmEnabled; + + 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_EMPLOYEE = "employee"; + private DeviceEmployee employee; + + public static final String JSON_PROPERTY_GEO_IP = "geo_ip"; + private DeviceGeoIP geoIp; + + 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_REBOOT = "last_reboot"; + private String lastReboot; + + 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_PACKET_SENT = "packet_sent"; + private Double packetSent; + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_RETRANSMIT = "retransmit"; + private Double retransmit; + + public static final String JSON_PROPERTY_RETRANSMIT_PCT = "retransmit_pct"; + private Double retransmitPct; + + public static final String JSON_PROPERTY_SERIAL_NUMBER = "serial_number"; + private String serialNumber; + + public static final String JSON_PROPERTY_STATUS = "status"; + private DeviceStatus status; + + public static final String JSON_PROPERTY_TCP_CANCELED = "tcp_canceled"; + private Double tcpCanceled; + + public static final String JSON_PROPERTY_TCP_ESTABLISHED = "tcp_established"; + private Double tcpEstablished; + + public static final String JSON_PROPERTY_TCP_ESTABLISHMENT_FAILURE_PCT = + "tcp_establishment_failure_pct"; + private Double tcpEstablishmentFailurePct; + + public static final String JSON_PROPERTY_TCP_ESTABLISHMENT_FAILURES = + "tcp_establishment_failures"; + private Double tcpEstablishmentFailures; + + public static final String JSON_PROPERTY_TCP_HOST_UNREACHABLE = "tcp_host_unreachable"; + private Double tcpHostUnreachable; + + public static final String JSON_PROPERTY_TCP_NETWORK_UNREACHABLE = "tcp_network_unreachable"; + private Double tcpNetworkUnreachable; + + public static final String JSON_PROPERTY_TCP_REFUSALS = "tcp_refusals"; + private Double tcpRefusals; + + public static final String JSON_PROPERTY_TCP_TIMEOUTS = "tcp_timeouts"; + private Double tcpTimeouts; + + 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 batteryCritical(Boolean batteryCritical) { + this.batteryCritical = batteryCritical; + return this; + } + + /** + * Whether the device's battery health has degraded to a critical level. + * + * @return batteryCritical + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BATTERY_CRITICAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBatteryCritical() { + return batteryCritical; + } + + public void setBatteryCritical(Boolean batteryCritical) { + this.batteryCritical = batteryCritical; + } + + 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 cnmEnabled(Boolean cnmEnabled) { + this.cnmEnabled = cnmEnabled; + return this; + } + + /** + * Whether Cloud Network Monitoring is enabled on the device. + * + * @return cnmEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CNM_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCnmEnabled() { + return cnmEnabled; + } + + public void setCnmEnabled(Boolean cnmEnabled) { + this.cnmEnabled = cnmEnabled; + } + + 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 employee(DeviceEmployee employee) { + this.employee = employee; + this.unparsed |= employee.unparsed; + return this; + } + + /** + * Directory information about the employee associated with the device, sourced from a customer + * reference table. Absent when no reference table is configured or the device has no match. + * + * @return employee + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMPLOYEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceEmployee getEmployee() { + return employee; + } + + public void setEmployee(DeviceEmployee employee) { + this.employee = employee; + if (employee != null) { + this.unparsed |= employee.unparsed; + } + } + + public DeviceDetailsDataAttributes geoIp(DeviceGeoIP geoIp) { + this.geoIp = geoIp; + this.unparsed |= geoIp.unparsed; + return this; + } + + /** + * Location derived from the device's public IP address. Absent when no location data is + * available. + * + * @return geoIp + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEO_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceGeoIP getGeoIp() { + return geoIp; + } + + public void setGeoIp(DeviceGeoIP geoIp) { + this.geoIp = geoIp; + if (geoIp != null) { + this.unparsed |= geoIp.unparsed; + } + } + + 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. + * + * @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 lastReboot(String lastReboot) { + this.lastReboot = lastReboot; + return this; + } + + /** + * Timestamp of the most recent device reboot, in RFC 3339 format. + * + * @return lastReboot + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_REBOOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastReboot() { + return lastReboot; + } + + public void setLastReboot(String lastReboot) { + this.lastReboot = lastReboot; + } + + 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, as reported by the Datadog Agent (for example, + * macOS, Windows, or linux). Empty when unknown. + * + * @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 packetSent(Double packetSent) { + this.packetSent = packetSent; + return this; + } + + /** + * Number of TCP packets sent by the device over the query window, as reported by Cloud Network + * Monitoring. + * + * @return packetSent + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PACKET_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getPacketSent() { + return packetSent; + } + + public void setPacketSent(Double packetSent) { + this.packetSent = packetSent; + } + + 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 retransmit(Double retransmit) { + this.retransmit = retransmit; + return this; + } + + /** + * Number of TCP packets retransmitted by the device over the query window. + * + * @return retransmit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETRANSMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getRetransmit() { + return retransmit; + } + + public void setRetransmit(Double retransmit) { + this.retransmit = retransmit; + } + + public DeviceDetailsDataAttributes retransmitPct(Double retransmitPct) { + this.retransmitPct = retransmitPct; + return this; + } + + /** + * Percentage of sent TCP packets that were retransmitted, between 0 and 100. + * + * @return retransmitPct + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETRANSMIT_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getRetransmitPct() { + return retransmitPct; + } + + public void setRetransmitPct(Double retransmitPct) { + this.retransmitPct = retransmitPct; + } + + 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(DeviceStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Health status of the device, computed from its issues and recent telemetry. inactive + * means the device stopped reporting. unknown means no telemetry is + * available yet. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceStatus getStatus() { + return status; + } + + public void setStatus(DeviceStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public DeviceDetailsDataAttributes tcpCanceled(Double tcpCanceled) { + this.tcpCanceled = tcpCanceled; + return this; + } + + /** + * Number of TCP connection attempts canceled by the device over the query window. + * + * @return tcpCanceled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_CANCELED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpCanceled() { + return tcpCanceled; + } + + public void setTcpCanceled(Double tcpCanceled) { + this.tcpCanceled = tcpCanceled; + } + + public DeviceDetailsDataAttributes tcpEstablished(Double tcpEstablished) { + this.tcpEstablished = tcpEstablished; + return this; + } + + /** + * Number of TCP connections established by the device over the query window. + * + * @return tcpEstablished + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_ESTABLISHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpEstablished() { + return tcpEstablished; + } + + public void setTcpEstablished(Double tcpEstablished) { + this.tcpEstablished = tcpEstablished; + } + + public DeviceDetailsDataAttributes tcpEstablishmentFailurePct(Double tcpEstablishmentFailurePct) { + this.tcpEstablishmentFailurePct = tcpEstablishmentFailurePct; + return this; + } + + /** + * Percentage of TCP connection attempts that failed, between 0 and 100. + * + * @return tcpEstablishmentFailurePct + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_ESTABLISHMENT_FAILURE_PCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpEstablishmentFailurePct() { + return tcpEstablishmentFailurePct; + } + + public void setTcpEstablishmentFailurePct(Double tcpEstablishmentFailurePct) { + this.tcpEstablishmentFailurePct = tcpEstablishmentFailurePct; + } + + public DeviceDetailsDataAttributes tcpEstablishmentFailures(Double tcpEstablishmentFailures) { + this.tcpEstablishmentFailures = tcpEstablishmentFailures; + return this; + } + + /** + * Number of TCP connection attempts that failed over the query window. + * + * @return tcpEstablishmentFailures + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_ESTABLISHMENT_FAILURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpEstablishmentFailures() { + return tcpEstablishmentFailures; + } + + public void setTcpEstablishmentFailures(Double tcpEstablishmentFailures) { + this.tcpEstablishmentFailures = tcpEstablishmentFailures; + } + + public DeviceDetailsDataAttributes tcpHostUnreachable(Double tcpHostUnreachable) { + this.tcpHostUnreachable = tcpHostUnreachable; + return this; + } + + /** + * Number of TCP connection attempts that failed because the host was unreachable. + * + * @return tcpHostUnreachable + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_HOST_UNREACHABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpHostUnreachable() { + return tcpHostUnreachable; + } + + public void setTcpHostUnreachable(Double tcpHostUnreachable) { + this.tcpHostUnreachable = tcpHostUnreachable; + } + + public DeviceDetailsDataAttributes tcpNetworkUnreachable(Double tcpNetworkUnreachable) { + this.tcpNetworkUnreachable = tcpNetworkUnreachable; + return this; + } + + /** + * Number of TCP connection attempts that failed because the network was unreachable. + * + * @return tcpNetworkUnreachable + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_NETWORK_UNREACHABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpNetworkUnreachable() { + return tcpNetworkUnreachable; + } + + public void setTcpNetworkUnreachable(Double tcpNetworkUnreachable) { + this.tcpNetworkUnreachable = tcpNetworkUnreachable; + } + + public DeviceDetailsDataAttributes tcpRefusals(Double tcpRefusals) { + this.tcpRefusals = tcpRefusals; + return this; + } + + /** + * Number of TCP connection attempts refused by the remote host over the query window. + * + * @return tcpRefusals + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_REFUSALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpRefusals() { + return tcpRefusals; + } + + public void setTcpRefusals(Double tcpRefusals) { + this.tcpRefusals = tcpRefusals; + } + + public DeviceDetailsDataAttributes tcpTimeouts(Double tcpTimeouts) { + this.tcpTimeouts = tcpTimeouts; + return this; + } + + /** + * Number of TCP connection attempts that timed out over the query window. + * + * @return tcpTimeouts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_TIMEOUTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTcpTimeouts() { + return tcpTimeouts; + } + + public void setTcpTimeouts(Double tcpTimeouts) { + this.tcpTimeouts = tcpTimeouts; + } + + public DeviceDetailsDataAttributes type(String type) { + this.type = type; + return this; + } + + /** + * Hardware type of the device (for example, laptop or desktop). + * unknown when the type cannot be determined. + * + * @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.batteryCritical, deviceDetailsDataAttributes.batteryCritical) + && Objects.equals(this.batteryCycleCount, deviceDetailsDataAttributes.batteryCycleCount) + && Objects.equals( + this.batteryMaxCapacityPct, deviceDetailsDataAttributes.batteryMaxCapacityPct) + && Objects.equals(this.cnmEnabled, deviceDetailsDataAttributes.cnmEnabled) + && 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.employee, deviceDetailsDataAttributes.employee) + && Objects.equals(this.geoIp, deviceDetailsDataAttributes.geoIp) + && Objects.equals(this.ipAddress, deviceDetailsDataAttributes.ipAddress) + && Objects.equals(this.issues, deviceDetailsDataAttributes.issues) + && Objects.equals(this.kernelName, deviceDetailsDataAttributes.kernelName) + && Objects.equals(this.lastReboot, deviceDetailsDataAttributes.lastReboot) + && 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.packetSent, deviceDetailsDataAttributes.packetSent) + && Objects.equals(this.resourceId, deviceDetailsDataAttributes.resourceId) + && Objects.equals(this.retransmit, deviceDetailsDataAttributes.retransmit) + && Objects.equals(this.retransmitPct, deviceDetailsDataAttributes.retransmitPct) + && Objects.equals(this.serialNumber, deviceDetailsDataAttributes.serialNumber) + && Objects.equals(this.status, deviceDetailsDataAttributes.status) + && Objects.equals(this.tcpCanceled, deviceDetailsDataAttributes.tcpCanceled) + && Objects.equals(this.tcpEstablished, deviceDetailsDataAttributes.tcpEstablished) + && Objects.equals( + this.tcpEstablishmentFailurePct, deviceDetailsDataAttributes.tcpEstablishmentFailurePct) + && Objects.equals( + this.tcpEstablishmentFailures, deviceDetailsDataAttributes.tcpEstablishmentFailures) + && Objects.equals(this.tcpHostUnreachable, deviceDetailsDataAttributes.tcpHostUnreachable) + && Objects.equals( + this.tcpNetworkUnreachable, deviceDetailsDataAttributes.tcpNetworkUnreachable) + && Objects.equals(this.tcpRefusals, deviceDetailsDataAttributes.tcpRefusals) + && Objects.equals(this.tcpTimeouts, deviceDetailsDataAttributes.tcpTimeouts) + && 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, + batteryCritical, + batteryCycleCount, + batteryMaxCapacityPct, + cnmEnabled, + cpuCores, + cpuLogicalProcessors, + cpuModel, + cpuUsage, + diskUsage, + employee, + geoIp, + ipAddress, + issues, + kernelName, + lastReboot, + lastSeen, + manufacturer, + memUsage, + memoryTotalKb, + modelName, + modelNumber, + os, + osVersion, + packetSent, + resourceId, + retransmit, + retransmitPct, + serialNumber, + status, + tcpCanceled, + tcpEstablished, + tcpEstablishmentFailurePct, + tcpEstablishmentFailures, + tcpHostUnreachable, + tcpNetworkUnreachable, + tcpRefusals, + tcpTimeouts, + 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(" batteryCritical: ").append(toIndentedString(batteryCritical)).append("\n"); + sb.append(" batteryCycleCount: ").append(toIndentedString(batteryCycleCount)).append("\n"); + sb.append(" batteryMaxCapacityPct: ") + .append(toIndentedString(batteryMaxCapacityPct)) + .append("\n"); + sb.append(" cnmEnabled: ").append(toIndentedString(cnmEnabled)).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(" employee: ").append(toIndentedString(employee)).append("\n"); + sb.append(" geoIp: ").append(toIndentedString(geoIp)).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(" lastReboot: ").append(toIndentedString(lastReboot)).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(" packetSent: ").append(toIndentedString(packetSent)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" retransmit: ").append(toIndentedString(retransmit)).append("\n"); + sb.append(" retransmitPct: ").append(toIndentedString(retransmitPct)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tcpCanceled: ").append(toIndentedString(tcpCanceled)).append("\n"); + sb.append(" tcpEstablished: ").append(toIndentedString(tcpEstablished)).append("\n"); + sb.append(" tcpEstablishmentFailurePct: ") + .append(toIndentedString(tcpEstablishmentFailurePct)) + .append("\n"); + sb.append(" tcpEstablishmentFailures: ") + .append(toIndentedString(tcpEstablishmentFailures)) + .append("\n"); + sb.append(" tcpHostUnreachable: ").append(toIndentedString(tcpHostUnreachable)).append("\n"); + sb.append(" tcpNetworkUnreachable: ") + .append(toIndentedString(tcpNetworkUnreachable)) + .append("\n"); + sb.append(" tcpRefusals: ").append(toIndentedString(tcpRefusals)).append("\n"); + sb.append(" tcpTimeouts: ").append(toIndentedString(tcpTimeouts)).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/DeviceEmployee.java b/src/main/java/com/datadog/api/client/v2/model/DeviceEmployee.java new file mode 100644 index 00000000000..476d508bcdc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceEmployee.java @@ -0,0 +1,302 @@ +/* + * 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; + +/** + * Directory information about the employee associated with the device, sourced from a customer + * reference table. Absent when no reference table is configured or the device has no match. + */ +@JsonPropertyOrder({ + DeviceEmployee.JSON_PROPERTY_CITY, + DeviceEmployee.JSON_PROPERTY_COUNTRY, + DeviceEmployee.JSON_PROPERTY_DEPARTMENT, + DeviceEmployee.JSON_PROPERTY_EMAIL, + DeviceEmployee.JSON_PROPERTY_NAME, + DeviceEmployee.JSON_PROPERTY_OFFICE, + DeviceEmployee.JSON_PROPERTY_TEAM +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceEmployee { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private String country; + + public static final String JSON_PROPERTY_DEPARTMENT = "department"; + private String department; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OFFICE = "office"; + private String office; + + public static final String JSON_PROPERTY_TEAM = "team"; + private String team; + + public DeviceEmployee city(String city) { + this.city = city; + return this; + } + + /** + * City where the employee is based. + * + * @return city + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public DeviceEmployee country(String country) { + this.country = country; + return this; + } + + /** + * Country where the employee is based. + * + * @return country + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public DeviceEmployee department(String department) { + this.department = department; + return this; + } + + /** + * Department the employee belongs to. + * + * @return department + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEPARTMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public DeviceEmployee email(String email) { + this.email = email; + return this; + } + + /** + * Email address of the employee. + * + * @return email + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public DeviceEmployee name(String name) { + this.name = name; + return this; + } + + /** + * Full name of the employee. + * + * @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 DeviceEmployee office(String office) { + this.office = office; + return this; + } + + /** + * Office the employee is assigned to. + * + * @return office + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OFFICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOffice() { + return office; + } + + public void setOffice(String office) { + this.office = office; + } + + public DeviceEmployee team(String team) { + this.team = team; + return this; + } + + /** + * Team the employee belongs to. + * + * @return team + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeam() { + return team; + } + + public void setTeam(String team) { + this.team = team; + } + + /** + * 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 DeviceEmployee + */ + @JsonAnySetter + public DeviceEmployee 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 DeviceEmployee object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceEmployee deviceEmployee = (DeviceEmployee) o; + return Objects.equals(this.city, deviceEmployee.city) + && Objects.equals(this.country, deviceEmployee.country) + && Objects.equals(this.department, deviceEmployee.department) + && Objects.equals(this.email, deviceEmployee.email) + && Objects.equals(this.name, deviceEmployee.name) + && Objects.equals(this.office, deviceEmployee.office) + && Objects.equals(this.team, deviceEmployee.team) + && Objects.equals(this.additionalProperties, deviceEmployee.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(city, country, department, email, name, office, team, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceEmployee {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" department: ").append(toIndentedString(department)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" office: ").append(toIndentedString(office)).append("\n"); + sb.append(" team: ").append(toIndentedString(team)).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/DeviceGeoIP.java b/src/main/java/com/datadog/api/client/v2/model/DeviceGeoIP.java new file mode 100644 index 00000000000..92f11c6b1ab --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceGeoIP.java @@ -0,0 +1,284 @@ +/* + * 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; + +/** + * Location derived from the device's public IP address. Absent when no location data is available. + */ +@JsonPropertyOrder({ + DeviceGeoIP.JSON_PROPERTY_GEO_CITY, + DeviceGeoIP.JSON_PROPERTY_GEO_COUNTRY_ISO_CODE, + DeviceGeoIP.JSON_PROPERTY_GEO_LATITUDE, + DeviceGeoIP.JSON_PROPERTY_GEO_LONGITUDE, + DeviceGeoIP.JSON_PROPERTY_GEO_SUBDIVISION_ISO_CODE, + DeviceGeoIP.JSON_PROPERTY_PUBLIC_IP_ADDRESS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeviceGeoIP { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GEO_CITY = "geo_city"; + private String geoCity; + + public static final String JSON_PROPERTY_GEO_COUNTRY_ISO_CODE = "geo_country_iso_code"; + private String geoCountryIsoCode; + + public static final String JSON_PROPERTY_GEO_LATITUDE = "geo_latitude"; + private Double geoLatitude; + + public static final String JSON_PROPERTY_GEO_LONGITUDE = "geo_longitude"; + private Double geoLongitude; + + public static final String JSON_PROPERTY_GEO_SUBDIVISION_ISO_CODE = "geo_subdivision_iso_code"; + private String geoSubdivisionIsoCode; + + public static final String JSON_PROPERTY_PUBLIC_IP_ADDRESS = "public_ip_address"; + private String publicIpAddress; + + public DeviceGeoIP geoCity(String geoCity) { + this.geoCity = geoCity; + return this; + } + + /** + * City resolved from the device's public IP address. + * + * @return geoCity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEO_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGeoCity() { + return geoCity; + } + + public void setGeoCity(String geoCity) { + this.geoCity = geoCity; + } + + public DeviceGeoIP geoCountryIsoCode(String geoCountryIsoCode) { + this.geoCountryIsoCode = geoCountryIsoCode; + return this; + } + + /** + * ISO 3166-1 alpha-2 country code resolved from the device's public IP address. + * + * @return geoCountryIsoCode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEO_COUNTRY_ISO_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGeoCountryIsoCode() { + return geoCountryIsoCode; + } + + public void setGeoCountryIsoCode(String geoCountryIsoCode) { + this.geoCountryIsoCode = geoCountryIsoCode; + } + + public DeviceGeoIP geoLatitude(Double geoLatitude) { + this.geoLatitude = geoLatitude; + return this; + } + + /** + * Latitude resolved from the device's public IP address. + * + * @return geoLatitude + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEO_LATITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getGeoLatitude() { + return geoLatitude; + } + + public void setGeoLatitude(Double geoLatitude) { + this.geoLatitude = geoLatitude; + } + + public DeviceGeoIP geoLongitude(Double geoLongitude) { + this.geoLongitude = geoLongitude; + return this; + } + + /** + * Longitude resolved from the device's public IP address. + * + * @return geoLongitude + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEO_LONGITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getGeoLongitude() { + return geoLongitude; + } + + public void setGeoLongitude(Double geoLongitude) { + this.geoLongitude = geoLongitude; + } + + public DeviceGeoIP geoSubdivisionIsoCode(String geoSubdivisionIsoCode) { + this.geoSubdivisionIsoCode = geoSubdivisionIsoCode; + return this; + } + + /** + * ISO 3166-2 subdivision code (for example, a state or province) resolved from the device's + * public IP address. + * + * @return geoSubdivisionIsoCode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEO_SUBDIVISION_ISO_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGeoSubdivisionIsoCode() { + return geoSubdivisionIsoCode; + } + + public void setGeoSubdivisionIsoCode(String geoSubdivisionIsoCode) { + this.geoSubdivisionIsoCode = geoSubdivisionIsoCode; + } + + public DeviceGeoIP publicIpAddress(String publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Public IPv4 or IPv6 address of the device. + * + * @return publicIpAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_IP_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicIpAddress() { + return publicIpAddress; + } + + public void setPublicIpAddress(String publicIpAddress) { + this.publicIpAddress = publicIpAddress; + } + + /** + * 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 DeviceGeoIP + */ + @JsonAnySetter + public DeviceGeoIP 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 DeviceGeoIP object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceGeoIP deviceGeoIp = (DeviceGeoIP) o; + return Objects.equals(this.geoCity, deviceGeoIp.geoCity) + && Objects.equals(this.geoCountryIsoCode, deviceGeoIp.geoCountryIsoCode) + && Objects.equals(this.geoLatitude, deviceGeoIp.geoLatitude) + && Objects.equals(this.geoLongitude, deviceGeoIp.geoLongitude) + && Objects.equals(this.geoSubdivisionIsoCode, deviceGeoIp.geoSubdivisionIsoCode) + && Objects.equals(this.publicIpAddress, deviceGeoIp.publicIpAddress) + && Objects.equals(this.additionalProperties, deviceGeoIp.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + geoCity, + geoCountryIsoCode, + geoLatitude, + geoLongitude, + geoSubdivisionIsoCode, + publicIpAddress, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceGeoIP {\n"); + sb.append(" geoCity: ").append(toIndentedString(geoCity)).append("\n"); + sb.append(" geoCountryIsoCode: ").append(toIndentedString(geoCountryIsoCode)).append("\n"); + sb.append(" geoLatitude: ").append(toIndentedString(geoLatitude)).append("\n"); + sb.append(" geoLongitude: ").append(toIndentedString(geoLongitude)).append("\n"); + sb.append(" geoSubdivisionIsoCode: ") + .append(toIndentedString(geoSubdivisionIsoCode)) + .append("\n"); + sb.append(" publicIpAddress: ").append(toIndentedString(publicIpAddress)).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/DeviceStatus.java b/src/main/java/com/datadog/api/client/v2/model/DeviceStatus.java new file mode 100644 index 00000000000..3457c4d2f22 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeviceStatus.java @@ -0,0 +1,61 @@ +/* + * 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; + +/** + * Health status of the device, computed from its issues and recent telemetry. inactive + * means the device stopped reporting. unknown means no telemetry is available yet. + */ +@JsonSerialize(using = DeviceStatus.DeviceStatusSerializer.class) +public class DeviceStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("healthy", "degraded", "critical", "inactive", "unknown")); + + public static final DeviceStatus HEALTHY = new DeviceStatus("healthy"); + public static final DeviceStatus DEGRADED = new DeviceStatus("degraded"); + public static final DeviceStatus CRITICAL = new DeviceStatus("critical"); + public static final DeviceStatus INACTIVE = new DeviceStatus("inactive"); + public static final DeviceStatus UNKNOWN = new DeviceStatus("unknown"); + + DeviceStatus(String value) { + super(value, allowedValues); + } + + public static class DeviceStatusSerializer extends StdSerializer { + public DeviceStatusSerializer(Class t) { + super(t); + } + + public DeviceStatusSerializer() { + this(null); + } + + @Override + public void serialize(DeviceStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeviceStatus fromValue(String value) { + return new DeviceStatus(value); + } +} 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..cddff39a3d0 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/end_user_device_monitoring.feature @@ -0,0 +1,48 @@ +@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:ddoghq/eudm-experiences + Scenario: Get a device returns "Bad Request" response + Given operation "GetEUDMDevice" enabled + And new "GetEUDMDevice" request + And request contains "device_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/eudm-experiences + Scenario: Get a device returns "Not Found" response + Given operation "GetEUDMDevice" enabled + And 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 + + @generated @skip @team:ddoghq/eudm-experiences + Scenario: Get a device returns "OK" response + Given operation "GetEUDMDevice" enabled + And 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:ddoghq/eudm-experiences + Scenario: Get all devices returns "Bad Request" response + Given operation "GetEUDMDevices" enabled + And new "GetEUDMDevices" request + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/eudm-experiences + Scenario: Get all devices returns "OK" response + Given operation "GetEUDMDevices" enabled + And new "GetEUDMDevices" 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/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index ecd54435b67..d92af14e39a 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 @@ -2771,6 +2771,18 @@ "type": "idempotent" } }, + "GetEUDMDevices": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, + "GetEUDMDevice": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, "ListEvents": { "tag": "Events", "undo": { diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index d129a46befa..caa6c8ef32d 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -5649,6 +5649,20 @@ "scenario": "Update a downtime returns \"OK\" response", "version": "v2" }, + { + "feature": "End User Device Monitoring", + "feature_file": "../../com/datadog/api/client/v2/api/end_user_device_monitoring.feature", + "file": "v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json", + "scenario": "Get a device returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "End User Device Monitoring", + "feature_file": "../../com/datadog/api/client/v2/api/end_user_device_monitoring.feature", + "file": "v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json", + "scenario": "Get all devices returns \"OK\" response", + "version": "v2" + }, { "feature": "Error Tracking", "feature_file": "../../com/datadog/api/client/v2/api/error_tracking.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json b/src/test/resources/generated-test/test-runner-data/v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json new file mode 100644 index 00000000000..81cee7568df --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json @@ -0,0 +1,35 @@ +{ + "api": "EndUserDeviceMonitoring", + "expected_status": 404, + "feature": "End User Device Monitoring", + "id": "v2/End User Device Monitoring/Get a device returns \"Not Found\" response", + "operation_id": "GetEUDMDevice", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "device_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "not_found" + }, + "style": null + } + ], + "path": "/api/v2/eudm/devices/{device_id}" + }, + "scenario": "Get a device returns \"Not Found\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json new file mode 100644 index 00000000000..bfb96d83cc1 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json @@ -0,0 +1,18 @@ +{ + "api": "EndUserDeviceMonitoring", + "expected_status": 200, + "feature": "End User Device Monitoring", + "id": "v2/End User Device Monitoring/Get all devices returns \"OK\" response", + "operation_id": "GetEUDMDevices", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [], + "path": "/api/v2/eudm/devices" + }, + "scenario": "Get all devices returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/manifest.json b/src/test/resources/generated-test/test-server-data/manifest.json index 56164199065..651d02c6898 100644 --- a/src/test/resources/generated-test/test-server-data/manifest.json +++ b/src/test/resources/generated-test/test-server-data/manifest.json @@ -300,6 +300,11 @@ "file": "v2/downtimes.json", "version": "v2" }, + { + "feature": "End User Device Monitoring", + "file": "v2/end-user-device-monitoring.json", + "version": "v2" + }, { "feature": "Error Tracking", "file": "v2/error-tracking.json", diff --git a/src/test/resources/generated-test/test-server-data/v2/end-user-device-monitoring.json b/src/test/resources/generated-test/test-server-data/v2/end-user-device-monitoring.json new file mode 100644 index 00000000000..b735ee3aada --- /dev/null +++ b/src/test/resources/generated-test/test-server-data/v2/end-user-device-monitoring.json @@ -0,0 +1,69 @@ +{ + "feature": "End User Device Monitoring", + "recordings": [ + { + "feature": "End User Device Monitoring", + "frozen_at": "2026-05-26T22:33:26.244Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/eudm/devices/not_found", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Get a device returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "End User Device Monitoring", + "frozen_at": "2026-05-26T22:33:27.236Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/eudm/devices", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"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\"}}],\"meta\":{\"page\":{}},\"links\":{\"self\":\"/api/v2/eudm/devices\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Get all devices returns \"OK\" response", + "version": "v2" + } + ], + "schema_version": 1, + "version": "v2" +}